Fix for coap_get_header_token() always returning 0 and not retrieving the token when using CoAP draft v13.

Every reference to the old Token Option has been removed (in CoAP draft v13 the Token Option has been promoted to a field following the CoAP Header).
This commit is contained in:
Daniele Alessandrelli 2013-07-22 19:36:01 +02:00
parent 10f64c0ce8
commit 9230c0a158
2 changed files with 0 additions and 4 deletions

View File

@ -822,8 +822,6 @@ coap_get_header_token(void *packet, const uint8_t **token)
{
coap_packet_t *const coap_pkt = (coap_packet_t *) packet;
if (!IS_OPTION(coap_pkt, COAP_OPTION_TOKEN)) return 0;
*token = coap_pkt->token;
return coap_pkt->token_len;
}
@ -836,7 +834,6 @@ coap_set_header_token(void *packet, const uint8_t *token, size_t token_len)
coap_pkt->token_len = MIN(COAP_TOKEN_LEN, token_len);
memcpy(coap_pkt->token, token, coap_pkt->token_len);
SET_OPTION(coap_pkt, COAP_OPTION_TOKEN);
return coap_pkt->token_len;
}
/*-----------------------------------------------------------------------------------*/

View File

@ -172,7 +172,6 @@ typedef enum {
COAP_OPTION_MAX_AGE = 14, /* 0-4 B */
COAP_OPTION_URI_QUERY = 15, /* 0-270 B */
COAP_OPTION_ACCEPT = 16, /* 0-2 B */
COAP_OPTION_TOKEN = 19, /* 1-8 B */
COAP_OPTION_LOCATION_QUERY = 20, /* 1-270 B */
COAP_OPTION_BLOCK2 = 23, /* 1-3 B */
COAP_OPTION_BLOCK1 = 27, /* 1-3 B */