From dc907b76fa56a455d65a1416afed0d1c75b576a2 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 3 Nov 2016 12:56:55 +0100 Subject: [PATCH] gcoap: use generic netreg initializers PR #5526 introduced mbox support for netreg so using these functions is now required. --- sys/net/gnrc/application_layer/coap/gcoap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/net/gnrc/application_layer/coap/gcoap.c b/sys/net/gnrc/application_layer/coap/gcoap.c index a678b682a5..79a0c50625 100644 --- a/sys/net/gnrc/application_layer/coap/gcoap.c +++ b/sys/net/gnrc/application_layer/coap/gcoap.c @@ -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, }; @@ -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);