Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/gcoap: add user ptr to response handler functions #9857

Merged
merged 6 commits into from
Nov 28, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
net/cord_epsim: adapt to gcoap API changes
  • Loading branch information
haukepetersen committed Nov 28, 2019
commit 3a7b60e4d4efebec3c8511aeaa7813c175745d85
8 changes: 4 additions & 4 deletions sys/net/application_layer/cord/epsim/cord_epsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ static uint8_t buf[BUFSIZE];
/* keep state of the latest registration attempt */
static int _state = CORD_EPSIM_ERROR;

static void _req_handler(unsigned req_state, coap_pkt_t* pdu,
sock_udp_ep_t *remote)
static void _req_handler(const gcoap_request_memo_t *memo, coap_pkt_t* pdu,
const sock_udp_ep_t *remote)
{
(void)remote;
(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)
Expand All @@ -67,7 +67,7 @@ int cord_epsim_register(const sock_udp_ep_t *rd_ep)
/* finish, we don't have any payload */
ssize_t len = gcoap_finish(&pkt, 0, COAP_FORMAT_NONE);
_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;
}

Expand Down