1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #9088 from basilfx/feature/netopt_checksum_busy

sys: netopt: add checksum and busy options
This commit is contained in:
Bas Stottelaar 2018-05-21 23:24:59 +02:00 committed by GitHub
commit bc96c6f60d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 1 deletions

View File

@ -539,6 +539,21 @@ typedef enum {
*/
NETOPT_BLE_CTX,
/**
* @brief (@ref netopt_enable_t) enable hardware checksumming
*
* If enabled, enable hardware checksumming of incoming frames.
*/
NETOPT_CHECKSUM,
/**
* @brief (@ref netopt_enable_t) enable busy mode
*
* When set, the PHY will enter busy mode, in which it will not accept
* incoming frames until unset.
*/
NETOPT_PHY_BUSY,
/* add more options if needed */
/**

View File

@ -90,6 +90,8 @@ static const char *_netopt_strmap[] = {
[NETOPT_TX_RETRIES_NEEDED] = "NETOPT_TX_RETRIES_NEEDED",
[NETOPT_6LO_IPHC] = "NETOPT_6LO_IPHC",
[NETOPT_BLE_CTX] = "NETOPT_BLE_CTX",
[NETOPT_CHECKSUM] = "NETOPT_CHECKSUM",
[NETOPT_PHY_BUSY] = "NETOPT_PHY_BUSY",
[NETOPT_NUMOF] = "NETOPT_NUMOF",
};

View File

@ -67,11 +67,13 @@ static const struct {
{ "iphc", NETOPT_6LO_IPHC },
{ "preload", NETOPT_PRELOADING },
{ "promisc", NETOPT_PROMISCUOUSMODE },
{ "phy_busy", NETOPT_PHY_BUSY },
{ "raw", NETOPT_RAWMODE },
{ "rtr_adv", NETOPT_IPV6_SND_RTR_ADV },
{ "iq_invert", NETOPT_IQ_INVERT },
{ "rx_single", NETOPT_SINGLE_RECEIVE },
{ "chan_hop", NETOPT_CHANNEL_HOP }
{ "chan_hop", NETOPT_CHANNEL_HOP },
{ "checksum", NETOPT_CHECKSUM },
};
/* utility functions */
@ -150,6 +152,7 @@ static void _set_usage(char *cmd_name)
" * \"freq\" - sets the \"channel\" center frequency\n"
" * \"channel\" - sets the frequency channel\n"
" * \"chan\" - alias for \"channel\"\n"
" * \"checksum\" - set checksumming on-off\n"
" * \"csma_retries\" - set max. number of channel access attempts\n"
" * \"encrypt\" - set the encryption on-off\n"
" * \"hop_limit\" - set hop limit\n"
@ -160,6 +163,7 @@ static void _set_usage(char *cmd_name)
" * \"page\" - set the channel page (IEEE 802.15.4)\n"
" * \"pan\" - alias for \"nid\"\n"
" * \"pan_id\" - alias for \"nid\"\n"
" * \"phy_busy\" - set busy mode on-off\n"
" * \"bw\" - alias for channel bandwidth\n"
" * \"sf\" - alias for spreading factor\n"
" * \"cr\" - alias for coding rate\n"
@ -276,6 +280,14 @@ static void _print_netopt(netopt_t opt)
printf("coding rate");
break;
case NETOPT_CHECKSUM:
printf("checksum");
break;
case NETOPT_PHY_BUSY:
printf("PHY busy");
break;
default:
/* we don't serve these options here */
break;