differentiate receiving and publishing mqtt for the new json option in user_config.h
#318 so as to avoid user with non modified controllers to have regression on receiving (per default receiving is activated for both json and simple and prioritary analysed for json)
This commit is contained in:
1 parent
c7fe43eb97
commit
68352f10e6
9 files changed
+18
-16
No files matched your search
+2
-2
@@ -878,7 +878,7 @@ void receivingMQTT(char * topicOri, char * datacallback) {
|
||||
#ifdef ZgatewayPilight // ZgatewayPilight is only defined with json publishing
|
||||
MQTTtoPilight(topicOri, jsondata);
|
||||
#endif
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
#ifdef ZgatewayRF
|
||||
MQTTtoRF(topicOri, jsondata);
|
||||
#endif
|
||||
@@ -905,7 +905,7 @@ void receivingMQTT(char * topicOri, char * datacallback) {
|
||||
MQTTtoONOFF(topicOri, jsondata);
|
||||
#endif
|
||||
} else { // not a json object --> simple decoding
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
#ifdef ZgatewayRF
|
||||
MQTTtoRF(topicOri, datacallback);
|
||||
#endif
|
||||
|
||||
@@ -122,11 +122,13 @@ const byte subnet[] = { 255, 255, 255, 0 }; //ip adress
|
||||
|
||||
#define jsonPublishing true //comment if you don't want to use Json publishing (one topic for all the parameters)
|
||||
//example home/OpenMQTTGateway_ESP32_DEVKIT/BTtoMQTT/4XXXXXXXXXX4 {"rssi":-63,"servicedata":"fe0000000000000000000000000000000000000000"}
|
||||
#define jsonReceiving true //comment if you don't want to use Json reception analysis
|
||||
|
||||
//#define simplePublishing true //comment if you don't want to use simple publishing (one topic for one parameter)
|
||||
//example
|
||||
// home/OpenMQTTGateway_ESP32_DEVKIT/BTtoMQTT/4XXXXXXXXXX4/rssi -63.0
|
||||
// home/OpenMQTTGateway_ESP32_DEVKIT/BTtoMQTT/4XXXXXXXXXX4/servicedata fe0000000000000000000000000000000000000000
|
||||
#define simpleReceiving true //comment if you don't want to use old way reception analysis
|
||||
|
||||
/*-------------DEFINE YOUR OTA PARAMETERS BELOW----------------*/
|
||||
#define ota_hostname Gateway_Name
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ boolean _2GtoMQTT(){
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
void MQTTto2G(char * topicOri, char * datacallback) {
|
||||
|
||||
String data = datacallback;
|
||||
@@ -132,7 +132,7 @@ boolean _2GtoMQTT(){
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
void MQTTto2G(char * topicOri, JsonObject& SMSdata) {
|
||||
|
||||
if (strcmp(topicOri,subjectMQTTto2G) == 0){
|
||||
|
||||
+2
-2
@@ -154,7 +154,7 @@ void IRtoMQTT(){
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
void MQTTtoIR(char * topicOri, char * datacallback) {
|
||||
|
||||
// IR DATA ANALYSIS
|
||||
@@ -477,7 +477,7 @@ void IRtoMQTT(){
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
void MQTTtoIR(char * topicOri, JsonObject& IRdata) {
|
||||
|
||||
if (strcmp(topicOri,subjectMQTTtoIR) == 0){
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@ void RFtoMQTTdiscovery(unsigned long MQTTvalue){//on the fly switch creation fro
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
void MQTTtoRF(char * topicOri, char * datacallback) {
|
||||
|
||||
unsigned long data = strtoul(datacallback, NULL, 10); // we will not be able to pass values > 4294967295
|
||||
@@ -153,7 +153,7 @@ void MQTTtoRF(char * topicOri, char * datacallback) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
void MQTTtoRF(char * topicOri, JsonObject& RFdata) { // json object decoding
|
||||
|
||||
if (strcmp(topicOri,subjectMQTTtoRF) == 0){
|
||||
|
||||
+2
-2
@@ -100,7 +100,7 @@ void rf2Callback(unsigned int period, unsigned long address, unsigned long group
|
||||
|
||||
}
|
||||
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
void MQTTtoRF2(char * topicOri, char * datacallback) {
|
||||
|
||||
// RF DATA ANALYSIS
|
||||
@@ -214,7 +214,7 @@ void rf2Callback(unsigned int period, unsigned long address, unsigned long group
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
void MQTTtoRF2(char * topicOri, JsonObject& RF2data) { // json object decoding
|
||||
|
||||
if (strcmp(topicOri,subjectMQTTtoRF2) == 0){
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ boolean RF315toMQTT(){
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
void MQTTtoRF315(char * topicOri, char * datacallback) {
|
||||
|
||||
unsigned long data = strtoul(datacallback, NULL, 10); // we will not be able to pass values > 4294967295
|
||||
@@ -133,7 +133,7 @@ boolean RF315toMQTT(){
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
void MQTTtoRF315(char * topicOri, JsonObject& RF315data) { // json object decoding
|
||||
|
||||
if (strcmp(topicOri,subjectMQTTtoRF315) == 0){
|
||||
|
||||
+2
-2
@@ -179,7 +179,7 @@ boolean RFM69toMQTT(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
void MQTTtoRFM69(char * topicOri, char * datacallback) {
|
||||
int loops;
|
||||
uint32_t startMillis;
|
||||
@@ -228,7 +228,7 @@ boolean RFM69toMQTT(void) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
void MQTTtoRFM69(char * topicOri, JsonObject& RFM69data) {
|
||||
|
||||
if (strcmp(topicOri,subjectMQTTtoRFM69) == 0){
|
||||
|
||||
+2
-2
@@ -169,7 +169,7 @@ bool _rfbToChar(byte * in, char * out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef simplePublishing
|
||||
#ifdef simpleReceiving
|
||||
void MQTTtoSRFB(char * topicOri, char * datacallback) {
|
||||
|
||||
// RF DATA ANALYSIS
|
||||
@@ -268,7 +268,7 @@ bool _rfbToChar(byte * in, char * out) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef jsonPublishing
|
||||
#ifdef jsonReceiving
|
||||
void MQTTtoSRFB(char * topicOri, JsonObject& SRFBdata) {
|
||||
|
||||
// RF DATA ANALYSIS
|
||||
|
||||
Reference in new issue
Block a user