mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 18:09:04 +00:00
Formatting applied
This commit is contained in:
parent
37aab8a42b
commit
32017e53f5
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
StoreForwardPlugin *storeForwardPlugin;
|
StoreForwardPlugin *storeForwardPlugin;
|
||||||
|
|
||||||
int32_t StoreForwardPlugin::runOnce()
|
int32_t StoreForwardPlugin::runOnce()
|
||||||
@ -119,37 +118,39 @@ void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to)
|
|||||||
for (int i = 0; i < this->packetHistoryCurrent; i++) {
|
for (int i = 0; i < this->packetHistoryCurrent; i++) {
|
||||||
if (this->packetHistory[i].time) {
|
if (this->packetHistory[i].time) {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Stored packet was sent to a broadcast address
|
Stored packet was sent to a broadcast address
|
||||||
*/
|
*/
|
||||||
if ((this->packetHistory[i].to & 0xffffffff) == 0xffffffff) {
|
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);
|
pb_decode_from_bytes(this->packetHistory[i].bytes, this->packetHistory[i].bytes_size, ToRadio_fields, &mp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Take saved packet
|
Take saved packet
|
||||||
Decode it
|
Decode it
|
||||||
Read something form the decoded packet.
|
Read something form the decoded packet.
|
||||||
*/
|
*/
|
||||||
DEBUG_MSG(">>>>> %s\n", mp.decoded.payload.bytes);
|
DEBUG_MSG(">>>>> %s\n", mp.decoded.payload.bytes);
|
||||||
|
|
||||||
storeForwardPlugin->sendPayload(to, true);
|
storeForwardPlugin->sendPayload(to, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Stored packet was intended to a named address
|
Stored packet was intended to a named address
|
||||||
|
|
||||||
TODO: TEST ME! I don't know if this works.
|
TODO: TEST ME! I don't know if this works.
|
||||||
*/
|
*/
|
||||||
if ((this->packetHistory[i].to & 0xffffffff) == to) {
|
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);
|
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);
|
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), Data_fields, &p->decoded);
|
||||||
assert(numbytes <= MAX_RHPACKETLEN);
|
assert(numbytes <= MAX_RHPACKETLEN);
|
||||||
|
|
||||||
//DEBUG_MSG("MP numbytes %u\n", numbytes);
|
// DEBUG_MSG("MP numbytes %u\n", numbytes);
|
||||||
|
|
||||||
// destination, source, bytes
|
// destination, source, bytes
|
||||||
// memcpy(p->encrypted.bytes, bytes, numbytes);
|
// 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].to = mp->to;
|
||||||
this->packetHistory[this->packetHistoryCurrent].bytes_size = sizeof(bytes);
|
this->packetHistory[this->packetHistoryCurrent].bytes_size = sizeof(bytes);
|
||||||
this->packetHistoryCurrent++;
|
this->packetHistoryCurrent++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshPacket *StoreForwardPlugin::allocReply()
|
MeshPacket *StoreForwardPlugin::allocReply()
|
||||||
@ -198,7 +198,6 @@ void StoreForwardPlugin::sendPayload(NodeNum dest, bool wantReplies)
|
|||||||
service.sendToMesh(p);
|
service.sendToMesh(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp)
|
ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp)
|
||||||
{
|
{
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
@ -243,10 +242,9 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp)
|
|||||||
StoreForwardPlugin::StoreForwardPlugin()
|
StoreForwardPlugin::StoreForwardPlugin()
|
||||||
: SinglePortPlugin("StoreForwardPlugin", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("StoreForwardPlugin")
|
: SinglePortPlugin("StoreForwardPlugin", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("StoreForwardPlugin")
|
||||||
{
|
{
|
||||||
//StoreForwardPlugin::StoreForwardPlugin()
|
// StoreForwardPlugin::StoreForwardPlugin()
|
||||||
// : SinglePortPlugin("StoreForwardPlugin", PortNum_STORE_FORWARD_APP), concurrency::OSThread("StoreForwardPlugin")
|
// : SinglePortPlugin("StoreForwardPlugin", PortNum_STORE_FORWARD_APP), concurrency::OSThread("StoreForwardPlugin")
|
||||||
//{
|
//{
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
|
|
||||||
|
@ -50,7 +50,8 @@ class StoreForwardPlugin : public SinglePortPlugin, private concurrency::OSThrea
|
|||||||
|
|
||||||
/** Called to handle a particular incoming message
|
/** 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);
|
virtual ProcessMessage handleReceived(const MeshPacket &mp);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user