1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
19906: netdev/ieee802154_submac: support setting promiscuous mode option r=aabadie a=geonnave



### Contribution description

Found this was missing when trying to use `examples/sniffer` with the `nrf52840dk`. The solution was actually provided by `@benpicco` on the matrix channel.


### Testing procedure

Use the `examples/sniffer` following its README.


### Issues/PRs references

N/A.

Co-authored-by: Geovane Fedrecheski <geonnave@gmail.com>
This commit is contained in:
bors[bot] 2023-08-28 07:24:49 +00:00 committed by GitHub
commit da88c4169f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,10 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value,
return res;
case NETOPT_STATE:
return _set_submac_state(submac, *((netopt_state_t*) value));
case NETOPT_PROMISCUOUSMODE:
return ieee802154_radio_set_frame_filter_mode(&submac->dev,
*((bool *)value) ? IEEE802154_FILTER_PROMISC
: IEEE802154_FILTER_ACCEPT);
default:
break;
}