Skip to content

Commit 662d690

Browse files
author
Martin Lenders
committed
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 0331d61 commit 662d690

File tree

3 files changed

+448
-11
lines changed

3 files changed

+448
-11
lines changed

sys/include/basic_net.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,22 @@ typedef struct {
231231
command. */
232232
} basic_net_ack_t;
233233

234+
#ifdef MODULE_TRANSCEIVER
235+
/**
236+
* @brief PID for a basic_net layer, when used with the transceiver module.
237+
*
238+
* @detail This variable is only needed, iff this definitions are used with
239+
* the transceiver module in legacy applications. Needs to be set
240+
* externaly (e. g. the layer, that uses basic_net). Guard it against
241+
* other layers using basic_net with the transceiver with
242+
* the macro `HAS_BASIC_NET_PID`, the transceiver module will check
243+
* if it is there and only than allow adapter capabilities. Since
244+
* only one basic_net layer can be used with this hack, it is
245+
* advised to let only layers below network layer use this.
246+
*/
247+
extern unsigned int basic_net_pid;
248+
#endif /* MODULE_TRANSCEIVER */
249+
234250
#ifdef MODULE_BASIC_NET /* Only include if module basic_net is compiled */
235251
/**
236252
* @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)