Merge remote-tracking branch 'root/master' into dev1.2

# Conflicts:
#	proto
This commit is contained in:
Kevin Hester
2021-03-23 12:17:46 +08:00
11 changed files with 129 additions and 37 deletions

View File

@@ -186,9 +186,19 @@ bool SerialPluginRadio::handleReceived(const MeshPacket &mp)
}
} else {
// DEBUG_MSG("* * Message came from the mesh\n");
// Serial2.println("* * Message came from the mesh");
Serial2.printf("%s", p.payload.bytes);
if (radioConfig.preferences.serialplugin_mode == 0 || radioConfig.preferences.serialplugin_mode == 1) {
// DEBUG_MSG("* * Message came from the mesh\n");
// Serial2.println("* * Message came from the mesh");
Serial2.printf("%s", p.payload.bytes);
} else if (radioConfig.preferences.serialplugin_mode == 10) {
/*
@jobionekabnoi
Add code here to handle what gets sent out to the serial interface.
Format it the way you want.
*/
}
}
} else {

View File

@@ -35,9 +35,9 @@ int32_t RangeTestPlugin::runOnce()
without having to configure it from the PythonAPI or WebUI.
*/
//radioConfig.preferences.range_test_plugin_enabled = 1;
//radioConfig.preferences.range_test_plugin_sender = 45;
//radioConfig.preferences.range_test_plugin_save = 1;
// radioConfig.preferences.range_test_plugin_enabled = 1;
// radioConfig.preferences.range_test_plugin_sender = 45;
// radioConfig.preferences.range_test_plugin_save = 1;
// Fixed position is useful when testing indoors.
// radioConfig.preferences.fixed_position = 1;
@@ -112,7 +112,7 @@ void RangeTestPluginRadio::sendPayload(NodeNum dest, bool wantReplies)
packetSequence++;
static char heartbeatString[20];
snprintf(heartbeatString, sizeof(heartbeatString), "seq %d", packetSequence);
snprintf(heartbeatString, sizeof(heartbeatString), "seq %u", packetSequence);
p->decoded.payload.size = strlen(heartbeatString); // You must specify how many bytes are in the reply
memcpy(p->decoded.payload.bytes, heartbeatString, p->decoded.payload.size);
@@ -290,7 +290,7 @@ bool RangeTestPluginRadio::appendFile(const MeshPacket &mp)
fileToAppend.printf("??:??:??,"); // Time
}
fileToAppend.printf("%d,", getFrom(&mp)); // From
fileToAppend.printf("%d,", getFrom(&mp)); // From
fileToAppend.printf("%s,", n->user.long_name); // Long Name
fileToAppend.printf("%f,", n->position.latitude_i * 1e-7); // Sender Lat
fileToAppend.printf("%f,", n->position.longitude_i * 1e-7); // Sender Long

View File

@@ -231,6 +231,10 @@ bool StoreForwardPlugin::handleReceived(const MeshPacket &mp)
DEBUG_MSG("Packet came from - PortNum_POSITION_APP\n");
} else if (mp.decoded.portnum == PortNum_NODEINFO_APP) {
DEBUG_MSG("Packet came from - PortNum_NODEINFO_APP\n");
} else if (mp.decoded.portnum == PortNum_ROUTING_APP) {
DEBUG_MSG("Packet came from - PortNum_ROUTING_APP\n");
} else if (mp.decoded.portnum == PortNum_ADMIN_APP) {
DEBUG_MSG("Packet came from - PortNum_ADMIN_APP\n");
} else if (mp.decoded.portnum == PortNum_REPLY_APP) {
DEBUG_MSG("Packet came from - PortNum_REPLY_APP\n");
} else if (mp.decoded.portnum == PortNum_IP_TUNNEL_APP) {
@@ -276,40 +280,34 @@ StoreForwardPlugin::StoreForwardPlugin()
Uncomment the preferences below if you want to use the plugin
without having to configure it from the PythonAPI or WebUI.
*/
radioConfig.preferences.store_forward_plugin_enabled = 1;
radioConfig.preferences.is_router = 1;
*/
if (radioConfig.preferences.store_forward_plugin_enabled) {
// Router
if (radioConfig.preferences.is_router) {
DEBUG_MSG("Initializing Store & Forward Plugin - Enabled as Router\n");
// Router
if (ESP.getPsramSize()) {
if (ESP.getFreePsram() >= 2048 * 1024) {
if (ESP.getFreePsram() >= 1024 * 1024) {
// Do the startup here
this->populatePSRAM();
// packetHistory[0].bytes;
// return (10 * 1000);
} else {
DEBUG_MSG("Device has less than 2M of PSRAM free. Aborting startup.\n");
DEBUG_MSG("Device has less than 1M of PSRAM free. Aborting startup.\n");
DEBUG_MSG("Store & Forward Plugin - Aborting Startup.\n");
// return (INT32_MAX);
}
} else {
DEBUG_MSG("Device doesn't have PSRAM.\n");
DEBUG_MSG("Store & Forward Plugin - Aborting Startup.\n");
// return (INT32_MAX);
}
// Client
} else {
DEBUG_MSG("Initializing Store & Forward Plugin - Enabled as Client\n");
// return (5 * 1000);
}
}
#endif