[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:
1 parent
a89ff43900
commit
3187ed6154
52 files changed
+588
-459
No files matched your search
@@ -67,7 +67,7 @@ void _rfbSend(byte* message, int times) {
|
||||
}
|
||||
}
|
||||
|
||||
bool SRFBtoMQTT() {
|
||||
bool SRFBtoX() {
|
||||
static bool receiving = false;
|
||||
|
||||
while (Serial.available()) {
|
||||
@@ -145,7 +145,7 @@ void _rfbAck() {
|
||||
}
|
||||
|
||||
# if simpleReceiving
|
||||
void MQTTtoSRFB(char* topicOri, char* datacallback) {
|
||||
void XtoSRFB(const char* topicOri, const char* datacallback) {
|
||||
// RF DATA ANALYSIS
|
||||
String topic = topicOri;
|
||||
int valueRPT = 0;
|
||||
@@ -241,7 +241,7 @@ void MQTTtoSRFB(char* topicOri, char* datacallback) {
|
||||
}
|
||||
# endif
|
||||
# if jsonReceiving
|
||||
void MQTTtoSRFB(char* topicOri, JsonObject& SRFBdata) {
|
||||
void XtoSRFB(const char* topicOri, JsonObject& SRFBdata) {
|
||||
// RF DATA ANALYSIS
|
||||
const char* raw = SRFBdata["raw"];
|
||||
int valueRPT = SRFBdata["repeat"] | 1;
|
||||
@@ -300,7 +300,8 @@ void MQTTtoSRFB(char* topicOri, JsonObject& SRFBdata) {
|
||||
|
||||
Log.notice(F("MQTTtoSRFB OK" CR));
|
||||
_rfbSend(message_b, valueRPT);
|
||||
pub(subjectGTWSRFBtoMQTT, SRFBdata); // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also
|
||||
SRFBdata["origin"] = subjectGTWSRFBtoMQTT;
|
||||
enqueueJsonObject(SRFBdata); // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also
|
||||
} else {
|
||||
Log.error(F("MQTTtoSRFB error decoding value" CR));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user