-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed startup crash on ESP8266 chipset - Changed default X10 RF transmitter pin from 4 to 6 - Updated to `espressif32` 6.7.0
- Loading branch information
Showing
43 changed files
with
400 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* HomeGenie-Mini (c) 2018-2024 G-Labs | ||
* | ||
* | ||
* This file is part of HomeGenie-Mini (HGM). | ||
* | ||
* HomeGenie-Mini is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* HomeGenie-Mini is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with HomeGenie-Mini. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Authors: | ||
* - Generoso Martello <[email protected]> | ||
* | ||
*/ | ||
|
||
#include "RFReceiver.h" | ||
|
||
namespace IO { namespace RCS { | ||
|
||
RFReceiver *receiverInstance = NULL; | ||
|
||
RFReceiver::RFReceiver() { | ||
receiverInstance = this; | ||
} | ||
|
||
RFReceiver::RFReceiver(RFReceiverConfig *configuration) : RFReceiver() { | ||
this->configuration = configuration; | ||
} | ||
|
||
|
||
////////////////////////////// | ||
/// Public | ||
////////////////////////////// | ||
|
||
void RFReceiver::begin() { | ||
Logger::info("| - %s (PIN=%d INT=%d)", RF_RFRECEIVER_NS_PREFIX, | ||
configuration->getPin(), | ||
configuration->getInterrupt()); | ||
|
||
//RF.setPulseLength(7000); | ||
//RF.setReceiveTolerance(100); | ||
|
||
RF.disableTransmit(); | ||
RF.enableReceive(configuration->getPin()); | ||
|
||
Logger::info("| ✔ %s", RF_RFRECEIVER_NS_PREFIX); | ||
} | ||
|
||
void RFReceiver::loop() { | ||
|
||
if (RF.available()) { // We have captured something. | ||
|
||
Serial.print("Received "); | ||
Serial.print(RF.getReceivedValue()); | ||
Serial.print(" / "); | ||
Serial.print(RF.getReceivedBitlength()); | ||
Serial.print("bit "); | ||
Serial.print("Protocol: "); | ||
Serial.println(RF.getReceivedProtocol()); | ||
|
||
|
||
// TODO: | ||
// TODO: | ||
// sendEvent((const uint8_t*)(IOEventPaths::Receiver_RawData), eventData, IOEventDataType::Undefined); | ||
// TODO: auto eventData = RF.getReceivedValue(); | ||
|
||
|
||
RF.resetAvailable(); | ||
|
||
} | ||
|
||
} | ||
|
||
}} // ns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* HomeGenie-Mini (c) 2018-2024 G-Labs | ||
* | ||
* | ||
* This file is part of HomeGenie-Mini (HGM). | ||
* | ||
* HomeGenie-Mini is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* HomeGenie-Mini is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with HomeGenie-Mini. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Authors: | ||
* - Generoso Martello <[email protected]> | ||
* | ||
*/ | ||
|
||
#ifndef HOMEGENIE_MINI_RFRECEIVER_H_ | ||
#define HOMEGENIE_MINI_RFRECEIVER_H_ | ||
|
||
#include <RCSwitch.h> | ||
|
||
#include <HomeGenie.h> | ||
#include <Utility.h> | ||
|
||
#include "RFReceiverConfig.h" | ||
|
||
#define RF_RFRECEIVER_NS_PREFIX "IO::RF::RfReceiver" | ||
|
||
namespace IO { namespace RCS { | ||
|
||
class RFReceiver : Task, public IIOEventSender { | ||
public: | ||
RFReceiver(); | ||
RFReceiver(RFReceiverConfig *); | ||
|
||
void begin() override; | ||
void loop() override; | ||
|
||
private: | ||
RFReceiverConfig* configuration; | ||
RCSwitch RF = RCSwitch(); | ||
}; | ||
|
||
}} // ns | ||
|
||
#endif // HOMEGENIE_MINI_RFRECEIVER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.