Class to communicate with ELV(R) MAX! wireless devices with RFM22B-Modules. Based on Library RF22. Initial version unable to send! Only receive! See http://mbed.org/users/charly/notebook/reading-a-max-wireless-window-sensor-with-rfm22-an/
Dependents: RF22_MAX_test_Send
RF22Max Class Reference
receive (in future also send) packets from/to MAX! Devices by ELV (http://www.elv.de/max-funk-heizungsregler-system.html) More...
#include <RF22Max.h>
Data Structures | |
struct | max_message |
a message from a max!-Device More... | |
Public Member Functions | |
RF22Max (PinName slaveSelectPin, PinName mosi, PinName miso, PinName sclk, PinName interrupt) | |
Constructor Create an object for a RFM22-module connected to the controller via SPI, SlaveSelect and Interrupt-pin. | |
boolean | init () |
Initialize the module for MAX!-messages sets frequency, datarate, ... | |
boolean | recv (uint8_t *buf, uint8_t *len) |
start receiver and see if a valid MAX!-message is available and return it undecoded to the caller | |
boolean | recv_max (RF22Max::max_message *message) |
start receiver and see if a valid MAX!-message is available and return the decoded message to the caller | |
uint16_t | calc_crc (uint8_t *buf, size_t len) |
calculate crc for the data in buf with len |
Detailed Description
receive (in future also send) packets from/to MAX! Devices by ELV (http://www.elv.de/max-funk-heizungsregler-system.html)
This class provides basic functions for sending and receiving MAX!-messages, at the moment only receiving possible ueses recv() from RF22 based on RF22-Class (C) by Mike McCauley (mikem@open.com.au) for RFM22 transceiver-modules by HopeRF returns decodes message and payload for further processing
Definition at line 32 of file RF22Max.h.
Constructor & Destructor Documentation
RF22Max | ( | PinName | slaveSelectPin, |
PinName | mosi, | ||
PinName | miso, | ||
PinName | sclk, | ||
PinName | interrupt | ||
) |
Constructor Create an object for a RFM22-module connected to the controller via SPI, SlaveSelect and Interrupt-pin.
- Parameters:
-
[in] slaveSelectPin SlaveSelectPin [in] mosi SPI [in] miso SPI [in] sclk SPI [in] interrupt Interrupt line for RFM22
Definition at line 8 of file RF22Max.cpp.
Member Function Documentation
uint16_t calc_crc | ( | uint8_t * | buf, |
size_t | len | ||
) |
calculate crc for the data in buf with len
- Parameters:
-
[in] buf message to calculate crc for [in,out] len of message
Definition at line 215 of file RF22Max.cpp.
boolean init | ( | ) |
Initialize the module for MAX!-messages sets frequency, datarate, ...
- Returns:
- true if everything was successful
Definition at line 171 of file RF22Max.cpp.
boolean recv | ( | uint8_t * | buf, |
uint8_t * | len | ||
) |
start receiver and see if a valid MAX!-message is available and return it undecoded to the caller
nonblocking
do NOT check crc and DO dewithening
- Parameters:
-
[in] buf Location to copy the received message [in,out] len Pointer to available space in buf(copies maximum len bytes!). Set to the actual number of octets copied.
- Returns:
- true if a valid message was copied to buf
Definition at line 226 of file RF22Max.cpp.
boolean recv_max | ( | RF22Max::max_message * | message ) |
start receiver and see if a valid MAX!-message is available and return the decoded message to the caller
nonblocking
check crc and do dewithening and do decoding of fields
- Parameters:
-
[in] message A pointer to a RF22Max::max_message
- Returns:
- true if a valid message was copied to buf
Definition at line 253 of file RF22Max.cpp.
Generated on Mon Jul 18 2022 04:16:30 by 1.7.2