Contiki-NG
Loading...
Searching...
No Matches
nullradio.c
1#include "dev/nullradio.h"
2/*---------------------------------------------------------------------------*/
3/*
4 * The maximum number of bytes this driver can accept from the MAC layer for
5 * "transmission".
6 */
7#define MAX_PAYLOAD_LEN ((unsigned short) - 1)
8/*---------------------------------------------------------------------------*/
9static int
10init(void)
11{
12 return 0;
13}
14/*---------------------------------------------------------------------------*/
15static int
16prepare(const void *payload, unsigned short payload_len)
17{
18 return 1;
19}
20/*---------------------------------------------------------------------------*/
21static int
22transmit(unsigned short transmit_len)
23{
24 return RADIO_TX_OK;
25}
26/*---------------------------------------------------------------------------*/
27static int
28send(const void *payload, unsigned short payload_len)
29{
30 return RADIO_TX_OK;
31}
32/*---------------------------------------------------------------------------*/
33static int
34radio_read(void *buf, unsigned short buf_len)
35{
36 return 0;
37}
38/*---------------------------------------------------------------------------*/
39static int
40channel_clear(void)
41{
42 return 1;
43}
44/*---------------------------------------------------------------------------*/
45static int
46receiving_packet(void)
47{
48 return 0;
49}
50/*---------------------------------------------------------------------------*/
51static int
52pending_packet(void)
53{
54 return 0;
55}
56/*---------------------------------------------------------------------------*/
57static int
58on(void)
59{
60 return 0;
61}
62/*---------------------------------------------------------------------------*/
63static int
64off(void)
65{
66 return 0;
67}
68/*---------------------------------------------------------------------------*/
69static radio_result_t
70get_value(radio_param_t param, radio_value_t *value)
71{
72 if(!value) {
74 }
75
76 switch(param) {
77 case RADIO_CONST_MAX_PAYLOAD_LEN:
78 *value = (radio_value_t)MAX_PAYLOAD_LEN;
79 return RADIO_RESULT_OK;
80 default:
82 }
83}
84/*---------------------------------------------------------------------------*/
85static radio_result_t
86set_value(radio_param_t param, radio_value_t value)
87{
89}
90/*---------------------------------------------------------------------------*/
91static radio_result_t
92get_object(radio_param_t param, void *dest, size_t size)
93{
95}
96/*---------------------------------------------------------------------------*/
97static radio_result_t
98set_object(radio_param_t param, const void *src, size_t size)
99{
101}
102/*---------------------------------------------------------------------------*/
103const struct radio_driver nullradio_driver =
104 {
105 init,
106 prepare,
107 transmit,
108 send,
109 radio_read,
110 channel_clear,
111 receiving_packet,
112 pending_packet,
113 on,
114 off,
115 get_value,
116 set_value,
119 };
120/*---------------------------------------------------------------------------*/
static int transmit(unsigned short transmit_len)
Definition cc2538-rf.c:708
static int off(void)
Definition cc2538-rf.c:533
static radio_result_t get_object(radio_param_t param, void *dest, size_t size)
Definition cc2538-rf.c:1069
static int prepare(const void *payload, unsigned short payload_len)
Definition cc2538-rf.c:648
static radio_result_t set_object(radio_param_t param, const void *src, size_t size)
Definition cc2538-rf.c:1110
static int on(void)
Definition cc2538-rf.c:517
static int init(void)
Definition cc2538-rf.c:556
static int value(int type)
enum radio_result_e radio_result_t
Radio return values when setting or getting radio parameters.
int radio_value_t
Each radio has a set of parameters that designate the current configuration and state of the radio.
Definition radio.h:88
@ RADIO_RESULT_NOT_SUPPORTED
The parameter is not supported.
Definition radio.h:481
@ RADIO_RESULT_INVALID_VALUE
The value argument was incorrect.
Definition radio.h:482
@ RADIO_RESULT_OK
The parameter was set/read successfully.
Definition radio.h:480
@ RADIO_TX_OK
TX was successful and where an ACK was requested one was received.
Definition radio.h:498
The structure of a Contiki-NG radio device driver.
Definition radio.h:534