Lines Matching refs:data
38 pdu->data = NULL; in coap_pdu_clear()
153 coap_add_token(coap_pdu_t *pdu, size_t len, const unsigned char *data) { in coap_add_token() argument
161 memcpy(pdu->hdr->token, data, len); in coap_add_token()
164 pdu->data = NULL; in coap_add_token()
171 coap_add_option(coap_pdu_t *pdu, unsigned short type, unsigned int len, const unsigned char *data) { in coap_add_option() argument
176 pdu->data = NULL; in coap_add_option()
187 type - pdu->max_delta, data, len); in coap_add_option()
208 pdu->data = NULL; in coap_add_option_later()
234 coap_add_data(coap_pdu_t *pdu, unsigned int len, const unsigned char *data) { in coap_add_data() argument
236 assert(pdu->data == NULL); in coap_add_data()
243 assert(pdu->data == NULL); in coap_add_data()
247 pdu->data = (unsigned char *)pdu->hdr + pdu->length; in coap_add_data()
248 *pdu->data = COAP_PAYLOAD_START; in coap_add_data()
249 pdu->data++; in coap_add_data()
251 memcpy(pdu->data, data, len); in coap_add_data()
257 coap_get_data(coap_pdu_t *pdu, size_t *len, unsigned char **data) { in coap_get_data() argument
260 assert(data); in coap_get_data()
262 if (pdu->data) { in coap_get_data()
263 *len = (unsigned char *)pdu->hdr + pdu->length - pdu->data; in coap_get_data()
264 *data = pdu->data; in coap_get_data()
267 *data = NULL; in coap_get_data()
270 return *data != NULL; in coap_get_data()
341 coap_pdu_parse(unsigned char *data, size_t length, coap_pdu_t *pdu) { in coap_pdu_parse() argument
344 assert(data); in coap_pdu_parse()
357 LWIP_ASSERT("coap_pdu_parse with unexpected addresses", data == pdu->hdr); in coap_pdu_parse()
361 pdu->hdr->version = data[0] >> 6; in coap_pdu_parse()
362 pdu->hdr->type = (data[0] >> 4) & 0x03; in coap_pdu_parse()
363 pdu->hdr->token_length = data[0] & 0x0f; in coap_pdu_parse()
364 pdu->hdr->code = data[1]; in coap_pdu_parse()
366 pdu->data = NULL; in coap_pdu_parse()
385 memcpy(&pdu->hdr->id, data + 2, 2); in coap_pdu_parse()
388 memcpy(pdu->hdr + 1, data + sizeof(coap_hdr_t), length - sizeof(coap_hdr_t)); in coap_pdu_parse()
418 pdu->data = (unsigned char *)opt; in coap_pdu_parse()