8 namespace lightwaverf {
10 static const char *
const TAG =
"lightwaverf.sensor";
12 static const uint8_t DEFAULT_REPEAT = 10;
13 static const bool DEFAULT_INVERT =
false;
14 static const uint32_t DEFAULT_TICK = 330;
17 ESP_LOGCONFIG(TAG,
"Setting up Lightwave RF...");
39 ESP_LOGD(TAG,
"[%i] msg start", timeout);
44 timeout =
millis() - timeout;
45 ESP_LOGD(TAG,
"[%u] msg sent: %i",
millis(), timeout);
50 ESP_LOGD(TAG,
" Received code (len:%i): ", len);
52 for (
int i = 0; i <
len; i++) {
53 sprintf(&buffer[i * 6],
"0x%02x, ", msg[i]);
55 ESP_LOGD(TAG,
"[%s]", buffer);
59 ESP_LOGCONFIG(TAG,
"Lightwave RF:");
60 LOG_PIN(
" Pin TX: ", this->
pin_tx_);
61 LOG_PIN(
" Pin RX: ", this->
pin_rx_);
62 LOG_UPDATE_INTERVAL(
this);
bool lwrx_getmessage(uint8_t *buf, uint8_t len)
Transfer a message to user buffer.
InternalGPIOPin * pin_tx_
uint32_t IRAM_ATTR HOT millis()
void send_rx(const std::vector< uint8_t > &msg, uint8_t repeats, bool inverted, int u_sec)
InternalGPIOPin * pin_rx_
bool lwrx_message()
Test if a message has arrived.
void print_msg_(uint8_t *msg, uint8_t len)
Implementation of SPI Controller mode.
void dump_config() override
void lwtx_setup(InternalGPIOPin *pin, uint8_t repeats, bool inverted, int u_sec)
Set things up to transmit LightWaveRF 434Mhz messages.
void lwrx_setup(InternalGPIOPin *pin)
Set things up to receive LightWaveRF 434Mhz messages pin must be 2 or 3 to trigger interrupts !!! For...
bool lwtx_free()
Check for send free.
void lwtx_send(const std::vector< uint8_t > &msg)
Send a LightwaveRF message (10 nibbles in bytes)
void IRAM_ATTR HOT delay(uint32_t ms)