mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-06 13:44:46 +00:00
Merge remote-tracking branch 'origin/unify-tft' into screen-refactor
This commit is contained in:
commit
134e01aa70
@ -59,7 +59,7 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket &
|
|||||||
r->hash1.size == 0) {
|
r->hash1.size == 0) {
|
||||||
memcpy(hash2, r->hash2.bytes, 32);
|
memcpy(hash2, r->hash2.bytes, 32);
|
||||||
if (screen)
|
if (screen)
|
||||||
screen->startAlert("Enter Security Number"); // TODO: replace with actual prompt in BaseUI
|
screen->showOverlayBanner("Enter Security Number", 15000);
|
||||||
|
|
||||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||||
cn->level = meshtastic_LogRecord_Level_WARNING;
|
cn->level = meshtastic_LogRecord_Level_WARNING;
|
||||||
@ -81,8 +81,7 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket &
|
|||||||
generateVerificationCode(message + 15);
|
generateVerificationCode(message + 15);
|
||||||
LOG_INFO("Hash1 matches!");
|
LOG_INFO("Hash1 matches!");
|
||||||
if (screen) {
|
if (screen) {
|
||||||
screen->endAlert();
|
screen->showOverlayBanner(message, 15000);
|
||||||
screen->startAlert(message);
|
|
||||||
}
|
}
|
||||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||||
cn->level = meshtastic_LogRecord_Level_WARNING;
|
cn->level = meshtastic_LogRecord_Level_WARNING;
|
||||||
@ -180,7 +179,7 @@ meshtastic_MeshPacket *KeyVerificationModule::allocReply()
|
|||||||
responsePacket->pki_encrypted = true;
|
responsePacket->pki_encrypted = true;
|
||||||
if (screen) {
|
if (screen) {
|
||||||
snprintf(message, 25, "Security Number \n%03u %03u", currentSecurityNumber / 1000, currentSecurityNumber % 1000);
|
snprintf(message, 25, "Security Number \n%03u %03u", currentSecurityNumber / 1000, currentSecurityNumber % 1000);
|
||||||
screen->startAlert(message);
|
screen->showOverlayBanner(message, 15000);
|
||||||
LOG_WARN("%s", message);
|
LOG_WARN("%s", message);
|
||||||
}
|
}
|
||||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||||
@ -250,8 +249,7 @@ void KeyVerificationModule::processSecurityNumber(uint32_t incomingNumber)
|
|||||||
sprintf(message, "Verification: \n");
|
sprintf(message, "Verification: \n");
|
||||||
generateVerificationCode(message + 15); // send the toPhone packet
|
generateVerificationCode(message + 15); // send the toPhone packet
|
||||||
if (screen) {
|
if (screen) {
|
||||||
screen->endAlert();
|
screen->showOverlayBanner(message, 15000);
|
||||||
screen->startAlert(message);
|
|
||||||
}
|
}
|
||||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||||
cn->level = meshtastic_LogRecord_Level_WARNING;
|
cn->level = meshtastic_LogRecord_Level_WARNING;
|
||||||
@ -287,8 +285,6 @@ void KeyVerificationModule::resetToIdle()
|
|||||||
currentSecurityNumber = 0;
|
currentSecurityNumber = 0;
|
||||||
currentRemoteNode = 0;
|
currentRemoteNode = 0;
|
||||||
currentState = KEY_VERIFICATION_IDLE;
|
currentState = KEY_VERIFICATION_IDLE;
|
||||||
if (screen)
|
|
||||||
screen->endAlert();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyVerificationModule::generateVerificationCode(char *readableCode)
|
void KeyVerificationModule::generateVerificationCode(char *readableCode)
|
||||||
|
@ -328,7 +328,13 @@ void PositionModule::sendOurPosition()
|
|||||||
|
|
||||||
// If we changed channels, ask everyone else for their latest info
|
// If we changed channels, ask everyone else for their latest info
|
||||||
LOG_INFO("Send pos@%x:6 to mesh (wantReplies=%d)", localPosition.timestamp, requestReplies);
|
LOG_INFO("Send pos@%x:6 to mesh (wantReplies=%d)", localPosition.timestamp, requestReplies);
|
||||||
sendOurPosition(NODENUM_BROADCAST, requestReplies);
|
for (uint8_t channelNum = 0; channelNum < 8; channelNum++) {
|
||||||
|
if (channels.getByIndex(channelNum).settings.has_module_settings &&
|
||||||
|
channels.getByIndex(channelNum).settings.module_settings.position_precision != 0) {
|
||||||
|
sendOurPosition(NODENUM_BROADCAST, requestReplies, channelNum);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t channel)
|
void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t channel)
|
||||||
@ -340,11 +346,6 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha
|
|||||||
// Set's the class precision value for this particular packet
|
// Set's the class precision value for this particular packet
|
||||||
if (channels.getByIndex(channel).settings.has_module_settings) {
|
if (channels.getByIndex(channel).settings.has_module_settings) {
|
||||||
precision = channels.getByIndex(channel).settings.module_settings.position_precision;
|
precision = channels.getByIndex(channel).settings.module_settings.position_precision;
|
||||||
} else if (channels.getByIndex(channel).role == meshtastic_Channel_Role_PRIMARY) {
|
|
||||||
// backwards compatibility for Primary channels created before position_precision was set by default
|
|
||||||
precision = 13;
|
|
||||||
} else {
|
|
||||||
precision = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
meshtastic_MeshPacket *p = allocPositionPacket();
|
meshtastic_MeshPacket *p = allocPositionPacket();
|
||||||
|
Loading…
Reference in New Issue
Block a user