Fixed missing #includes and restricted linuxradiodrv compilation to linux

This commit is contained in:
Vladimir Pouzanov 2014-02-19 17:04:00 +00:00 committed by Vladimir Pouzanov
parent 43a327df5a
commit 52c90519d9
2 changed files with 16 additions and 3 deletions

View file

@ -35,11 +35,15 @@
#include "contiki.h"
#ifdef linux
#include "linuxradio-drv.h"
#include "net/packetbuf.h"
#include "net/netstack.h"
#include <sys/ioctl.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@ -145,6 +149,7 @@ handle_fd(fd_set *rset, fd_set *wset)
NETSTACK_RDC.input();
}
}
static const struct select_callback linuxradio_sock_callback = { set_fd, handle_fd };
static int
@ -199,3 +204,5 @@ const struct radio_driver linuxradio_driver =
on,
off,
};
#endif

View file

@ -36,6 +36,12 @@
#include <inttypes.h>
#include <limits.h>
struct select_callback {
int (* set_fd)(fd_set *fdr, fd_set *fdw);
void (* handle_fd)(fd_set *fdr, fd_set *fdw);
};
int select_set_callback(int fd, const struct select_callback *callback);
#define CC_CONF_REGISTER_ARGS 1
#define CC_CONF_FUNCTION_POINTER_ARGS 1
#define CC_CONF_FASTCALL
@ -88,9 +94,9 @@ typedef unsigned short uip_stats_t;
*/
#define WEBSERVER_CONF_STATUSPAGE 1
/* RPL currently works only on Windows. *nix would require converting the tun interface to two pcap tees. */
/* RPL currently works only on Windows. *nix would require converting the tun interface to two pcap tees. */
//#define RPL_BORDER_ROUTER 0
#endif
#endif
#if UIP_CONF_IPV6_RPL
/* RPL motes use the uip.c link layer address or optionally the harded coded address (but without the prefix!)
@ -121,7 +127,7 @@ typedef unsigned short uip_stats_t;
* e.g. the jackdaw RNDIS <-> repeater. Then RPL will configure on the radio network and the RF motes will
* be reached through bbbb::<mote link layer address>.
* Possibly minimal-net RPL motes could also be added to this interface?
*
*
*/
#undef UIP_CONF_ROUTER
#define UIP_CONF_ROUTER 1