From 25a613ba93b6e5ad1202726862fe5306c17e72f0 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 12 Mar 2021 10:30:47 +0100 Subject: [PATCH] pkg/semtech-loramac: use netdev interface to set sleep state --- pkg/semtech-loramac/contrib/semtech_loramac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/semtech-loramac/contrib/semtech_loramac.c b/pkg/semtech-loramac/contrib/semtech_loramac.c index 4f7a6a1b7c..31e3710ea2 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac.c @@ -520,11 +520,13 @@ static void _semtech_loramac_event_cb(netdev_t *dev, netdev_event_t event) break; case NETDEV_EVENT_TX_COMPLETE: - sx127x_set_sleep((sx127x_t *)dev); + { + netopt_state_t sleep_state = NETOPT_STATE_SLEEP; + dev->driver->set(dev, NETOPT_STATE, &sleep_state, sizeof(netopt_state_t)); semtech_loramac_radio_events.TxDone(); DEBUG("[semtech-loramac] Transmission completed\n"); break; - + } case NETDEV_EVENT_TX_TIMEOUT: msg.type = MSG_TYPE_TX_TIMEOUT; if (msg_send(&msg, semtech_loramac_pid) <= 0) {