2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* @file StoreForwardModule.cpp
|
|
|
|
|
* @brief Implementation of the StoreForwardModule class.
|
2023-07-26 17:08:04 -07:00
|
|
|
*
|
|
|
|
|
* This file contains the implementation of the StoreForwardModule class, which is responsible for managing the store and forward
|
|
|
|
|
* functionality of the Meshtastic device. The class provides methods for sending and receiving messages, as well as managing the
|
|
|
|
|
* message history queue. It also initializes and manages the data structures used for storing the message history.
|
|
|
|
|
*
|
|
|
|
|
* The StoreForwardModule class is used by the MeshService class to provide store and forward functionality to the Meshtastic
|
|
|
|
|
* device.
|
|
|
|
|
*
|
2023-07-26 16:34:36 -07:00
|
|
|
* @author Jm Casler
|
|
|
|
|
* @date [Insert Date]
|
|
|
|
|
*/
|
2022-02-27 01:27:17 -08:00
|
|
|
#include "StoreForwardModule.h"
|
2021-01-31 09:12:01 -08:00
|
|
|
#include "MeshService.h"
|
|
|
|
|
#include "NodeDB.h"
|
|
|
|
|
#include "RTC.h"
|
|
|
|
|
#include "Router.h"
|
2021-12-30 14:24:44 -08:00
|
|
|
#include "airtime.h"
|
2021-01-31 09:12:01 -08:00
|
|
|
#include "configuration.h"
|
2023-02-17 12:31:51 +01:00
|
|
|
#include "memGet.h"
|
2021-02-20 23:53:53 -08:00
|
|
|
#include "mesh-pb-constants.h"
|
2023-01-18 08:56:47 -06:00
|
|
|
#include "mesh/generated/meshtastic/storeforward.pb.h"
|
2022-02-27 00:18:35 -08:00
|
|
|
#include "modules/ModuleDev.h"
|
2021-01-31 09:12:01 -08:00
|
|
|
#include <Arduino.h>
|
2021-11-22 17:47:42 -08:00
|
|
|
#include <iterator>
|
2021-11-28 19:41:34 -08:00
|
|
|
#include <map>
|
2021-11-18 09:35:05 -08:00
|
|
|
|
2022-02-27 02:21:02 -08:00
|
|
|
StoreForwardModule *storeForwardModule;
|
2021-01-31 09:12:01 -08:00
|
|
|
|
2022-02-27 02:21:02 -08:00
|
|
|
int32_t StoreForwardModule::runOnce()
|
2021-01-31 09:12:01 -08:00
|
|
|
{
|
2022-07-31 07:11:47 -05:00
|
|
|
#ifdef ARCH_ESP32
|
2022-12-06 16:56:38 +01:00
|
|
|
if (moduleConfig.store_forward.enabled && is_server) {
|
|
|
|
|
// Send out the message queue.
|
|
|
|
|
if (this->busy) {
|
|
|
|
|
// Only send packets if the channel is less than 25% utilized.
|
2023-01-11 21:52:19 +01:00
|
|
|
if (airTime->isTxAllowedChannelUtil(true)) {
|
2022-12-06 16:56:38 +01:00
|
|
|
storeForwardModule->sendPayload(this->busyTo, this->packetHistoryTXQueue_index);
|
2024-02-14 14:07:20 +01:00
|
|
|
if (this->packetHistoryTXQueue_index < packetHistoryTXQueue_size - 1) {
|
|
|
|
|
this->packetHistoryTXQueue_index++;
|
|
|
|
|
} else {
|
2022-12-06 16:56:38 +01:00
|
|
|
this->packetHistoryTXQueue_index = 0;
|
|
|
|
|
this->busy = false;
|
2021-11-22 17:47:42 -08:00
|
|
|
}
|
2022-12-06 16:56:38 +01:00
|
|
|
}
|
2023-01-11 21:52:19 +01:00
|
|
|
} else if ((millis() - lastHeartbeat > (heartbeatInterval * 1000)) && airTime->isTxAllowedChannelUtil(true)) {
|
2022-12-06 16:56:38 +01:00
|
|
|
lastHeartbeat = millis();
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** Sending heartbeat\n");
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_StoreAndForward sf = meshtastic_StoreAndForward_init_zero;
|
|
|
|
|
sf.rr = meshtastic_StoreAndForward_RequestResponse_ROUTER_HEARTBEAT;
|
|
|
|
|
sf.which_variant = meshtastic_StoreAndForward_heartbeat_tag;
|
2024-02-14 14:07:20 +01:00
|
|
|
sf.variant.heartbeat.period = heartbeatInterval;
|
2022-12-21 12:57:42 +01:00
|
|
|
sf.variant.heartbeat.secondary = 0; // TODO we always have one primary router for now
|
|
|
|
|
storeForwardModule->sendMessage(NODENUM_BROADCAST, sf);
|
2021-01-31 09:12:01 -08:00
|
|
|
}
|
2022-12-06 16:56:38 +01:00
|
|
|
return (this->packetTimeMax);
|
2021-01-31 09:12:01 -08:00
|
|
|
}
|
|
|
|
|
#endif
|
2022-12-29 18:48:33 -06:00
|
|
|
return disable();
|
2021-01-31 09:12:01 -08:00
|
|
|
}
|
|
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Populates the PSRAM with data to be sent later when a device is out of range.
|
|
|
|
|
*/
|
2022-02-27 02:21:02 -08:00
|
|
|
void StoreForwardModule::populatePSRAM()
|
2021-02-22 20:07:19 -08:00
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
For PSRAM usage, see:
|
|
|
|
|
https://learn.upesy.com/en/programmation/psram.html#psram-tab
|
|
|
|
|
*/
|
|
|
|
|
|
2023-07-14 17:25:20 -04:00
|
|
|
LOG_DEBUG("*** Before PSRAM initialization: heap %d/%d PSRAM %d/%d\n", memGet.getFreeHeap(), memGet.getHeapSize(),
|
2023-02-17 12:31:51 +01:00
|
|
|
memGet.getFreePsram(), memGet.getPsramSize());
|
2021-02-22 20:07:19 -08:00
|
|
|
|
2021-12-03 22:20:15 -08:00
|
|
|
this->packetHistoryTXQueue =
|
|
|
|
|
static_cast<PacketHistoryStruct *>(ps_calloc(this->historyReturnMax, sizeof(PacketHistoryStruct)));
|
|
|
|
|
|
|
|
|
|
/* Use a maximum of 2/3 the available PSRAM unless otherwise specified.
|
|
|
|
|
Note: This needs to be done after every thing that would use PSRAM
|
|
|
|
|
*/
|
2023-02-17 12:31:51 +01:00
|
|
|
uint32_t numberOfPackets =
|
|
|
|
|
(this->records ? this->records : (((memGet.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct)));
|
2022-12-21 12:57:42 +01:00
|
|
|
this->records = numberOfPackets;
|
2021-03-17 21:03:11 -07:00
|
|
|
|
2021-03-21 19:45:35 -07:00
|
|
|
this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
|
2021-12-03 22:20:15 -08:00
|
|
|
|
2023-07-14 17:25:20 -04:00
|
|
|
LOG_DEBUG("*** After PSRAM initialization: heap %d/%d PSRAM %d/%d\n", memGet.getFreeHeap(), memGet.getHeapSize(),
|
2023-02-17 12:31:51 +01:00
|
|
|
memGet.getFreePsram(), memGet.getPsramSize());
|
2022-12-29 20:41:37 -06:00
|
|
|
LOG_DEBUG("*** numberOfPackets for packetHistory - %u\n", numberOfPackets);
|
2021-02-24 20:27:21 -08:00
|
|
|
}
|
2021-03-21 19:45:35 -07:00
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Sends messages from the message history to the specified recipient.
|
2023-07-26 17:08:04 -07:00
|
|
|
*
|
2023-07-26 16:34:36 -07:00
|
|
|
* @param msAgo The number of milliseconds ago from which to start sending messages.
|
|
|
|
|
* @param to The recipient ID to send the messages to.
|
|
|
|
|
*/
|
2024-02-18 21:27:44 +01:00
|
|
|
void StoreForwardModule::historySend(uint32_t msAgo, uint32_t to)
|
2021-02-24 20:27:21 -08:00
|
|
|
{
|
2024-02-18 21:27:44 +01:00
|
|
|
uint32_t lastIndex = lastRequest.find(to) != lastRequest.end() ? lastRequest[to] : 0;
|
|
|
|
|
uint32_t queueSize = storeForwardModule->historyQueueCreate(msAgo, to, &lastIndex);
|
2021-11-21 14:43:47 -08:00
|
|
|
|
2021-11-22 17:47:42 -08:00
|
|
|
if (queueSize) {
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** S&F - Sending %u message(s)\n", queueSize);
|
2021-11-22 17:47:42 -08:00
|
|
|
this->busy = true; // runOnce() will pickup the next steps once busy = true.
|
|
|
|
|
this->busyTo = to;
|
|
|
|
|
} else {
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** S&F - No history to send\n");
|
2021-11-22 17:47:42 -08:00
|
|
|
}
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_StoreAndForward sf = meshtastic_StoreAndForward_init_zero;
|
|
|
|
|
sf.rr = meshtastic_StoreAndForward_RequestResponse_ROUTER_HISTORY;
|
|
|
|
|
sf.which_variant = meshtastic_StoreAndForward_history_tag;
|
2022-12-21 12:57:42 +01:00
|
|
|
sf.variant.history.history_messages = queueSize;
|
2022-12-21 17:56:34 +01:00
|
|
|
sf.variant.history.window = msAgo;
|
2024-02-18 21:27:44 +01:00
|
|
|
sf.variant.history.last_request = lastIndex;
|
|
|
|
|
lastRequest[to] = lastIndex;
|
2022-12-21 12:57:42 +01:00
|
|
|
storeForwardModule->sendMessage(to, sf);
|
2021-11-22 17:47:42 -08:00
|
|
|
}
|
2021-11-18 09:35:05 -08:00
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Creates a new history queue with messages that were received within the specified time frame.
|
2023-07-26 17:08:04 -07:00
|
|
|
*
|
2023-07-26 16:34:36 -07:00
|
|
|
* @param msAgo The number of milliseconds ago to start the history queue.
|
2024-02-14 14:07:20 +01:00
|
|
|
* @param to The NodeNum of the recipient.
|
|
|
|
|
* @param last_request_index The index in the packet history of the last request from this node.
|
2023-07-26 16:34:36 -07:00
|
|
|
* @return The ID of the newly created history queue.
|
|
|
|
|
*/
|
2024-02-14 14:07:20 +01:00
|
|
|
uint32_t StoreForwardModule::historyQueueCreate(uint32_t msAgo, uint32_t to, uint32_t *last_request_index)
|
2021-11-28 19:41:34 -08:00
|
|
|
{
|
|
|
|
|
|
2021-11-22 17:47:42 -08:00
|
|
|
this->packetHistoryTXQueue_size = 0;
|
2024-02-18 21:27:44 +01:00
|
|
|
// If our history was cleared, ignore the last request index
|
|
|
|
|
uint32_t last_index = *last_request_index > this->packetHistoryCurrent ? 0 : *last_request_index;
|
2021-11-18 09:35:05 -08:00
|
|
|
|
2024-02-18 21:27:44 +01:00
|
|
|
for (uint32_t i = last_index; i < this->packetHistoryCurrent; i++) {
|
2021-11-22 17:47:42 -08:00
|
|
|
/*
|
2022-12-29 20:41:37 -06:00
|
|
|
LOG_DEBUG("SF historyQueueCreate\n");
|
|
|
|
|
LOG_DEBUG("SF historyQueueCreate - time %d\n", this->packetHistory[i].time);
|
|
|
|
|
LOG_DEBUG("SF historyQueueCreate - millis %d\n", millis());
|
|
|
|
|
LOG_DEBUG("SF historyQueueCreate - math %d\n", (millis() - msAgo));
|
2021-11-22 17:47:42 -08:00
|
|
|
*/
|
|
|
|
|
if (this->packetHistory[i].time && (this->packetHistory[i].time < (millis() - msAgo))) {
|
2024-02-14 14:07:20 +01:00
|
|
|
/* Copy the messages that were received by the router in the last msAgo
|
2021-11-22 17:47:42 -08:00
|
|
|
to the packetHistoryTXQueue structure.
|
2024-02-14 14:07:20 +01:00
|
|
|
Client not interested in packets from itself and only in broadcast packets or packets towards it. */
|
|
|
|
|
if (this->packetHistory[i].from != to &&
|
|
|
|
|
(this->packetHistory[i].to == NODENUM_BROADCAST || this->packetHistory[i].to == to)) {
|
2021-12-21 19:28:47 -05:00
|
|
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].time = this->packetHistory[i].time;
|
2021-11-22 17:47:42 -08:00
|
|
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].to = this->packetHistory[i].to;
|
|
|
|
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].from = this->packetHistory[i].from;
|
2021-12-21 19:28:47 -05:00
|
|
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].channel = this->packetHistory[i].channel;
|
2021-11-22 17:47:42 -08:00
|
|
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].payload_size = this->packetHistory[i].payload_size;
|
2021-11-28 19:41:34 -08:00
|
|
|
memcpy(this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].payload, this->packetHistory[i].payload,
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_Constants_DATA_PAYLOAD_LEN);
|
2021-11-22 17:47:42 -08:00
|
|
|
this->packetHistoryTXQueue_size++;
|
2024-02-14 14:07:20 +01:00
|
|
|
*last_request_index = i + 1; // Set to one higher such that we don't send the same message again
|
2021-11-22 17:47:42 -08:00
|
|
|
|
2024-02-14 14:07:20 +01:00
|
|
|
LOG_DEBUG("*** PacketHistoryStruct time=%d, msg=%s\n", this->packetHistory[i].time,
|
|
|
|
|
this->packetHistory[i].payload);
|
2021-11-18 09:35:05 -08:00
|
|
|
}
|
2021-02-24 20:27:21 -08:00
|
|
|
}
|
|
|
|
|
}
|
2021-11-22 17:47:42 -08:00
|
|
|
return this->packetHistoryTXQueue_size;
|
2021-02-24 20:27:21 -08:00
|
|
|
}
|
|
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Adds a mesh packet to the history buffer for store-and-forward functionality.
|
|
|
|
|
*
|
|
|
|
|
* @param mp The mesh packet to add to the history buffer.
|
|
|
|
|
*/
|
2023-01-21 18:22:19 +01:00
|
|
|
void StoreForwardModule::historyAdd(const meshtastic_MeshPacket &mp)
|
2021-02-21 20:15:31 -08:00
|
|
|
{
|
2022-01-24 18:39:17 +00:00
|
|
|
const auto &p = mp.decoded;
|
2021-02-21 20:15:31 -08:00
|
|
|
|
2024-02-14 14:07:20 +01:00
|
|
|
if (this->packetHistoryCurrent < this->records) {
|
|
|
|
|
this->packetHistory[this->packetHistoryCurrent].time = millis();
|
|
|
|
|
this->packetHistory[this->packetHistoryCurrent].to = mp.to;
|
|
|
|
|
this->packetHistory[this->packetHistoryCurrent].channel = mp.channel;
|
|
|
|
|
this->packetHistory[this->packetHistoryCurrent].from = mp.from;
|
|
|
|
|
this->packetHistory[this->packetHistoryCurrent].payload_size = p.payload.size;
|
|
|
|
|
memcpy(this->packetHistory[this->packetHistoryCurrent].payload, p.payload.bytes, meshtastic_Constants_DATA_PAYLOAD_LEN);
|
2021-11-20 21:21:11 -08:00
|
|
|
|
2024-02-14 14:07:20 +01:00
|
|
|
this->packetHistoryCurrent++;
|
|
|
|
|
this->packetHistoryMax++;
|
|
|
|
|
} else {
|
|
|
|
|
// TODO: Overwrite the oldest message in the history buffer when it is full.
|
|
|
|
|
LOG_WARN("*** S&F - PSRAM Full. Packet is not added to the history.\n");
|
|
|
|
|
}
|
2021-02-21 20:15:31 -08:00
|
|
|
}
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_MeshPacket *StoreForwardModule::allocReply()
|
2021-01-31 09:12:01 -08:00
|
|
|
{
|
2021-03-13 08:29:32 +08:00
|
|
|
auto reply = allocDataPacket(); // Allocate a packet for sending
|
2021-03-17 21:03:11 -07:00
|
|
|
return reply;
|
2021-01-31 09:12:01 -08:00
|
|
|
}
|
|
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Sends a payload to a specified destination node using the store and forward mechanism.
|
2023-07-26 17:08:04 -07:00
|
|
|
*
|
2023-07-26 16:34:36 -07:00
|
|
|
* @param dest The destination node number.
|
|
|
|
|
* @param packetHistory_index The index of the packet in the packet history buffer.
|
|
|
|
|
*/
|
2022-02-27 02:21:02 -08:00
|
|
|
void StoreForwardModule::sendPayload(NodeNum dest, uint32_t packetHistory_index)
|
2021-01-31 09:12:01 -08:00
|
|
|
{
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** Sending S&F Payload\n");
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_MeshPacket *p = allocReply();
|
2021-01-31 09:12:01 -08:00
|
|
|
|
2021-11-20 21:21:11 -08:00
|
|
|
p->to = dest;
|
2021-11-22 17:47:42 -08:00
|
|
|
p->from = this->packetHistoryTXQueue[packetHistory_index].from;
|
2021-12-21 19:28:47 -05:00
|
|
|
p->channel = this->packetHistoryTXQueue[packetHistory_index].channel;
|
2021-11-20 21:57:21 -08:00
|
|
|
|
2021-11-20 21:21:11 -08:00
|
|
|
// Let's assume that if the router received the S&F request that the client is in range.
|
|
|
|
|
// TODO: Make this configurable.
|
2021-11-20 21:57:21 -08:00
|
|
|
p->want_ack = false;
|
2021-03-21 19:45:35 -07:00
|
|
|
|
2024-02-14 14:07:20 +01:00
|
|
|
meshtastic_StoreAndForward sf = meshtastic_StoreAndForward_init_zero;
|
|
|
|
|
sf.which_variant = meshtastic_StoreAndForward_text_tag;
|
|
|
|
|
sf.variant.text.size = this->packetHistoryTXQueue[packetHistory_index].payload_size;
|
|
|
|
|
memcpy(sf.variant.text.bytes, this->packetHistoryTXQueue[packetHistory_index].payload,
|
2021-11-22 17:47:42 -08:00
|
|
|
this->packetHistoryTXQueue[packetHistory_index].payload_size);
|
2024-02-14 14:07:20 +01:00
|
|
|
if (this->packetHistoryTXQueue[packetHistory_index].to == NODENUM_BROADCAST) {
|
|
|
|
|
sf.rr = meshtastic_StoreAndForward_RequestResponse_ROUTER_TEXT_BROADCAST;
|
|
|
|
|
} else {
|
|
|
|
|
sf.rr = meshtastic_StoreAndForward_RequestResponse_ROUTER_TEXT_DIRECT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p->decoded.payload.size =
|
|
|
|
|
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_StoreAndForward_msg, &sf);
|
2021-01-31 09:12:01 -08:00
|
|
|
|
|
|
|
|
service.sendToMesh(p);
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Sends a message to a specified destination node using the store and forward protocol.
|
2023-07-26 17:08:04 -07:00
|
|
|
*
|
2023-07-26 16:34:36 -07:00
|
|
|
* @param dest The destination node number.
|
|
|
|
|
* @param payload The message payload to be sent.
|
|
|
|
|
*/
|
2023-08-12 09:29:19 -05:00
|
|
|
void StoreForwardModule::sendMessage(NodeNum dest, const meshtastic_StoreAndForward &payload)
|
2021-11-21 14:43:47 -08:00
|
|
|
{
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_MeshPacket *p = allocDataProtobuf(payload);
|
2021-11-21 14:43:47 -08:00
|
|
|
|
|
|
|
|
p->to = dest;
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
p->priority = meshtastic_MeshPacket_Priority_MIN;
|
2022-12-21 12:57:42 +01:00
|
|
|
|
2021-12-27 10:02:43 -08:00
|
|
|
// FIXME - Determine if the delayed packet is broadcast or delayed. For now, assume
|
|
|
|
|
// everything is broadcast.
|
2023-01-21 18:22:19 +01:00
|
|
|
p->delayed = meshtastic_MeshPacket_Delayed_DELAYED_BROADCAST;
|
2021-12-27 10:02:43 -08:00
|
|
|
|
2021-11-21 14:43:47 -08:00
|
|
|
// Let's assume that if the router received the S&F request that the client is in range.
|
|
|
|
|
// TODO: Make this configurable.
|
|
|
|
|
p->want_ack = false;
|
2022-12-21 12:57:42 +01:00
|
|
|
p->decoded.want_response = false;
|
2021-11-21 14:43:47 -08:00
|
|
|
|
|
|
|
|
service.sendToMesh(p);
|
2022-12-21 17:56:34 +01:00
|
|
|
}
|
2021-11-28 19:41:34 -08:00
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Sends a store-and-forward message to the specified destination node.
|
2023-07-26 17:08:04 -07:00
|
|
|
*
|
2023-07-26 16:34:36 -07:00
|
|
|
* @param dest The destination node number.
|
|
|
|
|
* @param rr The store-and-forward request/response message to send.
|
|
|
|
|
*/
|
2023-01-21 18:22:19 +01:00
|
|
|
void StoreForwardModule::sendMessage(NodeNum dest, meshtastic_StoreAndForward_RequestResponse rr)
|
2022-12-21 17:56:34 +01:00
|
|
|
{
|
|
|
|
|
// Craft an empty response, save some bytes in flash
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_StoreAndForward sf = meshtastic_StoreAndForward_init_zero;
|
2022-12-21 17:56:34 +01:00
|
|
|
sf.rr = rr;
|
|
|
|
|
storeForwardModule->sendMessage(dest, sf);
|
2021-11-21 14:43:47 -08:00
|
|
|
}
|
|
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Sends statistics about the store and forward module to the specified node.
|
|
|
|
|
*
|
|
|
|
|
* @param to The node ID to send the statistics to.
|
|
|
|
|
*/
|
2022-12-21 12:57:42 +01:00
|
|
|
void StoreForwardModule::statsSend(uint32_t to)
|
|
|
|
|
{
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_StoreAndForward sf = meshtastic_StoreAndForward_init_zero;
|
2022-12-21 12:57:42 +01:00
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
sf.rr = meshtastic_StoreAndForward_RequestResponse_ROUTER_STATS;
|
|
|
|
|
sf.which_variant = meshtastic_StoreAndForward_stats_tag;
|
2022-12-21 12:57:42 +01:00
|
|
|
sf.variant.stats.messages_total = this->packetHistoryMax;
|
|
|
|
|
sf.variant.stats.messages_saved = this->packetHistoryCurrent;
|
|
|
|
|
sf.variant.stats.messages_max = this->records;
|
|
|
|
|
sf.variant.stats.up_time = millis() / 1000;
|
|
|
|
|
sf.variant.stats.requests = this->requests;
|
|
|
|
|
sf.variant.stats.requests_history = this->requests_history;
|
|
|
|
|
sf.variant.stats.heartbeat = this->heartbeat;
|
|
|
|
|
sf.variant.stats.return_max = this->historyReturnMax;
|
|
|
|
|
sf.variant.stats.return_window = this->historyReturnWindow;
|
|
|
|
|
|
2022-12-29 20:41:37 -06:00
|
|
|
LOG_DEBUG("*** Sending S&F Stats\n");
|
2022-12-21 12:57:42 +01:00
|
|
|
storeForwardModule->sendMessage(to, sf);
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Handles a received mesh packet, potentially storing it for later forwarding.
|
|
|
|
|
*
|
|
|
|
|
* @param mp The received mesh packet.
|
|
|
|
|
* @return A `ProcessMessage` indicating whether the packet was successfully handled.
|
|
|
|
|
*/
|
2023-01-21 18:22:19 +01:00
|
|
|
ProcessMessage StoreForwardModule::handleReceived(const meshtastic_MeshPacket &mp)
|
2021-01-31 09:12:01 -08:00
|
|
|
{
|
2022-07-31 07:11:47 -05:00
|
|
|
#ifdef ARCH_ESP32
|
2022-05-22 13:27:56 +02:00
|
|
|
if (moduleConfig.store_forward.enabled) {
|
2021-01-31 09:12:01 -08:00
|
|
|
|
2022-12-06 16:56:38 +01:00
|
|
|
// The router node should not be sending messages as a client. Unless he is a ROUTER_CLIENT
|
2023-01-21 18:22:19 +01:00
|
|
|
if ((getFrom(&mp) != nodeDB.getNodeNum()) || (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT)) {
|
2021-11-22 17:47:42 -08:00
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
if ((mp.decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) && is_server) {
|
2023-01-05 17:50:35 +01:00
|
|
|
auto &p = mp.decoded;
|
|
|
|
|
if ((p.payload.bytes[0] == 'S') && (p.payload.bytes[1] == 'F') && (p.payload.bytes[2] == 0x00)) {
|
|
|
|
|
LOG_DEBUG("*** Legacy Request to send\n");
|
|
|
|
|
|
|
|
|
|
// Send the last 60 minutes of messages.
|
|
|
|
|
if (this->busy) {
|
2023-01-21 18:22:19 +01:00
|
|
|
storeForwardModule->sendMessage(getFrom(&mp), meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY);
|
2023-01-05 17:50:35 +01:00
|
|
|
LOG_INFO("*** S&F - Busy. Try again shortly.\n");
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_MeshPacket *pr = allocReply();
|
2023-01-05 17:50:35 +01:00
|
|
|
pr->to = getFrom(&mp);
|
2023-01-21 18:22:19 +01:00
|
|
|
pr->priority = meshtastic_MeshPacket_Priority_MIN;
|
2023-01-05 17:50:35 +01:00
|
|
|
pr->want_ack = false;
|
|
|
|
|
pr->decoded.want_response = false;
|
2023-01-21 18:22:19 +01:00
|
|
|
pr->decoded.portnum = meshtastic_PortNum_TEXT_MESSAGE_APP;
|
2023-01-16 17:56:48 +01:00
|
|
|
memcpy(pr->decoded.payload.bytes, "** S&F - Busy. Try again shortly.", 34);
|
|
|
|
|
pr->decoded.payload.size = 34;
|
2023-01-05 17:50:35 +01:00
|
|
|
service.sendToMesh(pr);
|
|
|
|
|
} else {
|
|
|
|
|
storeForwardModule->historySend(historyReturnWindow * 60000, getFrom(&mp));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
storeForwardModule->historyAdd(mp);
|
|
|
|
|
LOG_INFO("*** S&F stored. Message history contains %u records now.\n", this->packetHistoryCurrent);
|
|
|
|
|
}
|
2023-01-21 18:22:19 +01:00
|
|
|
} else if (mp.decoded.portnum == meshtastic_PortNum_STORE_FORWARD_APP) {
|
2022-01-24 18:39:17 +00:00
|
|
|
auto &p = mp.decoded;
|
2023-01-21 18:22:19 +01:00
|
|
|
meshtastic_StoreAndForward scratch;
|
|
|
|
|
meshtastic_StoreAndForward *decoded = NULL;
|
|
|
|
|
if (mp.which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
|
|
|
|
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_StoreAndForward_msg, &scratch)) {
|
2022-12-21 12:57:42 +01:00
|
|
|
decoded = &scratch;
|
2021-11-22 17:47:42 -08:00
|
|
|
} else {
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_ERROR("Error decoding protobuf module!\n");
|
2022-12-21 12:57:42 +01:00
|
|
|
// if we can't decode it, nobody can process it!
|
|
|
|
|
return ProcessMessage::STOP;
|
2021-11-22 17:47:42 -08:00
|
|
|
}
|
2022-12-21 12:57:42 +01:00
|
|
|
return handleReceivedProtobuf(mp, decoded) ? ProcessMessage::STOP : ProcessMessage::CONTINUE;
|
2021-11-18 09:35:05 -08:00
|
|
|
}
|
2022-12-21 12:57:42 +01:00
|
|
|
} // all others are irrelevant
|
2021-02-14 20:13:52 -08:00
|
|
|
}
|
|
|
|
|
}
|
2021-01-31 09:12:01 -08:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-09-23 04:42:09 +03:00
|
|
|
return ProcessMessage::CONTINUE; // Let others look at this message also if they want
|
2021-01-31 09:12:01 -08:00
|
|
|
}
|
2021-03-17 21:03:11 -07:00
|
|
|
|
2023-07-26 16:34:36 -07:00
|
|
|
/**
|
|
|
|
|
* Handles a received protobuf message for the Store and Forward module.
|
2023-07-26 17:08:04 -07:00
|
|
|
*
|
2023-07-26 16:34:36 -07:00
|
|
|
* @param mp The received MeshPacket to handle.
|
|
|
|
|
* @param p A pointer to the StoreAndForward object.
|
|
|
|
|
* @return True if the message was successfully handled, false otherwise.
|
|
|
|
|
*/
|
2023-01-21 18:22:19 +01:00
|
|
|
bool StoreForwardModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_StoreAndForward *p)
|
2021-12-02 17:27:38 -08:00
|
|
|
{
|
2022-05-22 13:27:56 +02:00
|
|
|
if (!moduleConfig.store_forward.enabled) {
|
2022-02-27 00:29:05 -08:00
|
|
|
// If this module is not enabled in any capacity, don't handle the packet, and allow other modules to consume
|
2022-12-06 16:56:38 +01:00
|
|
|
return false;
|
2021-12-02 17:27:38 -08:00
|
|
|
}
|
|
|
|
|
|
2022-12-21 12:57:42 +01:00
|
|
|
requests++;
|
2021-12-02 17:27:38 -08:00
|
|
|
|
|
|
|
|
switch (p->rr) {
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_CLIENT_ERROR:
|
|
|
|
|
case meshtastic_StoreAndForward_RequestResponse_CLIENT_ABORT:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_server) {
|
|
|
|
|
// stop sending stuff, the client wants to abort or has another error
|
|
|
|
|
if ((this->busy) && (this->busyTo == getFrom(&mp))) {
|
|
|
|
|
LOG_ERROR("*** Client in ERROR or ABORT requested\n");
|
|
|
|
|
this->packetHistoryTXQueue_index = 0;
|
|
|
|
|
this->busy = false;
|
2022-12-06 16:56:38 +01:00
|
|
|
}
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_CLIENT_HISTORY:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_server) {
|
|
|
|
|
requests_history++;
|
|
|
|
|
LOG_INFO("*** Client Request to send HISTORY\n");
|
|
|
|
|
// Send the last 60 minutes of messages.
|
|
|
|
|
if (this->busy) {
|
2023-01-21 18:22:19 +01:00
|
|
|
storeForwardModule->sendMessage(getFrom(&mp), meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY);
|
2023-01-18 14:51:48 -06:00
|
|
|
LOG_INFO("*** S&F - Busy. Try again shortly.\n");
|
|
|
|
|
} else {
|
2023-01-21 18:22:19 +01:00
|
|
|
if ((p->which_variant == meshtastic_StoreAndForward_history_tag) && (p->variant.history.window > 0)) {
|
2024-02-14 14:07:20 +01:00
|
|
|
// window is in minutes
|
2024-02-18 21:27:44 +01:00
|
|
|
storeForwardModule->historySend(p->variant.history.window * 60000, getFrom(&mp));
|
2022-12-06 16:56:38 +01:00
|
|
|
} else {
|
2023-01-18 14:51:48 -06:00
|
|
|
storeForwardModule->historySend(historyReturnWindow * 60000, getFrom(&mp)); // defaults to 4 hours
|
2022-12-06 16:56:38 +01:00
|
|
|
}
|
|
|
|
|
}
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
2021-12-02 17:27:38 -08:00
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_CLIENT_PING:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_server) {
|
|
|
|
|
LOG_INFO("*** StoreAndForward_RequestResponse_CLIENT_PING\n");
|
|
|
|
|
// respond with a ROUTER PONG
|
2023-01-21 18:22:19 +01:00
|
|
|
storeForwardModule->sendMessage(getFrom(&mp), meshtastic_StoreAndForward_RequestResponse_ROUTER_PONG);
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
2021-12-04 19:29:42 -08:00
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_CLIENT_PONG:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_server) {
|
|
|
|
|
LOG_INFO("*** StoreAndForward_RequestResponse_CLIENT_PONG\n");
|
2024-02-14 14:07:20 +01:00
|
|
|
// NodeDB is already updated
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_CLIENT_STATS:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_server) {
|
|
|
|
|
LOG_INFO("*** Client Request to send STATS\n");
|
|
|
|
|
if (this->busy) {
|
2023-01-21 18:22:19 +01:00
|
|
|
storeForwardModule->sendMessage(getFrom(&mp), meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY);
|
2023-01-18 14:51:48 -06:00
|
|
|
LOG_INFO("*** S&F - Busy. Try again shortly.\n");
|
|
|
|
|
} else {
|
|
|
|
|
storeForwardModule->statsSend(getFrom(&mp));
|
2022-12-06 16:56:38 +01:00
|
|
|
}
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_ROUTER_ERROR:
|
|
|
|
|
case meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_client) {
|
|
|
|
|
LOG_DEBUG("*** StoreAndForward_RequestResponse_ROUTER_BUSY\n");
|
|
|
|
|
// retry in messages_saved * packetTimeMax ms
|
2023-01-21 18:39:58 +01:00
|
|
|
retry_delay = millis() + packetHistoryCurrent * packetTimeMax *
|
|
|
|
|
(meshtastic_StoreAndForward_RequestResponse_ROUTER_ERROR ? 2 : 1);
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_ROUTER_PONG:
|
2023-01-18 14:51:48 -06:00
|
|
|
// A router responded, this is equal to receiving a heartbeat
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_ROUTER_HEARTBEAT:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_client) {
|
|
|
|
|
// register heartbeat and interval
|
2023-01-21 18:22:19 +01:00
|
|
|
if (p->which_variant == meshtastic_StoreAndForward_heartbeat_tag) {
|
2023-01-18 14:51:48 -06:00
|
|
|
heartbeatInterval = p->variant.heartbeat.period;
|
2022-12-06 16:56:38 +01:00
|
|
|
}
|
2023-01-18 14:51:48 -06:00
|
|
|
lastHeartbeat = millis();
|
|
|
|
|
LOG_INFO("*** StoreAndForward Heartbeat received\n");
|
|
|
|
|
}
|
|
|
|
|
break;
|
2022-12-06 16:56:38 +01:00
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_ROUTER_PING:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_client) {
|
|
|
|
|
LOG_DEBUG("*** StoreAndForward_RequestResponse_ROUTER_PING\n");
|
|
|
|
|
// respond with a CLIENT PONG
|
2023-01-21 18:22:19 +01:00
|
|
|
storeForwardModule->sendMessage(getFrom(&mp), meshtastic_StoreAndForward_RequestResponse_CLIENT_PONG);
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_ROUTER_STATS:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_client) {
|
|
|
|
|
LOG_DEBUG("*** Router Response STATS\n");
|
|
|
|
|
// These fields only have informational purpose on a client. Fill them to consume later.
|
2023-01-21 18:22:19 +01:00
|
|
|
if (p->which_variant == meshtastic_StoreAndForward_stats_tag) {
|
2023-01-18 14:51:48 -06:00
|
|
|
this->packetHistoryMax = p->variant.stats.messages_total;
|
|
|
|
|
this->packetHistoryCurrent = p->variant.stats.messages_saved;
|
|
|
|
|
this->records = p->variant.stats.messages_max;
|
|
|
|
|
this->requests = p->variant.stats.requests;
|
|
|
|
|
this->requests_history = p->variant.stats.requests_history;
|
|
|
|
|
this->heartbeat = p->variant.stats.heartbeat;
|
|
|
|
|
this->historyReturnMax = p->variant.stats.return_max;
|
|
|
|
|
this->historyReturnWindow = p->variant.stats.return_window;
|
2022-12-21 15:22:38 +01:00
|
|
|
}
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2023-01-21 18:22:19 +01:00
|
|
|
case meshtastic_StoreAndForward_RequestResponse_ROUTER_HISTORY:
|
2023-01-18 14:51:48 -06:00
|
|
|
if (is_client) {
|
|
|
|
|
// These fields only have informational purpose on a client. Fill them to consume later.
|
2023-01-21 18:22:19 +01:00
|
|
|
if (p->which_variant == meshtastic_StoreAndForward_history_tag) {
|
2023-01-18 14:51:48 -06:00
|
|
|
this->historyReturnWindow = p->variant.history.window / 60000;
|
|
|
|
|
LOG_INFO("*** Router Response HISTORY - Sending %d messages from last %d minutes\n",
|
|
|
|
|
p->variant.history.history_messages, this->historyReturnWindow);
|
2022-12-21 17:56:34 +01:00
|
|
|
}
|
2023-01-18 14:51:48 -06:00
|
|
|
}
|
|
|
|
|
break;
|
2022-12-21 17:56:34 +01:00
|
|
|
|
2023-01-18 14:51:48 -06:00
|
|
|
default:
|
|
|
|
|
assert(0); // unexpected state
|
2021-12-02 17:27:38 -08:00
|
|
|
}
|
2022-12-06 16:56:38 +01:00
|
|
|
return true; // There's no need for others to look at this message.
|
2021-12-02 17:27:38 -08:00
|
|
|
}
|
|
|
|
|
|
2022-02-27 02:21:02 -08:00
|
|
|
StoreForwardModule::StoreForwardModule()
|
2023-01-21 18:39:58 +01:00
|
|
|
: concurrency::OSThread("StoreForwardModule"),
|
|
|
|
|
ProtobufModule("StoreForward", meshtastic_PortNum_STORE_FORWARD_APP, &meshtastic_StoreAndForward_msg)
|
2021-03-17 21:03:11 -07:00
|
|
|
{
|
|
|
|
|
|
2022-07-31 07:11:47 -05:00
|
|
|
#ifdef ARCH_ESP32
|
2021-03-17 21:03:11 -07:00
|
|
|
|
2021-03-25 19:22:46 -07:00
|
|
|
isPromiscuous = true; // Brown chicken brown cow
|
|
|
|
|
|
2021-03-25 19:24:36 -07:00
|
|
|
if (StoreForward_Dev) {
|
2021-11-18 09:35:05 -08:00
|
|
|
/*
|
2022-02-27 02:21:02 -08:00
|
|
|
Uncomment the preferences below if you want to use the module
|
2021-11-18 09:35:05 -08:00
|
|
|
without having to configure it from the PythonAPI or WebUI.
|
|
|
|
|
*/
|
|
|
|
|
|
2022-05-22 13:27:56 +02:00
|
|
|
moduleConfig.store_forward.enabled = 1;
|
2021-03-25 19:24:36 -07:00
|
|
|
}
|
2021-03-17 21:03:11 -07:00
|
|
|
|
2022-05-22 13:27:56 +02:00
|
|
|
if (moduleConfig.store_forward.enabled) {
|
2021-03-19 23:43:06 -07:00
|
|
|
|
|
|
|
|
// Router
|
2023-01-21 18:22:19 +01:00
|
|
|
if ((config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER) ||
|
|
|
|
|
(config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT)) {
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** Initializing Store & Forward Module in Router mode\n");
|
2023-02-17 12:31:51 +01:00
|
|
|
if (memGet.getPsramSize() > 0) {
|
|
|
|
|
if (memGet.getFreePsram() >= 1024 * 1024) {
|
2021-03-19 23:43:06 -07:00
|
|
|
|
2021-03-17 21:03:11 -07:00
|
|
|
// Do the startup here
|
|
|
|
|
|
2021-12-03 22:20:15 -08:00
|
|
|
// Maximum number of records to return.
|
2022-05-22 13:27:56 +02:00
|
|
|
if (moduleConfig.store_forward.history_return_max)
|
|
|
|
|
this->historyReturnMax = moduleConfig.store_forward.history_return_max;
|
2021-12-03 22:20:15 -08:00
|
|
|
|
|
|
|
|
// Maximum time window for records to return (in minutes)
|
2022-05-22 13:27:56 +02:00
|
|
|
if (moduleConfig.store_forward.history_return_window)
|
|
|
|
|
this->historyReturnWindow = moduleConfig.store_forward.history_return_window;
|
2021-12-03 22:20:15 -08:00
|
|
|
|
|
|
|
|
// Maximum number of records to store in memory
|
2022-05-22 13:27:56 +02:00
|
|
|
if (moduleConfig.store_forward.records)
|
|
|
|
|
this->records = moduleConfig.store_forward.records;
|
2021-12-03 22:20:15 -08:00
|
|
|
|
2022-12-06 16:56:38 +01:00
|
|
|
// send heartbeat advertising?
|
2022-05-22 13:27:56 +02:00
|
|
|
if (moduleConfig.store_forward.heartbeat)
|
|
|
|
|
this->heartbeat = moduleConfig.store_forward.heartbeat;
|
2021-12-03 22:20:15 -08:00
|
|
|
|
2021-11-21 14:43:47 -08:00
|
|
|
// Popupate PSRAM with our data structures.
|
2021-03-17 21:03:11 -07:00
|
|
|
this->populatePSRAM();
|
2022-12-06 16:56:38 +01:00
|
|
|
is_server = true;
|
2021-03-17 21:03:11 -07:00
|
|
|
} else {
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** Device has less than 1M of PSRAM free.\n");
|
|
|
|
|
LOG_INFO("*** Store & Forward Module - disabling server.\n");
|
2021-03-17 21:03:11 -07:00
|
|
|
}
|
|
|
|
|
} else {
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** Device doesn't have PSRAM.\n");
|
|
|
|
|
LOG_INFO("*** Store & Forward Module - disabling server.\n");
|
2021-03-17 21:03:11 -07:00
|
|
|
}
|
|
|
|
|
|
2021-03-21 19:45:35 -07:00
|
|
|
// Client
|
2024-02-14 14:07:20 +01:00
|
|
|
} else {
|
2022-12-06 16:56:38 +01:00
|
|
|
is_client = true;
|
2022-12-30 10:27:07 -06:00
|
|
|
LOG_INFO("*** Initializing Store & Forward Module in Client mode\n");
|
2021-03-17 21:03:11 -07:00
|
|
|
}
|
2022-12-29 15:45:49 +01:00
|
|
|
} else {
|
2022-12-29 16:26:25 -06:00
|
|
|
disable();
|
2021-03-17 21:03:11 -07:00
|
|
|
}
|
|
|
|
|
#endif
|
2023-07-26 17:08:04 -07:00
|
|
|
}
|