[SERIAL] Enable SERIAL to X communication (#2068)

Add Serial as a communication layer so as to transmit data to/from serial
Enable discovery of BT sensors through serial
Add serial heartbeat

Change discovery principle for interval and intervalacts, keep them always discovered and deactivate adaptivescan when changed. Instead of removing their discovery when adaptive scan is activated

Increase JSON_MSG_BUFFER_MAX as we are now using const char* and it requires more memory for Arduino Json Deserialization

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2024-09-26 06:55:26 -05:00
1 parent a89ff43900
commit 3187ed6154
52 files changed
+588 -459

No files matched your search

+5 -4
View File
@@ -134,7 +134,7 @@ void setupRFM69(void) {
}
}
bool RFM69toMQTT(void) {
bool RFM69toX(void) {
//check if something was received (could be an interrupt from the radio)
if (radio.receiveDone()) {
StaticJsonDocument<JSON_MSG_BUFFER> RFM69dataBuffer;
@@ -162,7 +162,8 @@ bool RFM69toMQTT(void) {
RFM69data["data"] = (char*)data;
RFM69data["rssi"] = (int)radio.RSSI;
RFM69data["senderid"] = (int)radio.SENDERID;
pub(buff, RFM69data);
RFM69data["origin"] = buff;
enqueueJsonObject(RFM69data);
return true;
} else {
@@ -171,7 +172,7 @@ bool RFM69toMQTT(void) {
}
# if simpleReceiving
void MQTTtoRFM69(char* topicOri, char* datacallback) {
void XtoRFM69(const char* topicOri, const char* datacallback) {
if (cmpToMainTopic(topicOri, subjectMQTTtoRFM69)) {
Log.trace(F("MQTTtoRFM69 data analysis" CR));
char data[RF69_MAX_DATA_LEN + 1];
@@ -200,7 +201,7 @@ void MQTTtoRFM69(char* topicOri, char* datacallback) {
}
# endif
# if jsonReceiving
void MQTTtoRFM69(char* topicOri, JsonObject& RFM69data) {
void XtoRFM69(const char* topicOri, JsonObject& RFM69data) {
if (cmpToMainTopic(topicOri, subjectMQTTtoRFM69)) {
const char* data = RFM69data["data"];
Log.trace(F("MQTTtoRFM69 json data analysis" CR));