Lines Matching refs:obs
495 coap_subscription_t *obs, *otmp; local
512 LL_FOREACH_SAFE( resource->subscribers, obs, otmp ) {
513 coap_session_release( obs->session );
514 coap_delete_pdu(obs->pdu);
515 coap_delete_cache_key(obs->cache_key);
516 COAP_FREE_TYPE( subscription, obs );
861 coap_subscription_t *obs; local
871 LL_FOREACH(r->subscribers, obs) {
872 if (r->dirty == 0 && obs->dirty == 0) {
880 if (obs->session->con_active >= COAP_DEFAULT_NSTART &&
882 (obs->non_cnt >= COAP_OBS_MAX_NON))) {
884 obs->dirty = 1;
890 obs->dirty = 0;
892 response = coap_pdu_init(COAP_MESSAGE_CON, 0, 0, coap_session_max_pdu_size(obs->session));
894 obs->dirty = 1;
903 if (!coap_add_token(response, obs->pdu->token_length, obs->pdu->token)) {
904 obs->dirty = 1;
914 token.length = obs->pdu->token_length;
915 token.s = obs->pdu->token;
917 obs->pdu->mid = response->mid = coap_new_message_id(obs->session);
920 obs->non_cnt < COAP_OBS_MAX_NON)) {
932 if (coap_get_block(obs->pdu, COAP_OPTION_BLOCK2, &block)) {
942 h = r->handler[obs->pdu->code - 1];
945 query = coap_get_query(obs->pdu);
946 h(r, obs->session, obs->pdu, query, response);
948 coap_check_code_lg_xmit(obs->session, response, r, query);
954 coap_delete_observer(r, obs->session, &token);
966 obs->non_cnt = 0;
968 obs->non_cnt++;
971 mid = coap_send_internal( obs->session, response );
977 obs->dirty = 1;
1087 coap_subscription_t *obs, *otmp; local
1089 LL_FOREACH_SAFE(resource->subscribers, obs, otmp) {
1090 if ( obs->session == session &&
1091 token->length == obs->pdu->token_length &&
1092 memcmp(token->s, obs->pdu->token, token->length) == 0) {
1096 if (obs->fail_cnt < COAP_OBS_MAX_FAIL)
1097 obs->fail_cnt++;
1099 LL_DELETE(resource->subscribers, obs);
1100 obs->fail_cnt = 0;
1108 if (coap_print_addr(&obs->session->addr_info.remote,
1112 coap_cancel_all_messages(context, obs->session,
1113 obs->pdu->token, obs->pdu->token_length);
1114 coap_session_release( obs->session );
1115 coap_delete_pdu(obs->pdu);
1116 coap_delete_cache_key(obs->cache_key);
1117 COAP_FREE_TYPE(subscription, obs);