AllWize Library
Public Member Functions | Protected Member Functions | Protected Attributes
AllWize Class Reference

Public Member Functions

 AllWize (HardwareSerial *serial, uint8_t reset_gpio=GPIO_NONE)
 AllWize object constructor. More...
 
 AllWize (uint8_t rx, uint8_t tx, uint8_t reset_gpio=GPIO_NONE)
 AllWize object constructor. More...
 
void begin ()
 Inits the module communications.
 
bool reset ()
 Resets the radio module. More...
 
bool factoryReset ()
 Resets the module to factory settings. More...
 
void sleep ()
 Sets the radio module in sleep mode.
 
void wakeup ()
 Wakes up the radio from sleep mode.
 
bool ready ()
 Test whether the radio module is ready or not.
 
bool waitForReady (uint32_t timeout=DEFAULT_TIMEOUT)
 Waits for timeout millis for the module to be ready.
 
void dump (Stream &debug)
 Dumps the current memory configuration to the given stream. 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 incomming messages. More...
 
allwize_message_t read ()
 Returns latest received message. 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.
 
void slave ()
 Sets the module in slave mode.
 
void repeater ()
 Sets the module in repeater mode.
 
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 (uint8_t timeout)
 Sets the timeout 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 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...
 
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...
 
uint8_t getTimeout ()
 Gets the current timeout 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 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 getTemperature ()
 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...
 
uint16_t getVoltage ()
 Returns the internal voltage of the module. More...
 
String getMID ()
 Returns the Manufacturer ID string. More...
 
bool setMID (uint16_t mid)
 Sets the Manufacturer ID mid MID to save.
 
String getUID ()
 Returns the Unique ID string. More...
 
bool setUID (uint32_t uid)
 Saved the UID into the module memory uid UID to save.
 
uint8_t getVersion ()
 Returns the module version from non-volatile memory. More...
 
uint8_t getDevice ()
 Returns the device version from non-volatile memory. More...
 
String getPartNumber ()
 Returns the module part number. More...
 
String getRequiredHardwareVersion ()
 Returns the module hardware revision. More...
 
String getFirmwareVersion ()
 Returns the module firmware revision. More...
 
String getSerialNumber ()
 Returns the module serial number. More...
 

Protected Member Functions

void _init ()
 
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 _setMemory (uint8_t address, uint8_t *data, uint8_t len)
 Sets non-volatile memory contents starting from given address. More...
 
bool _setMemory (uint8_t address, uint8_t data)
 Sets non-volatile memory contents starting from given address. More...
 
uint8_t _getMemory (uint8_t address, uint8_t *buffer, uint8_t len)
 Returns the contents of consecutive memory addresses. More...
 
uint8_t _getMemory (uint8_t address)
 Returns the contents of single memory addresses. More...
 
String _getMemoryAsHexString (uint8_t address, uint8_t len)
 Returns the contents of the memory from a certain address as an HEX String. More...
 
String _getMemoryAsString (uint8_t address, uint8_t len)
 Returns the contents of the memory from a certain address as a String object. More...
 
void _readModel ()
 Reads and caches the module model & version.
 
bool _decode ()
 Decodes the current RX buffer contents. More...
 
void _flush ()
 Flushes the serial line to the module.
 
void _reset_serial ()
 Resets the serial object.
 
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 incomming 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...
 

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
 
bool _config = false
 
uint32_t _timeout = DEFAULT_TIMEOUT
 
uint8_t _ci = CONTROL_INFORMATION
 
uint8_t _mbus_mode = 0xFF
 
uint8_t _data_interface = 0xFF
 
bool _append_rssi = false
 
bool _encrypt = false
 
unsigned char _access_number = 0
 
String _model
 
String _fw
 
String _hw
 
allwize_message_t _message
 
uint8_t _buffer [RX_BUFFER_SIZE]
 
uint8_t _pointer
 

Detailed Description

Definition at line 92 of file AllWize.h.

Constructor & Destructor Documentation

◆ AllWize() [1/2]

AllWize::AllWize ( HardwareSerial *  serial,
uint8_t  reset_gpio = GPIO_NONE 
)

AllWize object constructor.

Parameters
streamHardwareSerial object to communicate with the module

Definition at line 34 of file AllWize.cpp.

◆ AllWize() [2/2]

AllWize::AllWize ( uint8_t  rx,
uint8_t  tx,
uint8_t  reset_gpio = GPIO_NONE 
)

AllWize object constructor.

Parameters
streamSoftwareSerial object to communicate with the module

Definition at line 55 of file AllWize.cpp.

Member Function Documentation

◆ _bin2hex()

void AllWize::_bin2hex ( uint8_t *  bin,
char *  hex,
uint8_t  len 
)
protected

Converts a binary buffer to an hex c-string.

Parameters
binBuffer to read the values from
hexC-string to store the hex values
lenLength of the input buffer

Definition at line 1355 of file AllWize.cpp.

◆ _decode()

bool AllWize::_decode ( )
protected

Decodes the current RX buffer contents.

Returns
Whether the contents are a valid packet

Message format depending current configuration

Data interface | 0 | 1 | 3 | 4 | 8 | C |

0. Start byte (0x68) | | | | * | | * |

  1. Length (1-byte) | * | * | * | * | * | * | length of sections 2 to 7
  2. Control field (1-byte) | * | | | * | * | * |
  3. Header (8-bytes) | * | | | * | * | * | manID (2 bytes) + address (6 bytes)
  4. Control info (1-byte) | * | * | * | * | * | * |
  5. App data (n-bytes) | * | * | * | * | * | * |
  6. RSSI (1-byte) | - | - | - | - | - | - |
  7. CRC (2-bytes) | | | | | * | * |
  8. Stop byte (0x16) | | | | * | | * |

Note:

  • Data Interface defaults to 0x04 for this version and RSSI enabled
  • Modes 0x01 and 0x03 not working in MBUS_MODE_OSP
  • Modes 0x01 and 0x03 should be the same, but 0x03 does ACK
  • Section 6 (RSSI) present always and only if RSSI_MODE == 1
  • Section 2 (C) and 3 (HEADER) not present in MBUS_MODE_OSP

Definition at line 1071 of file AllWize.cpp.

◆ _getMemory() [1/2]

uint8_t AllWize::_getMemory ( uint8_t  address,
uint8_t *  buffer,
uint8_t  len 
)
protected

Returns the contents of consecutive memory addresses.

Parameters
addressAddress to start from
bufferBuffer with at least 'len' position to store data to
lenNumber of positions to read
Returns
Number of positions actually read

Definition at line 953 of file AllWize.cpp.

◆ _getMemory() [2/2]

uint8_t AllWize::_getMemory ( uint8_t  address)
protected

Returns the contents of single memory addresses.

Parameters
addressAddress to start from
Returns
Contents of the address, 0 if error

Definition at line 973 of file AllWize.cpp.

◆ _getMemoryAsHexString()

String AllWize::_getMemoryAsHexString ( uint8_t  address,
uint8_t  len 
)
protected

Returns the contents of the memory from a certain address as an HEX String.

Parameters
addressAddress to start from
lenNumber of bytes to read
Returns
Result (empty string if error)

Definition at line 986 of file AllWize.cpp.

◆ _getMemoryAsString()

String AllWize::_getMemoryAsString ( uint8_t  address,
uint8_t  len 
)
protected

Returns the contents of the memory from a certain address as a String object.

Parameters
addressAddress to start from
lenNumber of bytes to read
Returns
Result (empty string if error)

Definition at line 1003 of file AllWize.cpp.

◆ _hex2bin()

void AllWize::_hex2bin ( char *  hex,
uint8_t *  bin,
uint8_t  len 
)
protected

Converts a hex c-string to a binary buffer.

Parameters
hexC-string with the hex values
binBuffer to store the converted values in
lenLength of the hex c-string

Definition at line 1342 of file AllWize.cpp.

◆ _readBytes()

int AllWize::_readBytes ( char *  buffer,
uint16_t  len 
)
protected

Reads the stream buffer up to a number of bytes.

Parameters
bufferBuffer to store the values to
lenMax number of bytes to read
Returns
Number of bytes read or -1 if timed out

Definition at line 1283 of file AllWize.cpp.

◆ _readBytesUntil()

int AllWize::_readBytesUntil ( char  terminator,
char *  buffer,
uint16_t  len 
)
protected

Reads the stream buffer up to a certain char or times out.

Parameters
terminatorTerminating char
bufferBuffer to store the values to
lenMax number of bytes to read
Returns
Number of bytes read or -1 if timed out

Definition at line 1312 of file AllWize.cpp.

◆ _receive()

int8_t AllWize::_receive ( )
protected

Listens to incomming data from the module until timeout or END_OF_RESPONSE.

Returns
Number of bytes received and stored in the internal _buffer.

Definition at line 1228 of file AllWize.cpp.

◆ _send() [1/2]

uint8_t AllWize::_send ( uint8_t *  buffer,
uint8_t  len 
)
protected

Sends a binary buffer to the module UART. Returns the number of bytes actually sent.

Parameters
bufferBinary data to send
lenLength of the binary data
Returns
Number of bytes actually sent

Definition at line 1215 of file AllWize.cpp.

◆ _send() [2/2]

uint8_t AllWize::_send ( uint8_t  ch)
protected

Sends a single byte to the module UART. Returns the number of bytes actually sent.

Parameters
chByte to send
Returns
Number of bytes actually sent

Definition at line 1197 of file AllWize.cpp.

◆ _sendAndReceive() [1/2]

int8_t AllWize::_sendAndReceive ( uint8_t *  buffer,
uint8_t  len 
)
protected

Sends a binary buffer and waits for response. Returns the number of bytes received and stored in the internal _buffer.

Parameters
bufferBinary data to send
lenLength of the binary data
Returns
Number of bytes received, -1 if timed out or error sending

Definition at line 1239 of file AllWize.cpp.

◆ _sendAndReceive() [2/2]

int8_t AllWize::_sendAndReceive ( uint8_t  ch)
protected

Sends a byte and waits for response. Returns the number of bytes received and stored in the internal _buffer.

Parameters
chByte to send (-1 if timed out)
Returns
Number of bytes received, -1 if timed out or error sending

Definition at line 1250 of file AllWize.cpp.

◆ _sendCommand() [1/3]

int8_t AllWize::_sendCommand ( uint8_t  command,
uint8_t *  data,
uint8_t  len 
)
protected

Sends a command with the given data.

Parameters
commandCommand key
dataBinary data to send
lenLength of the binary data

Definition at line 874 of file AllWize.cpp.

◆ _sendCommand() [2/3]

int8_t AllWize::_sendCommand ( uint8_t  command,
uint8_t  data 
)
protected

Sends a command with the given data.

Parameters
commandCommand key
dataSingle byte
Returns
Number of bytes received, -1 if timed out or error sending

Definition at line 891 of file AllWize.cpp.

◆ _sendCommand() [3/3]

int8_t AllWize::_sendCommand ( uint8_t  command)
protected

Sends a command with no data.

Parameters
commandCommand key
Returns
Number of bytes received, -1 if timed out or error sending

Definition at line 907 of file AllWize.cpp.

◆ _setConfig()

bool AllWize::_setConfig ( bool  value)
protected

Sets or unsets config mode.

Parameters
valueTrue to enter config mode
Returns
True if in config mode

Definition at line 850 of file AllWize.cpp.

◆ _setMemory() [1/2]

bool AllWize::_setMemory ( uint8_t  address,
uint8_t *  data,
uint8_t  len 
)
protected

Sets non-volatile memory contents starting from given address.

Parameters
addressCommand key
dataBinary data to store
lenLength of the binary data
Returns
True if the data was successfully saved

Definition at line 923 of file AllWize.cpp.

◆ _setMemory() [2/2]

bool AllWize::_setMemory ( uint8_t  address,
uint8_t  value 
)
protected

Sets non-volatile memory contents starting from given address.

Parameters
addressCommand key
dataSingle byte to store at given address
Returns
True if the data was successfully saved

Definition at line 940 of file AllWize.cpp.

◆ _timedRead()

int AllWize::_timedRead ( )
protected

Reads a byte from the stream with a timeout.

Returns
Read char or -1 if timed out

Definition at line 1264 of file AllWize.cpp.

◆ available()

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 incomming messages.

Returns
Whether a new message is available

Definition at line 334 of file AllWize.cpp.

◆ dump()

void AllWize::dump ( Stream &  debug)

Dumps the current memory configuration to the given stream.

Parameters
debugData stream to dump the data to

Definition at line 248 of file AllWize.cpp.

◆ factoryReset()

bool AllWize::factoryReset ( )

Resets the module to factory settings.

Returns
Factory reset successfully issued

Definition at line 158 of file AllWize.cpp.

◆ getAppendRSSI()

bool AllWize::getAppendRSSI ( )

Gets the current RSSI mode value.

Returns
True if RSSI value will be appended to received data

Definition at line 505 of file AllWize.cpp.

◆ getChannel()

uint8_t AllWize::getChannel ( )

Gets the channel stored in non-volatile memory.

Returns
Channel (1 byte)

Definition at line 407 of file AllWize.cpp.

◆ getControlField()

uint8_t AllWize::getControlField ( )

Gets the control field value stored in non-volatile memory.

Returns
Control field value (1 byte)

Definition at line 610 of file AllWize.cpp.

◆ getControlInformation()

uint8_t AllWize::getControlInformation ( )

Gets the control information byte.

Returns
CI byte value

Definition at line 387 of file AllWize.cpp.

◆ getDataInterface()

uint8_t AllWize::getDataInterface ( )

Gets the data interface for receiving packets.

Returns
Value (1 byte)

Definition at line 590 of file AllWize.cpp.

◆ getDataRate()

uint8_t AllWize::getDataRate ( )

Gets the data rate stored in non-volatile memory.

Returns
Current data rate (1 byte)

Definition at line 447 of file AllWize.cpp.

◆ getDecryptFlag()

uint8_t AllWize::getDecryptFlag ( )

Gets the decrypt flag setting.

Returns
Decrypt flag

Definition at line 667 of file AllWize.cpp.

◆ getDefaultKey()

void AllWize::getDefaultKey ( uint8_t *  key)

Gets the default encryption key.

Parameters
keyA binary buffer to store the key (16 bytes)

Definition at line 697 of file AllWize.cpp.

◆ getDevice()

uint8_t AllWize::getDevice ( )

Returns the device version from non-volatile memory.

Returns
Device

Definition at line 801 of file AllWize.cpp.

◆ getEncryptFlag()

uint8_t AllWize::getEncryptFlag ( )

Gets the encrypt flag setting.

Returns
Encrypt flag

Definition at line 651 of file AllWize.cpp.

◆ getFirmwareVersion()

String AllWize::getFirmwareVersion ( )

Returns the module firmware revision.

Returns
4-byte hex string with the FW version

Definition at line 827 of file AllWize.cpp.

◆ getRequiredHardwareVersion()

String AllWize::getRequiredHardwareVersion ( )

Returns the module hardware revision.

Returns
4-byte hex string with the HW version

Definition at line 818 of file AllWize.cpp.

◆ getInstallMode()

uint8_t AllWize::getInstallMode ( )

Gets the install modevalue stored in non-volatile memory.

Returns
Install mode value (1 byte)

Definition at line 632 of file AllWize.cpp.

◆ getLEDControl()

uint8_t AllWize::getLEDControl ( )

Gets the current LED control.

Returns
LED control value

Definition at line 571 of file AllWize.cpp.

◆ getMode()

uint8_t AllWize::getMode ( )

Gets the MBus mode stored in non-volatile memory.

Returns
MBus mode (1 byte)

Definition at line 468 of file AllWize.cpp.

◆ getMID()

String AllWize::getMID ( )

Returns the Manufacturer ID string.

Returns
2-byte hex string with the manufacturer ID

Definition at line 753 of file AllWize.cpp.

◆ getNetworkRole()

uint8_t AllWize::getNetworkRole ( )

Gets the current network role.

Returns
Network role

Definition at line 555 of file AllWize.cpp.

◆ getPartNumber()

String AllWize::getPartNumber ( )

Returns the module part number.

Returns
12-byte hex string with the part number

Definition at line 809 of file AllWize.cpp.

◆ getPower()

uint8_t AllWize::getPower ( )

Gets the RF power stored in non-volatile memory.

Returns
RF power (1 byte)

Definition at line 429 of file AllWize.cpp.

◆ getPreamble()

uint8_t AllWize::getPreamble ( )

Gets the preamble length frame format.

Returns
Preamble length format (1 byte)

Definition at line 523 of file AllWize.cpp.

◆ getSerialNumber()

String AllWize::getSerialNumber ( )

Returns the module serial number.

Returns
8-byte hex string with the serial number

Definition at line 836 of file AllWize.cpp.

◆ getSleepMode()

uint8_t AllWize::getSleepMode ( )

Gets the sleep mode stored in non-volatile memory.

Returns
Sleep mode (1 byte)

Definition at line 484 of file AllWize.cpp.

◆ getTemperature()

uint8_t AllWize::getTemperature ( )

Returns the RSSI of the last valid packet received TODO: values do not seem right and are not the same as in the packet.

Returns
RSSI in dBmReturns the internal temperature of the module
Temperature in Celsius

Definition at line 720 of file AllWize.cpp.

◆ getTimeout()

uint8_t AllWize::getTimeout ( )

Gets the current timeout for auto sleep modes.

Returns
Timeout setting

Definition at line 539 of file AllWize.cpp.

◆ getUID()

String AllWize::getUID ( )

Returns the Unique ID string.

Returns
4-byte hex string with the unique ID

Definition at line 772 of file AllWize.cpp.

◆ getVersion()

uint8_t AllWize::getVersion ( )

Returns the module version from non-volatile memory.

Returns
Version

Definition at line 793 of file AllWize.cpp.

◆ getVoltage()

uint16_t AllWize::getVoltage ( )

Returns the internal voltage of the module.

Returns
Voltage in mV

Definition at line 737 of file AllWize.cpp.

◆ read()

allwize_message_t AllWize::read ( )

Returns latest received message.

Returns
New message

Definition at line 367 of file AllWize.cpp.

◆ reset()

bool AllWize::reset ( )

Resets the radio module.

Returns
Reset successfully issued

Definition at line 127 of file AllWize.cpp.

◆ send() [1/2]

bool AllWize::send ( uint8_t *  buffer,
uint8_t  len 
)

Sends a byte array.

Parameters
bufferByte array with the application payload
lenLength of the payload
Returns
Returns true if message has been correctly sent

Definition at line 301 of file AllWize.cpp.

◆ send() [2/2]

bool AllWize::send ( const char *  buffer)

Sends c-string.

Parameters
bufferC-string with the application payload
Returns
Returns true if message has been correctly sent

Definition at line 325 of file AllWize.cpp.

◆ setAppendRSSI()

void AllWize::setAppendRSSI ( bool  value)

Sets the RSSI mode value.

Parameters
valueSet to true to append RSSI value to received data

Definition at line 492 of file AllWize.cpp.

◆ setChannel()

void AllWize::setChannel ( uint8_t  channel,
bool  persist = false 
)

Sets the communications channel (for MBUS_MODE_R2 only)

Parameters
channelChannel number
persistPersist the changes in non-volatile memory (defaults to False)

Definition at line 396 of file AllWize.cpp.

◆ setControlField()

void AllWize::setControlField ( uint8_t  value,
bool  persist = false 
)

Sets the control field value.

Parameters
valueControl field
persistPersist the changes in non-volatile memory (defaults to False)

Definition at line 599 of file AllWize.cpp.

◆ setControlInformation()

void AllWize::setControlInformation ( uint8_t  ci)

Sets the control information byte.

Parameters
ciCI byte value

Definition at line 379 of file AllWize.cpp.

◆ setDataInterface()

void AllWize::setDataInterface ( uint8_t  value)

Sets the data interface for receiving packets.

Parameters
Valuefrom 0x00 to 0x0C

Definition at line 579 of file AllWize.cpp.

◆ setDataRate()

void AllWize::setDataRate ( uint8_t  dr)

Sets the data rate.

Parameters
drValue in [1, 2, 4, 5]

Definition at line 437 of file AllWize.cpp.

◆ setDecryptFlag()

void AllWize::setDecryptFlag ( uint8_t  flag)

Sets the decrypt flag setting.

Parameters
flagDecrypt flag

Definition at line 659 of file AllWize.cpp.

◆ setDefaultKey()

void AllWize::setDefaultKey ( const uint8_t *  key)

Sets the default encryption key.

Parameters
keyA 16-byte encryption key as binary array

Definition at line 689 of file AllWize.cpp.

◆ setEncryptFlag()

void AllWize::setEncryptFlag ( uint8_t  flag)

Sets the encrypt flag setting.

Parameters
flagEncrypt flag

Definition at line 640 of file AllWize.cpp.

◆ setInstallMode()

void AllWize::setInstallMode ( uint8_t  mode,
bool  persist = false 
)

Sets the module in one of the available operations modes.

Parameters
modeOperation mode
persistPersist the changes in non-volatile memory (defaults to False)

Definition at line 619 of file AllWize.cpp.

◆ setKey()

void AllWize::setKey ( uint8_t  reg,
const uint8_t *  key 
)

Sets the default encryption key.

Parameters
regRegister number (1-64)
keyA 16-byte encryption key as binary array

Definition at line 676 of file AllWize.cpp.

◆ setLEDControl()

void AllWize::setLEDControl ( uint8_t  value)

Sets the LED control.

Parameters
valueLED control value

Definition at line 563 of file AllWize.cpp.

◆ setMode()

void AllWize::setMode ( uint8_t  mode,
bool  persist = false 
)

Sets the module in one of the available MBus modes.

Parameters
modeMBus mode (MBUS_MODE_*)
persistPersist the changes in non-volatile memory (defaults to False)

Definition at line 456 of file AllWize.cpp.

◆ setNetworkRole()

void AllWize::setNetworkRole ( uint8_t  role)

Sets the network role.

Parameters
roleNetwork role (NETWORK_ROLE_*)

Definition at line 547 of file AllWize.cpp.

◆ setPower()

void AllWize::setPower ( uint8_t  power,
bool  persist = false 
)

Sets the RF power.

Parameters
powerValue from 1 to 5
persistPersist the changes in non-volatile memory (defaults to False)

Definition at line 416 of file AllWize.cpp.

◆ setPreamble()

void AllWize::setPreamble ( uint8_t  preamble)

Sets the preamble length frame format.

Parameters
preamble0 or 2

Definition at line 513 of file AllWize.cpp.

◆ setSleepMode()

void AllWize::setSleepMode ( uint8_t  mode)

Sets the sleep mode.

Parameters
modeOne of SLEEP_MODE_*

Definition at line 476 of file AllWize.cpp.

◆ setTimeout()

void AllWize::setTimeout ( uint8_t  timeout)

Sets the timeout for auto sleep modes.

Parameters
timeoutTimeout value (defaults to 1s)

Definition at line 531 of file AllWize.cpp.


The documentation for this class was generated from the following files: