|
Data Structures |
| struct | net_proto |
| | Net protocol data structure. More...
|
Defines |
|
#define | NET_BUF_FULL -20 |
| | No space left in the comBuf.
|
|
#define | NET_PROTO_INVALID -1 |
| | Not a valid protocol id.
|
|
#define | NET_PROTO_MAX 3 |
| | Maximum number of protocols.
|
| #define | SIMPLE_PROTO_ID 17 |
|
#define | MST_PROTO_ID 18 |
|
#define | RTS_PROTO_ID 19 |
|
#define | DELUGE_PROTO_ID 20 |
|
#define | CTP_PROTO_ID 0xC4 |
| #define | DUTY_CYCLE_UP_TIME 10000 |
|
#define | DUTY_CYCLE_PERIOD 60000 |
Typedefs |
|
typedef int8_t(* | net_proto_send )(comBuf *pkt, va_list args) |
|
typedef boolean(* | net_proto_recv )(comBuf *pkt, uint8_t **footer, uint8_t port) |
|
typedef int8_t(* | net_proto_ioctl )(uint8_t request, va_list args) |
Functions |
| void | net_init () |
|
void | net_init_duty_cycle (uint32_t recvTimeout) |
| | Initialize the net layer variables. Use duty cycling.
|
| void | setNetRecvTimeout (uint32_t recvTimeout) |
| | Set receive timeout for duty cycling. The radio will wait for timeout ms to receive a packet upon turning on, before turning off again.
|
| uint32_t | getNetRecvTimeout () |
| | Get receive timeout for duty cycling.
|
| int8_t | net_send (comBuf *pkt, uint8_t proto_id, uint8_t port,...) |
| | Send an event with the currently selected protocol.
|
| int8_t | net_proto_register (uint8_t proto, net_proto_send sfunc, net_proto_recv rfunc, net_proto_ioctl ifunc) |
| | Register a new protocol to be used with the net layer.
|
| int8_t | net_ioctl (uint8_t proto, uint8_t request,...) |
| | Set some protocol specific options.
|
| boolean | is_app_waiting_on (uint8_t port) |
| comBuf * | net_recv (uint8_t port) |
| | net_recv method called by applications
|
| void | net_thread () |