mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-18 21:49:05 +03:00
examples/client.c: Change COAP_OPTION_SUBSCRIPTION to COAP_OPTION_OBSERVE
As we are talking about Observe here
This commit is contained in:
1 parent
db48a839b6
commit
97486e7112
1 file changed
+3
-3
+3
-3
@@ -360,7 +360,7 @@ message_handler(struct coap_context_t *ctx,
|
||||
if (COAP_RESPONSE_CLASS(received->code) == 2) {
|
||||
|
||||
/* set obs timer if we have successfully subscribed a resource */
|
||||
if (!obs_started && coap_check_option(received, COAP_OPTION_SUBSCRIPTION, &opt_iter)) {
|
||||
if (!obs_started && coap_check_option(received, COAP_OPTION_OBSERVE, &opt_iter)) {
|
||||
debug("observation relationship established, set timeout to %d\n", obs_seconds);
|
||||
obs_started = 1;
|
||||
obs_ms = obs_seconds * 1000;
|
||||
@@ -532,7 +532,7 @@ message_handler(struct coap_context_t *ctx,
|
||||
assert(pdu == NULL);
|
||||
|
||||
/* our job is done, we can exit at any time */
|
||||
ready = coap_check_option(received, COAP_OPTION_SUBSCRIPTION, &opt_iter) == NULL;
|
||||
ready = coap_check_option(received, COAP_OPTION_OBSERVE, &opt_iter) == NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -819,7 +819,7 @@ set_blocksize(void) {
|
||||
static void
|
||||
cmdline_subscribe(char *arg) {
|
||||
obs_seconds = atoi(arg);
|
||||
coap_insert(&optlist, new_option_node(COAP_OPTION_SUBSCRIPTION, 0, NULL));
|
||||
coap_insert(&optlist, new_option_node(COAP_OPTION_OBSERVE, 0, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in new issue
Block a user