Skip to content

Commit

Permalink
Add default LoRaCommand disable reception (#17790)
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed May 21, 2024
1 parent a4c7add commit 00a389b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tasmota/tasmota_xdrv_driver/xdrv_73_0_lora_struct.ino
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
enum TasLoraFlags {
TAS_LORA_FLAG_BRIDGE_ENABLED,
TAS_LORA_FLAG_JOIN_ENABLED,
TAS_LORA_FLAG_DECODE_ENABLED
TAS_LORA_FLAG_DECODE_ENABLED,
TAS_LORA_COMMAND_ENABLED
};

enum TasLoraWanFlags {
Expand Down
7 changes: 5 additions & 2 deletions tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ void LoraInput(void) {
char *topic_part = strtok_r(payload, " ", &command_part);
if (topic_part && command_part) {
if (!strcasecmp(topic_part, SettingsText(SET_MQTT_TOPIC))) { // Is it mine
ExecuteCommand(command_part, SRC_REMOTE);
return;
if (bitRead(Lora->settings.flags, TAS_LORA_COMMAND_ENABLED)) {
ExecuteCommand(command_part, SRC_REMOTE);
return;
}
} else {
*--command_part = ' '; // Restore strtok_r '/0'
}
Expand Down Expand Up @@ -318,6 +320,7 @@ void CmndLoraOption(void) {
// LoraOption1 1 - Enable LoRaWanBridge
// LoraOption2 1 - Enable LoRaWanBridge Join
// LoraOption3 1 - Enable LoRaWanBridge decoding
// LoraOption4 1 - Enable LoRaCommand reception
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 8)) {
uint32_t pindex = XdrvMailbox.index -1;
if (XdrvMailbox.payload >= 0) {
Expand Down

0 comments on commit 00a389b

Please sign in to comment.