Skip to content

Commit

Permalink
gcoap: use generic netreg initializers
Browse files Browse the repository at this point in the history
PR RIOT-OS#5526 introduced mbox support for netreg so using these functions
is now required.
  • Loading branch information
miri64 authored and rzr committed Nov 8, 2016
1 parent bae6eab commit 550dc14
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sys/net/gnrc/application_layer/coap/gcoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static gcoap_listener_t _default_listener = {
};

static gcoap_state_t _coap_state = {
.netreg_port = {NULL, 0, KERNEL_PID_UNDEF},
.netreg_port = GNRC_NETREG_ENTRY_INIT_PID(0, KERNEL_PID_UNDEF),
.listeners = &_default_listener,
};

Expand Down Expand Up @@ -304,8 +304,7 @@ static void _expire_request(gcoap_request_memo_t *memo)
static int _register_port(gnrc_netreg_entry_t *netreg_port, uint16_t port)
{
if (!gnrc_netreg_lookup(GNRC_NETTYPE_UDP, port)) {
netreg_port->demux_ctx = port;
netreg_port->target.pid = _pid;
gnrc_netreg_entry_init_pid(netreg_port, port, _pid);
gnrc_netreg_register(GNRC_NETTYPE_UDP, netreg_port);
DEBUG("coap: registered UDP port %" PRIu32 "\n",
netreg_port->demux_ctx);
Expand Down

0 comments on commit 550dc14

Please sign in to comment.