diff --git a/src/main.cpp b/src/main.cpp index ddb99568da..931c2a3fda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -173,7 +173,7 @@ const char *getDeviceName() static char name[20]; snprintf(name, sizeof(name), "%02x%02x", dmac[4], dmac[5]); // if the shortname exists and is NOT the new default of ab3c, use it for BLE name. - if ((owner.short_name != NULL) && (strcmp(owner.short_name, name) != 0)) { + if (strcmp(owner.short_name, name) != 0) { snprintf(name, sizeof(name), "%s_%02x%02x", owner.short_name, dmac[4], dmac[5]); } else { snprintf(name, sizeof(name), "Meshtastic_%02x%02x", dmac[4], dmac[5]); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index cf576e94fe..209e0cbfae 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -141,11 +141,6 @@ NodeDB::NodeDB() if (channelFileCRC != crc32Buffer(&channelFile, sizeof(channelFile))) saveWhat |= SEGMENT_CHANNELS; - if (!devicestate.node_remote_hardware_pins) { - meshtastic_NodeRemoteHardwarePin empty[12] = {meshtastic_RemoteHardwarePin_init_default}; - memcpy(devicestate.node_remote_hardware_pins, empty, sizeof(empty)); - } - if (config.position.gps_enabled) { config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; config.position.gps_enabled = 0; diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 0915864623..8146866090 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -299,8 +299,8 @@ void AdminModule::handleGetModuleConfigResponse(const meshtastic_MeshPacket &mp, { // Skip if it's disabled or no pins are exposed if (!r->get_module_config_response.payload_variant.remote_hardware.enabled || - !r->get_module_config_response.payload_variant.remote_hardware.available_pins) { - LOG_DEBUG("Remote hardware module disabled or no vailable_pins. Skipping...\n"); + r->get_module_config_response.payload_variant.remote_hardware.available_pins_count == 0) { + LOG_DEBUG("Remote hardware module disabled or no available_pins. Skipping...\n"); return; } for (uint8_t i = 0; i < devicestate.node_remote_hardware_pins_count; i++) { diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 9f9ac5c243..74f3ca5a32 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -482,7 +482,12 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp, const meshtastic_MeshPacket & auto &ch = channels.getByIndex(chIndex); - if (&mp_decoded.decoded && strcmp(moduleConfig.mqtt.address, default_mqtt_address) == 0 && + if (mp_decoded.which_payload_variant != meshtastic_MeshPacket_decoded_tag) { + LOG_CRIT("MQTT::onSend(): mp_decoded isn't actually decoded\n"); + return; + } + + if (strcmp(moduleConfig.mqtt.address, default_mqtt_address) == 0 && (mp_decoded.decoded.portnum == meshtastic_PortNum_RANGE_TEST_APP || mp_decoded.decoded.portnum == meshtastic_PortNum_DETECTION_SENSOR_APP)) { LOG_DEBUG("MQTT onSend - Ignoring range test or detection sensor message on public mqtt\n");