mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-15 09:33:50 +01:00
Merge pull request #5485 from jfischer-phytec-iot/pr@add-opt-netdev
add testmode and cca mode option to netdev
This commit is contained in:
commit
cf11a0dab7
@ -58,6 +58,21 @@ extern "C" {
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Option parameter to be used with @ref NETOPT_CCA_MODE to set
|
||||
* the mode of the clear channel assessment (CCA) defined
|
||||
* in Std 802.15.4.
|
||||
*/
|
||||
typedef enum {
|
||||
NETDEV2_IEEE802154_CCA_MODE_1 = 1, /**< Energy above threshold */
|
||||
NETDEV2_IEEE802154_CCA_MODE_2, /**< Carrier sense only */
|
||||
NETDEV2_IEEE802154_CCA_MODE_3, /**< Carrier sense with energy above threshold */
|
||||
NETDEV2_IEEE802154_CCA_MODE_4, /**< ALOHA */
|
||||
NETDEV2_IEEE802154_CCA_MODE_5, /**< UWB preamble sense based on the SHR of a frame */
|
||||
NETDEV2_IEEE802154_CCA_MODE_6, /**< UWB preamble sense based on the packet
|
||||
* with the multiplexed preamble */
|
||||
} netdev2_ieee802154_cca_mode_t;
|
||||
|
||||
/**
|
||||
* @brief Extended structure to hold IEEE 802.15.4 driver state
|
||||
*
|
||||
|
||||
@ -201,6 +201,15 @@ typedef enum {
|
||||
*/
|
||||
NETOPT_CCA_THRESHOLD,
|
||||
|
||||
/**
|
||||
* @brief CCA mode for the radio transceiver
|
||||
*
|
||||
* Get/set the CCA mode as uint8_t
|
||||
* corresponding to the respective PHY standard.
|
||||
* - IEEE 802.15.4: @ref netdev2_ieee802154_cca_mode_t
|
||||
*/
|
||||
NETOPT_CCA_MODE,
|
||||
|
||||
/**
|
||||
* @brief get statistics about sent and received packets and data of the device or protocol
|
||||
*
|
||||
@ -215,6 +224,22 @@ typedef enum {
|
||||
NETOPT_ENCRYPTION, /**< en/disable encryption */
|
||||
NETOPT_ENCRYPTION_KEY, /**< set encryption key */
|
||||
|
||||
/**
|
||||
* @brief Test mode for the radio, e.g. for CE or FCC certification
|
||||
*
|
||||
* Get/set the test mode as type @ref netopt_rf_testmode_t or as uint8_t
|
||||
* if the radio supports other vendor specific test modes.
|
||||
*
|
||||
* @note Setting this option should always return -ENOTSUP,
|
||||
* unless it was explicitly allowed at build time,
|
||||
* therefore it should be secured with an additional macro in the device driver.
|
||||
* For development and certification purposes only, this test modes can disturb
|
||||
* normal radio communications and exceed the limits, established by
|
||||
* the regulatory authority.
|
||||
*
|
||||
*/
|
||||
NETOPT_RF_TESTMODE,
|
||||
|
||||
/* add more options if needed */
|
||||
|
||||
/**
|
||||
@ -255,6 +280,16 @@ typedef enum {
|
||||
/* add other states if needed */
|
||||
} netopt_state_t;
|
||||
|
||||
/**
|
||||
* @brief Option parameter to be used with @ref NETOPT_RF_TESTMODE
|
||||
*/
|
||||
typedef enum {
|
||||
NETOPT_RF_TESTMODE_IDLE = 0, /**< idle mode, radio off */
|
||||
NETOPT_RF_TESTMODE_CRX, /**< continuous rx mode */
|
||||
NETOPT_RF_TESTMODE_CTX_CW, /**< carrier wave continuous tx mode */
|
||||
NETOPT_RF_TESTMODE_CTX_PRBS9, /**< PRBS9 continuous tx mode */
|
||||
} netopt_rf_testmode_t;
|
||||
|
||||
/**
|
||||
* @brief Get a string ptr corresponding to opt, for debugging
|
||||
*
|
||||
|
||||
@ -53,9 +53,11 @@ static const char *_netopt_strmap[] = {
|
||||
[NETOPT_DEVICE_TYPE] = "NETOPT_DEVICE_TYPE",
|
||||
[NETOPT_CHANNEL_PAGE] = "NETOPT_CHANNEL_PAGE",
|
||||
[NETOPT_CCA_THRESHOLD] = "NETOPT_CCA_THRESHOLD",
|
||||
[NETOPT_CCA_MODE] = "NETOPT_CCA_MODE",
|
||||
[NETOPT_STATS] = "NETOPT_STATS",
|
||||
[NETOPT_ENCRYPTION] = "NETOPT_ENCRYPTION",
|
||||
[NETOPT_ENCRYPTION_KEY] = "NETOPT_ENCRYPTION_KEY",
|
||||
[NETOPT_RF_TESTMODE] = "NETOPT_RF_TESTMODE",
|
||||
[NETOPT_NUMOF] = "NETOPT_NUMOF",
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user