Merge pull request #10046 from haukepetersen/fix_nanocoap_usecorrecttypedef

net/nanocoap: use correct type param for _bulid_hdr()
This commit is contained in:
Martine Lenders 2018-09-26 13:48:47 +02:00 committed by GitHub
commit 8e9c28dac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ extern "C" {
int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize); int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize);
/** /**
* @brief Simple synchronous CoAP get * @brief Simple synchronous CoAP (confirmable) get
* *
* @param[in] remote remote UDP endpoint * @param[in] remote remote UDP endpoint
* @param[in] path remote path * @param[in] path remote path

View File

@ -94,7 +94,7 @@ ssize_t nanocoap_get(sock_udp_ep_t *remote, const char *path, uint8_t *buf, size
uint8_t *pktpos = buf; uint8_t *pktpos = buf;
pkt.hdr = (coap_hdr_t*)buf; pkt.hdr = (coap_hdr_t*)buf;
pktpos += coap_build_hdr(pkt.hdr, COAP_REQ, NULL, 0, COAP_METHOD_GET, 1); pktpos += coap_build_hdr(pkt.hdr, COAP_TYPE_CON, NULL, 0, COAP_METHOD_GET, 1);
pktpos += coap_opt_put_uri_path(pktpos, 0, path); pktpos += coap_opt_put_uri_path(pktpos, 0, path);
pkt.payload = pktpos; pkt.payload = pktpos;
pkt.payload_len = 0; pkt.payload_len = 0;

View File

@ -34,7 +34,7 @@ static void test_nanocoap__hdr(void)
unsigned char path_tmp[64] = {0}; unsigned char path_tmp[64] = {0};
uint8_t *pktpos = &buf[0]; uint8_t *pktpos = &buf[0];
pktpos += coap_build_hdr((coap_hdr_t *)pktpos, COAP_REQ, NULL, 0, pktpos += coap_build_hdr((coap_hdr_t *)pktpos, COAP_TYPE_CON, NULL, 0,
COAP_METHOD_GET, msgid); COAP_METHOD_GET, msgid);
pktpos += coap_opt_put_location_path(pktpos, 0, loc_path); pktpos += coap_opt_put_location_path(pktpos, 0, loc_path);
pktpos += coap_opt_put_uri_path(pktpos, COAP_OPT_LOCATION_PATH, path); pktpos += coap_opt_put_uri_path(pktpos, COAP_OPT_LOCATION_PATH, path);