Merge pull request #16961 from jia200x/pr/semtech-loramac/fix_schedule_uplink
pkg/semtech-loramac: forward uplink schedule request to upper layer
This commit is contained in:
commit
1f00d7a89c
@ -698,10 +698,11 @@ void *_semtech_loramac_event_loop(void *arg)
|
|||||||
MlmeIndication_t *indication = (MlmeIndication_t *)msg.content.ptr;
|
MlmeIndication_t *indication = (MlmeIndication_t *)msg.content.ptr;
|
||||||
if (indication->MlmeIndication == MLME_SCHEDULE_UPLINK) {
|
if (indication->MlmeIndication == MLME_SCHEDULE_UPLINK) {
|
||||||
DEBUG("[semtech-loramac] MLME indication: schedule an uplink\n");
|
DEBUG("[semtech-loramac] MLME indication: schedule an uplink\n");
|
||||||
uint8_t prev_port = mac->port;
|
#ifdef MODULE_SEMTECH_LORAMAC_RX
|
||||||
mac->port = 0;
|
msg_t msg_ret;
|
||||||
_semtech_loramac_send(mac, NULL, 0);
|
msg_ret.content.value = SEMTECH_LORAMAC_TX_SCHEDULE;
|
||||||
mac->port = prev_port;
|
msg_send(&msg_ret, mac->rx_pid);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -787,18 +788,8 @@ void *_semtech_loramac_event_loop(void *arg)
|
|||||||
|
|
||||||
/* Check Multicast
|
/* Check Multicast
|
||||||
Check Port
|
Check Port
|
||||||
Check Datarate
|
Check Datarate */
|
||||||
Check FramePending */
|
|
||||||
if (indication->FramePending) {
|
|
||||||
/* The server signals that it has pending data to be sent.
|
|
||||||
We schedule an uplink as soon as possible to flush the server. */
|
|
||||||
DEBUG("[semtech-loramac] MCPS indication: pending data, schedule an "
|
|
||||||
"uplink\n");
|
|
||||||
uint8_t prev_port = mac->port;
|
|
||||||
mac->port = 0;
|
|
||||||
_semtech_loramac_send(mac, NULL, 0);
|
|
||||||
mac->port = prev_port;
|
|
||||||
}
|
|
||||||
#ifdef MODULE_SEMTECH_LORAMAC_RX
|
#ifdef MODULE_SEMTECH_LORAMAC_RX
|
||||||
if (indication->RxData) {
|
if (indication->RxData) {
|
||||||
DEBUG("[semtech-loramac] MCPS indication: data received\n");
|
DEBUG("[semtech-loramac] MCPS indication: data received\n");
|
||||||
|
|||||||
@ -60,6 +60,10 @@ static void *_wait_recv(void *arg)
|
|||||||
puts("Received ACK from network");
|
puts("Received ACK from network");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SEMTECH_LORAMAC_TX_SCHEDULE:
|
||||||
|
puts("The Network Server has pending data");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user