mirror of
https://github.com/meshtastic/firmware.git
synced 2026-11-07 06:44:33 -05:00
Set ClientNotification.type on every firmware notification (#12280)
* Set ClientNotification.type on every firmware notification Every ClientNotification the firmware sends now carries the NotificationType for its message, so clients can localize or act on it without matching the text. `message` is unchanged. The shared senders take the type as a required argument so a new call site cannot omit it: PhoneAPI::sendNotification, AdminModule::sendWarning / sendWarningAndLog / queueChannelWarning, and RadioInterface's sendErrorNotification. The channel-warning queue keeps the type of a lone warning and uses CHANNEL_*_ISSUES for a coalesced one. checkConfigRegion() gains an optional errType out-parameter so validateConfigRegion() can send the reason's type. NodeDB::notifyRefusedIdentity() (added in #12191) has no type yet and stays UNSET until the protobufs add one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZVEy3QxYqj916trqLEsrb * Fix AdminModule.h formatting Move pendingWarningType below the aligned member block so clang-format leaves the existing trailing-comment alignment alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZVEy3QxYqj916trqLEsrb * Honor level in PhoneAPI::sendNotification; test catch-all types sendNotification ignored its level argument and always sent WARNING. Every caller passes WARNING today, so behavior is unchanged. Add test_admin_radio cases for the CHANNEL_PSK_ISSUES and CHANNEL_NAME_AND_PSK_ISSUES catch-all types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZVEy3QxYqj916trqLEsrb --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
24c6e139dc
commit
51ac6ea7b7
18 files changed
+260
-61
No files matched your search
@@ -486,6 +486,7 @@ bool PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha
|
||||
meshtastic_ClientNotification *notification = clientNotificationPool.allocZeroed();
|
||||
if (notification) {
|
||||
notification->level = meshtastic_LogRecord_Level_INFO;
|
||||
notification->type = meshtastic_ClientNotification_NotificationType_POSITION_SENT_SLEEPING;
|
||||
notification->time = getValidTime(RTCQualityFromNet);
|
||||
sprintf(notification->message, "Sending position and sleeping for %us interval in a moment",
|
||||
Default::getConfiguredOrDefaultMs(config.position.position_broadcast_secs, default_broadcast_interval_secs) /
|
||||
|
||||
Reference in new issue
Block a user