3434// Flag to indicate a heartbeat was received and we should send queue status
3535bool heartbeatReceived = false ;
3636
37- // Helper function to skip excluded module configs and advance state
38- size_t PhoneAPI::skipExcludedModuleConfig (uint8_t *buf)
39- {
40- config_state++;
41- if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1 )) {
42- if (config_nonce == SPECIAL_NONCE_ONLY_CONFIG) {
43- state = STATE_SEND_FILEMANIFEST;
44- } else {
45- state = STATE_SEND_OTHER_NODEINFOS;
46- }
47- config_state = 0 ;
48- }
49- return getFromRadio (buf);
50- }
51-
5237PhoneAPI::PhoneAPI ()
5338{
5439 lastContactMsec = millis ();
@@ -370,35 +355,20 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
370355 fromRadioScratch.moduleConfig .payload_variant .serial = moduleConfig.serial ;
371356 break ;
372357 case meshtastic_ModuleConfig_external_notification_tag:
373- #if !(NO_EXT_GPIO || MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION)
374358 LOG_DEBUG (" Send module config: ext notification" );
375359 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_external_notification_tag;
376360 fromRadioScratch.moduleConfig .payload_variant .external_notification = moduleConfig.external_notification ;
377361 break ;
378- #else
379- LOG_DEBUG (" External Notification module excluded from build, skipping" );
380- return skipExcludedModuleConfig (buf);
381- #endif
382362 case meshtastic_ModuleConfig_store_forward_tag:
383- #if !MESHTASTIC_EXCLUDE_STOREFORWARD
384363 LOG_DEBUG (" Send module config: store forward" );
385364 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_store_forward_tag;
386365 fromRadioScratch.moduleConfig .payload_variant .store_forward = moduleConfig.store_forward ;
387366 break ;
388- #else
389- LOG_DEBUG (" Store & Forward module excluded from build, skipping" );
390- return skipExcludedModuleConfig (buf);
391- #endif
392367 case meshtastic_ModuleConfig_range_test_tag:
393- #if !MESHTASTIC_EXCLUDE_RANGETEST
394368 LOG_DEBUG (" Send module config: range test" );
395369 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_range_test_tag;
396370 fromRadioScratch.moduleConfig .payload_variant .range_test = moduleConfig.range_test ;
397371 break ;
398- #else
399- LOG_DEBUG (" Range Test module excluded from build, skipping" );
400- return skipExcludedModuleConfig (buf);
401- #endif
402372 case meshtastic_ModuleConfig_telemetry_tag:
403373 LOG_DEBUG (" Send module config: telemetry" );
404374 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_telemetry_tag;
@@ -410,15 +380,10 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
410380 fromRadioScratch.moduleConfig .payload_variant .canned_message = moduleConfig.canned_message ;
411381 break ;
412382 case meshtastic_ModuleConfig_audio_tag:
413- #if !MESHTASTIC_EXCLUDE_AUDIO
414383 LOG_DEBUG (" Send module config: audio" );
415384 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_audio_tag;
416385 fromRadioScratch.moduleConfig .payload_variant .audio = moduleConfig.audio ;
417386 break ;
418- #else
419- LOG_DEBUG (" Audio module excluded from build, skipping" );
420- return skipExcludedModuleConfig (buf);
421- #endif
422387 case meshtastic_ModuleConfig_remote_hardware_tag:
423388 LOG_DEBUG (" Send module config: remote hardware" );
424389 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_remote_hardware_tag;
@@ -435,25 +400,15 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
435400 fromRadioScratch.moduleConfig .payload_variant .detection_sensor = moduleConfig.detection_sensor ;
436401 break ;
437402 case meshtastic_ModuleConfig_ambient_lighting_tag:
438- #if !MESHTASTIC_EXCLUDE_AMBIENTLIGHTING
439403 LOG_DEBUG (" Send module config: ambient lighting" );
440404 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_ambient_lighting_tag;
441405 fromRadioScratch.moduleConfig .payload_variant .ambient_lighting = moduleConfig.ambient_lighting ;
442406 break ;
443- #else
444- LOG_DEBUG (" Ambient Lighting module excluded from build, skipping" );
445- return skipExcludedModuleConfig (buf);
446- #endif
447407 case meshtastic_ModuleConfig_paxcounter_tag:
448- #if !MESHTASTIC_EXCLUDE_PAXCOUNTER
449408 LOG_DEBUG (" Send module config: paxcounter" );
450409 fromRadioScratch.moduleConfig .which_payload_variant = meshtastic_ModuleConfig_paxcounter_tag;
451410 fromRadioScratch.moduleConfig .payload_variant .paxcounter = moduleConfig.paxcounter ;
452411 break ;
453- #else
454- LOG_DEBUG (" Paxcounter module excluded from build, skipping" );
455- return skipExcludedModuleConfig (buf);
456- #endif
457412 default :
458413 LOG_ERROR (" Unknown module config type %d" , config_state);
459414 }
0 commit comments