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

78 lines
2.5 KiB
C
Raw Normal View History

/*
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @{
* @ingroup net_netopt
* @file
* @brief This file contains functionality to map netopt option
* numbers to strings
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @}
*/
#include "net/netopt.h"
#ifdef __cplusplus
extern "C" {
#endif
static const char *_netopt_strmap[] = {
[NETOPT_CHANNEL] = "NETOPT_CHANNEL",
[NETOPT_IS_CHANNEL_CLR] = "NETOPT_IS_CHANNEL_CLR",
[NETOPT_ADDRESS] = "NETOPT_ADDRESS",
[NETOPT_ADDRESS_LONG] = "NETOPT_ADDRESS_LONG",
[NETOPT_ADDR_LEN] = "NETOPT_ADDR_LEN",
[NETOPT_SRC_LEN] = "NETOPT_SRC_LEN",
[NETOPT_NID] = "NETOPT_NID",
[NETOPT_IPV6_IID] = "NETOPT_IPV6_IID",
[NETOPT_TX_POWER] = "NETOPT_TX_POWER",
[NETOPT_MAX_PACKET_SIZE] = "NETOPT_MAX_PACKET_SIZE",
[NETOPT_PRELOADING] = "NETOPT_PRELOADING",
[NETOPT_PROMISCUOUSMODE] = "NETOPT_PROMISCUOUSMODE",
[NETOPT_AUTOACK] = "NETOPT_AUTOACK",
[NETOPT_ACK_REQ] = "NETOPT_ACK_REQ",
[NETOPT_RETRANS] = "NETOPT_RETRANS",
[NETOPT_PROTO] = "NETOPT_PROTO",
[NETOPT_STATE] = "NETOPT_STATE",
[NETOPT_RAWMODE] = "NETOPT_RAWMODE",
[NETOPT_RX_START_IRQ] = "NETOPT_RX_START_IRQ",
[NETOPT_RX_END_IRQ] = "NETOPT_RX_END_IRQ",
[NETOPT_TX_START_IRQ] = "NETOPT_TX_START_IRQ",
[NETOPT_TX_END_IRQ] = "NETOPT_TX_END_IRQ",
[NETOPT_AUTOCCA] = "NETOPT_AUTOCCA",
2015-06-01 15:51:50 +02:00
[NETOPT_CSMA] = "NETOPT_CSMA",
[NETOPT_CSMA_RETRIES] = "NETOPT_CSMA_RETRIES",
[NETOPT_IS_WIRED] = "NETOPT_IS_WIRED",
[NETOPT_DEVICE_TYPE] = "NETOPT_DEVICE_TYPE",
[NETOPT_CHANNEL_PAGE] = "NETOPT_CHANNEL_PAGE",
[NETOPT_CCA_THRESHOLD] = "NETOPT_CCA_THRESHOLD",
2016-07-19 12:54:14 +02:00
[NETOPT_CCA_MODE] = "NETOPT_CCA_MODE",
2016-02-11 18:48:00 +01:00
[NETOPT_STATS] = "NETOPT_STATS",
drivers/xbee: encryption support add encryption to drivers fix new line at the end of file add shell command for enable encryption and set encryption key on a given device modify _net_if_set_encrypt_key to support any key length modify _net_if_set_encrypt_key to support any key length of the key modify blank line fix ace before tab in indent fix ace before tab indent fix ace before tab indent an error fix trailing white space drivers/xbee: encryption support add encryption to drivers fix new line at the end of file add shell command for enable encryption and set encryption key on a given device modify _net_if_set_encrypt_key to support any key length modify _net_if_set_encrypt_key to support any key length of the key modify blank line fix ace before tab in indent fix ace before tab indent fix ace before tab indent an error fix trailing white space modify drivers/xbee/xbee.c fix white spaces on xbee.c Update xbee encryption driver white line at end xbee.h fix error fix sc_netif.c fix rebase master interactive drivers/xbee: encryption support add encryption to drivers fix new line at the end of file add shell command for enable encryption and set encryption key on a given device modify _net_if_set_encrypt_key to support any key length modify _net_if_set_encrypt_key to support any key length of the key modify blank line fix ace before tab in indent fix ace before tab indent fix ace before tab indent an error fix trailing white space drivers/xbee: encryption support add encryption to drivers fix new line at the end of file add shell command for enable encryption and set encryption key on a given device modify _net_if_set_encrypt_key to support any key length modify _net_if_set_encrypt_key to support any key length of the key modify blank line fix ace before tab in indent fix ace before tab indent fix ace before tab indent an error fix trailing white space modify drivers/xbee/xbee.c fix white spaces on xbee.c Update xbee encryption driver white line at end xbee.h fix error fix rebase conflict 4 fix same missing in patches changes fix ascii to hex index parser fix syntax rules fix syntax issue 2 add _netopt_strmap NETOPT_ENCRYPTION e NETOPT_ENCRYPTION_KEY fix trailng white spaces
2015-05-14 15:03:52 +02:00
[NETOPT_ENCRYPTION] = "NETOPT_ENCRYPTION",
[NETOPT_ENCRYPTION_KEY] = "NETOPT_ENCRYPTION_KEY",
2016-07-19 12:54:14 +02:00
[NETOPT_RF_TESTMODE] = "NETOPT_RF_TESTMODE",
[NETOPT_NUMOF] = "NETOPT_NUMOF",
};
const char *netopt2str(netopt_t opt)
{
if (opt >= NETOPT_NUMOF) {
return "unknown";
}
else {
const char *tmp = _netopt_strmap[opt];
return tmp ? tmp : "unknown";
}
}
#ifdef __cplusplus
}
#endif