Skip to content

Commit

Permalink
sys: transceiver: Provide an adapter to basic_net module
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Martin Lenders authored and miri64 committed Aug 21, 2014
1 parent fd5cd9b commit 6ddfd97
Show file tree
Hide file tree
Showing 4 changed files with 559 additions and 11 deletions.
5 changes: 5 additions & 0 deletions sys/include/transceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
#define TRANSCEIVER_MC1322X (0x08) ///< MC1322X transceivers
#define TRANSCEIVER_NATIVE (0x10) ///< NATIVE transceivers
#define TRANSCEIVER_AT86RF231 (0x20) ///< AT86RF231 transceivers
#define TRANSCEIVER_BASIC_NET (0x30) ///< basic_net compatible L* layers

/**
* @brief Data type for transceiver specification
Expand All @@ -146,6 +147,10 @@ typedef uint64_t transceiver_eui64_t;

/**
* @brief Message types for transceiver interface
*
* @note **ATTENTION:** Packages received from a basic_net layer are neither
* of type radio_packet_t nor ieee802154_packet_t as they normally are
* (depending on the radio), but basic_net_rcv_pkt_t!
*/
enum transceiver_msg_type_t {
/* Message types for driver <-> transceiver communication */
Expand Down
16 changes: 16 additions & 0 deletions sys/net/include/basic_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,22 @@ typedef struct {
} basic_net_reg_t;


#ifdef MODULE_TRANSCEIVER
/**
* @brief PID for a basic_net layer, when used with the transceiver module.
*
* @detail This variable is only needed, iff this definitions are used with
* the transceiver module in legacy applications. Needs to be set
* externaly (e. g. the layer, that uses basic_net). Guard it against
* other layers using basic_net with the transceiver with
* the macro `HAS_BASIC_NET_PID`, the transceiver module will check
* if it is there and only than allow adapter capabilities. Since
* only one basic_net layer can be used with this hack, it is
* advised to let only layers below network layer use this.
*/
extern kernel_pid_t basic_net_pid;
#endif /* MODULE_TRANSCEIVER */

#ifdef MODULE_BASIC_NET /* Only include if module basic_net is compiled */
/**
* @brief Sends a command to a protocol's control thread.
Expand Down
12 changes: 1 addition & 11 deletions sys/transceiver/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
ifneq (,$(filter cc2420,$(USEMODULE)))
INCLUDES += -I$(RIOTBASE)/sys/net/include
endif

ifneq (,$(filter at86rf231,$(USEMODULE)))
INCLUDES += -I$(RIOTBASE)/sys/net/include
endif

ifneq (,$(filter mc1322x,$(USEMODULE)))
INCLUDES += -I$(RIOTBASE)/sys/net/include
endif
INCLUDES += -I$(RIOTBASE)/sys/net/include

include $(RIOTBASE)/Makefile.base
Loading

0 comments on commit 6ddfd97

Please sign in to comment.