mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
net/cord_epsim: adapt to gcoap API changes
This commit is contained in:
parent
7b1217a529
commit
3a7b60e4d4
@ -37,12 +37,12 @@ static uint8_t buf[BUFSIZE];
|
|||||||
/* keep state of the latest registration attempt */
|
/* keep state of the latest registration attempt */
|
||||||
static int _state = CORD_EPSIM_ERROR;
|
static int _state = CORD_EPSIM_ERROR;
|
||||||
|
|
||||||
static void _req_handler(unsigned req_state, coap_pkt_t* pdu,
|
static void _req_handler(const gcoap_request_memo_t *memo, coap_pkt_t* pdu,
|
||||||
sock_udp_ep_t *remote)
|
const sock_udp_ep_t *remote)
|
||||||
{
|
{
|
||||||
(void)remote;
|
(void)remote;
|
||||||
(void)pdu;
|
(void)pdu;
|
||||||
_state = (req_state == GCOAP_MEMO_RESP) ? CORD_EPSIM_OK : CORD_EPSIM_ERROR;
|
_state = (memo->state == GCOAP_MEMO_RESP) ? CORD_EPSIM_OK : CORD_EPSIM_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cord_epsim_register(const sock_udp_ep_t *rd_ep)
|
int cord_epsim_register(const sock_udp_ep_t *rd_ep)
|
||||||
@ -67,7 +67,7 @@ int cord_epsim_register(const sock_udp_ep_t *rd_ep)
|
|||||||
/* finish, we don't have any payload */
|
/* finish, we don't have any payload */
|
||||||
ssize_t len = gcoap_finish(&pkt, 0, COAP_FORMAT_NONE);
|
ssize_t len = gcoap_finish(&pkt, 0, COAP_FORMAT_NONE);
|
||||||
_state = CORD_EPSIM_BUSY;
|
_state = CORD_EPSIM_BUSY;
|
||||||
if (gcoap_req_send(buf, len, rd_ep, _req_handler) == 0) {
|
if (gcoap_req_send(buf, len, rd_ep, _req_handler, NULL) == 0) {
|
||||||
return CORD_EPSIM_ERROR;
|
return CORD_EPSIM_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user