Merge pull request #3576 from haukepetersen/mv_netopt

net: remove ng_ from netopt header
dev/timer
Martine Lenders 8 years ago
commit 73a42314a5

@ -211,52 +211,52 @@ static void _switch_to_rx(void)
*/
int _get_state(uint8_t *val, size_t max_len)
{
ng_netopt_state_t state;
netopt_state_t state;
if (max_len < sizeof(ng_netopt_state_t)) {
if (max_len < sizeof(netopt_state_t)) {
return -EOVERFLOW;
}
switch (_state) {
case STATE_OFF:
state = NG_NETOPT_STATE_OFF;
state = NETOPT_STATE_OFF;
break;
case STATE_IDLE:
state = NG_NETOPT_STATE_SLEEP;
state = NETOPT_STATE_SLEEP;
break;
case STATE_RX:
state = NG_NETOPT_STATE_IDLE;
state = NETOPT_STATE_IDLE;
break;
case STATE_TX:
state = NG_NETOPT_STATE_TX;
state = NETOPT_STATE_TX;
break;
default:
return -ECANCELED;
}
memcpy(val, &state, sizeof(ng_netopt_state_t));
return sizeof(ng_netopt_state_t);
memcpy(val, &state, sizeof(netopt_state_t));
return sizeof(netopt_state_t);
}
int _set_state(uint8_t *val, size_t len)
{
ng_netopt_state_t state;
netopt_state_t state;
if (len != sizeof(ng_netopt_state_t)) {
if (len != sizeof(netopt_state_t)) {
return -EINVAL;
}
/* get target state */
memcpy(&state, val, len);
/* switch to target state */
switch (state) {
case NG_NETOPT_STATE_SLEEP:
case NETOPT_STATE_SLEEP:
_switch_to_idle();
break;
case NG_NETOPT_STATE_IDLE:
case NETOPT_STATE_IDLE:
_switch_to_rx();
break;
default:
return -ENOTSUP;
}
return sizeof(ng_netopt_state_t);
return sizeof(netopt_state_t);
}
int _get_address(uint8_t *val, size_t max_len)
@ -662,40 +662,40 @@ int _rem_event_cb(ng_netdev_t *dev, ng_netdev_event_cb_t cb)
return -ENOENT;
}
int _get(ng_netdev_t *dev, ng_netopt_t opt, void *value, size_t max_len)
int _get(ng_netdev_t *dev, netopt_t opt, void *value, size_t max_len)
{
(void)dev;
switch (opt) {
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
return _get_address(value, max_len);
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
return _get_channel(value, max_len);
case NG_NETOPT_NID:
case NETOPT_NID:
return _get_pan(value, max_len);
case NG_NETOPT_TX_POWER:
case NETOPT_TX_POWER:
return _get_txpower(value, max_len);
case NG_NETOPT_STATE:
case NETOPT_STATE:
return _get_state(value, max_len);
default:
return -ENOTSUP;
}
}
int _set(ng_netdev_t *dev, ng_netopt_t opt, void *value, size_t value_len)
int _set(ng_netdev_t *dev, netopt_t opt, void *value, size_t value_len)
{
(void)dev;
switch (opt) {
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
return _set_address(value, value_len);
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
return _set_channel(value, value_len);
case NG_NETOPT_NID:
case NETOPT_NID:
return _set_pan(value, value_len);
case NG_NETOPT_TX_POWER:
case NETOPT_TX_POWER:
return _set_txpower(value, value_len);
case NG_NETOPT_STATE:
case NETOPT_STATE:
return _set_state(value, value_len);
default:
return -ENOTSUP;

@ -109,7 +109,7 @@ typedef struct {
kernel_pid_t mac_pid; /**< The driver's thread's PID */
/* driver specific fields */
uint8_t buf[KW2XRF_MAX_PKT_LENGTH]; /**< Buffer for incoming or outgoing packets */
ng_netopt_state_t state; /**< Variable to keep radio driver's state */
netopt_state_t state; /**< Variable to keep radio driver's state */
uint8_t seq_nr; /**< Next packets sequence number */
uint16_t radio_pan; /**< The PAN the radio device is using */
uint8_t radio_channel; /**< The channel the radio device is using */

@ -184,32 +184,32 @@ void kw2xrf_set_sequence(kw2xrf_t *dev, kw2xrf_physeq_t seq)
/* Progrmm new sequence */
switch (seq) {
case XCVSEQ_IDLE:
dev->state = NG_NETOPT_STATE_SLEEP;
dev->state = NETOPT_STATE_SLEEP;
break;
case XCVSEQ_RECEIVE:
dev->state = NG_NETOPT_STATE_IDLE;
dev->state = NETOPT_STATE_IDLE;
break;
case XCVSEQ_TRANSMIT:
dev->state = NG_NETOPT_STATE_TX;
dev->state = NETOPT_STATE_TX;
break;
case XCVSEQ_CCA:
dev->state = NG_NETOPT_STATE_TX;
dev->state = NETOPT_STATE_TX;
break;
case XCVSEQ_TX_RX:
dev->state = NG_NETOPT_STATE_TX;
dev->state = NETOPT_STATE_TX;
break;
case XCVSEQ_CONTINUOUS_CCA:
dev->state = NG_NETOPT_STATE_TX;
dev->state = NETOPT_STATE_TX;
break;
default:
DEBUG("kw2xrf: undefined state assigned to phy\n");
dev->state = NG_NETOPT_STATE_IDLE;
dev->state = NETOPT_STATE_IDLE;
}
/* Mapping of TX-sequences depending on AUTOACK flag */
@ -352,7 +352,7 @@ int kw2xrf_on(kw2xrf_t *dev)
/* abort any ongoing sequence */
kw2xrf_set_sequence(dev, XCVSEQ_IDLE);
dev->state = NG_NETOPT_STATE_SLEEP;
dev->state = NETOPT_STATE_SLEEP;
return 0;
}
@ -508,7 +508,7 @@ uint64_t kw2xrf_get_addr_long(kw2xrf_t *dev)
return addr;
}
int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len)
int kw2xrf_get(ng_netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
@ -517,7 +517,7 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
}
switch (opt) {
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -525,7 +525,7 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
*((uint16_t *)value) = ((dev->addr_short[0] << 8) | dev->addr_short[1]);
return sizeof(uint16_t);
case NG_NETOPT_ADDRESS_LONG:
case NETOPT_ADDRESS_LONG:
if (max_len < sizeof(uint64_t)) {
return -EOVERFLOW;
}
@ -533,7 +533,7 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
*((uint64_t *)value) = kw2xrf_get_addr_long(dev);
return sizeof(uint64_t);
case NG_NETOPT_ADDR_LEN:
case NETOPT_ADDR_LEN:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -541,7 +541,7 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
*((uint16_t *)value) = 2;
return sizeof(uint16_t);
case NG_NETOPT_SRC_LEN:
case NETOPT_SRC_LEN:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -555,7 +555,7 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
return sizeof(uint16_t);
case NG_NETOPT_NID:
case NETOPT_NID:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -563,21 +563,21 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
*((uint16_t *)value) = dev->radio_pan;
return sizeof(uint16_t);
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
return kw2xrf_get_channel(dev, (uint8_t *)value, max_len);
case NG_NETOPT_PROTO:
case NETOPT_PROTO:
return kw2xrf_get_proto(dev, (uint8_t *)value, max_len);
case NG_NETOPT_STATE:
if (max_len < sizeof(ng_netopt_state_t)) {
case NETOPT_STATE:
if (max_len < sizeof(netopt_state_t)) {
return -EOVERFLOW;
}
*(ng_netopt_state_t *)value = *(ng_netopt_state_t *) & (dev->state);
*(netopt_state_t *)value = *(netopt_state_t *) & (dev->state);
return 0;
case NG_NETOPT_TX_POWER:
case NETOPT_TX_POWER:
if (max_len < 1) {
return -EOVERFLOW;
}
@ -585,7 +585,7 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
*(int16_t *)value = dev->tx_power;
return 0;
case NG_NETOPT_MAX_PACKET_SIZE:
case NETOPT_MAX_PACKET_SIZE:
if (max_len < sizeof(int16_t)) {
return -EOVERFLOW;
}
@ -593,21 +593,21 @@ int kw2xrf_get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len
*((uint16_t *)value) = KW2XRF_MAX_PKT_LENGTH;
return sizeof(uint16_t);
case NG_NETOPT_PRELOADING:
*((ng_netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_PRELOADING);
return sizeof(ng_netopt_enable_t);
case NETOPT_PRELOADING:
*((netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_PRELOADING);
return sizeof(netopt_enable_t);
case NG_NETOPT_AUTOACK:
*((ng_netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_AUTOACK);
return sizeof(ng_netopt_enable_t);
case NETOPT_AUTOACK:
*((netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_AUTOACK);
return sizeof(netopt_enable_t);
case NG_NETOPT_PROMISCUOUSMODE:
*((ng_netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_PROMISCUOUS);
return sizeof(ng_netopt_enable_t);
case NETOPT_PROMISCUOUSMODE:
*((netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_PROMISCUOUS);
return sizeof(netopt_enable_t);
case NG_NETOPT_RAWMODE:
*((ng_netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_RAWDUMP);
return sizeof(ng_netopt_enable_t);
case NETOPT_RAWMODE:
*((netopt_enable_t *)value) = !!(dev->option & KW2XRF_OPT_RAWDUMP);
return sizeof(netopt_enable_t);
default:
return -ENOTSUP;
@ -696,7 +696,7 @@ void kw2xrf_set_option(kw2xrf_t *dev, uint16_t option, bool state)
}
}
int kw2xrf_set(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t value_len)
int kw2xrf_set(ng_netdev_t *netdev, netopt_t opt, void *value, size_t value_len)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
@ -705,24 +705,24 @@ int kw2xrf_set(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t value_l
}
switch (opt) {
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
return kw2xrf_set_channel(dev, (uint8_t *)value, value_len);
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
if (value_len > sizeof(uint16_t)) {
return -EOVERFLOW;
}
return kw2xrf_set_addr(dev, *((uint16_t *)value));
case NG_NETOPT_ADDRESS_LONG:
case NETOPT_ADDRESS_LONG:
if (value_len > sizeof(uint64_t)) {
return -EOVERFLOW;
}
return kw2xrf_set_addr_long(dev, *((uint64_t *)value));
case NG_NETOPT_SRC_LEN:
case NETOPT_SRC_LEN:
if (value_len > sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -741,14 +741,14 @@ int kw2xrf_set(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t value_l
return sizeof(uint16_t);
case NG_NETOPT_NID:
case NETOPT_NID:
if (value_len > sizeof(uint16_t)) {
return -EOVERFLOW;
}
return kw2xrf_set_pan(dev, *((uint16_t *)value));
case NG_NETOPT_TX_POWER:
case NETOPT_TX_POWER:
if (value_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -756,48 +756,48 @@ int kw2xrf_set(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t value_l
kw2xrf_set_tx_power(dev, (int8_t *)value, value_len);
return sizeof(uint16_t);
case NG_NETOPT_PROTO:
case NETOPT_PROTO:
return kw2xrf_set_proto(dev, (uint8_t *)value, value_len);
case NG_NETOPT_AUTOACK:
case NETOPT_AUTOACK:
/* Set up HW generated automatic ACK after Receive */
kw2xrf_set_option(dev, KW2XRF_OPT_AUTOACK,
((bool *)value)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_PROMISCUOUSMODE:
case NETOPT_PROMISCUOUSMODE:
kw2xrf_set_option(dev, KW2XRF_OPT_PROMISCUOUS,
((bool *)value)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RAWMODE:
case NETOPT_RAWMODE:
kw2xrf_set_option(dev, KW2XRF_OPT_RAWDUMP,
((bool *)value)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_PRELOADING:
case NETOPT_PRELOADING:
kw2xrf_set_option(dev, KW2XRF_OPT_PRELOADING,
((bool *)value)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_AUTOCCA:
case NETOPT_AUTOCCA:
kw2xrf_set_option(dev, KW2XRF_OPT_CSMA,
((bool *)value)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_STATE:
if (*((ng_netopt_state_t *)value) == NG_NETOPT_STATE_TX) {
case NETOPT_STATE:
if (*((netopt_state_t *)value) == NETOPT_STATE_TX) {
DEBUG("kw2xrf: Sending now.\n");
kw2xrf_set_sequence(dev, XCVSEQ_TRANSMIT);
return sizeof(ng_netopt_state_t);
return sizeof(netopt_state_t);
}
else if (*((ng_netopt_state_t *)value) == NG_NETOPT_STATE_SLEEP) {
else if (*((netopt_state_t *)value) == NETOPT_STATE_SLEEP) {
kw2xrf_set_sequence(dev, XCVSEQ_IDLE);
return sizeof(ng_netopt_state_t);
return sizeof(netopt_state_t);
}
else if (*((ng_netopt_state_t *)value) == NG_NETOPT_STATE_IDLE) {
else if (*((netopt_state_t *)value) == NETOPT_STATE_IDLE) {
kw2xrf_set_sequence(dev, XCVSEQ_RECEIVE);
return sizeof(ng_netopt_state_t);
return sizeof(netopt_state_t);
}
/* TODO: Implement Off state here, when LPM functions are implemented */
@ -1188,7 +1188,7 @@ int kw2xrf_send(ng_netdev_t *netdev, ng_pktsnip_t *pkt)
DEBUG("kw2xrf: packet with size %i loaded to tx_buf\n", dev->buf[0]);
kw2xrf_write_fifo(dev->buf, dev->buf[0]);
if ((dev->option & KW2XRF_OPT_PRELOADING) == NG_NETOPT_DISABLE) {
if ((dev->option & KW2XRF_OPT_PRELOADING) == NETOPT_DISABLE) {
DEBUG("kw2xrf: Sending now.\n");
kw2xrf_set_sequence(dev, XCVSEQ_TRANSMIT);
}

@ -318,46 +318,46 @@ static void _receive_data(ng_at86rf2xx_t *dev)
dev->event_cb(NETDEV_EVENT_RX_COMPLETE, payload);
}
static int _set_state(ng_at86rf2xx_t *dev, ng_netopt_state_t state)
static int _set_state(ng_at86rf2xx_t *dev, netopt_state_t state)
{
switch (state) {
case NG_NETOPT_STATE_SLEEP:
case NETOPT_STATE_SLEEP:
ng_at86rf2xx_set_state(dev, NG_AT86RF2XX_STATE_TRX_OFF);
break;
case NG_NETOPT_STATE_IDLE:
case NETOPT_STATE_IDLE:
ng_at86rf2xx_set_state(dev, NG_AT86RF2XX_STATE_RX_AACK_ON);
break;
case NG_NETOPT_STATE_TX:
case NETOPT_STATE_TX:
if (dev->options & NG_AT86RF2XX_OPT_PRELOADING) {
ng_at86rf2xx_tx_exec(dev);
}
break;
case NG_NETOPT_STATE_RESET:
case NETOPT_STATE_RESET:
ng_at86rf2xx_reset(dev);
break;
default:
return -ENOTSUP;
}
return sizeof(ng_netopt_state_t);
return sizeof(netopt_state_t);
}
ng_netopt_state_t _get_state(ng_at86rf2xx_t *dev)
netopt_state_t _get_state(ng_at86rf2xx_t *dev)
{
switch (ng_at86rf2xx_get_status(dev)) {
case NG_AT86RF2XX_STATE_SLEEP:
return NG_NETOPT_STATE_SLEEP;
return NETOPT_STATE_SLEEP;
case NG_AT86RF2XX_STATE_BUSY_RX_AACK:
return NG_NETOPT_STATE_RX;
return NETOPT_STATE_RX;
case NG_AT86RF2XX_STATE_BUSY_TX_ARET:
case NG_AT86RF2XX_STATE_TX_ARET_ON:
return NG_NETOPT_STATE_TX;
return NETOPT_STATE_TX;
case NG_AT86RF2XX_STATE_RX_AACK_ON:
default:
return NG_NETOPT_STATE_IDLE;
return NETOPT_STATE_IDLE;
}
}
static int _get(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t max_len)
static int _get(ng_netdev_t *device, netopt_t opt, void *val, size_t max_len)
{
if (device == NULL) {
return -ENODEV;
@ -366,28 +366,28 @@ static int _get(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t max_len)
switch (opt) {
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)val) = ng_at86rf2xx_get_addr_short(dev);
return sizeof(uint16_t);
case NG_NETOPT_ADDRESS_LONG:
case NETOPT_ADDRESS_LONG:
if (max_len < sizeof(uint64_t)) {
return -EOVERFLOW;
}
*((uint64_t *)val) = ng_at86rf2xx_get_addr_long(dev);
return sizeof(uint64_t);
case NG_NETOPT_ADDR_LEN:
case NETOPT_ADDR_LEN:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)val) = 2;
return sizeof(uint16_t);
case NG_NETOPT_SRC_LEN:
case NETOPT_SRC_LEN:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -399,14 +399,14 @@ static int _get(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t max_len)
}
return sizeof(uint16_t);
case NG_NETOPT_NID:
case NETOPT_NID:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)val) = dev->pan;
return sizeof(uint16_t);
case NG_NETOPT_IPV6_IID:
case NETOPT_IPV6_IID:
if (max_len < sizeof(eui64_t)) {
return -EOVERFLOW;
}
@ -420,14 +420,14 @@ static int _get(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t max_len)
}
return sizeof(eui64_t);
case NG_NETOPT_PROTO:
case NETOPT_PROTO:
if (max_len < sizeof(ng_nettype_t)) {
return -EOVERFLOW;
}
*((ng_nettype_t *)val) = dev->proto;
return sizeof(ng_nettype_t);
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -435,98 +435,98 @@ static int _get(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t max_len)
((uint8_t *)val)[0] = ng_at86rf2xx_get_chan(dev);
return sizeof(uint16_t);
case NG_NETOPT_TX_POWER:
case NETOPT_TX_POWER:
if (max_len < sizeof(int16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)val) = ng_at86rf2xx_get_txpower(dev);
return sizeof(uint16_t);
case NG_NETOPT_MAX_PACKET_SIZE:
case NETOPT_MAX_PACKET_SIZE:
if (max_len < sizeof(int16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)val) = NG_AT86RF2XX_MAX_PKT_LENGTH - _MAX_MHR_OVERHEAD;
return sizeof(uint16_t);
case NG_NETOPT_STATE:
if (max_len < sizeof(ng_netopt_state_t)) {
case NETOPT_STATE:
if (max_len < sizeof(netopt_state_t)) {
return -EOVERFLOW;
}
*((ng_netopt_state_t*)val) = _get_state(dev);
*((netopt_state_t*)val) = _get_state(dev);
break;
case NG_NETOPT_PRELOADING:
case NETOPT_PRELOADING:
if (dev->options & NG_AT86RF2XX_OPT_PRELOADING) {
*((ng_netopt_enable_t *)val) = NG_NETOPT_ENABLE;
*((netopt_enable_t *)val) = NETOPT_ENABLE;
}
else {
*((ng_netopt_enable_t *)val) = NG_NETOPT_DISABLE;
*((netopt_enable_t *)val) = NETOPT_DISABLE;
}
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_AUTOACK:
case NETOPT_AUTOACK:
if (dev->options & NG_AT86RF2XX_OPT_AUTOACK) {
*((ng_netopt_enable_t *)val) = NG_NETOPT_ENABLE;
*((netopt_enable_t *)val) = NETOPT_ENABLE;
}
else {
*((ng_netopt_enable_t *)val) = NG_NETOPT_DISABLE;
*((netopt_enable_t *)val) = NETOPT_DISABLE;
}
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RETRANS:
case NETOPT_RETRANS:
if (max_len < sizeof(uint8_t)) {
return -EOVERFLOW;
}
*((uint8_t *)val) = ng_at86rf2xx_get_max_retries(dev);
return sizeof(uint8_t);
case NG_NETOPT_PROMISCUOUSMODE:
case NETOPT_PROMISCUOUSMODE:
if (dev->options & NG_AT86RF2XX_OPT_PROMISCUOUS) {
*((ng_netopt_enable_t *)val) = NG_NETOPT_ENABLE;
*((netopt_enable_t *)val) = NETOPT_ENABLE;
}
else {
*((ng_netopt_enable_t *)val) = NG_NETOPT_DISABLE;
*((netopt_enable_t *)val) = NETOPT_DISABLE;
}
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RAWMODE:
case NETOPT_RAWMODE:
if (dev->options & NG_AT86RF2XX_OPT_RAWDUMP) {
*((ng_netopt_enable_t *)val) = NG_NETOPT_ENABLE;
*((netopt_enable_t *)val) = NETOPT_ENABLE;
}
else {
*((ng_netopt_enable_t *)val) = NG_NETOPT_DISABLE;
*((netopt_enable_t *)val) = NETOPT_DISABLE;
}
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_IS_CHANNEL_CLR:
case NETOPT_IS_CHANNEL_CLR:
if (ng_at86rf2xx_cca(dev)) {
*((ng_netopt_enable_t *)val) = NG_NETOPT_ENABLE;
*((netopt_enable_t *)val) = NETOPT_ENABLE;
}
else {
*((ng_netopt_enable_t *)val) = NG_NETOPT_DISABLE;
*((netopt_enable_t *)val) = NETOPT_DISABLE;
}
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RX_START_IRQ:
*((ng_netopt_enable_t *)val) =
case NETOPT_RX_START_IRQ:
*((netopt_enable_t *)val) =
!!(dev->options & NG_AT86RF2XX_OPT_TELL_RX_START);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RX_END_IRQ:
*((ng_netopt_enable_t *)val) =
case NETOPT_RX_END_IRQ:
*((netopt_enable_t *)val) =
!!(dev->options & NG_AT86RF2XX_OPT_TELL_RX_END);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_TX_START_IRQ:
*((ng_netopt_enable_t *)val) =
case NETOPT_TX_START_IRQ:
*((netopt_enable_t *)val) =
!!(dev->options & NG_AT86RF2XX_OPT_TELL_TX_START);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_TX_END_IRQ:
*((ng_netopt_enable_t *)val) =
case NETOPT_TX_END_IRQ:
*((netopt_enable_t *)val) =
!!(dev->options & NG_AT86RF2XX_OPT_TELL_TX_END);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
default:
return -ENOTSUP;
@ -535,7 +535,7 @@ static int _get(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t max_len)
return 0;
}
static int _set(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t len)
static int _set(ng_netdev_t *device, netopt_t opt, void *val, size_t len)
{
ng_at86rf2xx_t *dev = (ng_at86rf2xx_t *) device;
@ -544,21 +544,21 @@ static int _set(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t len)
}
switch (opt) {
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
if (len > sizeof(uint16_t)) {
return -EOVERFLOW;
}
ng_at86rf2xx_set_addr_short(dev, *((uint16_t*)val));
return sizeof(uint16_t);
case NG_NETOPT_ADDRESS_LONG:
case NETOPT_ADDRESS_LONG:
if (len > sizeof(uint64_t)) {
return -EOVERFLOW;
}
ng_at86rf2xx_set_addr_long(dev, *((uint64_t*)val));
return sizeof(uint64_t);
case NG_NETOPT_SRC_LEN:
case NETOPT_SRC_LEN:
if (len > sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -575,14 +575,14 @@ static int _set(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t len)
}
return sizeof(uint16_t);
case NG_NETOPT_NID:
case NETOPT_NID:
if (len > sizeof(uint16_t)) {
return -EOVERFLOW;
}
ng_at86rf2xx_set_pan(dev, *((uint16_t *)val));
return sizeof(uint16_t);
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
if (len != sizeof(uint16_t)) {
return -EINVAL;
}
@ -594,65 +594,65 @@ static int _set(ng_netdev_t *device, ng_netopt_t opt, void *val, size_t len)
ng_at86rf2xx_set_chan(dev, chan);
return sizeof(uint16_t);
case NG_NETOPT_TX_POWER:
case NETOPT_TX_POWER:
if (len > sizeof(int16_t)) {
return -EOVERFLOW;
}
ng_at86rf2xx_set_txpower(dev, *((int16_t *)val));
return sizeof(uint16_t);
case NG_NETOPT_STATE:
if (len > sizeof(ng_netopt_state_t)) {
case NETOPT_STATE:
if (len > sizeof(netopt_state_t)) {
return -EOVERFLOW;
}
return _set_state(dev, *((ng_netopt_state_t *)val));
return _set_state(dev, *((netopt_state_t *)val));
case NG_NETOPT_AUTOACK:
case NETOPT_AUTOACK:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_AUTOACK,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RETRANS:
case NETOPT_RETRANS:
if (len > sizeof(uint8_t)) {
return -EOVERFLOW;
}
ng_at86rf2xx_set_max_retries(dev, *((uint8_t *)val));
return sizeof(uint8_t);
case NG_NETOPT_PRELOADING:
case NETOPT_PRELOADING:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_PRELOADING,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_PROMISCUOUSMODE:
case NETOPT_PROMISCUOUSMODE:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_PROMISCUOUS,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RAWMODE:
case NETOPT_RAWMODE:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_RAWDUMP,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RX_START_IRQ:
case NETOPT_RX_START_IRQ:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_TELL_RX_START,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_RX_END_IRQ:
case NETOPT_RX_END_IRQ:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_TELL_RX_END,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_TX_START_IRQ:
case NETOPT_TX_START_IRQ:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_TELL_TX_START,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
case NG_NETOPT_TX_END_IRQ:
case NETOPT_TX_END_IRQ:
ng_at86rf2xx_set_option(dev, NG_AT86RF2XX_OPT_TELL_TX_END,
((bool *)val)[0]);
return sizeof(ng_netopt_enable_t);
return sizeof(netopt_enable_t);
default:
return -ENOTSUP;

@ -597,7 +597,7 @@ static int _rem_cb(ng_netdev_t *dev, ng_netdev_event_cb_t cb)
return 0;
}
static int _get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_len)
static int _get(ng_netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
{
xbee_t *dev = (xbee_t *)netdev;
if (dev == NULL) {
@ -605,12 +605,12 @@ static int _get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_le
}
switch (opt) {
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
return _get_addr_short(dev, (uint8_t *)value, max_len);
case NG_NETOPT_ADDRESS_LONG:
case NETOPT_ADDRESS_LONG:
return _get_addr_long(dev, (uint8_t *)value, max_len);
case NG_NETOPT_ADDR_LEN:
case NG_NETOPT_SRC_LEN:
case NETOPT_ADDR_LEN:
case NETOPT_SRC_LEN:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
@ -621,7 +621,7 @@ static int _get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_le
*((uint16_t *)value) = 2;
}
return sizeof(uint16_t);
case NG_NETOPT_IPV6_IID:
case NETOPT_IPV6_IID:
if (max_len < sizeof(eui64_t)) {
return -EOVERFLOW;
}
@ -633,24 +633,24 @@ static int _get(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t max_le
}
return sizeof(eui64_t);
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
return _get_channel(dev, (uint8_t *)value, max_len);
case NG_NETOPT_MAX_PACKET_SIZE:
case NETOPT_MAX_PACKET_SIZE:
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)value) = XBEE_MAX_PAYLOAD_LENGTH;
return sizeof(uint16_t);
case NG_NETOPT_NID:
case NETOPT_NID:
return _get_panid(dev, (uint8_t *)value, max_len);
case NG_NETOPT_PROTO:
case NETOPT_PROTO:
return _get_proto(dev, (uint8_t *)value, max_len);
default:
return -ENOTSUP;
}
}
static int _set(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t value_len)
static int _set(ng_netdev_t *netdev, netopt_t opt, void *value, size_t value_len)
{
xbee_t *dev = (xbee_t *)netdev;
if (dev == NULL) {
@ -658,16 +658,16 @@ static int _set(ng_netdev_t *netdev, ng_netopt_t opt, void *value, size_t value_
}
switch (opt) {
case NG_NETOPT_ADDRESS:
case NETOPT_ADDRESS:
return _set_addr(dev, (uint8_t *)value, value_len);
case NG_NETOPT_ADDR_LEN:
case NG_NETOPT_SRC_LEN:
case NETOPT_ADDR_LEN:
case NETOPT_SRC_LEN:
return _set_addr_len(dev, value, value_len);
case NG_NETOPT_CHANNEL:
case NETOPT_CHANNEL:
return _set_channel(dev, (uint8_t *)value, value_len);
case NG_NETOPT_NID:
case NETOPT_NID:
return _set_panid(dev, (uint8_t *)value, value_len);
case NG_NETOPT_PROTO:
case NETOPT_PROTO:
return _set_proto(dev, (uint8_t *)value, value_len);
default:
return -ENOTSUP;

@ -0,0 +1,185 @@
/*
* Copyright (C) 2015 Freie Universität Berlin
*
* 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.
*/
/**
* @defgroup net_netopt Configuration options for network APIs
* @ingroup net
* @brief List of available configuration options for the
* @ref net_ng_netdev and the @ref net_ng_netapi
* @{
*
* @file
* @brief Definition of global configuration options
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
*/
#ifndef NETOPT_H_
#define NETOPT_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Global list of configuration options available throughout the
* network stack, e.g. by netdev and netapi
*/
typedef enum {
NETOPT_CHANNEL, /**< get/set channel as uint16_t in host
* byte order */
NETOPT_IS_CHANNEL_CLR, /**< check if channel is clear */
NETOPT_ADDRESS, /**< get/set address in host byte order */
/**
* @brief get/set long address in host byte order
*
* Examples for this include the EUI-64 in IEEE 802.15.4
*/
NETOPT_ADDRESS_LONG,
NETOPT_ADDR_LEN, /**< get the default address length a
* network device expects as uint16_t in
* host byte order */
NETOPT_SRC_LEN, /**< get/set the address length to choose
* for the network device's source address
* as uint16_t in host byte order */
/**
* @brief get/set the network ID as uint16_t in host byte order
*
* Examples for this include the PAN ID in IEEE 802.15.4
*/
NETOPT_NID,
/**
* @brief get the IPv6 interface identifier of a network interface as
* eui64_t.
*
* @see <a href="https://tools.ietf.org/html/rfc4291#section-2.5.1">
* RFC 4291, section 2.5.1
* </a>
*
* The generation of the interface identifier is dependent on the link-layer.
* Please refer to the appropriate IPv6 over `<link>` specification for
* further implementation details (such as
* <a href="https://tools.ietf.org/html/rfc2464">RFC 2464</a> or
* <a href="https://tools.ietf.org/html/rfc4944">RFC 4944</a>).
*/
NETOPT_IPV6_IID,
NETOPT_TX_POWER, /**< get/set the output power for radio
* devices in dBm as int16_t in host byte
* order */
NETOPT_MAX_PACKET_SIZE, /**< get/set the maximum packet size a
* network module can handle as uint16_t
* in host byte order */
/**
* @brief en/disable preloading or read the current state.
*
* Preload using ng_netdev_driver_t::send_data() or ng_netapi_send()
* respectively, send setting state to @ref NETOPT_STATE_TX
*/
NETOPT_PRELOADING,
NETOPT_PROMISCUOUSMODE, /**< en/disable promiscuous mode or read
* the current state */
NETOPT_AUTOACK, /**< en/disable link layer auto ACKs or read
* the current state */
NETOPT_RETRANS, /**< get/set the maximum number of
* retransmissions. */
NETOPT_PROTO, /**< get/set the protocol for the layer
* as type ng_nettype_t. */
NETOPT_STATE, /**< get/set the state of network devices as
* type netopt_state_t */
NETOPT_RAWMODE, /**< en/disable the pre-processing of data
* in a network device driver as type
* ng_nettype_t */
/**
* @brief en/disable the interrupt at reception start.
*
* It is mostly triggered after the preamble is correctly received
*
* @note not all transceivers may support this interrupt
*/
NETOPT_RX_START_IRQ,
/**
* @brief en/disable the interrupt after packet reception.
*
* This interrupt is triggered after a complete packet is received.
*
* @note in case a transceiver does not support this interrupt, the event
* may be triggered by the driver
*/
NETOPT_RX_END_IRQ,
/**
* @brief en/disable the interrupt right in the beginning of transmission.
*
* This interrupt is triggered when the transceiver starts to send out the
* packet.
*
* @note in case a transceiver does not support this interrupt, the event
* may be triggered by the driver
*/
NETOPT_TX_START_IRQ,
/**
* @brief en/disable the interrupt after packet transmission.
*
* This interrupt is triggered when the full packet is transmitted.
*
* @note not all transceivers may support this interrupt
*/
NETOPT_TX_END_IRQ,
NETOPT_AUTOCCA, /**< en/disable to check automatically
* before sending the channel is clear. */
/* add more options if needed */
/**
* @brief maximum number of options defined here
*
* @note Interfaces are not meant to respond to that.
*/
NETOPT_NUMOF,
} netopt_t;
/**
* @brief Binary parameter for enabling and disabling options
*/
typedef enum {
NETOPT_DISABLE = 0, /**< disable a given option */
NETOPT_ENABLE = 1, /**< enable a given option */
} netopt_enable_t;
/**
* @brief Option parameter to be used with @ref NETOPT_STATE to set or get
* the state of a network device or protocol implementation
*/
typedef enum {
NETOPT_STATE_OFF = 0, /**< powered off */
NETOPT_STATE_SLEEP, /**< sleep mode */
NETOPT_STATE_IDLE, /**< idle mode,
* the device listens to receive packets */
NETOPT_STATE_RX, /**< receive mode,
* the device currently receives a packet */
NETOPT_STATE_TX, /**< transmit mode,
* set: triggers transmission of a preloaded packet
* (see @ref NETOPT_PRELOADING*). The resulting
* state of the network device is @ref NETOPT_STATE_IDLE
* get: the network device is in the process of
* transmitting a packet */
NETOPT_STATE_RESET, /**< triggers a hardware reset. The resulting
* state of the network device is @ref NETOPT_STATE_IDLE */
/* add other states if needed */
} netopt_state_t;
#ifdef __cplusplus
}
#endif
#endif /* NETOPT_H_ */
/** @} */

@ -30,7 +30,7 @@
#include "kernel.h"
#include "thread.h"
#include "net/ng_netopt.h"
#include "net/netopt.h"
#include "net/ng_nettype.h"
#include "net/ng_pkt.h"
@ -67,7 +67,7 @@ extern "C" {
* @brief Data structure to be send for setting and getting options
*/
typedef struct {
ng_netopt_t opt; /**< the option to get/set */
netopt_t opt; /**< the option to get/set */
uint16_t context; /**< (optional) context for that option */
void *data; /**< data to set or buffer to read into */
uint16_t data_len; /**< size of the data / the buffer */
@ -133,7 +133,7 @@ int ng_netapi_dispatch_receive(ng_nettype_t type, uint32_t demux_ctx,
*
* @return value returned by the @ref NG_NETAPI_MSG_TYPE_ACK message
*/
int ng_netapi_get(kernel_pid_t pid, ng_netopt_t opt, uint16_t context,
int ng_netapi_get(kernel_pid_t pid, netopt_t opt, uint16_t context,
void *data, size_t max_len);
/**
@ -148,7 +148,7 @@ int ng_netapi_get(kernel_pid_t pid, ng_netopt_t opt, uint16_t context,
*
* @return value returned by the @ref NG_NETAPI_MSG_TYPE_ACK message
*/
int ng_netapi_set(kernel_pid_t pid, ng_netopt_t opt, uint16_t context,
int ng_netapi_set(kernel_pid_t pid, netopt_t opt, uint16_t context,
void *data, size_t data_len);
#ifdef __cplusplus

@ -20,9 +20,9 @@
#ifndef NG_NETBASE_H_
#define NG_NETBASE_H_
#include "net/netopt.h"
#include "net/ng_netdev.h"
#include "net/ng_netapi.h"
#include "net/ng_netopt.h"
#include "net/ng_netreg.h"
#include "net/ng_nettype.h"
#include "net/ng_netif.h"

@ -28,7 +28,7 @@
#include "kernel.h"
#include "net/ng_pkt.h"
#include "net/ng_netopt.h"
#include "net/netopt.h"
#ifdef __cplusplus
extern "C" {
@ -127,7 +127,7 @@ typedef struct {
* @p max_len is too small to store the option value
* @return -ECANCELED if internal driver error occurred
*/
int (*get)(ng_netdev_t *dev, ng_netopt_t opt, void *value, size_t max_len);
int (*get)(ng_netdev_t *dev, netopt_t opt, void *value, size_t max_len);
/**
* @brief Set an option value for a given network device
@ -143,7 +143,7 @@ typedef struct {
* @return -EINVAL if @p value is invalid
* @return -ECANCELED if internal driver error occurred
*/
int (*set)(ng_netdev_t *dev, ng_netopt_t opt, void *value, size_t value_len);
int (*set)(ng_netdev_t *dev, netopt_t opt, void *value, size_t value_len);
/**
* @brief This function is called by a MAC layer when a message of type

@ -1,185 +0,0 @@
/*
* Copyright (C) 2015 Freie Universität Berlin
*
* 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.
*/
/**
* @defgroup net_ng_netopt Configuration options for network APIs
* @ingroup net
* @brief List of available configuration options for the
* @ref net_ng_netdev and the @ref net_ng_netapi
* @{
*
* @file
* @brief Definition of global configuration options
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
*/
#ifndef NG_NETOPT_H_
#define NG_NETOPT_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Global list of configuration options available throughout the
* network stack, e.g. by netdev and netapi
*/
typedef enum {
NG_NETOPT_CHANNEL, /**< get/set channel as uint16_t in host
* byte order */
NG_NETOPT_IS_CHANNEL_CLR, /**< check if channel is clear */
NG_NETOPT_ADDRESS, /**< get/set address in host byte order */
/**
* @brief get/set long address in host byte order
*
* Examples for this include the EUI-64 in IEEE 802.15.4
*/
NG_NETOPT_ADDRESS_LONG,
NG_NETOPT_ADDR_LEN, /**< get the default address length a
* network device expects as uint16_t in
* host byte order */
NG_NETOPT_SRC_LEN, /**< get/set the address length to choose
* for the network device's source address
* as uint16_t in host byte order */
/**
* @brief get/set the network ID as uint16_t in host byte order
*
* Examples for this include the PAN ID in IEEE 802.15.4
*/
NG_NETOPT_NID,
/**
* @brief get the IPv6 interface identifier of a network interface as
* eui64_t.
*
* @see <a href="https://tools.ietf.org/html/rfc4291#section-2.5.1">
* RFC 4291, section 2.5.1
* </a>
*
* The generation of the interface identifier is dependent on the link-layer.
* Please refer to the appropriate IPv6 over `<link>` specification for
* further implementation details (such as
* <a href="https://tools.ietf.org/html/rfc2464">RFC 2464</a> or
* <a href="https://tools.ietf.org/html/rfc4944">RFC 4944</a>).
*/
NG_NETOPT_IPV6_IID,
NG_NETOPT_TX_POWER, /**< get/set the output power for radio
* devices in dBm as int16_t in host byte
* order */
NG_NETOPT_MAX_PACKET_SIZE, /**< get/set the maximum packet size a
* network module can handle as uint16_t
* in host byte order */
/**
* @brief en/disable preloading or read the current state.
*
* Preload using ng_netdev_driver_t::send_data() or ng_netapi_send()
* respectively, send setting state to @ref NG_NETOPT_STATE_TX
*/
NG_NETOPT_PRELOADING,
NG_NETOPT_PROMISCUOUSMODE, /**< en/disable promiscuous mode or read
* the current state */
NG_NETOPT_AUTOACK, /**< en/disable link layer auto ACKs or read
* the current state */
NG_NETOPT_RETRANS, /**< get/set the maximum number of
retransmissions. */
NG_NETOPT_PROTO, /**< get/set the protocol for the layer
* as type ng_nettype_t. */
NG_NETOPT_STATE, /**< get/set the state of network devices as
* type ng_netopt_state_t */
NG_NETOPT_RAWMODE, /**< en/disable the pre-processing of data
* in a network device driver as type
* ng_nettype_t */
/**
* @brief en/disable the interrupt at reception start.
*
* It is mostly triggered after the preamble is correctly received
*
* @note not all transceivers may support this interrupt
*/
NG_NETOPT_RX_START_IRQ,
/**
* @brief en/disable the interrupt after packet reception.
*
* This interrupt is triggered after a complete packet is received.
*
* @note in case a transceiver does not support this interrupt, the event
* may be triggered by the driver
*/
NG_NETOPT_RX_END_IRQ,
/**
* @brief en/disable the interrupt right in the beginning of transmission.
*
* This interrupt is triggered when the transceiver starts to send out the
* packet.
*
* @note in case a transceiver does not support this interrupt, the event
* may be triggered by the driver
*/
NG_NETOPT_TX_START_IRQ,
/**
* @brief en/disable the interrupt after packet transmission.
*
* This interrupt is triggered when the full packet is transmitted.
*
* @note not all transceivers may support this interrupt
*/
NG_NETOPT_TX_END_IRQ,
NG_NETOPT_AUTOCCA, /**< en/disable to check automatically
* before sending the channel is clear. */
/* add more options if needed */
/**
* @brief maximum number of options defined here
*
* @note Interfaces are not meant to respond to that.
*/
NG_NETOPT_NUMOF,
} ng_netopt_t;
/**
* @brief Binary parameter for enabling and disabling options
*/
typedef enum {
NG_NETOPT_DISABLE = 0, /**< disable a given option */
NG_NETOPT_ENABLE = 1, /**< enable a given option */
} ng_netopt_enable_t;
/**
* @brief Option parameter to be used with @ref NG_NETOPT_STATE to set or get
* the state of a network device or protocol implementation
*/
typedef enum {
NG_NETOPT_STATE_OFF = 0, /**< powered off */
NG_NETOPT_STATE_SLEEP, /**< sleep mode */
NG_NETOPT_STATE_IDLE, /**< idle mode,
* the device listens to receive packets */
NG_NETOPT_STATE_RX, /**< receive mode,