mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
net/gcoap: change return type from gcoap_req_send() to ssize_t
This commit is contained in:
parent
8482434bdf
commit
2e523bf101
@ -800,9 +800,9 @@ static inline ssize_t gcoap_request(coap_pkt_t *pdu, uint8_t *buf, size_t len,
|
||||
* @return length of the packet
|
||||
* @return 0 if cannot send
|
||||
*/
|
||||
size_t gcoap_req_send(const uint8_t *buf, size_t len,
|
||||
const sock_udp_ep_t *remote,
|
||||
gcoap_resp_handler_t resp_handler, void *context);
|
||||
ssize_t gcoap_req_send(const uint8_t *buf, size_t len,
|
||||
const sock_udp_ep_t *remote,
|
||||
gcoap_resp_handler_t resp_handler, void *context);
|
||||
|
||||
/**
|
||||
* @brief Initializes a CoAP response packet on a buffer
|
||||
|
@ -812,9 +812,9 @@ int gcoap_req_init(coap_pkt_t *pdu, uint8_t *buf, size_t len,
|
||||
return (res > 0) ? 0 : res;
|
||||
}
|
||||
|
||||
size_t gcoap_req_send(const uint8_t *buf, size_t len,
|
||||
const sock_udp_ep_t *remote,
|
||||
gcoap_resp_handler_t resp_handler, void *context)
|
||||
ssize_t gcoap_req_send(const uint8_t *buf, size_t len,
|
||||
const sock_udp_ep_t *remote,
|
||||
gcoap_resp_handler_t resp_handler, void *context)
|
||||
{
|
||||
gcoap_request_memo_t *memo = NULL;
|
||||
unsigned msg_type = (*buf & 0x30) >> 4;
|
||||
@ -913,7 +913,7 @@ size_t gcoap_req_send(const uint8_t *buf, size_t len,
|
||||
}
|
||||
DEBUG("gcoap: sock send failed: %d\n", (int)res);
|
||||
}
|
||||
return (size_t)((res > 0) ? res : 0);
|
||||
return ((res > 0) ? res : 0);
|
||||
}
|
||||
|
||||
int gcoap_resp_init(coap_pkt_t *pdu, uint8_t *buf, size_t len, unsigned code)
|
||||
|
Loading…
Reference in New Issue
Block a user