Packet Assistant#

The RAIL Packet Assistant component provides functions to prepare and unpack packets for various protocols such as Wi-SUN FSK, Wi-SUN OFDM, SUN OQPSK, and Sidewalk. This component ensures that the application can generate the appropriate packet headers for any selected PHY, allowing RAIL to send out the proper packet with the user payload. The component provides functions to prepare and unpack packets, ensuring that the application can handle different packet formats as needed.

Key functions include:

  • prepare_packet(): Prepares the packet for sending and loads it into the RAIL TX FIFO.

  • unpack_packet(): Unpacks the received packet, points to the payload, and returns the length.

Modules#

Configurations

Type definitions

Functions#

void

Checks PHY setting to avoid errors at packet sending.

void
update_assistant_pointers(uint8_t new_phy_index)

Updates assistant pointers with a new PHY index.

uint16_t
unpack_packet(uint8_t *rx_destination, const RAIL_RxPacketInfo_t *packet_information, uint8_t **start_of_payload)

Unpacks the received packet, points to the payload and returns the length.

void
prepare_packet(RAIL_Handle_t rail_handle, uint8_t *out_data, uint16_t length)

Prepares the packet for sending and load it in the RAIL TX FIFO.

uint8_t

Get the print packet information.

void
set_print_packet_info(uint8_t new_print_packet_info)

Set the print packet information.

void
printf_rx_packet(const uint8_t *const rx_buffer, uint16_t length)

Prints out the received packet.

uint8_t

Get the Wi-SUN OFDM rate.

uint8_t
set_wisun_ofdm_rate(uint8_t new_rate)

Set the Wi-SUN OFDM rate.

uint8_t

Get the Wi-SUN OFDM scrambler.

uint8_t
set_wisun_ofdm_scrambler(uint8_t new_scrambler)

Set the Wi-SUN OFDM scrambler.

uint8_t

Get the Wi-SUN FSK FCS value.

uint8_t
set_wisun_fsk_fcs(uint8_t new_fcs)

Set the Wi-SUN FSK FCS value.

uint8_t

Get the Wi-SUN FSK Whitening value.

uint8_t
set_wisun_fsk_whitening(uint8_t new_whitening)

Set the Wi-SUN FSK Whitening value.

uint8_t

Get the Sun OQPSK Spreading Mode.

uint8_t
set_sun_oqpsk_spreading_mode(uint8_t new_spreading_mode)

Set the Sun OQPSK Spreading Mode.

uint8_t

Get the Sun OQPSK Rate Mode.

uint8_t
set_sun_oqpsk_rate_mode(uint8_t new_rate_mode)

Set the Sun OQPSK Rate Mode.

uint8_t

Get the Sidewalk FSK FCS value.

uint8_t
set_sidewalk_fcs_type(uint8_t new_fcs)

Set the Sidewalk FSK FCS value.

uint8_t

Get the Sidewalk Whitening value.

uint8_t
set_sidewalk_whitening(uint8_t new_whitening)

Set the Sidewalk Whitening value.

Function Documentation#

validation_check#

void validation_check (void )

Checks PHY setting to avoid errors at packet sending.

Parameters
TypeDirectionArgument NameDescription
voidN/A

update_assistant_pointers#

void update_assistant_pointers (uint8_t new_phy_index)

Updates assistant pointers with a new PHY index.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_phy_index

The new PHY index to update.


unpack_packet#

uint16_t unpack_packet (uint8_t * rx_destination, const RAIL_RxPacketInfo_t * packet_information, uint8_t ** start_of_payload)

Unpacks the received packet, points to the payload and returns the length.

Parameters
TypeDirectionArgument NameDescription
uint8_t *[out]rx_destination

Where should the full packet be unpacked

const RAIL_RxPacketInfo_t *[out]packet_information

Where should all the information of the packet stored

uint8_t **[out]start_of_payload

Pointer where the payload starts

Returns

  • The length of the received payload


prepare_packet#

void prepare_packet (RAIL_Handle_t rail_handle, uint8_t * out_data, uint16_t length)

Prepares the packet for sending and load it in the RAIL TX FIFO.

Parameters
TypeDirectionArgument NameDescription
RAIL_Handle_t[in]rail_handle

Which rail handlers should be used for the TX FIFO writing

uint8_t *[in]out_data

The payload buffer

uint16_t[in]length

The length of the payload


get_print_packet_info#

uint8_t get_print_packet_info (void )

Get the print packet information.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This function retrieves the current print packet information setting. Returns

  • The current print packet information setting.


set_print_packet_info#

void set_print_packet_info (uint8_t new_print_packet_info)

Set the print packet information.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_print_packet_info

The new print packet information setting to be applied.

This function sets a new value for the print packet information setting.


printf_rx_packet#

void printf_rx_packet (const uint8_t *const rx_buffer, uint16_t length)

Prints out the received packet.

Parameters
TypeDirectionArgument NameDescription
const uint8_t *const[in]rx_buffer

The buffer where the packet is stored.

uint16_t[in]length

The length of the packet.

This function prints the contents of the received packet.


get_wisun_ofdm_rate#

uint8_t get_wisun_ofdm_rate (void )

Get the Wi-SUN OFDM rate.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns the current Wi-SUN OFDM rate. Returns

  • The Wi-SUN OFDM rate.


set_wisun_ofdm_rate#

uint8_t set_wisun_ofdm_rate (uint8_t new_rate)

Set the Wi-SUN OFDM rate.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_rate

The new Wi-SUN OFDM rate to set.

Sets the Wi-SUN OFDM rate to the specified value. Returns

  • 1 if the value was set successfully, 0 otherwise.


get_wisun_ofdm_scrambler#

uint8_t get_wisun_ofdm_scrambler (void )

Get the Wi-SUN OFDM scrambler.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns the current Wi-SUN OFDM scrambler. Returns

  • The Wi-SUN OFDM scrambler.


set_wisun_ofdm_scrambler#

uint8_t set_wisun_ofdm_scrambler (uint8_t new_scrambler)

Set the Wi-SUN OFDM scrambler.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_scrambler

The new Wi-SUN OFDM scrambler to set, 2 bits wide (0-3)

Sets the Wi-SUN OFDM scrambler to the specified value. Returns

  • 1 if the value was set successfully, 0 otherwise.


get_wisun_fsk_fcs#

uint8_t get_wisun_fsk_fcs (void )

Get the Wi-SUN FSK FCS value.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns the current Wi-SUN FSK FCS value. Returns

  • The Wi-SUN FSK FCS value.


set_wisun_fsk_fcs#

uint8_t set_wisun_fsk_fcs (uint8_t new_fcs)

Set the Wi-SUN FSK FCS value.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_fcs

The new Wi-SUN FSK FCS value to set.

Sets the Wi-SUN FSK FCS value to the specified new value. Returns

  • 1 if the value was set successfully, 0 otherwise.


get_wisun_fsk_whitening#

uint8_t get_wisun_fsk_whitening (void )

Get the Wi-SUN FSK Whitening value.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns the current Wi-SUN FSK Whitening value. Returns

  • The Wi-SUN FSK Whitening value.


set_wisun_fsk_whitening#

uint8_t set_wisun_fsk_whitening (uint8_t new_whitening)

Set the Wi-SUN FSK Whitening value.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_whitening

The new Wi-SUN FSK Whitening value to set.

Sets the Wi-SUN FSK Whitening value to the specified new value. Returns

  • 1 if the value was set successfully, 0 otherwise.


get_sun_oqpsk_spreading_mode#

uint8_t get_sun_oqpsk_spreading_mode (void )

Get the Sun OQPSK Spreading Mode.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Retrieves the current Sun OQPSK Spreading Mode. Returns

  • The current Sun OQPSK Spreading Mode.


set_sun_oqpsk_spreading_mode#

uint8_t set_sun_oqpsk_spreading_mode (uint8_t new_spreading_mode)

Set the Sun OQPSK Spreading Mode.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_spreading_mode

The new Sun OQPSK Spreading Mode to set.

Sets the Sun OQPSK Spreading Mode to the specified new mode. Returns

  • 1 if the value was set successfully, 0 otherwise.


get_sun_oqpsk_rate_mode#

uint8_t get_sun_oqpsk_rate_mode (void )

Get the Sun OQPSK Rate Mode.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Retrieves the current Sun OQPSK Rate Mode. Returns

  • The current Sun OQPSK Rate Mode.


set_sun_oqpsk_rate_mode#

uint8_t set_sun_oqpsk_rate_mode (uint8_t new_rate_mode)

Set the Sun OQPSK Rate Mode.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_rate_mode

The new Sun OQPSK Rate Mode to set, 2 bits wide (0-3)

Sets the Sun OQPSK Rate Mode to the specified new mode. Returns

  • 1 if the value was set successfully, 0 otherwise.


get_sidewalk_fcs_type#

uint8_t get_sidewalk_fcs_type (void )

Get the Sidewalk FSK FCS value.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Retrieves the current Sidewalk FSK FCS value. Returns

  • The current Sidewalk FSK FCS value.


set_sidewalk_fcs_type#

uint8_t set_sidewalk_fcs_type (uint8_t new_fcs)

Set the Sidewalk FSK FCS value.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_fcs

The new Sidewalk FSK FCS value to set.

Sets the Sidewalk FSK FCS value to the specified new value. Returns

  • 1 if the value was set successfully, 0 otherwise.


get_sidewalk_whitening#

uint8_t get_sidewalk_whitening (void )

Get the Sidewalk Whitening value.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Retrieves the current Sidewalk Whitening value. Returns

  • The current Sidewalk Whitening value.


set_sidewalk_whitening#

uint8_t set_sidewalk_whitening (uint8_t new_whitening)

Set the Sidewalk Whitening value.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]new_whitening

The new Sidewalk Whitening value to set.

Sets the Sidewalk Whitening value to the specified new value. Returns

  • 1 if the value was set successfully, 0 otherwise.