mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
Merge pull request #13591 from gschorcht/gnrc/lorawan/fix_set_state
gnrc/lorawan: fix netopt_state_t value handling
This commit is contained in:
commit
5e9733645f
@ -351,7 +351,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
|
||||
|
||||
switch(opt) {
|
||||
case NETOPT_STATE:
|
||||
assert(len <= sizeof(netopt_state_t));
|
||||
assert(len == sizeof(netopt_state_t));
|
||||
return _set_state(dev, *((const netopt_state_t*) val));
|
||||
|
||||
case NETOPT_DEVICE_TYPE:
|
||||
|
||||
@ -143,7 +143,7 @@ void gnrc_lorawan_open_rx_window(gnrc_lorawan_t *mac)
|
||||
if (mac->state == LORAWAN_STATE_RX_1) {
|
||||
xtimer_set_msg(&mac->rx, _DRIFT_FACTOR, &mac->msg, thread_getpid());
|
||||
}
|
||||
uint8_t state = NETOPT_STATE_RX;
|
||||
netopt_state_t state = NETOPT_STATE_RX;
|
||||
dev->driver->set(dev, NETOPT_STATE, &state, sizeof(state));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user