Skip to content

Commit 4cbdb4d

Browse files
Merge branch 'develop' into heltec_mesh_pocket_battery_adc
2 parents c4bd8b2 + 7633ddc commit 4cbdb4d

File tree

12 files changed

+40
-48
lines changed

12 files changed

+40
-48
lines changed

.trunk/trunk.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins:
99
lint:
1010
enabled:
1111
12-
- renovate@41.127.2
12+
- renovate@41.130.1
1313
1414
1515

src/graphics/SharedUIDisplay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti
284284
int iconX = iconRightEdge - mute_symbol_big_width;
285285
int iconY = textY + (FONT_HEIGHT_SMALL - mute_symbol_big_height) / 2;
286286

287-
if (isInverted) {
287+
if (isInverted && !force_no_invert) {
288288
display->setColor(WHITE);
289289
display->fillRect(iconX - 1, iconY - 1, mute_symbol_big_width + 2, mute_symbol_big_height + 2);
290290
display->setColor(BLACK);

src/graphics/draw/MenuHandler.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,24 +852,31 @@ void menuHandler::GPSFormatMenu()
852852
bannerOptions.bannerCallback = [](int selected) -> void {
853853
if (selected == 1) {
854854
uiconfig.gps_format = meshtastic_DeviceUIConfig_GpsCoordinateFormat_DEC;
855+
saveUIConfig();
855856
service->reloadConfig(SEGMENT_CONFIG);
856857
} else if (selected == 2) {
857858
uiconfig.gps_format = meshtastic_DeviceUIConfig_GpsCoordinateFormat_DMS;
859+
saveUIConfig();
858860
service->reloadConfig(SEGMENT_CONFIG);
859861
} else if (selected == 3) {
860862
uiconfig.gps_format = meshtastic_DeviceUIConfig_GpsCoordinateFormat_UTM;
863+
saveUIConfig();
861864
service->reloadConfig(SEGMENT_CONFIG);
862865
} else if (selected == 4) {
863866
uiconfig.gps_format = meshtastic_DeviceUIConfig_GpsCoordinateFormat_MGRS;
867+
saveUIConfig();
864868
service->reloadConfig(SEGMENT_CONFIG);
865869
} else if (selected == 5) {
866870
uiconfig.gps_format = meshtastic_DeviceUIConfig_GpsCoordinateFormat_OLC;
871+
saveUIConfig();
867872
service->reloadConfig(SEGMENT_CONFIG);
868873
} else if (selected == 6) {
869874
uiconfig.gps_format = meshtastic_DeviceUIConfig_GpsCoordinateFormat_OSGR;
875+
saveUIConfig();
870876
service->reloadConfig(SEGMENT_CONFIG);
871877
} else if (selected == 7) {
872878
uiconfig.gps_format = meshtastic_DeviceUIConfig_GpsCoordinateFormat_MLS;
879+
saveUIConfig();
873880
service->reloadConfig(SEGMENT_CONFIG);
874881
} else {
875882
menuQueue = position_base_menu;

src/graphics/draw/UIRenderer.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,18 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
11051105
// === Fourth Row: Line 2 GPS Info ===
11061106
UIRenderer::drawGpsCoordinates(display, x, getTextPositions(display)[line++], gpsStatus, "line2");
11071107
}
1108+
1109+
// === Final Row: Altitude ===
1110+
char altitudeLine[32] = {0};
1111+
int32_t alt = (strcmp(displayLine, "Phone GPS") == 0 && ourNode && nodeDB->hasValidPosition(ourNode))
1112+
? ourNode->position.altitude
1113+
: geoCoord.getAltitude();
1114+
if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) {
1115+
snprintf(altitudeLine, sizeof(altitudeLine), "Alt: %.0fft", alt * METERS_TO_FEET);
1116+
} else {
1117+
snprintf(altitudeLine, sizeof(altitudeLine), "Alt: %.0im", alt);
1118+
}
1119+
display->drawString(x, getTextPositions(display)[line++], altitudeLine);
11081120
}
11091121
#if !defined(M5STACK_UNITC6L)
11101122
// === Draw Compass if heading is valid ===

src/mesh/NodeDB.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
701701
#ifdef USERPREFS_NETWORK_ENABLED_PROTOCOLS
702702
config.network.enabled_protocols = USERPREFS_NETWORK_ENABLED_PROTOCOLS;
703703
#else
704-
config.network.enabled_protocols = 1;
704+
config.network.enabled_protocols = 0;
705705
#endif
706706
#endif
707707

@@ -1667,9 +1667,6 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
16671667
return false;
16681668
}
16691669
LOG_INFO("Public Key set for node, not updating!");
1670-
// we copy the key into the incoming packet, to prevent overwrite
1671-
p.public_key.size = 32;
1672-
memcpy(p.public_key.bytes, info->user.public_key.bytes, 32);
16731670
} else if (p.public_key.size == 32) {
16741671
LOG_INFO("Update Node Pubkey!");
16751672
}

src/mesh/Router.cpp

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ bool Router::shouldDecrementHopLimit(const meshtastic_MeshPacket *p)
9090
// For subsequent hops, check if previous relay is a favorite router
9191
// Optimized search for favorite routers with matching last byte
9292
// Check ordering optimized for IoT devices (cheapest checks first)
93-
for (int i = 0; i < nodeDB->getNumMeshNodes(); i++) {
93+
for (size_t i = 0; i < nodeDB->getNumMeshNodes(); i++) {
9494
meshtastic_NodeInfoLite *node = nodeDB->getMeshNodeByIndex(i);
9595
if (!node)
9696
continue;
@@ -105,7 +105,7 @@ bool Router::shouldDecrementHopLimit(const meshtastic_MeshPacket *p)
105105

106106
// Check 3: role check (moderate cost - multiple comparisons)
107107
if (!IS_ONE_OF(node->user.role, meshtastic_Config_DeviceConfig_Role_ROUTER,
108-
meshtastic_Config_DeviceConfig_Role_ROUTER_LATE, meshtastic_Config_DeviceConfig_Role_CLIENT_BASE)) {
108+
meshtastic_Config_DeviceConfig_Role_ROUTER_LATE)) {
109109
continue;
110110
}
111111

@@ -483,35 +483,6 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p)
483483
}
484484
}
485485

486-
#if HAS_UDP_MULTICAST
487-
// Fallback: for UDP multicast, try default preset names with default PSK if normal channel match failed
488-
if (!decrypted && p->transport_mechanism == meshtastic_MeshPacket_TransportMechanism_TRANSPORT_MULTICAST_UDP) {
489-
if (channels.setDefaultPresetCryptoForHash(p->channel)) {
490-
memcpy(bytes, p->encrypted.bytes, rawSize);
491-
crypto->decrypt(p->from, p->id, rawSize, bytes);
492-
493-
meshtastic_Data decodedtmp;
494-
memset(&decodedtmp, 0, sizeof(decodedtmp));
495-
if (pb_decode_from_bytes(bytes, rawSize, &meshtastic_Data_msg, &decodedtmp) &&
496-
decodedtmp.portnum != meshtastic_PortNum_UNKNOWN_APP) {
497-
p->decoded = decodedtmp;
498-
p->which_payload_variant = meshtastic_MeshPacket_decoded_tag;
499-
// Map to our local default channel index (name+PSK default), not necessarily primary
500-
ChannelIndex defaultIndex = channels.getPrimaryIndex();
501-
for (ChannelIndex i = 0; i < channels.getNumChannels(); ++i) {
502-
if (channels.isDefaultChannel(i)) {
503-
defaultIndex = i;
504-
break;
505-
}
506-
}
507-
chIndex = defaultIndex;
508-
decrypted = true;
509-
} else {
510-
LOG_WARN("UDP fallback decode attempted but failed for hash 0x%x", p->channel);
511-
}
512-
}
513-
}
514-
#endif
515486
if (decrypted) {
516487
// parsing was successful
517488
p->channel = chIndex; // change to store the index instead of the hash

src/mesh/generated/meshtastic/apponly.pb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern const pb_msgdesc_t meshtastic_ChannelSet_msg;
5555

5656
/* Maximum encoded size of messages (where known) */
5757
#define MESHTASTIC_MESHTASTIC_APPONLY_PB_H_MAX_SIZE meshtastic_ChannelSet_size
58-
#define meshtastic_ChannelSet_size 679
58+
#define meshtastic_ChannelSet_size 695
5959

6060
#ifdef __cplusplus
6161
} /* extern "C" */

src/mesh/generated/meshtastic/channel.pb.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ typedef struct _meshtastic_ChannelSettings {
9797
/* Per-channel module settings. */
9898
bool has_module_settings;
9999
meshtastic_ModuleSettings module_settings;
100+
/* Whether or not we should receive notifactions / alerts through this channel */
101+
bool mute;
100102
} meshtastic_ChannelSettings;
101103

102104
/* A pair of a channel number, mode and the (sharable) settings for that channel */
@@ -128,10 +130,10 @@ extern "C" {
128130

129131

130132
/* Initializer values for message structs */
131-
#define meshtastic_ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0, false, meshtastic_ModuleSettings_init_default}
133+
#define meshtastic_ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0, false, meshtastic_ModuleSettings_init_default, 0}
132134
#define meshtastic_ModuleSettings_init_default {0, 0}
133135
#define meshtastic_Channel_init_default {0, false, meshtastic_ChannelSettings_init_default, _meshtastic_Channel_Role_MIN}
134-
#define meshtastic_ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0, false, meshtastic_ModuleSettings_init_zero}
136+
#define meshtastic_ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0, false, meshtastic_ModuleSettings_init_zero, 0}
135137
#define meshtastic_ModuleSettings_init_zero {0, 0}
136138
#define meshtastic_Channel_init_zero {0, false, meshtastic_ChannelSettings_init_zero, _meshtastic_Channel_Role_MIN}
137139

@@ -145,6 +147,7 @@ extern "C" {
145147
#define meshtastic_ChannelSettings_uplink_enabled_tag 5
146148
#define meshtastic_ChannelSettings_downlink_enabled_tag 6
147149
#define meshtastic_ChannelSettings_module_settings_tag 7
150+
#define meshtastic_ChannelSettings_mute_tag 8
148151
#define meshtastic_Channel_index_tag 1
149152
#define meshtastic_Channel_settings_tag 2
150153
#define meshtastic_Channel_role_tag 3
@@ -157,7 +160,8 @@ X(a, STATIC, SINGULAR, STRING, name, 3) \
157160
X(a, STATIC, SINGULAR, FIXED32, id, 4) \
158161
X(a, STATIC, SINGULAR, BOOL, uplink_enabled, 5) \
159162
X(a, STATIC, SINGULAR, BOOL, downlink_enabled, 6) \
160-
X(a, STATIC, OPTIONAL, MESSAGE, module_settings, 7)
163+
X(a, STATIC, OPTIONAL, MESSAGE, module_settings, 7) \
164+
X(a, STATIC, SINGULAR, BOOL, mute, 8)
161165
#define meshtastic_ChannelSettings_CALLBACK NULL
162166
#define meshtastic_ChannelSettings_DEFAULT NULL
163167
#define meshtastic_ChannelSettings_module_settings_MSGTYPE meshtastic_ModuleSettings
@@ -187,8 +191,8 @@ extern const pb_msgdesc_t meshtastic_Channel_msg;
187191

188192
/* Maximum encoded size of messages (where known) */
189193
#define MESHTASTIC_MESHTASTIC_CHANNEL_PB_H_MAX_SIZE meshtastic_Channel_size
190-
#define meshtastic_ChannelSettings_size 72
191-
#define meshtastic_Channel_size 87
194+
#define meshtastic_ChannelSettings_size 74
195+
#define meshtastic_Channel_size 89
192196
#define meshtastic_ModuleSettings_size 8
193197

194198
#ifdef __cplusplus

src/mesh/generated/meshtastic/config.pb.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ typedef enum _meshtastic_Config_DeviceConfig_Role {
2626
meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT = 3,
2727
/* Description: Infrastructure node for extending network coverage by relaying messages with minimal overhead. Not visible in Nodes list.
2828
Technical Details: Mesh packets will simply be rebroadcasted over this node. Nodes configured with this role will not originate NodeInfo, Position, Telemetry
29-
or any other packet type. They will simply rebroadcast any mesh packets on the same frequency, channel num, spread factor, and coding rate. */
29+
or any other packet type. They will simply rebroadcast any mesh packets on the same frequency, channel num, spread factor, and coding rate.
30+
Deprecated in v2.7.11 because it creates "holes" in the mesh rebroadcast chain. */
3031
meshtastic_Config_DeviceConfig_Role_REPEATER = 4,
3132
/* Description: Broadcasts GPS position packets as priority.
3233
Technical Details: Position Mesh packets will be prioritized higher and sent more frequently by default.

0 commit comments

Comments
 (0)