Zpal-radio#

Defines a platform abstraction layer for the Z-Wave radio.

The ZPAL Radio module contains several APIs which are required to be implemented.

A user of this radio module shall first define all parameters of the Z-Wave Radio Profile (i.e., zpal_radio_profile_t) and initialise the radio using zpal_radio_init API.

After the initialisation of the radio is executed, the user can use any of the radio APIs to execute radio related paradigm for instance

  • zpal_radio_transmit shall be used to transmit a Z-Wave frame on radio

  • zpal_radio_start_receive shall be used to enable the reception of Z-Wave frame

The radio API assumes that the radio will return to receive mode with channel hopping enabled after transmitting a frame.

Modules#

zpal_radio_transmit_parameter_t

zpal_radio_rx_parameters_t

_zpal_radio_beam_info_t_

zpal_radio_receive_frame_t

zpal_radio_network_stats_t

zpal_radio_profile_t

zpal_radio_transmit_parameter_t.__unnamed4__

Number of Channels

Enumerations#

enum
ZPAL_RADIO_LISTEN_NEVER
ZPAL_RADIO_LISTEN_ALWAYS
ZPAL_RADIO_LISTEN_FREQUENTLY_250ms
ZPAL_RADIO_LISTEN_FREQUENTLY_1000ms
}

Wakeup interval for the radio.

enum
ZPAL_RADIO_CRC_NONE
ZPAL_RADIO_CRC_8_BIT_XOR
ZPAL_RADIO_CRC_16_BIT_CCITT
}

Enumeration containing supported checksum types in Z-Wave.

enum
ZPAL_RADIO_SPEED_UNDEFINED
ZPAL_RADIO_SPEED_9600
ZPAL_RADIO_SPEED_40K
ZPAL_RADIO_SPEED_100K
ZPAL_RADIO_SPEED_100KLR
}

Enumeration containing supported baud rates.

enum
ZPAL_RADIO_LR_CHANNEL_UNINITIALIZED
ZPAL_RADIO_LR_CHANNEL_A
ZPAL_RADIO_LR_CHANNEL_B
ZPAL_RADIO_LR_CHANNEL_UNKNOWN
ZPAL_RADIO_LR_CHANNEL_AUTO = 255
}

Enumeration containing Long Range Channels.

enum
ZPAL_RADIO_ZWAVE_CHANNEL_0 = 0
ZPAL_RADIO_ZWAVE_CHANNEL_1 = 1
ZPAL_RADIO_ZWAVE_CHANNEL_2 = 2
ZPAL_RADIO_ZWAVE_CHANNEL_3 = 3
ZPAL_RADIO_ZWAVE_CHANNEL_4 = 4
ZPAL_RADIO_ZWAVE_CHANNEL_NUM
ZPAL_RADIO_ZWAVE_CHANNEL_UNKNOWN = 0xFF
}

Enumeration containing Z-Wave channels.

enum
ZPAL_RADIO_PROTOCOL_MODE_1
ZPAL_RADIO_PROTOCOL_MODE_2
ZPAL_RADIO_PROTOCOL_MODE_3
ZPAL_RADIO_PROTOCOL_MODE_4
ZPAL_RADIO_PROTOCOL_MODE_UNDEFINED = 0xFF
}

Enumeration containing Z-Wave channels known as protocol modes.

enum
ZPAL_RADIO_LR_CH_CFG_NO_LR
ZPAL_RADIO_LR_CH_CFG1
ZPAL_RADIO_LR_CH_CFG2
ZPAL_RADIO_LR_CH_CFG3
ZPAL_RADIO_LR_CH_CFG_COUNT
}

List of LR channel configuration.

enum
REGION_2CH_FIRST = 0
REGION_EU = REGION_2CH_FIRST
REGION_US
REGION_ANZ
REGION_HK
REGION_DEPRECATED_4
REGION_IN = 5
REGION_IL
REGION_RU
REGION_CN
REGION_US_LR
REGION_DEPRECATED_10
REGION_EU_LR
REGION_2CH_END
REGION_3CH_FIRST = 32
REGION_JP = REGION_3CH_FIRST
REGION_KR
REGION_3CH_END
REGION_DEPRECATED_48 = 48
REGION_UNDEFINED = 0xFE
REGION_DEFAULT = 0xFF
}

Enumeration official Z-Wave regions.

enum
ZPAL_RADIO_TX_POWER_DEFAULT
ZPAL_RADIO_TX_POWER_MINUS1_DBM
ZPAL_RADIO_TX_POWER_MINUS2_DBM
ZPAL_RADIO_TX_POWER_MINUS3_DBM
ZPAL_RADIO_TX_POWER_MINUS4_DBM
ZPAL_RADIO_TX_POWER_MINUS5_DBM
ZPAL_RADIO_TX_POWER_MINUS6_DBM
ZPAL_RADIO_TX_POWER_MINUS7_DBM
ZPAL_RADIO_TX_POWER_MINUS8_DBM
ZPAL_RADIO_TX_POWER_MINUS9_DBM
ZPAL_RADIO_TX_POWER_MINUS10_DBM
ZPAL_RADIO_TX_POWER_MINUS11_DBM
ZPAL_RADIO_TX_POWER_MINUS12_DBM
ZPAL_RADIO_TX_POWER_MINUS13_DBM
ZPAL_RADIO_TX_POWER_MINUS14_DBM
ZPAL_RADIO_TX_POWER_REDUCED = ZPAL_RADIO_TX_POWER_MINUS3_DBM
}

Enumeration containing Tx power settings.

enum
ZPAL_RADIO_HEADER_TYPE_2CH
ZPAL_RADIO_HEADER_TYPE_3CH
ZPAL_RADIO_HEADER_TYPE_LR
ZPAL_RADIO_HEADER_TYPE_UNDEFINED
}

Z-Wave Frame header format types.

enum
ZPAL_RADIO_EVENT_NONE
ZPAL_RADIO_EVENT_RX_COMPLETE
ZPAL_RADIO_EVENT_TX_COMPLETE
ZPAL_RADIO_EVENT_RX_BEAM_COMPLETE
ZPAL_RADIO_EVENT_TX_BEAM_COMPLETE
ZPAL_RADIO_EVENT_RX_ABORT
ZPAL_RADIO_EVENT_TX_FAIL
ZPAL_RADIO_EVENT_TX_FAIL_LBT
ZPAL_RADIO_EVENT_RXTX_CALIBRATE
ZPAL_RADIO_EVENT_MASK = 0x1F
ZPAL_RADIO_EVENT_FLAG_SUCCESS = 0x80
ZPAL_RADIO_EVENT_TX_TIMEOUT = 254
}

Enumeratio radio events.

enum
ZPAL_RADIO_APPLICATION_CONTROLLER = 0
ZPAL_RADIO_APPLICATION_END_DEVICE
ZPAL_RADIO_APPLICATION_ZNIFFER
}
enum
ZPAL_RADIO_STATUS_OFF = 0
ZPAL_RADIO_STATUS_FLIRS
ZPAL_RADIO_STATUS_ON
}

Typedefs#

typedef uint16_t

Node ID type.

typedef int16_t

Parameter type to store deci dBm values.

typedef uint32_t

Parameter type to store stay awake ids.

typedef void(*
zpal_radio_callback_t)(const zpal_radio_event_t event)
typedef void(*
zpal_radio_receive_handler_t)(zpal_radio_rx_parameters_t *rx_parameters, zpal_radio_receive_frame_t *frame)

Function pointer declaration for handling of received frames.

typedef void(*
zpal_radio_status_callback_t)(const zpal_radio_status_t state)

Functions#

void
zpal_radio_set_network_ids(uint32_t home_id, node_id_t node_id, uint8_t home_id_hash)

Sets the home ID & the node ID.

zpal_radio_init(const zpal_radio_profile_t *const profile)

Initializes the radio hardware with the specified configuration profile.

zpal_radio_change_region(zpal_radio_region_t eRegion, zpal_radio_lr_channel_config_t eLrChCfg)

Function used to change region and Long Range mode at the same time.

Function for getting REGION runtime.

zpal_radio_transmit(zpal_radio_transmit_parameter_t const *const tx_parameters, uint8_t frame_header_length, uint8_t const *const frame_header_buffer, uint8_t frame_payload_length, uint8_t const *const frame_payload_buffer, uint8_t is_retransmission)

Function for transmitting a Z-Wave frame though the radio.

zpal_radio_transmit_beam(zpal_radio_transmit_parameter_t const *const tx_parameters, uint8_t beam_data_len, uint8_t const *const beam_data)

Function for transmitting a Z-Wave Beam frame though the radio.

Starts the receiver and enables reception of frames.

bool

Checks if data is available for processing in the radio module.

Restart the radio if a frame reception is in progress.

zpal_radio_get_last_received_frame(zpal_radio_receive_frame_t *frame)

Function to get the last received frame.

Function to get the protocol mode used in the configured region.

void
zpal_radio_set_lbt_level(uint8_t channel, int8_t level)

Function for setting the LBT RSSI level.

void

Enable or disables reception of broadcast beam.

void

Function for clearing current Channel Transmit timers.

void

Function for clearing current Network statistics.

zpal_radio_get_background_rssi(uint8_t channel, int8_t *rssi)

Returns the background RSSI.

Function for getting the default tx power in deci dBm.

Puts the radio into an idle state.

Aborts any ongoing radio operation.

Shuts down the radio hardware.

Resets the radio configuration to receive mode after having received a beam.

bool

Returns whether use of fragmented beams is enabled or not for the active region.

bool

Returns whether listen before talk (LBT) is enabled.

uint16_t

Returns the time it takes to start transmission of wake up beams.

Returns the minimum transmit power for Z-Wave Long Range.

Returns the maximum transmit power for Z-Wave Long Range.

Disable the radio debug mode.

a getter on the current rf profile.

Function to read current Long Range Channel Configuration.

Function to read current Primary Long Range Channel.

void
zpal_radio_set_primary_long_range_channel(zpal_radio_lr_channel_t channel)

Function to set the Primary Long Range Channel.

bool

Function to read current Long Range Channel selection mode.

Function to set the Long Range Channel selction mode.

bool
zpal_radio_is_region_supported(zpal_radio_region_t region)

Function to check if the stack implementation supports a given region.

bool
zpal_radio_is_transmit_allowed(uint8_t channel, uint8_t frame_length, bool cca)

Check if transmission is allowed for specified channel.

bool
zpal_radio_attenuate(zpal_radio_tx_power_t adjust_tx_power)

Function to reduce Tx power of classic non-listening devices.

Return the maximum board supported tx power for classic z-wave.

zpal_radio_limit_lr_power_to_capability(zpal_tx_power_decidbm_t requested_power)

Function to adjust the requested tx power for Long Range.

void

Function to radio calibration.

zpal_radio_get_last_beam_info(zpal_radio_beam_info_t *beamInfo)

Retrieves information about the last received beam.

void
zpal_radio_rf_channel_statistic_store_background_rssi_average(zpal_radio_zwave_channel_t zwavechannel, int8_t averagerssi)

Stores the average RSSI (Received Signal Strength Indicator) for a given Z-Wave channel.

zpal_radio_request_stay_awake(uint32_t msecs, zpal_radio_stay_awake_id_t *id)

Requests the radio to stay awake for a specified number of milliseconds.

zpal_radio_revoke_stay_awake(zpal_radio_stay_awake_id_t *id)

Revokes a previous stay-awake request, allowing the radio to sleep as normal.

zpal_radio_update_stay_awake(zpal_radio_stay_awake_id_t *id, uint32_t new_msecs)

Lengthens the current stay-awake period.

Getter of wakeup state of the radio.

zpal_radio_set_status_callback(zpal_radio_status_callback_t callback)

Registers a callback function to be invoked on radio state changes.

zpal_radio_set_joinable(bool is_joinable)

Inform the ZPAL radio layer that the node has been correctly included in a network.

Macros#

#define
ZPAL_RADIO_INVALID_RSSI_DBM (-128)

RSSI value is invalid or not measured.

#define
ZPAL_RADIO_RSSI_NOT_AVAILABLE (127)
#define
ZW_TX_POWER_100_DDBM 100
#define
ZW_TX_POWER_140_DDBM 140
#define
ZW_TX_POWER_200_DDBM 200
#define
ZW_TX_POWER_10DBM ZW_TX_POWER_100_DDBM

Deprecateduse ZW_TX_POWER_100_DDBM instead

#define
ZW_TX_POWER_14DBM ZW_TX_POWER_140_DDBM

Deprecateduse ZW_TX_POWER_140_DDBM instead

#define
ZW_TX_POWER_20DBM ZW_TX_POWER_200_DDBM

Deprecateduse ZW_TX_POWER_200_DDBM instead

#define
ZPAL_RADIO_STAY_AWAKE_ALWAYS UINT32_MAX
#define
ZPAL_TX_POWER_DECIDBM_MAX 0x7FFF

definition for maximum output power to use with zpal_tx_power_decidbm_t.

#define
REGION_2CH_NUM = (REGION_2CH_END - REGION_2CH_FIRST)

Number of 2 channel regions.

#define
REGION_3CH_NUM = (REGION_3CH_END - REGION_3CH_FIRST)

Number of 3 channel regions.

#define
ZWAVE_MAXIMUM_PAYLOAD_LEGACY 64
#define
ZWAVE_MAXIMUM_PAYLOAD_SIZE 170
#define
ZWAVE_MAXIMUM_PAYLOAD_SIZE_LR 190

Enumeration Documentation#

zpal_radio_listen_t#

zpal_radio_listen_t

Wakeup interval for the radio.

A FLiRS node will use 250 or 1000 ms interval, all other nodes should be configured as always listening.

Enumerator
ZPAL_RADIO_LISTEN_NEVER

Node is not listening (Only listen when application requests it).

ZPAL_RADIO_LISTEN_ALWAYS

Node is always listening.

ZPAL_RADIO_LISTEN_FREQUENTLY_250ms

Node wakes up every 250 ms interval to listen for a wakeup beam.

ZPAL_RADIO_LISTEN_FREQUENTLY_1000ms

Node wakes up every 1000 ms interval to listen for a wakeup beam.


zpal_radio_crc_t#

zpal_radio_crc_t

Enumeration containing supported checksum types in Z-Wave.

Enumerator
ZPAL_RADIO_CRC_NONE

No checksum.

ZPAL_RADIO_CRC_8_BIT_XOR

8 bit XOR checksum.

ZPAL_RADIO_CRC_16_BIT_CCITT

16 bit CRC-CCITT checksum.


zpal_radio_speed_t#

zpal_radio_speed_t

Enumeration containing supported baud rates.

Enumerator
ZPAL_RADIO_SPEED_UNDEFINED
ZPAL_RADIO_SPEED_9600
ZPAL_RADIO_SPEED_40K
ZPAL_RADIO_SPEED_100K
ZPAL_RADIO_SPEED_100KLR

zpal_radio_lr_channel_t#

zpal_radio_lr_channel_t

Enumeration containing Long Range Channels.

Enumerator
ZPAL_RADIO_LR_CHANNEL_UNINITIALIZED

Long Range Channel setting not initialized.

ZPAL_RADIO_LR_CHANNEL_A

Long Range Channel A.

ZPAL_RADIO_LR_CHANNEL_B

Long Range Channel B.

ZPAL_RADIO_LR_CHANNEL_UNKNOWN

Long Range Channel Unknown.

ZPAL_RADIO_LR_CHANNEL_AUTO

Long Range automatically selected Channel.


zpal_radio_zwave_channel_t#

zpal_radio_zwave_channel_t

Enumeration containing Z-Wave channels.

Enumerator
ZPAL_RADIO_ZWAVE_CHANNEL_0

Z-Wave channel 0.

ZPAL_RADIO_ZWAVE_CHANNEL_1

Z-Wave channel 1.

ZPAL_RADIO_ZWAVE_CHANNEL_2

Z-Wave channel 2.

ZPAL_RADIO_ZWAVE_CHANNEL_3

Z-Wave channel 3.

ZPAL_RADIO_ZWAVE_CHANNEL_4

Z-Wave channel 4.

ZPAL_RADIO_ZWAVE_CHANNEL_NUM

Number of Z-Wave channels. must be last.

ZPAL_RADIO_ZWAVE_CHANNEL_UNKNOWN

Z-Wave channel Unknown.


zpal_radio_protocol_mode_t#

zpal_radio_protocol_mode_t

Enumeration containing Z-Wave channels known as protocol modes.

Enumerator
ZPAL_RADIO_PROTOCOL_MODE_1

2 Channel Protocol Mode.

ZPAL_RADIO_PROTOCOL_MODE_2

3 Channel Protocol Mode.

ZPAL_RADIO_PROTOCOL_MODE_3

4 Channel Protocol Mode - Combination of 2 Channel (9.6kb/40kb, 100kb) and Long Range Channel.

ZPAL_RADIO_PROTOCOL_MODE_4

2 Long Range Channel Protocol Mode - End Device.

ZPAL_RADIO_PROTOCOL_MODE_UNDEFINED

Protocol mode undefined means invalid region code.


zpal_radio_lr_channel_config_t#

zpal_radio_lr_channel_config_t

List of LR channel configuration.

Used to select the correct phy configuration.

Enumerator
ZPAL_RADIO_LR_CH_CFG_NO_LR

used if region does not support Long range or end device included in classic network.

ZPAL_RADIO_LR_CH_CFG1

used by controller with primary channel A and not included end device Phy is configured to listen on classic Z-Wave channels and Long Range channel A.

ZPAL_RADIO_LR_CH_CFG2

used only by controller with primary channel B Phy is configured to listen on classic Z-Wave channels and Long Range channel B.

ZPAL_RADIO_LR_CH_CFG3

used only by end device when included in a LR network.

ZPAL_RADIO_LR_CH_CFG_COUNT

enumeration items count


zpal_radio_region_t#

zpal_radio_region_t

Enumeration official Z-Wave regions.

Enumerator
REGION_2CH_FIRST

First 2 channels region (with 3 data rates)

REGION_EU

Radio is located in Region EU. 2 Channel region.

REGION_US

Radio is located in Region US. 2 Channel region.

REGION_ANZ

Radio is located in Region Australia/New Zealand. 2 Channel region.

REGION_HK

Radio is located in Region Hong Kong. 2 Channel region.

REGION_DEPRECATED_4

Deprecated value, should never be used.

REGION_IN

Radio is located in Region India. 2 Channel region.

REGION_IL

Radio is located in Region Israel. 2 Channel region.

REGION_RU

Radio is located in Region Russia. 2 Channel region.

REGION_CN

Radio is located in Region China. 2 Channel region.

REGION_US_LR

Radio is located in Region US. 2 Channel LR region.

REGION_DEPRECATED_10

Deprecated value, should never be used.

REGION_EU_LR

Radio is located in Region EU. 2 Channel LR region.

REGION_2CH_END

end of 2 channels regions (with 3 data rates)

REGION_3CH_FIRST

First 3 channels region (with 1 data rate)

REGION_JP

Radio is located in Region Japan. 3 Channel region.

REGION_KR

Radio is located in Region Korea. 3 Channel region.

REGION_3CH_END

end of 3 channels regions (with 1 data rate)

REGION_DEPRECATED_48

Deprecated value, should never be used.

REGION_UNDEFINED
REGION_DEFAULT

Radio is located in Library Default Region EU. 2 Channel region.


zpal_radio_tx_power_t#

zpal_radio_tx_power_t

Enumeration containing Tx power settings.

Enumerator
ZPAL_RADIO_TX_POWER_DEFAULT

Max Tx power.

ZPAL_RADIO_TX_POWER_MINUS1_DBM
ZPAL_RADIO_TX_POWER_MINUS2_DBM
ZPAL_RADIO_TX_POWER_MINUS3_DBM
ZPAL_RADIO_TX_POWER_MINUS4_DBM
ZPAL_RADIO_TX_POWER_MINUS5_DBM
ZPAL_RADIO_TX_POWER_MINUS6_DBM
ZPAL_RADIO_TX_POWER_MINUS7_DBM
ZPAL_RADIO_TX_POWER_MINUS8_DBM
ZPAL_RADIO_TX_POWER_MINUS9_DBM
ZPAL_RADIO_TX_POWER_MINUS10_DBM
ZPAL_RADIO_TX_POWER_MINUS11_DBM
ZPAL_RADIO_TX_POWER_MINUS12_DBM
ZPAL_RADIO_TX_POWER_MINUS13_DBM
ZPAL_RADIO_TX_POWER_MINUS14_DBM
ZPAL_RADIO_TX_POWER_REDUCED

Default reduced Tx power.


zpal_radio_header_type_t#

zpal_radio_header_type_t

Z-Wave Frame header format types.

Enumerator
ZPAL_RADIO_HEADER_TYPE_2CH

2 Channel header format.

ZPAL_RADIO_HEADER_TYPE_3CH

3 Channel header format.

ZPAL_RADIO_HEADER_TYPE_LR

LR Channel header format.

ZPAL_RADIO_HEADER_TYPE_UNDEFINED

Undefined Channel header format.


zpal_radio_event_t#

zpal_radio_event_t

Enumeratio radio events.

Enumerator
ZPAL_RADIO_EVENT_NONE
ZPAL_RADIO_EVENT_RX_COMPLETE

Frame received.

ZPAL_RADIO_EVENT_TX_COMPLETE

Transmit complete.

ZPAL_RADIO_EVENT_RX_BEAM_COMPLETE

Beam received.

ZPAL_RADIO_EVENT_TX_BEAM_COMPLETE

Beam sent.

ZPAL_RADIO_EVENT_RX_ABORT

Receive was aborted.

ZPAL_RADIO_EVENT_TX_FAIL

Transmit failed.

ZPAL_RADIO_EVENT_TX_FAIL_LBT

Transmit failed because of an LBT failure.

ZPAL_RADIO_EVENT_RXTX_CALIBRATE

Radio needs calibration.

ZPAL_RADIO_EVENT_MASK
ZPAL_RADIO_EVENT_FLAG_SUCCESS

Indicates a successful event.

ZPAL_RADIO_EVENT_TX_TIMEOUT

zpal_radio_application_t#

zpal_radio_application_t
Enumerator
ZPAL_RADIO_APPLICATION_CONTROLLER

Controller mode.

ZPAL_RADIO_APPLICATION_END_DEVICE

End Device mode.

ZPAL_RADIO_APPLICATION_ZNIFFER

Zniffer mode.


zpal_radio_status_t#

zpal_radio_status_t
Enumerator
ZPAL_RADIO_STATUS_OFF

Radio is off.

ZPAL_RADIO_STATUS_FLIRS

Radio is in Beam receive mode.

ZPAL_RADIO_STATUS_ON

Radio is in normal operating mode.


Typedef Documentation#

node_id_t#

typedef uint16_t node_id_t

Node ID type.


zpal_tx_power_decidbm_t#

typedef int16_t zpal_tx_power_decidbm_t

Parameter type to store deci dBm values.


zpal_tx_power_t#

typedef zpal_tx_power_decidbm_t zpal_tx_power_t

Deprecateduse zpal_tx_power_decidbm_t instead


zpal_radio_stay_awake_id_t#

typedef uint32_t zpal_radio_stay_awake_id_t

Parameter type to store stay awake ids.


zpal_radio_beam_info_t#

typedef struct _zpal_radio_beam_info_t_ zpal_radio_beam_info_t

zpal_radio_callback_t#

typedef void(* zpal_radio_callback_t) (const zpal_radio_event_t event) )(const zpal_radio_event_t event)

zpal_radio_receive_handler_t#

typedef void(* zpal_radio_receive_handler_t) (zpal_radio_rx_parameters_t *rx_parameters, zpal_radio_receive_frame_t *frame) )(zpal_radio_rx_parameters_t *rx_parameters, zpal_radio_receive_frame_t *frame)

Function pointer declaration for handling of received frames.

Parameters
TypeDirectionArgument NameDescription
[in]rx_parameters

Pointer to the structure with channel and rssi values.

[in]frame

Pointer to the received frame. The frame is expected to be located in Z-Wave stack reserved memory and allocated throughout lifetime of stack processing. Application should copy payload data if required for unsynchronized data processing.

When a frame is received this function will be invoked in order to process the frame.


zpal_radio_status_callback_t#

typedef void(* zpal_radio_status_callback_t) (const zpal_radio_status_t state) )(const zpal_radio_status_t state)

Function Documentation#

zpal_radio_set_network_ids#

void zpal_radio_set_network_ids (uint32_t home_id, node_id_t node_id, uint8_t home_id_hash)

Sets the home ID & the node ID.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]home_id

Network home ID.

node_id_t[in]node_id

Network node ID.

uint8_t[in]home_id_hash

HomeID Hash. Used only for Flirs.


zpal_radio_init#

zpal_status_t zpal_radio_init (const zpal_radio_profile_t *const profile)

Initializes the radio hardware with the specified configuration profile.

Parameters
TypeDirectionArgument NameDescription
const zpal_radio_profile_t *const[in]profile

Pointer to a structure containing the configuration parameters for the radio. This must be properly initialized before calling this function.

This function sets up the radio module based on the provided profile, ensuring it is ready for operation. The profile contains necessary configuration parameters such as frequency, and other radio-specific settings.

Note

  • Ensure that the profile is valid and all required fields are set before invoking this function to avoid undefined behavior.

Returns


zpal_radio_change_region#

zpal_status_t zpal_radio_change_region (zpal_radio_region_t eRegion, zpal_radio_lr_channel_config_t eLrChCfg)

Function used to change region and Long Range mode at the same time.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_region_t[in]eRegion

Region to change to.

zpal_radio_lr_channel_config_t[in]eLrChCfg

long range mode to change to (in case of no LR region, should be set to ZPAL_RADIO_LR_CH_CFG_NO_LR).

Returns


zpal_radio_get_region#

zpal_radio_region_t zpal_radio_get_region (void )

Function for getting REGION runtime.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Current region.


zpal_radio_transmit#

zpal_status_t zpal_radio_transmit (zpal_radio_transmit_parameter_t const *const tx_parameters, uint8_t frame_header_length, uint8_t const *const frame_header_buffer, uint8_t frame_payload_length, uint8_t const *const frame_payload_buffer, uint8_t is_retransmission)

Function for transmitting a Z-Wave frame though the radio.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_transmit_parameter_t const *const[in]tx_parameters

Parameter setting specifying speed, channel, wakeup, crc for transmission.

uint8_t[in]frame_header_length

Length of frame header data to transmit.

uint8_t const *const[in]frame_header_buffer

Pointer to data array containing the frame header.

uint8_t[in]frame_payload_length

Length of frame payload data to transmit.

uint8_t const *const[in]frame_payload_buffer

Pointer to data array containing the frame payload.

uint8_tN/Ais_retransmission

Returns


zpal_radio_transmit_beam#

zpal_status_t zpal_radio_transmit_beam (zpal_radio_transmit_parameter_t const *const tx_parameters, uint8_t beam_data_len, uint8_t const *const beam_data)

Function for transmitting a Z-Wave Beam frame though the radio.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_transmit_parameter_t const *const[in]tx_parameters

Parameter setting specifying speed, channel, wakeup.

uint8_t[in]beam_data_len

Length of the Beam data to transmit.

uint8_t const *const[in]beam_data

Pointer to data array containing the BEAM data.

Returns


zpal_radio_start_receive#

zpal_status_t zpal_radio_start_receive (void )

Starts the receiver and enables reception of frames.

Parameters
TypeDirectionArgument NameDescription
voidN/A

If the receiver is already started, nothing will happen.


zpal_radio_is_data_available#

bool zpal_radio_is_data_available (void )

Checks if data is available for processing in the radio module.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This function determines whether there is any data available in the radio module that can be processed or retrieved.

Returns

  • True if data is available, false otherwise.


zpal_radio_restart_if_rx_in_progress#

zpal_status_t zpal_radio_restart_if_rx_in_progress (void )

Restart the radio if a frame reception is in progress.

Parameters
TypeDirectionArgument NameDescription
voidN/A

The radio is restarted once the frame is completed.

If a frame reception is in progress, the function wait for the end of the frame then restart the radio (in Rx mode). In other case, the function does nothing

Returns


zpal_radio_get_last_received_frame#

zpal_status_t zpal_radio_get_last_received_frame (zpal_radio_receive_frame_t * frame)

Function to get the last received frame.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_receive_frame_t *[out]frame

Pointer to a structure where the last received frame will be stored.

This function retrieves the oldest received Z-Wave frame from the radio module. The frame data is stored in the provided structure.

Returns


zpal_radio_get_protocol_mode#

zpal_radio_protocol_mode_t zpal_radio_get_protocol_mode (void )

Function to get the protocol mode used in the configured region.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Protocol mode used in the configured region.


zpal_radio_set_lbt_level#

void zpal_radio_set_lbt_level (uint8_t channel, int8_t level)

Function for setting the LBT RSSI level.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]channel

uint8_t channel to set LBT threshold for.

int8_t[in]level

int8_t LBT RSSI level in dBm.


zpal_radio_enable_rx_broadcast_beam#

void zpal_radio_enable_rx_broadcast_beam (bool enable)

Enable or disables reception of broadcast beam.

Parameters
TypeDirectionArgument NameDescription
bool[in]enable

true to enable FLiRS broadcast address, false to disable.

Enable or disable FLiRS broadcast address.


zpal_radio_clear_tx_timers#

void zpal_radio_clear_tx_timers (void )

Function for clearing current Channel Transmit timers.

Parameters
TypeDirectionArgument NameDescription
voidN/A

zpal_radio_clear_network_stats#

void zpal_radio_clear_network_stats (void )

Function for clearing current Network statistics.

Parameters
TypeDirectionArgument NameDescription
voidN/A

zpal_radio_get_background_rssi#

zpal_status_t zpal_radio_get_background_rssi (uint8_t channel, int8_t * rssi)

Returns the background RSSI.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]channel

uint8_t channel Id for measurement.

int8_t *[out]rssi

pointer to background RSSI.

Returns


zpal_radio_get_default_tx_power#

zpal_tx_power_decidbm_t zpal_radio_get_default_tx_power (void )

Function for getting the default tx power in deci dBm.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • The default RF TX power in deci dBm


zpal_radio_idle#

zpal_status_t zpal_radio_idle (void )

Puts the radio into an idle state.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This function transitions the radio to an idle state where it is neither transmitting nor receiving. It can be used to conserve power or prepare the radio for a new operation.


zpal_radio_abort#

zpal_status_t zpal_radio_abort (void )

Aborts any ongoing radio operation.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This function halts any current transmission or reception activity and brings the radio to an idle state. It can be used to immediately stop the radio's operation in case of an error or when a higher-priority operation needs to be performed.


zpal_radio_shutdown#

zpal_status_t zpal_radio_shutdown (void )

Shuts down the radio hardware.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This function powers down the radio hardware, ensuring it is in a low-power state. It should be called when the radio is no longer needed to conserve energy.

Note

  • This function is definitive and should be used with caution. Once called, the radio cannot be restarted without reinitializing it.


zpal_radio_reset_after_beam_receive#

zpal_status_t zpal_radio_reset_after_beam_receive (bool start_receiver)

Resets the radio configuration to receive mode after having received a beam.

Parameters
TypeDirectionArgument NameDescription
bool[in]start_receiver

If set to true, the receiver will start listening. Otherwise, it will stay inactive.


zpal_radio_is_fragmented_beam_enabled#

bool zpal_radio_is_fragmented_beam_enabled (void )

Returns whether use of fragmented beams is enabled or not for the active region.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • True if use of fragmented beams is enabled, false otherwise.


zpal_radio_is_lbt_enabled#

bool zpal_radio_is_lbt_enabled (void )

Returns whether listen before talk (LBT) is enabled.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • True if LBT is enabled, false otherwise.


zpal_radio_get_beam_startup_time#

uint16_t zpal_radio_get_beam_startup_time (void )

Returns the time it takes to start transmission of wake up beams.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Includes time spent on LBT.

Returns

  • startup time in milli seconds.


zpal_radio_get_minimum_lr_tx_power#

zpal_tx_power_decidbm_t zpal_radio_get_minimum_lr_tx_power (void )

Returns the minimum transmit power for Z-Wave Long Range.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Minimum TX power in deci dBm.


zpal_radio_get_maximum_lr_tx_power#

zpal_tx_power_decidbm_t zpal_radio_get_maximum_lr_tx_power (void )

Returns the maximum transmit power for Z-Wave Long Range.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Maximum TX power in deci dBm.


zpal_radio_disable_debug#

zpal_status_t zpal_radio_disable_debug (void )

Disable the radio debug mode.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This function disables the radio debug mode


zpal_radio_get_rf_profile#

const zpal_radio_profile_t * zpal_radio_get_rf_profile (void )

a getter on the current rf profile.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Function return a pointer (instead of a struct) to reduce RAM memory usage and execution time. The pointer target a const structure because it should not be used to modify the content of the structure.

Returns

  • pointer on the current rf profile.


zpal_radio_get_lr_channel_config#

zpal_radio_lr_channel_config_t zpal_radio_get_lr_channel_config (void )

Function to read current Long Range Channel Configuration.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • current long rang channel configuration (ZPAL_RADIO_LR_Ch_CFG if region without lr)


zpal_radio_get_primary_long_range_channel#

zpal_radio_lr_channel_t zpal_radio_get_primary_long_range_channel (void )

Function to read current Primary Long Range Channel.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns


zpal_radio_set_primary_long_range_channel#

void zpal_radio_set_primary_long_range_channel (zpal_radio_lr_channel_t channel)

Function to set the Primary Long Range Channel.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_lr_channel_t[in]channel

zpal_radio_lr_channel_t Long Range Channel to set as Primary Long Range Channel.


zpal_radio_get_long_range_channel_auto_mode#

bool zpal_radio_get_long_range_channel_auto_mode (void )

Function to read current Long Range Channel selection mode.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • true for automatically slected channel, false for manually selected channel


zpal_radio_set_long_range_channel_auto_mode#

zpal_status_t zpal_radio_set_long_range_channel_auto_mode (bool enable)

Function to set the Long Range Channel selction mode.

Parameters
TypeDirectionArgument NameDescription
bool[in]enable

true to enable the automatically channel selection mode, false to enable the manual channel selection mode

Returns


zpal_radio_is_region_supported#

bool zpal_radio_is_region_supported (zpal_radio_region_t region)

Function to check if the stack implementation supports a given region.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_region_t[in]region

Region to check

Returns

  • True if the region is supported, False if it is not


zpal_radio_is_transmit_allowed#

bool zpal_radio_is_transmit_allowed (uint8_t channel, uint8_t frame_length, bool cca)

Check if transmission is allowed for specified channel.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]channel

The channel to check.

uint8_t[in]frame_length

The length of the frame to send.

bool[in]cca

If true, the function will provision cca_duration into transmission time.

Returns

  • True if node shall use Long Range channel only.


zpal_radio_attenuate#

bool zpal_radio_attenuate (zpal_radio_tx_power_t adjust_tx_power)

Function to reduce Tx power of classic non-listening devices.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_tx_power_t[in]adjust_tx_power

Reduces the devices default Tx power in dB. Valid range: 0-9 dB.

Returns

  • True when reduction is allowed, false for listening devices and out of range input.


zpal_radio_get_maximum_tx_power#

zpal_tx_power_decidbm_t zpal_radio_get_maximum_tx_power (void )

Return the maximum board supported tx power for classic z-wave.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • The maximum board supported tx power in deci dBm.


zpal_radio_limit_lr_power_to_capability#

zpal_tx_power_decidbm_t zpal_radio_limit_lr_power_to_capability (zpal_tx_power_decidbm_t requested_power)

Function to adjust the requested tx power for Long Range.

Parameters
TypeDirectionArgument NameDescription
zpal_tx_power_decidbm_t[in]requested_power

The requested tx power in deci dBm.

This function ensures that the requested power is within the allowed range

Returns

  • The adjusted tx power in deci dBm.


zpal_radio_request_calibration#

void zpal_radio_request_calibration (bool forced)

Function to radio calibration.

Parameters
TypeDirectionArgument NameDescription
bool[in]forced

If true, radio calibration is performed regardless if it is required. If false, radio calibration is performed only if it is required.


zpal_radio_get_last_beam_info#

zpal_status_t zpal_radio_get_last_beam_info (zpal_radio_beam_info_t * beamInfo)

Retrieves information about the last received beam.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_beam_info_t *[out]beamInfo

Pointer to the structure where the beam information will be stored.

Returns


zpal_radio_rf_channel_statistic_store_background_rssi_average#

void zpal_radio_rf_channel_statistic_store_background_rssi_average (zpal_radio_zwave_channel_t zwavechannel, int8_t averagerssi)

Stores the average RSSI (Received Signal Strength Indicator) for a given Z-Wave channel.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_zwave_channel_tN/Azwavechannel

The Z-Wave channel for which the RSSI average is to be calculated.

int8_tN/Aaveragerssi

The average RSSI value to be used for the calculation.

This function stores the background RSSI average for the specified Z-Wave channel.


zpal_radio_request_stay_awake#

zpal_status_t zpal_radio_request_stay_awake (uint32_t msecs, zpal_radio_stay_awake_id_t * id)

Requests the radio to stay awake for a specified number of milliseconds.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/Amsecs

Number of millisecs to stay awake (ZPAL_RADIO_STAY_AWAKE_ALWAYS = never ends).

zpal_radio_stay_awake_id_t *N/Aid

Pointer to a variable where the identifier for the stay-awake request will be stored. This identifier is used to revoke the request later. NULL value is accepted, but it won't be possible to revoke the request later.

Returns

Note

  • Duration Limit: Maximum duration is limited by INT32_MAX ticks in the underlying sleeptimer. The actual maximum milliseconds depends on the platform's sleeptimer frequency. At the default 32768 Hz, this is approximately 18.2 hours (1,092,266 ms). Requests exceeding this limit will fail. For indefinite duration, use ZPAL_RADIO_STAY_AWAKE_ALWAYS instead.

  • Timer Synchronization: This API uses platform-specific timers (hardware-based on Silicon Labs). When combining with OS-level timers (e.g., FreeRTOS ctimer), ensure stay_awake duration exceeds the OS timeout to account for scheduler latency. Example: if ctimer fires at 240ms, set stay_awake to 440ms (240 + 200ms margin). This prevents device to shutoff radio and eventually sleep before callback execution on low-power devices.


zpal_radio_revoke_stay_awake#

zpal_status_t zpal_radio_revoke_stay_awake (zpal_radio_stay_awake_id_t * id)

Revokes a previous stay-awake request, allowing the radio to sleep as normal.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_stay_awake_id_t *N/Aid

Pointer to the identifier of the stay-awake request to revoke. NULL is used as a special value to revoke permanent stay-awake requests.

Note

  • The pointer to the identifier is set to 0 after revocation.

  • Radio will transition to off or flirs mode if there are no other active stay-awake requests.


zpal_radio_update_stay_awake#

zpal_status_t zpal_radio_update_stay_awake (zpal_radio_stay_awake_id_t * id, uint32_t new_msecs)

Lengthens the current stay-awake period.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_stay_awake_id_t *N/Aid

Pointer to the identifier of the stay-awake request to update.

uint32_tN/Anew_msecs

The new length (in millisecs) to request from now.

Returns

Note

  • Duration Limit: Maximum duration is limited by INT32_MAX ticks in the underlying sleeptimer. See zpal_radio_request_stay_awake() for details.

  • This function is equivalent to revoking the previous request and creating a new one.


zpal_radio_get_wakeup_status#

zpal_radio_status_t zpal_radio_get_wakeup_status (void )

Getter of wakeup state of the radio.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Current wakeup state of the radio


zpal_radio_set_status_callback#

zpal_status_t zpal_radio_set_status_callback (zpal_radio_status_callback_t callback)

Registers a callback function to be invoked on radio state changes.

Parameters
TypeDirectionArgument NameDescription
zpal_radio_status_callback_t[in]callback

The function pointer to the callback to be registered. Pass NULL to unregister the current callback.

This function sets the callback that will be called whenever the radio state changes. The callback function should match the signature defined by zpal_radio_state_callback_t.

Returns

  • zpal_status_t Returns status code indicating success or failure of the operation.


zpal_radio_set_joinable#

zpal_status_t zpal_radio_set_joinable (bool is_joinable)

Inform the ZPAL radio layer that the node has been correctly included in a network.

Parameters
TypeDirectionArgument NameDescription
bool[in]is_joinable

true if the node has been correctly included, false otherwise.

Correctly included means that the node is joinable with tuple (homeid, nodeid).

Returns

  • zpal_status_t Returns status code indicating success or failure of the operation. ZPAL_STATUS_OK if the operation was successful.