Update to Serial Plugin to make it easy to override the device configuration

This commit is contained in:
Jm 2021-01-17 15:40:25 -08:00
parent 8704a9d08f
commit fa8cc74141

View File

@ -66,6 +66,17 @@ char serialStringChar[Constants_DATA_PAYLOAD_LEN];
int32_t SerialPlugin::runOnce() int32_t SerialPlugin::runOnce()
{ {
#ifndef NO_ESP32 #ifndef NO_ESP32
/*
Uncomment the preferences below if you want to use the plugin
without having to configure it from the PythonAPI or WebUI.
*/
// radioConfig.preferences.serialplugin_enabled = 1;
// radioConfig.preferences.serialplugin_rxd = 35;
// radioConfig.preferences.serialplugin_txd = 15;
// radioConfig.preferences.serialplugin_timeout = 1000;
if (radioConfig.preferences.serialplugin_enabled) { if (radioConfig.preferences.serialplugin_enabled) {
if (firstTime) { if (firstTime) {
@ -147,8 +158,8 @@ bool SerialPluginRadio::handleReceived(const MeshPacket &mp)
if (radioConfig.preferences.serialplugin_enabled) { if (radioConfig.preferences.serialplugin_enabled) {
auto &p = mp.decoded.data; auto &p = mp.decoded.data;
// DEBUG_MSG("Received text msg self=0x%0x, from=0x%0x, to=0x%0x, id=%d, msg=%.*s\n", nodeDB.getNodeNum(), // DEBUG_MSG("Received text msg self=0x%0x, from=0x%0x, to=0x%0x, id=%d, msg=%.*s\n",
// mp.from, mp.to, mp.id, p.payload.size, p.payload.bytes); // nodeDB.getNodeNum(), mp.from, mp.to, mp.id, p.payload.size, p.payload.bytes);
if (mp.from == nodeDB.getNodeNum()) { if (mp.from == nodeDB.getNodeNum()) {