AllWize Library
|
#include <AllWize.h>
Public Member Functions | |
AllWize (HardwareSerial *serial, uint8_t reset_gpio=GPIO_NONE, uint8_t config_gpio=GPIO_NONE) | |
AllWize object constructor. More... | |
AllWize (uint8_t rx, uint8_t tx, uint8_t reset_gpio=GPIO_NONE, uint8_t config_gpio=GPIO_NONE) | |
AllWize object constructor. More... | |
void | begin (uint8_t baudrate=MODEM_DEFAULT_BAUDRATE) |
Inits the module communications. More... | |
bool | reset () |
Resets the radio module. More... | |
void | softReset () |
Cleans the RX/TX line. More... | |
bool | factoryReset () |
Resets the module to factory settings. More... | |
void | sleep () |
Sets the radio module in sleep mode. More... | |
void | wakeup () |
Wakes up the radio from sleep mode. More... | |
bool | ready () |
Test whether the radio module is ready or not. More... | |
bool | waitForReady (uint32_t timeout=DEFAULT_TIMEOUT) |
Waits for timeout millis for the module to be ready. More... | |
void | dump (Stream &debug) |
Dumps the current memory configuration to the given stream. More... | |
bool | ack () |
Sends an ACK. More... | |
bool | send (uint8_t *buffer, uint8_t len) |
Sends a byte array. More... | |
bool | send (const char *buffer) |
Sends c-string. More... | |
bool | available () |
Returns true if a new message has been received and decoded This method has to be called in the main loop to monitor for incoming messages. More... | |
bool | enableRX (bool enable) |
Enables or disables RF recever. More... | |
allwize_message_t | read () |
Returns latest received message. More... | |
uint8_t * | getBuffer () |
Returns pointer to the last message raw data buffer Should be copied right away since any new incomming message with overwrite it. More... | |
uint8_t | getLength () |
Returns the length of the last message raw data buffer. More... | |
void | setControlInformation (uint8_t ci) |
Sets the control information byte. More... | |
uint8_t | getControlInformation () |
Gets the control information byte. More... | |
void | master () |
Sets the module in master mode. More... | |
void | slave () |
Sets the module in slave mode. More... | |
void | repeater () |
Sets the module in repeater mode. More... | |
void | setChannel (uint8_t channel, bool persist=false) |
Sets the communications channel (for MBUS_MODE_R2 only) More... | |
void | setPower (uint8_t power, bool persist=false) |
Sets the RF power. More... | |
void | setDataRate (uint8_t dr) |
Sets the data rate. More... | |
void | setMode (uint8_t mode, bool persist=false) |
Sets the module in one of the available MBus modes. More... | |
void | setSleepMode (uint8_t mode) |
Sets the sleep mode. More... | |
void | setAppendRSSI (bool value) |
Sets the RSSI mode value. More... | |
void | setPreamble (uint8_t preamble) |
Sets the preamble length frame format. More... | |
void | setTimeout (uint16_t ms) |
Sets the buffer timeout (also used for auto sleep modes) More... | |
void | setNetworkRole (uint8_t role) |
Sets the network role. More... | |
void | setLEDControl (uint8_t value) |
Sets the LED control. More... | |
void | setDataInterface (uint8_t value) |
Sets the data interface for receiving packets. More... | |
void | setControlField (uint8_t value, bool persist=false) |
Sets the control field value. More... | |
void | setInstallMode (uint8_t mode, bool persist=false) |
Sets the module in one of the available operations modes. More... | |
void | setMAC2CheckOnlyFlag (uint8_t flag) |
Sets the MAC 2 Check Only flag setting. More... | |
void | setEncryptFlag (uint8_t flag) |
Sets the encrypt flag setting. More... | |
void | setDecryptFlag (uint8_t flag) |
Sets the decrypt flag setting. More... | |
void | setKey (uint8_t reg, const uint8_t *key) |
Sets the default encryption key. More... | |
void | setDefaultKey (const uint8_t *key) |
Sets the default encryption key. More... | |
void | setAccessNumber (uint8_t value) |
Sets new/specific access number. More... | |
void | setBaudRate (uint8_t baudrate) |
Sets the UART baud rate, requires reset to take effect. More... | |
uint8_t | getChannel () |
Gets the channel stored in non-volatile memory. More... | |
uint8_t | getPower () |
Gets the RF power stored in non-volatile memory. More... | |
uint8_t | getDataRate () |
Gets the data rate stored in non-volatile memory. More... | |
uint8_t | getMode () |
Gets the MBus mode stored in non-volatile memory. More... | |
uint8_t | getSleepMode () |
Gets the sleep mode stored in non-volatile memory. More... | |
uint8_t | getPreamble () |
Gets the preamble length frame format. More... | |
uint8_t | getDataInterface () |
Gets the data interface for receiving packets. More... | |
uint8_t | getControlField () |
Gets the control field value stored in non-volatile memory. More... | |
bool | getAppendRSSI () |
Gets the current RSSI mode value. More... | |
uint16_t | getTimeout () |
Gets the current buffer timeout (also used for auto sleep modes) More... | |
uint8_t | getNetworkRole () |
Gets the current network role. More... | |
uint8_t | getLEDControl () |
Gets the current LED control. More... | |
uint8_t | getInstallMode () |
Gets the install modevalue stored in non-volatile memory. More... | |
uint8_t | getMAC2CheckOnlyFlag () |
Gets the MAC 2 Check Only flag setting. More... | |
uint8_t | getEncryptFlag () |
Gets the encrypt flag setting. More... | |
uint8_t | getDecryptFlag () |
Gets the decrypt flag setting. More... | |
void | getDefaultKey (uint8_t *key) |
Gets the default encryption key. More... | |
uint8_t | getBaudRate () |
Gets the UART baud rate. More... | |
uint32_t | getBaudRateSpeed (uint8_t value) |
Gets the UART baud rate speed in bps. More... | |
float | getRSSI () |
Returns the RSSI of the last valid packet received TODO: values do not seem right and are not the same as in the packet. More... | |
uint8_t | getTemperature () |
Returns the internal temperature of the module. More... | |
uint16_t | getVoltage () |
Returns the internal voltage of the module. More... | |
String | getMID () |
Returns the Manufacturer ID. More... | |
bool | setMID (uint16_t mid) |
Sets the Manufacturer ID. More... | |
String | getUID () |
Returns the Unique ID string. More... | |
bool | setUID (uint32_t uid) |
Saved the UID into the module memory. More... | |
uint8_t | getVersion () |
Returns the device version from non-volatile memory. More... | |
void | setVersion (uint8_t version) |
Sets the device version. More... | |
uint8_t | getDevice () |
Returns the device type from non-volatile memory. More... | |
void | setDevice (uint8_t type) |
Sets the device type. More... | |
String | getPartNumber () |
Returns the module part number. More... | |
String | getRequiredHardwareVersion () |
Returns the minimum required hardware version to run the current firmware. More... | |
String | getFirmwareVersion () |
Returns the module firmware revision. More... | |
String | getSerialNumber () |
Returns the module serial number. More... | |
double | getFrequency (uint8_t channel) |
Returns the frequency for the given channel. More... | |
uint16_t | getDataRateSpeed (uint8_t dr) |
Returns the speed for te given datarate. More... | |
uint8_t | getModuleType () |
Returns the module type. More... | |
String | getModuleTypeName () |
Returns the module type. More... | |
bool | setWizeControl (uint8_t wize_control) |
Sets the wize control field in the transport layer. More... | |
void | setWizeOperatorId (uint8_t wize_network_id) |
Use AllWize::setWizeNetworkId instead. More... | |
void | setWizeNetworkId (uint8_t wize_network_id) |
Sets the wize network ID field in the transpoprt layer. More... | |
void | setWizeApplication (uint8_t wize_application) |
Sets the wize applicaton field in the transpoprt layer. More... | |
void | setCounter (uint16_t counter) |
Sets the wize couonter field in the transpoprt layer. More... | |
uint16_t | getCounter () |
Gets the current wize counter. More... | |
Protected Member Functions | |
void | _init () |
uint8_t | _getAddress (uint8_t slot) |
Return the physical memory address for the given slot. More... | |
bool | _setConfig (bool value) |
Sets or unsets config mode. More... | |
int8_t | _sendCommand (uint8_t command, uint8_t *data, uint8_t len) |
Sends a command with the given data. More... | |
int8_t | _sendCommand (uint8_t command, uint8_t data) |
Sends a command with the given data. More... | |
int8_t | _sendCommand (uint8_t command) |
Sends a command with no data. More... | |
bool | _cacheMemory (uint8_t *buffer) |
Reads and caches the module memory. More... | |
uint8_t | _getMemory (uint8_t address) |
Returns the contents of memory address. More... | |
uint8_t | _getMemory (uint8_t address, uint8_t *buffer, uint8_t len) |
Returns the contents of consecutive memory addresses. More... | |
bool | _setMemory (uint8_t address, uint8_t data) |
Sets non-volatile memory contents starting from given address. More... | |
bool | _setMemory (uint8_t address, uint8_t *data, uint8_t len) |
Sets non-volatile memory contents starting from given address. More... | |
bool | _setSlot (uint8_t slot, uint8_t data) |
Sets non-volatile memory contents starting from given address. More... | |
bool | _setSlot (uint8_t slot, uint8_t *data, uint8_t len) |
Sets non-volatile memory contents starting from given address. More... | |
uint8_t | _getSlot (uint8_t slot) |
Returns the contents of single-byte memory slot. More... | |
uint8_t | _getSlot (uint8_t slot, uint8_t *buffer, uint8_t len) |
Returns the contents of consecutive memory addresses. More... | |
String | _getSlotAsHexString (uint8_t slot, uint8_t len) |
Returns the contents of the memory from a certain address as an HEX String. More... | |
String | _getSlotAsString (uint8_t slot, uint8_t len) |
Returns the contents of the memory from a certain address as a String object. More... | |
void | _readModel () |
Searches for the module model. More... | |
bool | _decode () |
Decodes the current RX buffer contents. More... | |
void | _flush () |
Flushes the serial line to the module. More... | |
void | _resetSerial () |
Resets the serial object. More... | |
uint8_t | _send (uint8_t *buffer, uint8_t len) |
Sends a binary buffer to the module UART. Returns the number of bytes actually sent. More... | |
uint8_t | _send (uint8_t ch) |
Sends a single byte to the module UART. Returns the number of bytes actually sent. More... | |
int8_t | _receive () |
Listens to incoming data from the module until timeout or END_OF_RESPONSE. More... | |
int8_t | _sendAndReceive (uint8_t *buffer, uint8_t len) |
Sends a binary buffer and waits for response. Returns the number of bytes received and stored in the internal _buffer. More... | |
int8_t | _sendAndReceive (uint8_t ch) |
Sends a byte and waits for response. Returns the number of bytes received and stored in the internal _buffer. More... | |
int | _timedRead () |
Reads a byte from the stream with a timeout. More... | |
int | _readBytes (char *buffer, uint16_t len) |
Reads the stream buffer up to a number of bytes. More... | |
int | _readBytesUntil (char terminator, char *buffer, uint16_t len) |
Reads the stream buffer up to a certain char or times out. More... | |
void | _hex2bin (char *hex, uint8_t *bin, uint8_t len) |
Converts a hex c-string to a binary buffer. More... | |
void | _bin2hex (uint8_t *bin, char *hex, uint8_t len) |
Converts a binary buffer to an hex c-string. More... | |
void | _niceDelay (uint32_t ms) |
Does a non-blocking delay. More... | |
Protected Attributes | |
int8_t | _rx = -1 |
int8_t | _tx = -1 |
Stream * | _stream = NULL |
HardwareSerial * | _hw_serial = NULL |
SoftwareSerial * | _sw_serial = NULL |
uint8_t | _reset_gpio = GPIO_NONE |
uint8_t | _config_gpio = GPIO_NONE |
bool | _config = false |
uint32_t | _timeout = DEFAULT_TIMEOUT |
uint32_t | _baudrate = 19200 |
uint8_t | _ci = CI_APP_RESPONSE_UP_SHORT |
uint8_t | _mbus_mode = 0xFF |
uint8_t | _data_interface = 0xFF |
bool | _append_rssi = false |
uint8_t | _access_number = 0 |
uint8_t | _module = MODULE_UNKNOWN |
bool | _ready = false |
uint8_t | _memory [0x100] = {0xFF} |
String | _model |
String | _hw |
String | _fw |
uint8_t | _wize_control = 0x40 |
uint16_t | _wize_network_id = 0 |
uint8_t | _wize_application = 0xFE |
uint16_t | _counter = 0 |
allwize_message_t | _message |
uint8_t | _buffer [RX_BUFFER_SIZE] |
uint8_t | _pointer = 0 |
uint8_t | _length = 0 |
AllWize::AllWize | ( | HardwareSerial * | serial, |
uint8_t | reset_gpio = GPIO_NONE , |
||
uint8_t | config_gpio = GPIO_NONE |
||
) |
AllWize object constructor.
serial | HardwareSerial object to communicate with the module |
reset_gpio | GPIO connected to the module RESET pin |
config_gpio | GPIO connected to the module CONFIG pin |
Definition at line 40 of file AllWize.cpp.
AllWize::AllWize | ( | uint8_t | rx, |
uint8_t | tx, | ||
uint8_t | reset_gpio = GPIO_NONE , |
||
uint8_t | config_gpio = GPIO_NONE |
||
) |
AllWize object constructor.
rx | GPIO for RX |
tx | GPIO for TX |
reset_gpio | GPIO connected to the module RESET pin |
config_gpio | GPIO connected to the module CONFIG pin |
Definition at line 63 of file AllWize.cpp.
|
protected |
Converts a binary buffer to an hex c-string.
bin | Buffer to read the values from |
hex | C-string to store the hex values |
len | Length of the input buffer |
Definition at line 1898 of file AllWize.cpp.
|
protected |
Reads and caches the module memory.
buffer | Buffer with at least 256 positions to hold memory |
Definition at line 1293 of file AllWize.cpp.
|
protected |
Decodes the current RX buffer contents.
Message format depending current configuration
0. Start byte (0x68) | | | | * | | * |
Note:
Definition at line 1586 of file AllWize.cpp.
|
protected |
Flushes the serial line to the module.
Definition at line 1722 of file AllWize.cpp.
|
protected |
Return the physical memory address for the given slot.
slot | Memory slot |
Definition at line 1463 of file AllWize.cpp.
|
protected |
Returns the contents of memory address.
address | Memory address |
Definition at line 1380 of file AllWize.cpp.
|
protected |
Returns the contents of consecutive memory addresses.
address | Starting memory address |
buffer | Buffer with at least 'len' position to store data to |
len | Number of positions to read |
Definition at line 1354 of file AllWize.cpp.
|
protected |
Returns the contents of single-byte memory slot.
slot | Memory slot |
Definition at line 1517 of file AllWize.cpp.
|
protected |
Returns the contents of consecutive memory addresses.
slot | Memory slot |
buffer | Buffer with at least 'len' position to store data to |
len | Number of positions to read |
Definition at line 1505 of file AllWize.cpp.
|
protected |
Returns the contents of the memory from a certain address as an HEX String.
slot | Memory slot |
len | Number of bytes to read |
Definition at line 1530 of file AllWize.cpp.
|
protected |
Returns the contents of the memory from a certain address as a String object.
slot | Memory slot |
len | Number of bytes to read |
Definition at line 1547 of file AllWize.cpp.
|
protected |
Converts a hex c-string to a binary buffer.
hex | C-string with the hex values |
bin | Buffer to store the converted values in |
len | Length of the hex c-string |
Definition at line 1885 of file AllWize.cpp.
|
protected |
|
protected |
Does a non-blocking delay.
ms | milliseconds to delay |
Definition at line 1909 of file AllWize.cpp.
|
protected |
Reads the stream buffer up to a number of bytes.
data | Buffer to store the values to |
len | Max number of bytes to read |
Definition at line 1837 of file AllWize.cpp.
|
protected |
Reads the stream buffer up to a certain char or times out.
terminator | Terminating char |
data | Buffer to store the values to |
len | Max number of bytes to read |
Definition at line 1861 of file AllWize.cpp.
|
protected |
Searches for the module model.
Definition at line 1308 of file AllWize.cpp.
|
protected |
Listens to incoming data from the module until timeout or END_OF_RESPONSE.
Definition at line 1769 of file AllWize.cpp.
|
protected |
Resets the serial object.
Definition at line 120 of file AllWize.cpp.
|
protected |
Sends a binary buffer to the module UART. Returns the number of bytes actually sent.
buffer | Binary data to send |
len | Length of the binary data |
Definition at line 1756 of file AllWize.cpp.
|
protected |
Sends a single byte to the module UART. Returns the number of bytes actually sent.
ch | Byte to send |
Definition at line 1738 of file AllWize.cpp.
|
protected |
Sends a binary buffer and waits for response. Returns the number of bytes received and stored in the internal _buffer.
buffer | Binary data to send |
len | Length of the binary data |
Definition at line 1780 of file AllWize.cpp.
|
protected |
Sends a byte and waits for response. Returns the number of bytes received and stored in the internal _buffer.
ch | Byte to send (-1 if timed out) |
Definition at line 1791 of file AllWize.cpp.
|
protected |
Sends a command with no data.
command | Command key |
Definition at line 1277 of file AllWize.cpp.
|
protected |
Sends a command with the given data.
command | Command key |
data | Binary data to send |
len | Length of the binary data |
Definition at line 1244 of file AllWize.cpp.
|
protected |
Sends a command with the given data.
command | Command key |
data | Single byte |
Definition at line 1261 of file AllWize.cpp.
|
protected |
Sets or unsets config mode.
value | True to enter config mode |
Definition at line 1215 of file AllWize.cpp.
|
protected |
Sets non-volatile memory contents starting from given address.
address | Memory address |
data | Binary data to store |
len | Length of the binary data |
Definition at line 1428 of file AllWize.cpp.
|
protected |
Sets non-volatile memory contents starting from given address.
address | Memory address |
data | Single byte to store at given address |
Definition at line 1398 of file AllWize.cpp.
|
protected |
Sets non-volatile memory contents starting from given address.
slot | Memory slot |
data | Binary data to store |
len | Length of the binary data |
Definition at line 1478 of file AllWize.cpp.
|
protected |
Sets non-volatile memory contents starting from given address.
slot | Memory slot |
data | Single byte to store at given address |
Definition at line 1491 of file AllWize.cpp.
|
protected |
Reads a byte from the stream with a timeout.
Definition at line 1801 of file AllWize.cpp.
bool AllWize::ack | ( | ) |
Sends an ACK.
Definition at line 432 of file AllWize.cpp.
bool AllWize::available | ( | ) |
Returns true if a new message has been received and decoded This method has to be called in the main loop to monitor for incoming messages.
Definition at line 458 of file AllWize.cpp.
void AllWize::begin | ( | uint8_t | baudrate = MODEM_DEFAULT_BAUDRATE | ) |
Inits the module communications.
Definition at line 91 of file AllWize.cpp.
void AllWize::dump | ( | Stream & | debug | ) |
Dumps the current memory configuration to the given stream.
debug | Data stream to dump the data to |
Definition at line 307 of file AllWize.cpp.
bool AllWize::enableRX | ( | bool | enable | ) |
Enables or disables RF recever.
enable | True to enable, false to disable |
Definition at line 443 of file AllWize.cpp.
bool AllWize::factoryReset | ( | ) |
Resets the module to factory settings.
Definition at line 212 of file AllWize.cpp.
bool AllWize::getAppendRSSI | ( | ) |
Gets the current RSSI mode value.
Definition at line 740 of file AllWize.cpp.
uint8_t AllWize::getBaudRate | ( | ) |
Gets the UART baud rate.
Definition at line 979 of file AllWize.cpp.
uint32_t AllWize::getBaudRateSpeed | ( | uint8_t | value | ) |
Gets the UART baud rate speed in bps.
value | Baudrate code |
Definition at line 988 of file AllWize.cpp.
uint8_t * AllWize::getBuffer | ( | ) |
Returns pointer to the last message raw data buffer Should be copied right away since any new incomming message with overwrite it.
Definition at line 514 of file AllWize.cpp.
uint8_t AllWize::getChannel | ( | ) |
Gets the channel stored in non-volatile memory.
Definition at line 617 of file AllWize.cpp.
uint8_t AllWize::getControlField | ( | ) |
Gets the control field value stored in non-volatile memory.
Definition at line 849 of file AllWize.cpp.
uint8_t AllWize::getControlInformation | ( | ) |
uint16_t AllWize::getCounter | ( | ) |
uint8_t AllWize::getDataInterface | ( | ) |
Gets the data interface for receiving packets.
Definition at line 829 of file AllWize.cpp.
uint8_t AllWize::getDataRate | ( | ) |
Gets the data rate stored in non-volatile memory.
Definition at line 672 of file AllWize.cpp.
uint16_t AllWize::getDataRateSpeed | ( | uint8_t | dr | ) |
Returns the speed for te given datarate.
dr | Datarate |
Definition at line 1197 of file AllWize.cpp.
uint8_t AllWize::getDecryptFlag | ( | ) |
Gets the decrypt flag setting.
Definition at line 923 of file AllWize.cpp.
void AllWize::getDefaultKey | ( | uint8_t * | key | ) |
Gets the default encryption key.
key | A binary buffer to store the key (16 bytes) |
Definition at line 952 of file AllWize.cpp.
uint8_t AllWize::getDevice | ( | ) |
Returns the device type from non-volatile memory.
Definition at line 1101 of file AllWize.cpp.
uint8_t AllWize::getEncryptFlag | ( | ) |
Gets the encrypt flag setting.
Definition at line 907 of file AllWize.cpp.
String AllWize::getFirmwareVersion | ( | ) |
Returns the module firmware revision.
Definition at line 1133 of file AllWize.cpp.
double AllWize::getFrequency | ( | uint8_t | channel | ) |
Returns the frequency for the given channel.
channel | Channel |
Definition at line 1172 of file AllWize.cpp.
uint8_t AllWize::getInstallMode | ( | ) |
Gets the install modevalue stored in non-volatile memory.
Definition at line 871 of file AllWize.cpp.
uint8_t AllWize::getLEDControl | ( | ) |
Gets the current LED control.
Definition at line 810 of file AllWize.cpp.
uint8_t AllWize::getLength | ( | ) |
Returns the length of the last message raw data buffer.
Definition at line 522 of file AllWize.cpp.
uint8_t AllWize::getMAC2CheckOnlyFlag | ( | ) |
Gets the MAC 2 Check Only flag setting.
Definition at line 889 of file AllWize.cpp.
String AllWize::getMID | ( | ) |
Returns the Manufacturer ID.
Definition at line 1045 of file AllWize.cpp.
uint8_t AllWize::getMode | ( | ) |
Gets the MBus mode stored in non-volatile memory.
Definition at line 703 of file AllWize.cpp.
uint8_t AllWize::getModuleType | ( | ) |
Returns the module type.
Definition at line 1149 of file AllWize.cpp.
String AllWize::getModuleTypeName | ( | ) |
Returns the module type.
Definition at line 1157 of file AllWize.cpp.
uint8_t AllWize::getNetworkRole | ( | ) |
Gets the current network role.
Definition at line 793 of file AllWize.cpp.
String AllWize::getPartNumber | ( | ) |
Returns the module part number.
Definition at line 1117 of file AllWize.cpp.
uint8_t AllWize::getPower | ( | ) |
Gets the RF power stored in non-volatile memory.
Definition at line 639 of file AllWize.cpp.
uint8_t AllWize::getPreamble | ( | ) |
Gets the preamble length frame format.
Definition at line 758 of file AllWize.cpp.
String AllWize::getRequiredHardwareVersion | ( | ) |
Returns the minimum required hardware version to run the current firmware.
Definition at line 1125 of file AllWize.cpp.
float AllWize::getRSSI | ( | ) |
Returns the RSSI of the last valid packet received TODO: values do not seem right and are not the same as in the packet.
Definition at line 1002 of file AllWize.cpp.
String AllWize::getSerialNumber | ( | ) |
Returns the module serial number.
Definition at line 1141 of file AllWize.cpp.
uint8_t AllWize::getSleepMode | ( | ) |
Gets the sleep mode stored in non-volatile memory.
Definition at line 719 of file AllWize.cpp.
uint8_t AllWize::getTemperature | ( | ) |
Returns the internal temperature of the module.
Definition at line 1012 of file AllWize.cpp.
uint16_t AllWize::getTimeout | ( | ) |
Gets the current buffer timeout (also used for auto sleep modes)
Definition at line 776 of file AllWize.cpp.
String AllWize::getUID | ( | ) |
Returns the Unique ID string.
Definition at line 1064 of file AllWize.cpp.
uint8_t AllWize::getVersion | ( | ) |
Returns the device version from non-volatile memory.
Definition at line 1085 of file AllWize.cpp.
uint16_t AllWize::getVoltage | ( | ) |
Returns the internal voltage of the module.
Definition at line 1029 of file AllWize.cpp.
void AllWize::master | ( | ) |
Sets the module in master mode.
Definition at line 234 of file AllWize.cpp.
allwize_message_t AllWize::read | ( | ) |
Returns latest received message.
Definition at line 505 of file AllWize.cpp.
bool AllWize::ready | ( | ) |
Test whether the radio module is ready or not.
Definition at line 285 of file AllWize.cpp.
void AllWize::repeater | ( | ) |
Sets the module in repeater mode.
Definition at line 260 of file AllWize.cpp.
bool AllWize::reset | ( | ) |
Resets the radio module.
Definition at line 162 of file AllWize.cpp.
bool AllWize::send | ( | const char * | buffer | ) |
Sends c-string.
buffer | C-string with the application payload |
Definition at line 424 of file AllWize.cpp.
bool AllWize::send | ( | uint8_t * | buffer, |
uint8_t | len | ||
) |
Sends a byte array.
buffer | Byte array with the application payload |
len | Length of the payload |
Definition at line 366 of file AllWize.cpp.
void AllWize::setAccessNumber | ( | uint8_t | value | ) |
Sets new/specific access number.
value | New access number |
Definition at line 960 of file AllWize.cpp.
void AllWize::setAppendRSSI | ( | bool | value | ) |
Sets the RSSI mode value.
value | Set to true to append RSSI value to received data |
Definition at line 727 of file AllWize.cpp.
void AllWize::setBaudRate | ( | uint8_t | value | ) |
Sets the UART baud rate, requires reset to take effect.
value | Value from 1 to 11 |
Definition at line 968 of file AllWize.cpp.
void AllWize::setChannel | ( | uint8_t | channel, |
bool | persist = false |
||
) |
Sets the communications channel (for MBUS_MODE_R2 only)
channel | Channel number |
persist | Persist the changes in non-volatile memory (defaults to False) |
Definition at line 602 of file AllWize.cpp.
void AllWize::setControlField | ( | uint8_t | value, |
bool | persist = false |
||
) |
Sets the control field value.
value | Control field |
persist | Persist the changes in non-volatile memory (defaults to False) |
Definition at line 838 of file AllWize.cpp.
void AllWize::setControlInformation | ( | uint8_t | ci | ) |
Sets the control information byte.
ci | CI byte value |
Definition at line 585 of file AllWize.cpp.
void AllWize::setCounter | ( | uint16_t | counter | ) |
Sets the wize couonter field in the transpoprt layer.
counter | Wize counter |
Definition at line 565 of file AllWize.cpp.
void AllWize::setDataInterface | ( | uint8_t | value | ) |
Sets the data interface for receiving packets.
value | Value from 0x00 to 0x0C |
Definition at line 818 of file AllWize.cpp.
void AllWize::setDataRate | ( | uint8_t | dr | ) |
Sets the data rate.
dr | Value in [1, 2, 3, 4, 5] |
Definition at line 647 of file AllWize.cpp.
void AllWize::setDecryptFlag | ( | uint8_t | flag | ) |
Sets the decrypt flag setting.
flag | Decrypt flag |
Definition at line 915 of file AllWize.cpp.
void AllWize::setDefaultKey | ( | const uint8_t * | key | ) |
Sets the default encryption key.
key | A 16-byte encryption key as binary array |
Definition at line 944 of file AllWize.cpp.
void AllWize::setDevice | ( | uint8_t | type | ) |
Sets the device type.
type | Device type |
Definition at line 1109 of file AllWize.cpp.
void AllWize::setEncryptFlag | ( | uint8_t | flag | ) |
Sets the encrypt flag setting.
flag | Encrypt flag |
Definition at line 897 of file AllWize.cpp.
void AllWize::setInstallMode | ( | uint8_t | mode, |
bool | persist = false |
||
) |
Sets the module in one of the available operations modes.
mode | Operation mode |
persist | Persist the changes in non-volatile memory (defaults to False) |
Definition at line 858 of file AllWize.cpp.
void AllWize::setKey | ( | uint8_t | reg, |
const uint8_t * | key | ||
) |
Sets the default encryption key.
reg | Register number (1-64) |
key | A 16-byte encryption key as binary array |
Definition at line 932 of file AllWize.cpp.
void AllWize::setLEDControl | ( | uint8_t | value | ) |
Sets the LED control.
value | LED control value |
Definition at line 801 of file AllWize.cpp.
void AllWize::setMAC2CheckOnlyFlag | ( | uint8_t | flag | ) |
Sets the MAC 2 Check Only flag setting.
flag | Flag |
Definition at line 879 of file AllWize.cpp.
bool AllWize::setMID | ( | uint16_t | mid | ) |
Sets the Manufacturer ID.
mid | MID to save |
Definition at line 1053 of file AllWize.cpp.
void AllWize::setMode | ( | uint8_t | mode, |
bool | persist = false |
||
) |
Sets the module in one of the available MBus modes.
mode | MBus mode (MBUS_MODE_*) |
persist | Persist the changes in non-volatile memory (defaults to False) |
Definition at line 681 of file AllWize.cpp.
void AllWize::setNetworkRole | ( | uint8_t | role | ) |
Sets the network role.
role | Network role (NETWORK_ROLE_*) |
Definition at line 785 of file AllWize.cpp.
void AllWize::setPower | ( | uint8_t | power, |
bool | persist = false |
||
) |
Sets the RF power.
power | Value from 1 to 5 |
persist | Persist the changes in non-volatile memory (defaults to False) |
Definition at line 626 of file AllWize.cpp.
void AllWize::setPreamble | ( | uint8_t | preamble | ) |
Sets the preamble length frame format.
preamble | 0 or 2 |
Definition at line 748 of file AllWize.cpp.
void AllWize::setSleepMode | ( | uint8_t | mode | ) |
Sets the sleep mode.
mode | One of SLEEP_MODE_* |
Definition at line 711 of file AllWize.cpp.
void AllWize::setTimeout | ( | uint16_t | ms | ) |
Sets the buffer timeout (also used for auto sleep modes)
ms | Timeout value in milliseconds |
Definition at line 766 of file AllWize.cpp.
bool AllWize::setUID | ( | uint32_t | uid | ) |
Saved the UID into the module memory.
uid | UID to save |
Definition at line 1072 of file AllWize.cpp.
void AllWize::setVersion | ( | uint8_t | version | ) |
Sets the device version.
version | Device version |
Definition at line 1093 of file AllWize.cpp.
void AllWize::setWizeApplication | ( | uint8_t | wize_application | ) |
Sets the wize applicaton field in the transpoprt layer.
wize_application | Wize Application |
Definition at line 557 of file AllWize.cpp.
bool AllWize::setWizeControl | ( | uint8_t | wize_control | ) |
Sets the wize control field in the transport layer.
wize_control | Wize Control (defined the key to be used) |
Definition at line 531 of file AllWize.cpp.
void AllWize::setWizeNetworkId | ( | uint8_t | wize_network_id | ) |
Sets the wize network ID field in the transpoprt layer.
wize_network_id | Wize Network ID |
Definition at line 549 of file AllWize.cpp.
void AllWize::setWizeOperatorId | ( | uint8_t | wize_network_id | ) |
Use AllWize::setWizeNetworkId instead.
Definition at line 541 of file AllWize.cpp.
void AllWize::slave | ( | ) |
Sets the module in slave mode.
Definition at line 249 of file AllWize.cpp.
void AllWize::sleep | ( | ) |
Sets the radio module in sleep mode.
Definition at line 268 of file AllWize.cpp.
void AllWize::softReset | ( | ) |
Cleans the RX/TX line.
Definition at line 197 of file AllWize.cpp.
bool AllWize::waitForReady | ( | uint32_t | timeout = DEFAULT_TIMEOUT | ) |
Waits for timeout millis for the module to be ready.
Definition at line 294 of file AllWize.cpp.
void AllWize::wakeup | ( | ) |
Wakes up the radio from sleep mode.
Definition at line 276 of file AllWize.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |