mirror of
https://github.com/AkitaEngineering/Akita-Meshtastic-Meshcore-Bridge.git
synced 2026-10-31 01:42:01 +01:00
Added Meshtastic ID to messages bridged to MeshCore
MeshCore messages already prepend the MeshCore ID to messages bridged to Meshtastic, so now conversely, Meshtastic IDs are prepended to messages bridged to MeshCore.
This commit is contained in:
2 files changed
+6
-1
No files matched your search
@@ -12,6 +12,7 @@
|
||||
- **Added** configuration settings for bridging specific channels
|
||||
- **Fixed** companion radio decoding to be more robust
|
||||
- **Added** `channel_index` key to `external_message` dict
|
||||
- **Added** Meshtastic ID to messages bridged to MeshCore
|
||||
---
|
||||
|
||||
## Version 2.0.0 - Comprehensive Code Review and Enhancements (December 31, 2025)
|
||||
|
||||
@@ -627,6 +627,10 @@ class MeshcoreHandler:
|
||||
# CMD_SEND_CHANNEL_TXT_MSG (3)
|
||||
txt_type = 0
|
||||
channel_idx = int(item.get("channel_index", 0))
|
||||
sender_meshtastic_id = item.get("sender_meshtastic_id", "Unknown")
|
||||
|
||||
# Prepend Meshtastic ID to outgoing MeshCore message
|
||||
payload = f"{sender_meshtastic_id}: {payload}"
|
||||
|
||||
if self.config.meshtastic_channel_index is not None and self.config.meshcore_channel_index is not None:
|
||||
if channel_idx == self.config.meshtastic_channel_index:
|
||||
@@ -642,4 +646,4 @@ class MeshcoreHandler:
|
||||
encoded = self.protocol_handler.encode({"payload": cmd_payload})
|
||||
if not encoded:
|
||||
self.logger.warning("Failed to encode companion text message.")
|
||||
return encoded
|
||||
return encoded
|
||||
Reference in new issue
Block a user