subscribe.h
Go to the documentation of this file.
/*
* subscribe.h -- subscription handling for CoAP
* see draft-ietf-core-observe-16
*
* Copyright (C) 2010-2012,2014-2015 Olaf Bergmann <bergmann@tzi.org>
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
#ifndef _COAP_SUBSCRIBE_H_
#define _COAP_SUBSCRIBE_H_
#include "address.h"
#include "coap_io.h"
#define COAP_OBSERVE_ESTABLISH 0
#define COAP_OBSERVE_CANCEL 1
#ifndef COAP_OBS_MAX_NON
#define COAP_OBS_MAX_NON 5
#endif /* COAP_OBS_MAX_NON */
#ifndef COAP_OBS_MAX_FAIL
#define COAP_OBS_MAX_FAIL 3
#endif /* COAP_OBS_MAX_FAIL */
typedef struct coap_subscription_t {
struct coap_subscription_t *next;
coap_endpoint_t local_if;
coap_address_t subscriber;
unsigned int non_cnt:4;
unsigned int fail_cnt:2;
unsigned int dirty:1;
size_t token_length;
unsigned char token[8];
} coap_subscription_t;
void coap_subscription_init(coap_subscription_t *);
#endif /* _COAP_SUBSCRIBE_H_ */
coap_address_t
multi-purpose address abstraction
Definition: address.h:59
coap_subscription_t::next
struct coap_subscription_t * next
next element in linked list
Definition: subscribe.h:55
coap_endpoint_t
Abstraction of virtual endpoint that can be attached to coap_context_t.
Definition: coap_io.h:35
coap_subscription_t::token_length
size_t token_length
actual length of token
Definition: subscribe.h:64
coap_subscription_t
struct coap_subscription_t coap_subscription_t
Subscriber information.
address.h
Representation of network addresses.
coap_subscription_t::non_cnt
unsigned int non_cnt
up to 15 non-confirmable notifies allowed
Definition: subscribe.h:59
coap_subscription_t
Subscriber information.
Definition: subscribe.h:54
coap_io.h
coap_subscription_t::dirty
unsigned int dirty
set if the notification temporarily could not be sent (in that case, the resource&#39;s partially dirty f...
Definition: subscribe.h:61
coap_subscription_t::fail_cnt
unsigned int fail_cnt
up to 3 confirmable notifies can fail
Definition: subscribe.h:60
coap_subscription_t::token
unsigned char token[8]
token used for subscription
Definition: subscribe.h:65
coap_subscription_t::local_if
coap_endpoint_t local_if
local communication interface
Definition: subscribe.h:56
coap_subscription_init
void coap_subscription_init(coap_subscription_t *)
Definition: subscribe.c:20
coap_subscription_t::subscriber
coap_address_t subscriber
address and port of subscriber
Definition: subscribe.h:57