Last active
August 29, 2015 14:20
-
-
Save miri64/a2f815d3bbbc5798de28 to your computer and use it in GitHub Desktop.
Minimal netapi thread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include "msg.h" | |
#include "net/ng_netapi.h" | |
void *_event_loop(void *args) | |
{ | |
msg_t msg, reply; | |
reply.type = NG_NETAPI_MSG_TYPE_ACK; /* Prepare reply type */ | |
while (1) { | |
msg_receive(&msg); | |
switch (msg->type) { | |
case NG_NETAPI_MSG_TYPE_GET: | |
case NG_NETAPI_MSG_TYPE_SET: | |
reply.content.value = (uint32_t)(-ENOTSUP); | |
msg_reply(&msg, &reply); | |
break; | |
case NG_NETAPI_MSG_TYPE_SND: | |
case NG_NETAPI_MSG_TYPE_RCV: | |
default: | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment