New bluetooth config protos and canned messages consolidation (#1632)

* Bluetooth and canned messages refactor

* More can of worms messages

* Set has_bluetooth and default pin

* Defaults
This commit is contained in:
Ben Meadors
2022-08-15 21:06:55 -05:00
committed by GitHub
parent aadaf332cf
commit 86d3759f55
15 changed files with 156 additions and 274 deletions

View File

@@ -189,15 +189,18 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
fromRadioScratch.config.which_payloadVariant = Config_lora_tag;
fromRadioScratch.config.payloadVariant.lora = config.lora;
break;
case Config_bluetooth_tag:
fromRadioScratch.config.which_payloadVariant = Config_bluetooth_tag;
fromRadioScratch.config.payloadVariant.bluetooth = config.bluetooth;
break;
}
// NOTE: The phone app needs to know the ls_secs value so it can properly expect sleep behavior.
// So even if we internally use 0 to represent 'use default' we still need to send the value we are
// using to the app (so that even old phone apps work with new device loads).
config_state++;
// Advance when we have sent all of our config objects
if (config_state > Config_lora_tag) {
if (config_state > Config_bluetooth_tag) {
state = STATE_SEND_MODULECONFIG;
config_state = ModuleConfig_mqtt_tag;
}