Wire in COMPRESSED port option pt 1

This commit is contained in:
Jonathan Bennett
2025-12-29 09:33:29 -06:00
parent d63b583ea2
commit 36e8a498f1
2 changed files with 9 additions and 3 deletions

View File

@@ -17,7 +17,10 @@
#include "modules/RoutingModule.h"
StoreForwardPlusPlusModule::StoreForwardPlusPlusModule()
: ProtobufModule("StoreForwardpp", meshtastic_PortNum_STORE_FORWARD_PLUSPLUS_APP, &meshtastic_StoreForwardPlusPlus_msg),
: ProtobufModule("StoreForwardpp",
USE_COMPRESSED_PORT ? meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP
: meshtastic_PortNum_STORE_FORWARD_PLUSPLUS_APP,
&meshtastic_StoreForwardPlusPlus_msg),
concurrency::OSThread("StoreForwardpp")
{
LOG_WARN("StoreForwardPlusPlusModule init");
@@ -296,7 +299,8 @@ ProcessMessage StoreForwardPlusPlusModule::handleReceived(const meshtastic_MeshP
// canonAnnounce(lo.message_hash, lo.commit_hash, lo.root_hash, lo.rx_time);
return ProcessMessage::CONTINUE; // Let others look at this message also if they want
// TODO: Block packets from self?
} else if (mp.decoded.portnum == meshtastic_PortNum_STORE_FORWARD_PLUSPLUS_APP) {
} else if (mp.decoded.portnum == USE_COMPRESSED_PORT ? meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP
: meshtastic_PortNum_STORE_FORWARD_PLUSPLUS_APP) {
LOG_WARN("Got a STORE_FORWARD++ packet");
meshtastic_StoreForwardPlusPlus scratch;
pb_decode_from_bytes(mp.decoded.payload.bytes, mp.decoded.payload.size, meshtastic_StoreForwardPlusPlus_fields, &scratch);

View File

@@ -9,6 +9,7 @@
#define SFPP_HASH_SIZE 16
#define SFPP_SHORT_HASH_SIZE 8
#define USE_COMPRESSED_PORT false
/**
* Store and forward ++ module
@@ -80,7 +81,8 @@ class StoreForwardPlusPlusModule : public ProtobufModule<meshtastic_StoreForward
{
switch (p->decoded.portnum) {
case meshtastic_PortNum_TEXT_MESSAGE_APP:
case meshtastic_PortNum_STORE_FORWARD_PLUSPLUS_APP:
case USE_COMPRESSED_PORT ? meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP:
meshtastic_PortNum_STORE_FORWARD_PLUSPLUS_APP:
return true;
default:
return false;