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

Public Member Functions

 Allwize (Stream &stream, uint8_t reset_gpio=0xFF)
 Allwize object constructor. More...
 
void begin ()
 Inits the module communications.
 
bool reset ()
 Resets the radio module. You must reset the serial connection after the reset: Serial1.end(); Serial1.begin(19200); delay(200);. More...
 
bool factoryReset ()
 Resets the module to factory settings You must reset the serial connection after the factoryReset: Serial1.end(); Serial1.begin(19200); delay(200);. 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.
 
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 setPreamble (uint8_t preamble)
 Sets the RSSI mode value. 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 setControlField (uint8_t value, bool persist=false)
 Sets the data interface for receiving packets. 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 setDefaultKey (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 getControlField ()
 Gets the control field value stored in non-volatile memory. 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...
 
String getUID ()
 Returns the Unique ID string. More...
 
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

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.
 
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. Returns the number of bytes received and stored in the internal _buffer. 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

Stream & _stream
 
uint8_t _reset_gpio = 0xFF
 
bool _config = false
 
uint32_t _timeout = DEFAULT_TIMEOUT
 
uint8_t _ci = CONTROL_INFORMATION
 
String _model
 
String _fw
 
String _hw
 
allwize_message_t _message
 
uint8_t _buffer [RX_BUFFER_SIZE]
 
uint8_t _pointer
 

Detailed Description

Definition at line 163 of file Allwize.h.

Constructor & Destructor Documentation

◆ Allwize()

Allwize::Allwize ( Stream &  stream,
uint8_t  reset_gpio = 0xFF 
)

Allwize object constructor.

Parameters
streamSerial stream to communicate with the module

Definition at line 33 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
{uint8_t*} bin Buffer to read the values from
{char*} hex C-string to store the hex values
{uint8_t}len Length of the input buffer

Definition at line 1066 of file Allwize.cpp.

◆ _decode()

bool Allwize::_decode ( )
protected

Decodes the current RX buffer contents.

Returns
{bool} 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) | * | * | * | * | * | * |
  2. Control field (1-byte) | * | * | * | * | * | * | NO?
  3. Header (8-bytes) | | | * | * | * | * | NO?
  4. Control info (1-byte) | * | * | * | * | * | * |
  5. App data (n-bytes) | * | * | * | * | * | * |
  6. RSSI (1-byte) | if RSSI_MODE == 1 |
  7. CRC (2-bytes) | | | | | | * |
  8. Stop byte (0x16) | | | | * | | * |

Data Interface is hardcoded to 0x04 for this version and RSSI enabled

Definition at line 892 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
{uint8_t}address Address to start from
{uint8_t*} buffer Buffer with at least 'len' position to store data to
{uint8_t}len Number of positions to read
Returns
{uint8_t} Number of positions actually read

Definition at line 780 of file Allwize.cpp.

◆ _getMemory() [2/2]

uint8_t Allwize::_getMemory ( uint8_t  address)
protected

Returns the contents of single memory addresses.

Parameters
{uint8_t}address Address to start from
Returns
{uint8_t} Contents of the address, 0 if error

Definition at line 800 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
{uint8_t}address Address to start from
{uint8_t}len Number of bytes to read
Returns
{String} Result (empty string if error)

Definition at line 813 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
{uint8_t}address Address to start from
{uint8_t}len Number of bytes to read
Returns
{String} Result (empty string if error)

Definition at line 830 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
{char*} hex C-string with the hex values
{uint8_t*} bin Buffer to store the converted values in
{uint8_t}len Length of the hex c-string

Definition at line 1053 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
{char*} buffer Buffer to store the values to
{uint16_t}len Max number of bytes to read
Returns
{int} Number of bytes read or -1 if timed out

Definition at line 1013 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
{char}terminator Terminating char
{char*} buffer Buffer to store the values to
{uint16_t}len Max number of bytes to read
Returns
{int} Number of bytes read or -1 if timed out

Definition at line 1033 of file Allwize.cpp.

◆ _receive()

int8_t Allwize::_receive ( )
protected

Listens to incomming data from the module until timeout or END_OF_RESPONSE. Returns the number of bytes received and stored in the internal _buffer.

Returns
{int8_t} Number of bytes received, -1 if timed out or error sending

Definition at line 958 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
{uint8_t*} buffer Binary data to send
{uint8_t}len Length of the binary data
Returns
{uint8_t} Number of bytes actually sent

Definition at line 945 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
{uint8_t}ch Byte to send
Returns
{uint8_t} Number of bytes actually sent

Definition at line 934 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
{uint8_t*} buffer Binary data to send
{uint8_t}len Length of the binary data
Returns
{int8_t} Number of bytes received, -1 if timed out or error sending

Definition at line 969 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
{uint8_t}ch Byte to send (-1 if timed out)
Returns
{int8_t} Number of bytes received, -1 if timed out or error sending

Definition at line 980 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
{uint8_t}command Command key
{uint8_t*} data Binary data to send
{uint8_t}len Length of the binary data

Definition at line 701 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
{uint8_t}command Command key
{uint8_t}data Single byte
Returns
{int8_t} Number of bytes received, -1 if timed out or error sending

Definition at line 718 of file Allwize.cpp.

◆ _sendCommand() [3/3]

int8_t Allwize::_sendCommand ( uint8_t  command)
protected

Sends a command with no data.

Parameters
{uint8_t}command Command key
Returns
{int8_t} Number of bytes received, -1 if timed out or error sending

Definition at line 734 of file Allwize.cpp.

◆ _setConfig()

bool Allwize::_setConfig ( bool  value)
protected

Sets or unsets config mode.

Parameters
{bool}value True to enter config mode
Returns
{bool} True if in config mode

Definition at line 677 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
{uint8_t}address Command key
{uint8_t*} data Binary data to store
{uint8_t}len Length of the binary data
Returns
{bool} True if the data was successfully saved

Definition at line 750 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
{uint8_t}address Command key
{uint8_t}data Single byte to store at given address
Returns
{bool} True if the data was successfully saved

Definition at line 767 of file Allwize.cpp.

◆ _timedRead()

int Allwize::_timedRead ( )
protected

Reads a byte from the stream with a timeout.

Returns
{int} Read char or -1 if timed out

Definition at line 994 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
bool Whether a new message is available

Definition at line 234 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 158 of file Allwize.cpp.

◆ factoryReset()

bool Allwize::factoryReset ( )

Resets the module to factory settings You must reset the serial connection after the factoryReset: Serial1.end(); Serial1.begin(19200); delay(200);.

Returns
bool Factory reset successfully issued

Definition at line 87 of file Allwize.cpp.

◆ getChannel()

uint8_t Allwize::getChannel ( )

Gets the channel stored in non-volatile memory.

Returns
uint8_t Channel (1 byte)

Definition at line 305 of file Allwize.cpp.

◆ getControlField()

uint8_t Allwize::getControlField ( )

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

Returns
{uint8_t} Control field value (1 byte)

Definition at line 495 of file Allwize.cpp.

◆ getControlInformation()

uint8_t Allwize::getControlInformation ( )

Gets the control information byte.

Returns
uint8_t CI byte value

Definition at line 287 of file Allwize.cpp.

◆ getDataRate()

uint8_t Allwize::getDataRate ( )

Gets the data rate stored in non-volatile memory.

Returns
uint8_t Current data rate (1 byte)

Definition at line 343 of file Allwize.cpp.

◆ getDecryptFlag()

uint8_t Allwize::getDecryptFlag ( )

Gets the decrypt flag setting.

Returns
{uint8_t} Decrypt flag

Definition at line 545 of file Allwize.cpp.

◆ getDefaultKey()

void Allwize::getDefaultKey ( uint8_t *  key)

Gets the default encryption key.

Parameters
{uint8_t*} key A binary buffer to store the key (16 bytes)

Definition at line 561 of file Allwize.cpp.

◆ getDevice()

uint8_t Allwize::getDevice ( )

Returns the device version from non-volatile memory.

Returns
{uint8_t} Device

Definition at line 628 of file Allwize.cpp.

◆ getEncryptFlag()

uint8_t Allwize::getEncryptFlag ( )

Gets the encrypt flag setting.

Returns
{uint8_t} Encrypt flag

Definition at line 529 of file Allwize.cpp.

◆ getFirmwareVersion()

String Allwize::getFirmwareVersion ( )

Returns the module firmware revision.

Returns
{String} 4-byte hex string with the FW version

Definition at line 654 of file Allwize.cpp.

◆ getRequiredHardwareVersion()

String Allwize::getRequiredHardwareVersion ( )

Returns the module hardware revision.

Returns
{String} 4-byte hex string with the HW version

Definition at line 645 of file Allwize.cpp.

◆ getInstallMode()

uint8_t Allwize::getInstallMode ( )

Gets the install modevalue stored in non-volatile memory.

Returns
{uint8_t} Install mode value (1 byte)

Definition at line 513 of file Allwize.cpp.

◆ getLEDControl()

uint8_t Allwize::getLEDControl ( )

Gets the current LED control.

Returns
{uint8_t} LED control value

Definition at line 459 of file Allwize.cpp.

◆ getMode()

uint8_t Allwize::getMode ( )

Gets the MBus mode stored in non-volatile memory.

Returns
uint8_t MBus mode (1 byte)

Definition at line 361 of file Allwize.cpp.

◆ getMID()

String Allwize::getMID ( )

Returns the Manufacturer ID string.

Returns
{String} 2-byte hex string with the manufacturer ID

Definition at line 604 of file Allwize.cpp.

◆ getNetworkRole()

uint8_t Allwize::getNetworkRole ( )

Gets the current network role.

Returns
uint8_t Network role

Definition at line 443 of file Allwize.cpp.

◆ getPartNumber()

String Allwize::getPartNumber ( )

Returns the module part number.

Returns
{String} 12-byte hex string with the part number

Definition at line 636 of file Allwize.cpp.

◆ getPower()

uint8_t Allwize::getPower ( )

Gets the RF power stored in non-volatile memory.

Returns
uint8_t RF power (1 byte)

Definition at line 325 of file Allwize.cpp.

◆ getPreamble()

uint8_t Allwize::getPreamble ( )

Gets the preamble length frame format.

Returns
uint8_t Preamble length format (1 byte)

Definition at line 411 of file Allwize.cpp.

◆ getSerialNumber()

String Allwize::getSerialNumber ( )

Returns the module serial number.

Returns
{String} 8-byte hex string with the serial number

Definition at line 663 of file Allwize.cpp.

◆ getSleepMode()

uint8_t Allwize::getSleepMode ( )

Gets the sleep mode stored in non-volatile memory.

Returns
uint8_t Sleep mode (1 byte)

Definition at line 377 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
{float} RSSI in dBmReturns the internal temperature of the module
{uint8_t} Temperature in Celsius

Definition at line 584 of file Allwize.cpp.

◆ getTimeout()

uint8_t Allwize::getTimeout ( )

Gets the current timeout for auto sleep modes.

Returns
uint8_t Timeout setting

Definition at line 427 of file Allwize.cpp.

◆ getUID()

String Allwize::getUID ( )

Returns the Unique ID string.

Returns
{String} 4-byte hex string with the unique ID

Definition at line 612 of file Allwize.cpp.

◆ getVersion()

uint8_t Allwize::getVersion ( )

Returns the module version from non-volatile memory.

Returns
{uint8_t} Version

Definition at line 620 of file Allwize.cpp.

◆ getVoltage()

uint16_t Allwize::getVoltage ( )

Returns the internal voltage of the module.

Returns
{uint16_t} Voltage in mV

Definition at line 594 of file Allwize.cpp.

◆ read()

allwize_message_t Allwize::read ( )

Returns latest received message.

Returns
allwize_message_t New message

Definition at line 267 of file Allwize.cpp.

◆ reset()

bool Allwize::reset ( )

Resets the radio module. You must reset the serial connection after the reset: Serial1.end(); Serial1.begin(19200); delay(200);.

Returns
bool Reset successfully issued

Definition at line 56 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
bool Returns true if message has been correctly sent

Definition at line 211 of file Allwize.cpp.

◆ send() [2/2]

bool Allwize::send ( const char *  buffer)

Sends c-string.

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

Definition at line 225 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 296 of file Allwize.cpp.

◆ setControlField()

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

Sets the data interface for receiving packets.

Parameters
{uint8_t}value Value from 0x00 to 0x0CGets the data interface for receiving packets
Returns
{uint8_t} value (1 byte)Sets the control field value
Parameters
{uint8_t}value Control field
{bool}persist Persist the changes in non-volatile memory (defaults to False)

Definition at line 486 of file Allwize.cpp.

◆ setControlInformation()

void Allwize::setControlInformation ( uint8_t  ci)

Sets the control information byte.

Parameters
ciCI byte value

Definition at line 279 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 333 of file Allwize.cpp.

◆ setDecryptFlag()

void Allwize::setDecryptFlag ( uint8_t  flag)

Sets the decrypt flag setting.

Parameters
{uint8_t}flag Decrypt flag

Definition at line 537 of file Allwize.cpp.

◆ setDefaultKey()

void Allwize::setDefaultKey ( uint8_t *  key)

Sets the default encryption key.

Parameters
{uint8_t*} key A 16-byte encryption key as binary array

Definition at line 553 of file Allwize.cpp.

◆ setEncryptFlag()

void Allwize::setEncryptFlag ( uint8_t  flag)

Sets the encrypt flag setting.

Parameters
{uint8_t}flag Encrypt flag

Definition at line 521 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
{allwize_install_mode_t}mode Operation mode
{bool}persist Persist the changes in non-volatile memory (defaults to False)

Definition at line 504 of file Allwize.cpp.

◆ setLEDControl()

void Allwize::setLEDControl ( uint8_t  value)

Sets the LED control.

Parameters
valueLED control value

Definition at line 451 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 352 of file Allwize.cpp.

◆ setNetworkRole()

void Allwize::setNetworkRole ( uint8_t  role)

Sets the network role.

Parameters
roleNetwork role (NETWORK_ROLE_*)

Definition at line 435 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 314 of file Allwize.cpp.

◆ setPreamble()

void Allwize::setPreamble ( uint8_t  preamble)

Sets the RSSI mode value.

Parameters
valueSet to true to append RSSI value to received dataGets the current RSSI mode value
Returns
bool True if RSSI value will be appended to received dataSets the preamble length frame format
Parameters
preamble0 or 2

Definition at line 401 of file Allwize.cpp.

◆ setSleepMode()

void Allwize::setSleepMode ( uint8_t  mode)

Sets the sleep mode.

Parameters
modeOne of SLEEP_MODE_*

Definition at line 369 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 419 of file Allwize.cpp.


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