1
0
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:
José Alamos 2020-03-09 10:53:28 +01:00 committed by GitHub
commit 5e9733645f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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));
}