mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-03 11:19:58 +00:00
Formatting applied
This commit is contained in:
parent
37aab8a42b
commit
32017e53f5
@ -22,7 +22,6 @@
|
||||
|
||||
*/
|
||||
|
||||
|
||||
StoreForwardPlugin *storeForwardPlugin;
|
||||
|
||||
int32_t StoreForwardPlugin::runOnce()
|
||||
@ -119,14 +118,15 @@ void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to)
|
||||
for (int i = 0; i < this->packetHistoryCurrent; i++) {
|
||||
if (this->packetHistory[i].time) {
|
||||
|
||||
|
||||
/*
|
||||
Stored packet was sent to a broadcast address
|
||||
*/
|
||||
if ((this->packetHistory[i].to & 0xffffffff) == 0xffffffff) {
|
||||
DEBUG_MSG("Request: to-0x%08x, Stored: time-%u to-0x%08x\n", to & 0xffffffff, this->packetHistory[i].time, this->packetHistory[i].to & 0xffffffff);
|
||||
DEBUG_MSG("Request: to-0x%08x, Stored: time-%u to-0x%08x\n", to & 0xffffffff, this->packetHistory[i].time,
|
||||
this->packetHistory[i].to & 0xffffffff);
|
||||
|
||||
//bool pb_decode_from_bytes(const uint8_t *srcbuf, size_t srcbufsize, const pb_msgdesc_t *fields, void *dest_struct);
|
||||
// bool pb_decode_from_bytes(const uint8_t *srcbuf, size_t srcbufsize, const pb_msgdesc_t *fields, void
|
||||
// *dest_struct);
|
||||
pb_decode_from_bytes(this->packetHistory[i].bytes, this->packetHistory[i].bytes_size, ToRadio_fields, &mp);
|
||||
|
||||
/*
|
||||
@ -145,11 +145,12 @@ void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to)
|
||||
TODO: TEST ME! I don't know if this works.
|
||||
*/
|
||||
if ((this->packetHistory[i].to & 0xffffffff) == to) {
|
||||
DEBUG_MSG("Request: to-0x%08x, Stored: time-%u to-0x%08x\n", to & 0xffffffff, this->packetHistory[i].time, this->packetHistory[i].to & 0xffffffff);
|
||||
DEBUG_MSG("Request: to-0x%08x, Stored: time-%u to-0x%08x\n", to & 0xffffffff, this->packetHistory[i].time,
|
||||
this->packetHistory[i].to & 0xffffffff);
|
||||
storeForwardPlugin->sendPayload(to, true);
|
||||
}
|
||||
|
||||
//break;
|
||||
// break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -162,7 +163,7 @@ void StoreForwardPlugin::historyAdd(const MeshPacket *mp)
|
||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), Data_fields, &p->decoded);
|
||||
assert(numbytes <= MAX_RHPACKETLEN);
|
||||
|
||||
//DEBUG_MSG("MP numbytes %u\n", numbytes);
|
||||
// DEBUG_MSG("MP numbytes %u\n", numbytes);
|
||||
|
||||
// destination, source, bytes
|
||||
// memcpy(p->encrypted.bytes, bytes, numbytes);
|
||||
@ -171,7 +172,6 @@ void StoreForwardPlugin::historyAdd(const MeshPacket *mp)
|
||||
this->packetHistory[this->packetHistoryCurrent].to = mp->to;
|
||||
this->packetHistory[this->packetHistoryCurrent].bytes_size = sizeof(bytes);
|
||||
this->packetHistoryCurrent++;
|
||||
|
||||
}
|
||||
|
||||
MeshPacket *StoreForwardPlugin::allocReply()
|
||||
@ -198,7 +198,6 @@ void StoreForwardPlugin::sendPayload(NodeNum dest, bool wantReplies)
|
||||
service.sendToMesh(p);
|
||||
}
|
||||
|
||||
|
||||
ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp)
|
||||
{
|
||||
#ifndef NO_ESP32
|
||||
@ -243,10 +242,9 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp)
|
||||
StoreForwardPlugin::StoreForwardPlugin()
|
||||
: SinglePortPlugin("StoreForwardPlugin", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("StoreForwardPlugin")
|
||||
{
|
||||
//StoreForwardPlugin::StoreForwardPlugin()
|
||||
// : SinglePortPlugin("StoreForwardPlugin", PortNum_STORE_FORWARD_APP), concurrency::OSThread("StoreForwardPlugin")
|
||||
//{
|
||||
|
||||
// StoreForwardPlugin::StoreForwardPlugin()
|
||||
// : SinglePortPlugin("StoreForwardPlugin", PortNum_STORE_FORWARD_APP), concurrency::OSThread("StoreForwardPlugin")
|
||||
//{
|
||||
|
||||
#ifndef NO_ESP32
|
||||
|
||||
|
@ -50,7 +50,8 @@ class StoreForwardPlugin : public SinglePortPlugin, private concurrency::OSThrea
|
||||
|
||||
/** Called to handle a particular incoming message
|
||||
|
||||
@return ProcessMessage::STOP if you've guaranteed you've handled this message and no other handlers should be considered for it
|
||||
@return ProcessMessage::STOP if you've guaranteed you've handled this message and no other handlers should be considered for
|
||||
it
|
||||
*/
|
||||
virtual ProcessMessage handleReceived(const MeshPacket &mp);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user