Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | #include <net/buf.h> #include "dev/nullradio.h" /*---------------------------------------------------------------------------*/ static int init(void) { return 0; } /*---------------------------------------------------------------------------*/ static int prepare(const void *payload, unsigned short payload_len) { return 1; } /*---------------------------------------------------------------------------*/ static int transmit(struct net_buf *buf, unsigned short transmit_len) { return RADIO_TX_OK; } /*---------------------------------------------------------------------------*/ static int send(struct net_buf *buf, const void *payload, unsigned short payload_len) { prepare(payload, payload_len); return transmit(buf, payload_len); } /*---------------------------------------------------------------------------*/ static int radio_read(void *buf, unsigned short buf_len) { return 0; } /*---------------------------------------------------------------------------*/ static int channel_clear(void) { return 1; } /*---------------------------------------------------------------------------*/ static int receiving_packet(void) { return 0; } /*---------------------------------------------------------------------------*/ static int pending_packet(void) { return 0; } /*---------------------------------------------------------------------------*/ static int on(void) { return 0; } /*---------------------------------------------------------------------------*/ static int off(void) { return 0; } /*---------------------------------------------------------------------------*/ static radio_result_t get_value(radio_param_t param, radio_value_t *value) { return RADIO_RESULT_NOT_SUPPORTED; } /*---------------------------------------------------------------------------*/ static radio_result_t set_value(radio_param_t param, radio_value_t value) { return RADIO_RESULT_NOT_SUPPORTED; } /*---------------------------------------------------------------------------*/ static radio_result_t get_object(radio_param_t param, void *dest, size_t size) { return RADIO_RESULT_NOT_SUPPORTED; } /*---------------------------------------------------------------------------*/ static radio_result_t set_object(radio_param_t param, const void *src, size_t size) { return RADIO_RESULT_NOT_SUPPORTED; } /*---------------------------------------------------------------------------*/ const struct radio_driver nullradio_driver = { init, prepare, transmit, send, radio_read, channel_clear, receiving_packet, pending_packet, on, off, get_value, set_value, get_object, set_object }; /*---------------------------------------------------------------------------*/ |