mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
feat(companion): add device-originated message frames
Adds RESP_CODE_CONTACT_MSG_SENT_V3 (0x1E) and RESP_CODE_CHANNEL_MSG_SENT_V3 (0x1F) so firmware that sends messages on its own (bot auto-replies, on-device keyboard input) can mirror them into the companion app's history, which today only ever sees inbound traffic and messages the app itself sent. See #3225. Both ride the existing offline-queue / MSG_WAITING / SYNC_NEXT_MESSAGE pipe and reuse the RECV_V3 byte layout, with the pubkey field holding the recipient instead of the sender and the SNR byte reserved. Requires app_target_ver >= 3; there is no pre-V3 shape, so older apps are skipped. Mainline never calls these -- nothing in companion_radio self-originates messages -- so this is API surface for custom builds, and the linker drops both functions when unused (identical flash usage before/after). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -192,6 +192,11 @@ public:
|
||||
_prefs.clearDirty();
|
||||
}
|
||||
|
||||
// For a custom firmware's own self-originated sends (bot replies, on-device
|
||||
// keyboard, etc.) -- mainline doesn't call these. See MyMesh.cpp.
|
||||
void queueSentMessage(const ContactInfo &to, uint8_t txt_type, uint32_t timestamp, const char *text);
|
||||
void queueSentChannelMessage(uint8_t channel_idx, uint32_t timestamp, const char *text);
|
||||
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
void applyGpsPrefs() {
|
||||
sensors.setSettingValue("gps", _prefs.gps_enabled ? "1" : "0");
|
||||
|
||||
Reference in New Issue
Block a user