mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-03 20:38:41 +00:00
Applied code formatters.
This commit is contained in:
parent
97aec5f125
commit
4367f05b24
@ -48,9 +48,9 @@ int32_t StoreForwardPlugin::runOnce()
|
|||||||
* This behavior is expected to change. It's only here until we come up with something better.
|
* This behavior is expected to change. It's only here until we come up with something better.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//DEBUG_MSG("Store & Forward Plugin - Sending heartbeat\n");
|
// DEBUG_MSG("Store & Forward Plugin - Sending heartbeat\n");
|
||||||
|
|
||||||
//storeForwardPlugin->sendPayload();
|
// storeForwardPlugin->sendPayload();
|
||||||
|
|
||||||
return (4 * 60 * 1000);
|
return (4 * 60 * 1000);
|
||||||
}
|
}
|
||||||
@ -83,8 +83,9 @@ void StoreForwardPlugin::populatePSRAM()
|
|||||||
DEBUG_MSG(" Free PSRAM: %d\n", ESP.getFreePsram());
|
DEBUG_MSG(" Free PSRAM: %d\n", ESP.getFreePsram());
|
||||||
|
|
||||||
// Use a maximum of 2/3 the available PSRAM unless otherwise specified.
|
// Use a maximum of 2/3 the available PSRAM unless otherwise specified.
|
||||||
uint32_t numberOfPackets =( radioConfig.preferences.store_forward_plugin_records ? radioConfig.preferences.store_forward_plugin_records :
|
uint32_t numberOfPackets =
|
||||||
( ( (ESP.getFreePsram() / 3) * 2 )/ sizeof(PacketHistoryStruct)) );
|
(radioConfig.preferences.store_forward_plugin_records ? radioConfig.preferences.store_forward_plugin_records
|
||||||
|
: (((ESP.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct)));
|
||||||
|
|
||||||
// this->packetHistory = (PacketHistoryStruct *)ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct));
|
// this->packetHistory = (PacketHistoryStruct *)ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct));
|
||||||
this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
|
this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
|
||||||
@ -110,7 +111,7 @@ void StoreForwardPlugin::historyReport()
|
|||||||
void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to)
|
void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to)
|
||||||
{
|
{
|
||||||
|
|
||||||
//MeshPacket mp;
|
// MeshPacket mp;
|
||||||
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) {
|
||||||
|
|
||||||
@ -171,8 +172,10 @@ void StoreForwardPlugin::sendPayload(NodeNum dest, uint32_t packetHistory_index)
|
|||||||
// TODO: Make this configurable.
|
// TODO: Make this configurable.
|
||||||
p->want_ack = false;
|
p->want_ack = false;
|
||||||
|
|
||||||
p->decoded.payload.size = this->packetHistory[packetHistory_index].payload_size; // You must specify how many bytes are in the reply
|
p->decoded.payload.size =
|
||||||
memcpy(p->decoded.payload.bytes, this->packetHistory[packetHistory_index].payload, this->packetHistory[packetHistory_index].payload_size);
|
this->packetHistory[packetHistory_index].payload_size; // You must specify how many bytes are in the reply
|
||||||
|
memcpy(p->decoded.payload.bytes, this->packetHistory[packetHistory_index].payload,
|
||||||
|
this->packetHistory[packetHistory_index].payload_size);
|
||||||
|
|
||||||
service.sendToMesh(p);
|
service.sendToMesh(p);
|
||||||
}
|
}
|
||||||
@ -236,7 +239,6 @@ StoreForwardPlugin::StoreForwardPlugin()
|
|||||||
radioConfig.preferences.store_forward_plugin_enabled = 1;
|
radioConfig.preferences.store_forward_plugin_enabled = 1;
|
||||||
radioConfig.preferences.is_router = 1;
|
radioConfig.preferences.is_router = 1;
|
||||||
radioConfig.preferences.is_always_powered = 1;
|
radioConfig.preferences.is_always_powered = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radioConfig.preferences.store_forward_plugin_enabled) {
|
if (radioConfig.preferences.store_forward_plugin_enabled) {
|
||||||
|
Loading…
Reference in New Issue
Block a user