Skip to content

Commit b8e225b

Browse files
Martin Lendersmiri64
authored andcommitted
sys: transceiver: Provide an adapter to basic_net module
Since basic_net is aimed to replace tranceiver one day, but porting efforts usally take a while, this commit aims to provide access via transceiver as we are used to for radio/network drivers that already implement basic_net (e. g. uart_net in RIOT-OS#1454).
1 parent 38ec15e commit b8e225b

File tree

3 files changed

+447
-11
lines changed

3 files changed

+447
-11
lines changed

sys/include/basic_net.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,22 @@ typedef struct {
258258
} basic_net_reg_t;
259259

260260

261+
#ifdef MODULE_TRANSCEIVER
262+
/**
263+
* @brief PID for a basic_net layer, when used with the transceiver module.
264+
*
265+
* @detail This variable is only needed, iff this definitions are used with
266+
* the transceiver module in legacy applications. Needs to be set
267+
* externaly (e. g. the layer, that uses basic_net). Guard it against
268+
* other layers using basic_net with the transceiver with
269+
* the macro `HAS_BASIC_NET_PID`, the transceiver module will check
270+
* if it is there and only than allow adapter capabilities. Since
271+
* only one basic_net layer can be used with this hack, it is
272+
* advised to let only layers below network layer use this.
273+
*/
274+
extern unsigned int basic_net_pid;
275+
#endif /* MODULE_TRANSCEIVER */
276+
261277
#ifdef MODULE_BASIC_NET /* Only include if module basic_net is compiled */
262278
/**
263279
* @brief Sends a command to a protocol's control thread.

sys/include/transceiver.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
#define TRANSCEIVER_MC1322X (0x08) ///< MC1322X transceivers
133133
#define TRANSCEIVER_NATIVE (0x10) ///< NATIVE transceivers
134134
#define TRANSCEIVER_AT86RF231 (0x20) ///< AT86RF231 transceivers
135+
#define TRANSCEIVER_BASIC_NET (0x30) ///< basic_net compatible L* layers
135136

136137
/**
137138
* @brief Data type for transceiver specification
@@ -145,6 +146,10 @@ typedef uint64_t transceiver_eui64_t;
145146

146147
/**
147148
* @brief Message types for transceiver interface
149+
*
150+
* @note **ATTENTION:** Packages received from a basic_net layer are neither
151+
* of type radio_packet_t nor ieee802154_packet_t as they normally are
152+
* (depending on the radio), but basic_net_rcv_pkt_t!
148153
*/
149154
enum transceiver_msg_type_t {
150155
/* Message types for driver <-> transceiver communication */

0 commit comments

Comments
 (0)