Skip to content

Commit f402e0c

Browse files
tohlihengtohliheng
authored andcommitted
Modified lora.c: void lora_config_tx_datarate_set(int8_t TxDataRate)
This modification allows AT+DR to change the data rate of the next AT+SEND. Previously, we could only change the data rate of the second AT+SEND.
1 parent 0fe66e5 commit f402e0c

File tree

1 file changed

+5
-1
lines changed
  • Projects/B-L072Z-LRWAN1/Applications/LoRa/AT_Slave/LoRaWAN/App/src

1 file changed

+5
-1
lines changed

Projects/B-L072Z-LRWAN1/Applications/LoRa/AT_Slave/LoRaWAN/App/src/lora.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,11 @@ int16_t lora_config_rssi_get(void)
891891

892892
void lora_config_tx_datarate_set(int8_t TxDataRate)
893893
{
894-
lora_config.TxDatarate = TxDataRate;
894+
mibReq.Type = MIB_CHANNELS_DATARATE;
895+
mibReq.Param.ChannelsDatarate = TxDataRate;
896+
if (LoRaMacMibSetRequestConfirm(&mibReq) != LORAMAC_STATUS_PARAMETER_INVALID) {
897+
lora_config.TxDatarate = TxDataRate;
898+
}
895899
}
896900

897901
int8_t lora_config_tx_datarate_get(void)

0 commit comments

Comments
 (0)