Add "repeat" field to RF JSON messages. (#372)
This commit is contained in:
1 parent
498bea872e
commit
f0d9a1e58e
2 files changed
+4
-1
No files matched your search
@@ -162,10 +162,13 @@ void MQTTtoRF(char * topicOri, char * datacallback) {
|
|||||||
int valuePRT = RFdata["protocol"]|1;
|
int valuePRT = RFdata["protocol"]|1;
|
||||||
int valuePLSL = RFdata["delay"]|350;
|
int valuePLSL = RFdata["delay"]|350;
|
||||||
int valueBITS = RFdata["length"]|24;
|
int valueBITS = RFdata["length"]|24;
|
||||||
|
int valueRPT = RFdata["repeat"]|RF_EMITTER_REPEAT;
|
||||||
|
mySwitch.setRepeatTransmit(valueRPT);
|
||||||
mySwitch.setProtocol(valuePRT,valuePLSL);
|
mySwitch.setProtocol(valuePRT,valuePLSL);
|
||||||
mySwitch.send(data, valueBITS);
|
mySwitch.send(data, valueBITS);
|
||||||
trc(F("MQTTtoRF OK"));
|
trc(F("MQTTtoRF OK"));
|
||||||
pub(subjectGTWRFtoMQTT, RFdata);// 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
|
pub(subjectGTWRFtoMQTT, RFdata);// 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
|
||||||
|
mySwitch.setRepeatTransmit(RF_EMITTER_REPEAT); // Restore the default value
|
||||||
}else{
|
}else{
|
||||||
trc(F("MQTTtoRF Fail json"));
|
trc(F("MQTTtoRF Fail json"));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ RF supported protocols
|
|||||||
#define RFpulselengthKey "PLSL_" // pulselength will be defined if a subject contains RFprotocolKey followed by a value of 3 digits
|
#define RFpulselengthKey "PLSL_" // pulselength will be defined if a subject contains RFprotocolKey followed by a value of 3 digits
|
||||||
// subject monitored to listen traffic processed by other gateways to store data and avoid ntuple
|
// subject monitored to listen traffic processed by other gateways to store data and avoid ntuple
|
||||||
#define subjectMultiGTWRF "+/+/433toMQTT"
|
#define subjectMultiGTWRF "+/+/433toMQTT"
|
||||||
//RF number of signal repetition
|
//RF number of signal repetition - Can be overridden by specifying "repeat" in a JSON message.
|
||||||
#define RF_EMITTER_REPEAT 20
|
#define RF_EMITTER_REPEAT 20
|
||||||
|
|
||||||
/*-------------------RF2 topics & parameters----------------------*/
|
/*-------------------RF2 topics & parameters----------------------*/
|
||||||
|
|||||||
Reference in new issue
Block a user