From 45ce082ad6e27dc895516b52806fe88211cabc6a Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Mon, 2 Mar 2015 18:40:09 +0100 Subject: [PATCH] net/ng_netapi: fixed implementation - renamed opt variable in _get_set - fixed msg type MACRO names --- sys/net/crosslayer/ng_netapi/ng_netapi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/net/crosslayer/ng_netapi/ng_netapi.c b/sys/net/crosslayer/ng_netapi/ng_netapi.c index 685224809c..df5eb60724 100644 --- a/sys/net/crosslayer/ng_netapi/ng_netapi.c +++ b/sys/net/crosslayer/ng_netapi/ng_netapi.c @@ -39,15 +39,15 @@ static inline int _get_set(kernel_pid_t pid, uint16_t type, { msg_t cmd; msg_t ack; - ng_netapi_opt_t opt; + ng_netapi_opt_t o; /* set Ĺ„etapi's option struct */ - opt.type = opt; - opt.context = context; - opt.data = data; - opt.data_len = data_len; + o.opt = opt; + o.context = context; + o.data = data; + o.data_len = data_len; /* set outgoing message's fields */ cmd.type = type; - cmd.content.ptr = (void *)&opt; + cmd.content.ptr = (void *)&o; /* trigger the netapi */ msg_send_receive(&cmd, &ack, pid); /* return the ACK message's value */ @@ -58,7 +58,7 @@ int ng_netapi_send(kernel_pid_t pid, ng_pktsnip_t *pkt) { msg_t msg; /* set the outgoing message's fields */ - msg.type = NETAPI_MSG_TYPE_SND; + msg.type = NG_NETAPI_MSG_TYPE_SND; msg.content.ptr = (void *)pkt; /* send data using netapi */ return msg_send(&msg, pid); @@ -67,13 +67,13 @@ int ng_netapi_send(kernel_pid_t pid, ng_pktsnip_t *pkt) int ng_netapi_get(kernel_pid_t pid, ng_netconf_opt_t opt, uint16_t context, void *data, size_t data_len) { - return _get_set(pid, NG_NETAPI_MSG_TYPE_GETOPT, opt, context, + return _get_set(pid, NG_NETAPI_MSG_TYPE_GET, opt, context, data, data_len); } int ng_netapi_set(kernel_pid_t pid, ng_netconf_opt_t opt, uint16_t context, void *data, size_t data_len) { - return _get_set(pid, NG_NETAPI_MSG_TYPE_SETOPT, opt, context, + return _get_set(pid, NG_NETAPI_MSG_TYPE_SET, opt, context, data, data_len); }