Applied code formatters.

1.2-legacy
Jm Casler 2021-11-20 21:57:21 -08:00
rodzic 97aec5f125
commit 4367f05b24
1 zmienionych plików z 12 dodań i 10 usunięć

Wyświetl plik

@ -83,8 +83,9 @@ void StoreForwardPlugin::populatePSRAM()
DEBUG_MSG(" Free PSRAM: %d\n", ESP.getFreePsram());
// 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 :
( ( (ESP.getFreePsram() / 3) * 2 )/ sizeof(PacketHistoryStruct)) );
uint32_t numberOfPackets =
(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 = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
@ -171,8 +172,10 @@ void StoreForwardPlugin::sendPayload(NodeNum dest, uint32_t packetHistory_index)
// TODO: Make this configurable.
p->want_ack = false;
p->decoded.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);
p->decoded.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);
}
@ -236,7 +239,6 @@ StoreForwardPlugin::StoreForwardPlugin()
radioConfig.preferences.store_forward_plugin_enabled = 1;
radioConfig.preferences.is_router = 1;
radioConfig.preferences.is_always_powered = 1;
}
if (radioConfig.preferences.store_forward_plugin_enabled) {