review update

This commit is contained in:
mverch67 2024-10-11 16:30:42 +02:00
parent b6fa052043
commit 9f15ef50e6
3 changed files with 12 additions and 10 deletions

View File

@ -53,7 +53,7 @@ NodeDB *nodeDB = nullptr;
EXT_RAM_BSS_ATTR meshtastic_DeviceState devicestate; EXT_RAM_BSS_ATTR meshtastic_DeviceState devicestate;
meshtastic_MyNodeInfo &myNodeInfo = devicestate.my_node; meshtastic_MyNodeInfo &myNodeInfo = devicestate.my_node;
meshtastic_LocalConfig config; meshtastic_LocalConfig config;
meshtastic_DeviceUIConfig uiconfig{.screen_timeout = 30}; meshtastic_DeviceUIConfig uiconfig{.screen_brightness = 153, .screen_timeout = 30};
meshtastic_LocalModuleConfig moduleConfig; meshtastic_LocalModuleConfig moduleConfig;
meshtastic_ChannelFile channelFile; meshtastic_ChannelFile channelFile;
meshtastic_OEMStore oemStore; meshtastic_OEMStore oemStore;

View File

@ -52,7 +52,7 @@ void PhoneAPI::handleStartConfig()
} }
// even if we were already connected - restart our state machine // even if we were already connected - restart our state machine
state = STATE_SEND_UIDATA; state = STATE_SEND_MY_INFO;
pauseBluetoothLogging = true; pauseBluetoothLogging = true;
filesManifest = getFiles("/", 10); filesManifest = getFiles("/", 10);
LOG_DEBUG("Got %d files in manifest\n", filesManifest.size()); LOG_DEBUG("Got %d files in manifest\n", filesManifest.size());
@ -190,23 +190,24 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
case STATE_SEND_NOTHING: case STATE_SEND_NOTHING:
LOG_INFO("getFromRadio=STATE_SEND_NOTHING\n"); LOG_INFO("getFromRadio=STATE_SEND_NOTHING\n");
break; break;
case STATE_SEND_UIDATA:
LOG_INFO("getFromRadio=STATE_SEND_UIDATA\n");
fromRadioScratch.which_payload_variant = meshtastic_FromRadio_deviceuiConfig_tag;
fromRadioScratch.deviceuiConfig = uiconfig;
state = STATE_SEND_MY_INFO;
break;
case STATE_SEND_MY_INFO: case STATE_SEND_MY_INFO:
LOG_INFO("getFromRadio=STATE_SEND_MY_INFO\n"); LOG_INFO("getFromRadio=STATE_SEND_MY_INFO\n");
// If the user has specified they don't want our node to share its location, make sure to tell the phone // If the user has specified they don't want our node to share its location, make sure to tell the phone
// app not to send locations on our behalf. // app not to send locations on our behalf.
fromRadioScratch.which_payload_variant = meshtastic_FromRadio_my_info_tag; fromRadioScratch.which_payload_variant = meshtastic_FromRadio_my_info_tag;
fromRadioScratch.my_info = myNodeInfo; fromRadioScratch.my_info = myNodeInfo;
state = STATE_SEND_OWN_NODEINFO; state = STATE_SEND_UIDATA;
service->refreshLocalMeshNode(); // Update my NodeInfo because the client will be asking for it soon. service->refreshLocalMeshNode(); // Update my NodeInfo because the client will be asking for it soon.
break; break;
case STATE_SEND_UIDATA:
LOG_INFO("getFromRadio=STATE_SEND_UIDATA\n");
fromRadioScratch.which_payload_variant = meshtastic_FromRadio_deviceuiConfig_tag;
fromRadioScratch.deviceuiConfig = uiconfig;
state = STATE_SEND_OWN_NODEINFO;
break;
case STATE_SEND_OWN_NODEINFO: { case STATE_SEND_OWN_NODEINFO: {
LOG_INFO("getFromRadio=STATE_SEND_OWN_NODEINFO\n"); LOG_INFO("getFromRadio=STATE_SEND_OWN_NODEINFO\n");
auto us = nodeDB->readNextMeshNode(readIndex); auto us = nodeDB->readNextMeshNode(readIndex);
@ -504,8 +505,8 @@ bool PhoneAPI::available()
switch (state) { switch (state) {
case STATE_SEND_NOTHING: case STATE_SEND_NOTHING:
return false; return false;
case STATE_SEND_UIDATA:
case STATE_SEND_MY_INFO: case STATE_SEND_MY_INFO:
case STATE_SEND_UIDATA:
case STATE_SEND_CHANNELS: case STATE_SEND_CHANNELS:
case STATE_SEND_CONFIG: case STATE_SEND_CONFIG:
case STATE_SEND_MODULECONFIG: case STATE_SEND_MODULECONFIG:

View File

@ -178,6 +178,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
case meshtastic_AdminMessage_get_ui_config_request_tag: { case meshtastic_AdminMessage_get_ui_config_request_tag: {
LOG_INFO("Client is getting device-ui config\n"); LOG_INFO("Client is getting device-ui config\n");
handleGetDeviceUIConfig(mp); handleGetDeviceUIConfig(mp);
handled = true;
break; break;
} }