sys: netopt: add checksum option

This commit is contained in:
Bas Stottelaar 2018-04-10 23:59:50 +02:00
parent 4ca2109655
commit 02395e593d
3 changed files with 15 additions and 1 deletions

View File

@ -539,6 +539,13 @@ typedef enum {
*/
NETOPT_BLE_CTX,
/**
* @brief (@ref netopt_enable_t) enable hardware checksumming
*
* If enabled, enable hardware checksumming of incoming frames.
*/
NETOPT_CHECKSUM,
/* add more options if needed */
/**

View File

@ -90,6 +90,7 @@ 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_NUMOF] = "NETOPT_NUMOF",
};

View File

@ -71,7 +71,8 @@ static const struct {
{ "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 +151,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"
@ -276,6 +278,10 @@ static void _print_netopt(netopt_t opt)
printf("coding rate");
break;
case NETOPT_CHECKSUM:
printf("checksum");
break;
default:
/* we don't serve these options here */
break;