mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
netdev: Add common ieee802154 reset function
Resets flags, sequence number and protocol.
This commit is contained in:
parent
15b0fe4368
commit
123b275b23
@ -121,6 +121,17 @@ typedef struct {
|
||||
*/
|
||||
typedef struct netdev_radio_rx_info netdev_ieee802154_rx_info_t;
|
||||
|
||||
/**
|
||||
* @brief Reset function for ieee802154 common fields
|
||||
*
|
||||
* Supposed to be used by netdev drivers to reset the ieee802154 fields when
|
||||
* resetting the device
|
||||
*
|
||||
* @param[in] dev network device descriptor
|
||||
*/
|
||||
void netdev_ieee802154_reset(netdev_ieee802154_t *dev);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Fallback function for netdev IEEE 802.15.4 devices' _get function
|
||||
*
|
||||
|
@ -50,6 +50,19 @@ static int _get_iid(netdev_ieee802154_t *dev, eui64_t *value, size_t max_len)
|
||||
return sizeof(eui64_t);
|
||||
}
|
||||
|
||||
void netdev_ieee802154_reset(netdev_ieee802154_t *dev)
|
||||
{
|
||||
dev->seq = 0;
|
||||
dev->flags = 0;
|
||||
|
||||
/* set default protocol */
|
||||
#ifdef MODULE_GNRC_SIXLOWPAN
|
||||
dev->proto = GNRC_NETTYPE_SIXLOWPAN;
|
||||
#elif MODULE_GNRC
|
||||
dev->proto = GNRC_NETTYPE_UNDEF;
|
||||
#endif
|
||||
}
|
||||
|
||||
int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
|
||||
size_t max_len)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user