tests/pkg_semtech-loramac: fix send return value management
This commit is contained in:
parent
afc85e3daa
commit
f6e616d48f
@ -414,15 +414,23 @@ static int _cmd_loramac(int argc, char **argv)
|
||||
switch (semtech_loramac_send(&loramac,
|
||||
(uint8_t *)argv[2], strlen(argv[2]))) {
|
||||
case SEMTECH_LORAMAC_NOT_JOINED:
|
||||
puts("Failed: not joined");
|
||||
puts("Cannot send: not joined");
|
||||
return 1;
|
||||
|
||||
case SEMTECH_LORAMAC_DUTYCYCLE_RESTRICTED:
|
||||
puts("Cannot send: dutycycle restriction");
|
||||
return 1;
|
||||
|
||||
case SEMTECH_LORAMAC_BUSY:
|
||||
puts("Failed: mac is busy");
|
||||
puts("Cannot send: MAC is busy");
|
||||
return 1;
|
||||
|
||||
case SEMTECH_LORAMAC_TX_ERROR:
|
||||
puts("Cannot send: error");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* clear the rx buffer of the mac */
|
||||
/* wait for receive windows */
|
||||
switch (semtech_loramac_recv(&loramac)) {
|
||||
case SEMTECH_LORAMAC_DATA_RECEIVED:
|
||||
loramac.rx_data.payload[loramac.rx_data.payload_len] = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user