From e2641f49e7bd8c9c15e469083329ad253a53af76 Mon Sep 17 00:00:00 2001 From: peshovec Date: Thu, 7 Nov 2024 15:55:30 +0200 Subject: [PATCH] [RF] Disable the active RF receive when transmitting with RC-Switch and NewRemoteTransmitter\n (#2084) Pilight RF transmit is behaving this way already. --- main/ZgatewayRF.ino | 2 +- main/ZgatewayRF2.ino | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/ZgatewayRF.ino b/main/ZgatewayRF.ino index 24901c4e26..7df172d27b 100644 --- a/main/ZgatewayRF.ino +++ b/main/ZgatewayRF.ino @@ -238,8 +238,8 @@ void XtoRF(const char* topicOri, JsonObject& RFdata) { // json object decoding Log.notice(F("RF Protocol:%d" CR), valuePRT); Log.notice(F("RF Pulse Lgth: %d" CR), valuePLSL); Log.notice(F("Bits nb: %d" CR), valueBITS); -# ifdef ZradioCC1101 disableCurrentReceiver(); +# ifdef ZradioCC1101 initCC1101(); int txPower = RFdata["txpower"] | RF_CC1101_TXPOWER; ELECHOUSE_cc1101.setPA((int)txPower); diff --git a/main/ZgatewayRF2.ino b/main/ZgatewayRF2.ino index 8f4ebb9393..35c8f4b5c2 100644 --- a/main/ZgatewayRF2.ino +++ b/main/ZgatewayRF2.ino @@ -133,7 +133,7 @@ void rf2Callback(unsigned int period, unsigned long address, unsigned long group # if simpleReceiving void XtoRF2(const char* topicOri, const char* datacallback) { - NewRemoteReceiver::disable(); + disableCurrentReceiver(); pinMode(RF_EMITTER_GPIO, OUTPUT); initCC1101(); @@ -235,8 +235,8 @@ void XtoRF2(const char* topicOri, const char* datacallback) { } # ifdef ZradioCC1101 ELECHOUSE_cc1101.SetRx(RFConfig.frequency); // set Receive on - NewRemoteReceiver::enable(); # endif + enableActiveReceiver(); } # endif @@ -266,7 +266,7 @@ void XtoRF2(const char* topicOri, JsonObject& RF2data) { // json object decoding valueUNIT = 0; if (valuePERIOD == 0) valuePERIOD = 272; - NewRemoteReceiver::disable(); + disableCurrentReceiver(); NewRemoteTransmitter transmitter(valueCODE, RF_EMITTER_GPIO, valuePERIOD, RF2_EMITTER_REPEAT); Log.trace(F("Sending" CR)); if (valueGROUP) { @@ -283,7 +283,7 @@ void XtoRF2(const char* topicOri, JsonObject& RF2data) { // json object decoding } } Log.notice(F("MQTTtoRF2 OK" CR)); - NewRemoteReceiver::enable(); + enableActiveReceiver(); success = true; }