Skip to content

Commit

Permalink
net/ng_netapi: fixed implementation
Browse files Browse the repository at this point in the history
- renamed opt variable in _get_set
- fixed msg type MACRO names
  • Loading branch information
haukepetersen committed Mar 2, 2015
1 parent 726bdf9 commit 45ce082
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sys/net/crosslayer/ng_netapi/ng_netapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand All @@ -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);
}

0 comments on commit 45ce082

Please sign in to comment.