Receive#
APIs related to packet receive.
Modules#
Enumerations#
Receive options, in reality a bitmask.
The packet status code associated with a packet received or currently being received.
Typedefs#
A handle used to reference a packet during reception processing.
A pointer to a function called before LQI is copied into the RAIL_RxPacketDetails_t structure.
Functions#
Configure receive options.
Include the code necessary for frame type based length decoding.
Handle frame type length.
Start the receiver on a specific channel.
Schedule a receive window for some future time.
Place a temporary hold on this packet's data and information resources within RAIL.
Copy 'len' bytes of packet data starting from 'offset' from the receive FIFO.
Release RAIL's internal resources for the packet.
Return the current raw RSSI.
Return the current raw RSSI within a definitive time period.
Start the RSSI averaging over a specified time in us.
Query whether the RSSI averaging is done.
Get the RSSI averaged over a specified time in us.
Set the RSSI offset.
Get the RSSI offset.
Set the RSSI detection threshold(in dBm) to trigger RAIL_EVENT_DETECT_RSSI_THRESHOLD.
Get the RSSI detection threshold(in dBm).
Set up a callback function capable of converting a RX packet's LQI value before being consumed by application code.
Macros#
A value representing no options enabled.
All options are disabled by default.
An option to configure whether the CRC portion of the packet is included in the packet payload exposed to the app on packet reception.
An option to configure whether CRC errors will be ignored.
An option to control which sync words will be accepted.
An option to configure whether frames which are aborted during reception should continue to be tracked.
An option to suppress capturing the appended information after received frames.
An option to select the use of antenna 0 during receive (including Auto-ACK receive).
An option to select the use of antenna 1 during receive (including Auto-ACK receive).
An option combination to automatically choose an antenna during receive (including Auto-ACK receive).
An option to disable frame detection.
An option to enable IEEE 802.15.4 RX channel switching.
An option to enable fast RX2RX state transition.
An option to enable collision detection.
A value representing all possible options.
The value returned by RAIL for an invalid RSSI, in dBm.
The value returned by RAIL for an invalid RSSI: in quarter dBm.
The lowest RSSI value returned by RAIL: in quarter dBm.
Maximum absolute value for RSSI offset.
A sentinel value to indicate waiting for a valid RSSI without a timeout.
A sentinel value to indicate no waiting for a valid RSSI.
An invalid RX packet handle value.
A special RX packet handle to refer to the oldest unreleased packet.
A special RX packet handle to refer to the oldest unreleased complete packet.
A special RX packet handle to refer to the newest unreleased packet when in callback context.
Enumeration Documentation#
RAIL_RxOptions_t#
RAIL_RxOptions_t
Receive options, in reality a bitmask.
Enumerator | |
---|---|
RAIL_RX_OPTION_STORE_CRC_SHIFT | Shift position of RAIL_RX_OPTION_STORE_CRC bit. |
RAIL_RX_OPTION_IGNORE_CRC_ERRORS_SHIFT | Shift position of RAIL_RX_OPTION_IGNORE_CRC_ERRORS bit. |
RAIL_RX_OPTION_ENABLE_DUALSYNC_SHIFT | Shift position of RAIL_RX_OPTION_ENABLE_DUALSYNC bit. |
RAIL_RX_OPTION_TRACK_ABORTED_FRAMES_SHIFT | Shift position of RAIL_RX_OPTION_TRACK_ABORTED_FRAMES bit. |
RAIL_RX_OPTION_REMOVE_APPENDED_INFO_SHIFT | Shift position of RAIL_RX_OPTION_REMOVE_APPENDED_INFO bit. |
RAIL_RX_OPTION_ANTENNA0_SHIFT | Shift position of RAIL_RX_OPTION_ANTENNA0 bit. |
RAIL_RX_OPTION_ANTENNA1_SHIFT | Shift position of RAIL_RX_OPTION_ANTENNA1 bit. |
RAIL_RX_OPTION_DISABLE_FRAME_DETECTION_SHIFT | Shift position of RAIL_RX_OPTION_DISABLE_FRAME_DETECTION bit. |
RAIL_RX_OPTION_CHANNEL_SWITCHING_SHIFT | Shift position of RAIL_RX_OPTION_CHANNEL_SWITCHING bit. |
RAIL_RX_OPTION_FAST_RX2RX_SHIFT | Shift position of RAIL_RX_OPTION_FAST_RX2RX bit. |
RAIL_RX_OPTION_ENABLE_COLLISION_DETECTION_SHIFT | Shift position of RAIL_RX_OPTION_ENABLE_COLLISION_DETECTION bit. |
3689
of file common/rail_types.h
RAIL_RxPacketStatus_t#
RAIL_RxPacketStatus_t
The packet status code associated with a packet received or currently being received.
Note
RECEIVING implies some packet data may be available, but is untrustworthy (not CRC-verified) and might disappear if the packet is rolled back on error. No packet details are yet available.
In RX RAIL_DataMethod_t::FIFO_MODE, ABORT statuses imply some packet data may be available, but it's incomplete and not trustworthy.
Enumerator | |
---|---|
RAIL_RX_PACKET_NONE | The radio is idle or searching for a packet. |
RAIL_RX_PACKET_ABORT_FORMAT | The packet was aborted during filtering because of illegal frame length, CRC or block decoding errors, other RAIL built-in protocol-specific packet content errors, or by the application or multiprotocol scheduler idling the radio with RAIL_IDLE_ABORT or higher. |
RAIL_RX_PACKET_ABORT_FILTERED | The packet failed address filtering. |
RAIL_RX_PACKET_ABORT_ABORTED | The packet passed any filtering but was aborted by the application or multiprotocol scheduler idling the radio with RAIL_IDLE_ABORT or higher. |
RAIL_RX_PACKET_ABORT_OVERFLOW | The packet overflowed the receive buffer. |
RAIL_RX_PACKET_ABORT_CRC_ERROR | The packet passed any filtering but subsequently failed CRC check(s) block decoding, or illegal frame length, and was aborted. |
RAIL_RX_PACKET_READY_CRC_ERROR | The packet passed any filtering but subsequently failed CRC check(s) with RAIL_RX_OPTION_IGNORE_CRC_ERRORS in effect. |
RAIL_RX_PACKET_READY_SUCCESS | The packet was successfully received, passing CRC check(s). |
RAIL_RX_PACKET_RECEIVING | A packet is being received and is not yet complete. |
3977
of file common/rail_types.h
Typedef Documentation#
RAIL_RxPacketHandle_t#
RAIL_RxPacketHandle_t
A handle used to reference a packet during reception processing.
There are several sentinel handle values that pertain to certain circumstances: RAIL_RX_PACKET_HANDLE_INVALID, RAIL_RX_PACKET_HANDLE_OLDEST, RAIL_RX_PACKET_HANDLE_OLDEST_COMPLETE and RAIL_RX_PACKET_HANDLE_NEWEST.
4062
of file common/rail_types.h
RAIL_ConvertLqiCallback_t#
RAIL_ConvertLqiCallback_t )(uint8_t lqi, int8_t rssi)
A pointer to a function called before LQI is copied into the RAIL_RxPacketDetails_t structure.
[in] | lqi | The LQI value obtained by hardware and being readied for application consumption. This LQI value is in integral units ranging from 0 to 255. |
[in] | rssi | The RSSI value corresponding to the packet from which the hardware LQI value was obtained. This RSSI value is in integral dBm units. |
Returns
uint8_t The converted LQI value that will be loaded into the RAIL_RxPacketDetails_t structure in preparation for application consumption. This value should likewise be in integral units ranging from 0 to 255.
4275
of file common/rail_types.h
Function Documentation#
RAIL_ConfigRxOptions#
RAIL_Status_t RAIL_ConfigRxOptions (RAIL_Handle_t railHandle, RAIL_RxOptions_t mask, RAIL_RxOptions_t options)
Configure receive options.
[in] | railHandle | A RAIL instance handle. |
[in] | mask | A bitmask containing which options should be modified. |
[in] | options | A bitmask containing desired configuration settings. Bit positions for each option are found in the RAIL_RxOptions_t. |
Returns
Status code indicating success of the function call.
Configure the radio receive flow based on the list of available options. Only the options indicated by the mask parameter will be affected. Pass RAIL_RX_OPTIONS_ALL to set all parameters. The previous settings may affect the current frame if a packet is received during this configuration.
Note
: On chips where RAIL_IEEE802154_SUPPORTS_RX_CHANNEL_SWITCHING is true, enabling RAIL_RX_OPTION_CHANNEL_SWITCHING without configuring RX channel switching, via RAIL_IEEE802154_ConfigRxChannelSwitching, will return RAIL_STATUS_INVALID_PARAMETER for only this option. Any other RX options (except antenna selection) would still take effect.
3673
of file common/rail.h
RAIL_IncludeFrameTypeLength#
void RAIL_IncludeFrameTypeLength (RAIL_Handle_t railHandle)
Include the code necessary for frame type based length decoding.
[in] | railHandle | A RAIL instance handle. |
This function must be called before RAIL_ConfigChannels to allow configurations using a frame type based length setup. In RAIL 2.x, it is called by default in the RAILCb_ConfigFrameTypeLength API which can be overridden to save code space. In future versions, the user may be required to call this API explicitly.
3688
of file common/rail.h
RAILCb_ConfigFrameTypeLength#
void RAILCb_ConfigFrameTypeLength (RAIL_Handle_t railHandle, const RAIL_FrameType_t * frameType)
Handle frame type length.
[in] | railHandle | A RAIL instance handle. |
[in] | frameType | A frame type configuration structure. |
This function is implemented in the radio configuration. Currently, the frame type passed in only handles packet length decoding. If NULL is passed into this function, it clears any currently configured frame type settings. This will either be implemented as an empty function in the radio configuration if it is not needed, to assist in dead code elimination.
3703
of file common/rail.h
RAIL_StartRx#
RAIL_Status_t RAIL_StartRx (RAIL_Handle_t railHandle, uint16_t channel, const RAIL_SchedulerInfo_t * schedulerInfo)
Start the receiver on a specific channel.
[in] | railHandle | A RAIL instance handle. |
[in] | channel | The channel to listen on. |
[in] | schedulerInfo | Information to allow the radio scheduler to place this receive appropriately. This is only used in multiprotocol version of RAIL and may be set to NULL in all other versions. |
Returns
Status code indicating success of the function call.
This is a non-blocking function. Whenever a packet is received, RAIL_Config_t::eventsCallback will fire with RAIL_EVENT_RX_PACKET_RECEIVED set. If you call this while not idle but with a different channel, any ongoing receive or transmit operation will be aborted.
3721
of file common/rail.h
RAIL_ScheduleRx#
RAIL_Status_t RAIL_ScheduleRx (RAIL_Handle_t railHandle, uint16_t channel, const RAIL_ScheduleRxConfig_t * cfg, const RAIL_SchedulerInfo_t * schedulerInfo)
Schedule a receive window for some future time.
[in] | railHandle | A RAIL instance handle. |
[in] | channel | A channel to listen on. |
[in] | cfg | The configuration structure to define the receive window. |
[in] | schedulerInfo | Information to allow the radio scheduler to place this receive appropriately. This is only used in multiprotocol version of RAIL and may be set to NULL in all other versions. |
Returns
Status code indicating success of the function call.
This API immediately changes the channel and schedules receive to start at the specified time and end at the given end time. If you do not specify an end time, you may call this API later with an end time as long as you set the start time to disabled. You can also terminate the receive operation immediately using the RAIL_Idle() function. Note that relative end times are always relative to the start unless no start time is specified. If changing channels, the channel is changed immediately and will abort any ongoing packet transmission or reception.
Returns an error if a CSMA or LBT transmit is still in progress.
In multiprotocol, ensure that you properly yield the radio after this call. See Yielding the Radio for more details.
3750
of file common/rail.h
RAIL_HoldRxPacket#
RAIL_RxPacketHandle_t RAIL_HoldRxPacket (RAIL_Handle_t railHandle)
Place a temporary hold on this packet's data and information resources within RAIL.
[in] | railHandle | A RAIL instance handle. |
This function can only be called from within RAIL callback context. It can be used in any RX mode.
Normally, when RAIL issues its callback indicating a packet is ready or aborted, it expects the application's callback to retrieve and copy (or discard) the packet's information and data, and will free up its internal packet data after the callback returns. This function tells RAIL to hold onto those resources after the callback returns in case the application wants to defer processing the packet to a later time, e.g., outside of callback context.
Returns
The packet handle for the packet associated with the callback, RAIL_RX_PACKET_HANDLE_INVALID if no such packet yet exists or railHandle is not active.
Note
When using multiprotocol the receive FIFO is reset during protocol switches so any packets held with RAIL_HoldRxPacket() will be lost. It is best to avoid using this in DMP or to at least reset any internal held packet information when the RAIL_EVENT_CONFIG_UNSCHEDULED occurs.
4137
of file common/rail.h
RAIL_PeekRxPacket#
uint16_t RAIL_PeekRxPacket (RAIL_Handle_t railHandle, RAIL_RxPacketHandle_t packetHandle, uint8_t * pDst, uint16_t len, uint16_t offset)
Copy 'len' bytes of packet data starting from 'offset' from the receive FIFO.
[in] | railHandle | A RAIL instance handle. |
[in] | packetHandle | A packet handle as returned from a previous RAIL_GetRxPacketInfo() or RAIL_HoldRxPacket() call, or sentinel values RAIL_RX_PACKET_HANDLE_OLDEST, RAIL_RX_PACKET_HANDLE_OLDEST_COMPLETE or RAIL_RX_PACKET_HANDLE_NEWEST. |
[out] | pDst | A pointer to the location where the received bytes will be copied. If NULL, no copying occurs. |
[in] | len | A number of packet data bytes to copy. |
[in] | offset | A byte offset within remaining packet data from which to copy. |
Those bytes remain valid for re-peeking.
Returns
Number of packet bytes copied.
Note
Peek does not permit peeking beyond the requested packet's available packet data (though there is a small chance it might for a RAIL_RX_PACKET_HANDLE_NEWEST packet at the very end of still being received). Nor can one peek into already-consumed data read by RAIL_ReadRxFifo(). len and offset are relative to the remaining data available in the packet, if any was already consumed by RAIL_ReadRxFifo().
4163
of file common/rail.h
RAIL_ReleaseRxPacket#
RAIL_Status_t RAIL_ReleaseRxPacket (RAIL_Handle_t railHandle, RAIL_RxPacketHandle_t packetHandle)
Release RAIL's internal resources for the packet.
[in] | railHandle | A RAIL instance handle. |
[in] | packetHandle | A packet handle as returned from a previous RAIL_HoldRxPacket() call, or sentinel values RAIL_RX_PACKET_HANDLE_OLDEST, RAIL_RX_PACKET_HANDLE_OLDEST_COMPLETE or RAIL_RX_PACKET_HANDLE_NEWEST. The latter might be used within RAIL callback context to explicitly release the packet associated with the callback early, before it's released automatically by RAIL on callback return (unless explicitly held). |
This function must be called for any packet previously held via RAIL_HoldRxPacket(). It may optionally be called within a callback context to release RAIL resources sooner than at callback completion time when not holding the packet. This function can be used in any RX mode.
Returns
RAIL_STATUS_NO_ERROR if the held packet was released or an appropriate error code otherwise.
4190
of file common/rail.h
RAIL_GetRssi#
int16_t RAIL_GetRssi (RAIL_Handle_t railHandle, bool wait)
Return the current raw RSSI.
[in] | railHandle | A RAIL instance handle. |
[in] | wait | if false returns instant RSSI with no checks. |
Returns
RAIL_RSSI_INVALID if the receiver is disabled and an RSSI value can't be obtained. Otherwise, return the RSSI in quarter dBm, dbm*4.
Gets the current RSSI value. This value represents the current energy of the channel. It can change rapidly and will be low if no RF energy is in the current channel. The function from the value reported to dBm is an offset dependent on the PHY and the PCB layout. Characterize the RSSI received on your hardware and apply an offset in the application to account for board and PHY parameters. When 'wait' is false, the radio needs to be currently in RX and have been in there for a sufficient amount of time for a fresh RSSI value to be read and returned. Otherwise, the RSSI is considered stale and RAIL_RSSI_INVALID is returned instead. When 'wait' is true, if the radio is transitioning to or already in RX, this function will wait for a valid RSSI to be read and return it. Otherwise, if the radio is in or transitions to IDLE or TX, RAIL_RSSI_INVALID will be returned. On low datarate PHYs, this function can take a significantly longer time when wait is true.
In multiprotocol, this function returns RAIL_RSSI_INVALID immediately if railHandle is not the current active RAIL_Handle_t. Additionally, 'wait' should never be set 'true' in multiprotocol as the wait time is not consistent, so scheduling a scheduler slot cannot be done accurately. Rather if waiting for a valid RSSI is desired, use RAIL_GetRssiAlt instead to apply a bounded time period.
Note
If RX Antenna Diversity is enabled via RAIL_ConfigRxOptions(), pass true for the wait parameter otherwise it's very likely RAIL_RSSI_INVALID will be returned.
If RX channel hopping is turned on, do not use this API. Instead, see RAIL_GetChannelHoppingRssi().
When 'wait' is false, this API is equivalent to RAIL_GetRssiAlt with 'waitTimeout' set to RAIL_GET_RSSI_NO_WAIT. When 'wait' is true, this API is equivalent to RAIL_GetRssiAlt with 'waitTimeout' set to RAIL_GET_RSSI_WAIT_WITHOUT_TIMEOUT. Consider using RAIL_GetRssiAlt if a bounded maximum wait timeout is desired.
4236
of file common/rail.h
RAIL_GetRssiAlt#
int16_t RAIL_GetRssiAlt (RAIL_Handle_t railHandle, RAIL_Time_t waitTimeout)
Return the current raw RSSI within a definitive time period.
[in] | railHandle | A RAIL instance handle. |
[in] | waitTimeout | Sets the maximum time to wait for a valid RSSI. If equal to RAIL_GET_RSSI_NO_WAIT returns instant RSSI with no checks. If equal to RAIL_GET_RSSI_WAIT_WITHOUT_TIMEOUT waits for a valid RSSI with no maximum timeout. |
Returns
RAIL_RSSI_INVALID if the receiver is disabled and an RSSI value can't be obtained. Otherwise, return the RSSI in quarter dBm, dbm*4.
Gets the current RSSI value. This value represents the current energy of the channel. It can change rapidly, and will be low if no RF energy is in the current channel. The function from the value reported to dBm is an offset dependent on the PHY and the PCB layout. Characterize the RSSI received on your hardware and apply an offset in the application to account for board and PHY parameters. If a value of RAIL_GET_RSSI_NO_WAIT is given for waitTimeout, the radio needs to be currently in RX and have been in there for a sufficient amount of time for a fresh RSSI value to be read and returned. Otherwise the RSSI is considered stale and RAIL_RSSI_INVALID is returned instead. For non-zero values of waitTimeout, if the radio is transitioning to or already in RX, this function will wait a maximum time equal to waitTimeout (or indefinitely if waitTimeout is set to RAIL_GET_RSSI_WAIT_WITHOUT_TIMEOUT) for a valid RSSI to be read and return it. Otherwise, if the waitTimeout is reached, or the radio is in or transitions to IDLE or TX, RAIL_RSSI_INVALID will be returned. On low datarate PHYs, this function can take a significantly longer time when waitTimeout is non-zero.
In multiprotocol, this function returns RAIL_RSSI_INVALID immediately if railHandle is not the current active RAIL_Handle_t. Additionally, 'waitTimeout' should never be set to a value other than RAIL_GET_RSSI_NO_WAIT in multiprotocol as the integration between this feature and the radio scheduler has not been implemented.
Note
If RX Antenna Diversity is enabled via RAIL_ConfigRxOptions(), pass true for the wait parameter otherwise it's very likely RAIL_RSSI_INVALID will be returned.
If RX Antenna Diversity is enabled via RAIL_ConfigRxOptions(), the RSSI value returned could come from either antenna and vary between antennas.
If RX channel hopping is turned on, do not use this API. Instead, see RAIL_GetChannelHoppingRssi().
4282
of file common/rail.h
RAIL_StartAverageRssi#
RAIL_Status_t RAIL_StartAverageRssi (RAIL_Handle_t railHandle, uint16_t channel, RAIL_Time_t averagingTimeUs, const RAIL_SchedulerInfo_t * schedulerInfo)
Start the RSSI averaging over a specified time in us.
[in] | railHandle | A RAIL instance handle. |
[in] | channel | The physical channel to set. |
[in] | averagingTimeUs | Averaging time in microseconds. |
[in] | schedulerInfo | Information to allow the radio scheduler to place this operation appropriately. This is only used in multiprotocol version of RAIL and may be set to NULL in all other versions. |
Returns
Status code indicating success of the function call.
Starts a non-blocking hardware-based RSSI averaging mechanism. Only a single instance of RSSI averaging can be run at any time and the radio must be idle to start.
In multiprotocol, this is a scheduled event. It will start when railHandle becomes active. railHandle needs to stay active until the averaging completes. If the averaging is interrupted, calls to RAIL_GetAverageRssi will return RAIL_RSSI_INVALID.
Also in multiprotocol, the user is required to call RAIL_YieldRadio after this event completes (i.e., when RAIL_EVENT_RSSI_AVERAGE_DONE occurs).
Note
If the radio is idled while RSSI averaging is still in effect, a RAIL_EVENT_RSSI_AVERAGE_DONE event may not occur and RAIL_IsAverageRssiReady may never return true.
4312
of file common/rail.h
RAIL_IsAverageRssiReady#
bool RAIL_IsAverageRssiReady (RAIL_Handle_t railHandle)
Query whether the RSSI averaging is done.
[in] | railHandle | A RAIL instance handle. |
Returns
Returns true if done and false otherwise.
This function can be used to poll for completion of the RSSI averaging to avoid relying on an interrupt-based callback.
Note
If the radio is idled while RSSI averaging is still in effect, this function may never return true.
4329
of file common/rail.h
RAIL_GetAverageRssi#
int16_t RAIL_GetAverageRssi (RAIL_Handle_t railHandle)
Get the RSSI averaged over a specified time in us.
[in] | railHandle | A RAIL instance handle. |
Returns
Return RAIL_RSSI_INVALID if the receiver is disabled an RSSI value can't be obtained. Otherwise, return the RSSI in quarter dBm,dbm*4.
Gets the hardware RSSI average after issuing RAIL_StartAverageRssi. Use after RAIL_StartAverageRssi.
4342
of file common/rail.h
RAIL_SetRssiOffset#
RAIL_Status_t RAIL_SetRssiOffset (RAIL_Handle_t railHandle, int8_t rssiOffset)
Set the RSSI offset.
[in] | railHandle | a RAIL instance handle. |
[in] | rssiOffset | desired offset to be added to the RSSI measurements. |
Returns
Status code indicating success of the function call. RAIL_STATUS_INVALID_CALL if called with chip-specific handle, such as RAIL_EFR32_HANDLE, after RAIL initialization. RAIL_STATUS_INVALID_PARAMETER if the RSSI offset is deemed large enough to cause the RSSI readings to underflow or overflow.
Adds an offset to the RSSI in dBm. This offset affects all functionality that depends on RSSI values, such as CCA functions. Do not modify the offset dynamically during packet reception. This function can only be called while the radio is off, or in the case of multiprotocol, on an inactive protocol.
Note
: If RAIL has not been initialized, a chip-specific handle, such as RAIL_EFR32_HANDLE, can be used to set a chip level RSSI offset.
: Setting a large rssiOffset may still cause the RSSI readings to underflow. If that happens, the RSSI value returned by RAIL_GetRssi, RAIL_GetAverageRssi, RAIL_GetChannelHoppingRssi etc. will be RAIL_RSSI_LOWEST
: During RX Channel Hopping this API will not update the RSSI offset immediately if channel hopping has already been configured. A subsequent call to RAIL_ZWAVE_ConfigRxChannelHopping or RAIL_ConfigRxChannelHopping is required for the new RSSI offset to take effect.
4375
of file common/rail.h
RAIL_GetRssiOffset#
int8_t RAIL_GetRssiOffset (RAIL_Handle_t railHandle)
Get the RSSI offset.
[in] | railHandle | a RAIL instance handle. |
Returns
rssiOffset in dBm corresponding to the current handle.
Note
: A chip-specific handle, such as RAIL_EFR32_HANDLE, can be used to get the chip level RSSI offset otherwise this will return the RSSI offset value associated with the RAIL instance handle, exclusive of any chip level RSSI offset correction, if any.
4388
of file common/rail.h
RAIL_SetRssiDetectThreshold#
RAIL_Status_t RAIL_SetRssiDetectThreshold (RAIL_Handle_t railHandle, int8_t rssiThresholdDbm)
Set the RSSI detection threshold(in dBm) to trigger RAIL_EVENT_DETECT_RSSI_THRESHOLD.
[in] | railHandle | a RAIL instance handle. |
[in] | rssiThresholdDbm | desired RSSI threshold(in dBm) over which the event RAIL_EVENT_DETECT_RSSI_THRESHOLD is triggered. |
Returns
Status code indicating success of the function call. Returns RAIL_STATUS_INVALID_STATE in multiprotocol, if the requested RAIL_Handle_t is not active. Returns RAIL_STATUS_INVALID_CALL if called on parts on which this function is not supported.
When in receive, RSSI is sampled and if it exceeds the threshold, RAIL_EVENT_DETECT_RSSI_THRESHOLD is triggered.
Note
: If the radio is idled or this function is called with rssiThresholdDbm as RAIL_RSSI_INVALID_DBM while RSSI detect is still in effect, a RAIL_EVENT_DETECT_RSSI_THRESHOLD may not occur and the detection is disabled. If the RSSI is already above threshold when this function is called then RAIL_EVENT_DETECT_RSSI_THRESHOLD will occur. Once the RSSI goes over the configured threshold and RAIL_EVENT_DETECT_RSSI_THRESHOLD occurs, this function needs to be called again to reactivate the RSSI threshold detection. This function is only available on series-2 Sub-GHz parts EFR32XG23 and EFR32XG25.
4417
of file common/rail.h
RAIL_GetRssiDetectThreshold#
int8_t RAIL_GetRssiDetectThreshold (RAIL_Handle_t railHandle)
Get the RSSI detection threshold(in dBm).
[in] | railHandle | a RAIL instance handle. |
Returns
rssiThreshold (in dBm) corresponding to the current handle.
Note
: The function returns RAIL_RSSI_INVALID_DBM when RAIL_SetRssiDetectThreshold is not supported or disabled. In multiprotocol, the function returns RAIL_RSSI_INVALID_DBM if railHandle is not active. This function is only available on series-2 Sub-GHz parts EFR32XG23 and EFR32XG25.
4432
of file common/rail.h
RAIL_ConvertLqi#
RAIL_Status_t RAIL_ConvertLqi (RAIL_Handle_t railHandle, RAIL_ConvertLqiCallback_t cb)
Set up a callback function capable of converting a RX packet's LQI value before being consumed by application code.
[in] | railHandle | A RAIL instance handle. |
[in] | cb | A callback of type RAIL_ConvertLqiCallback_t that is called before the RX packet LQI value is loaded into the RAIL_RxPacketDetails_t structure for application consumption. |
Returns
Status code indicating success of the function call.
4444
of file common/rail.h
Macro Definition Documentation#
RAIL_RX_OPTIONS_NONE#
#define RAIL_RX_OPTIONS_NONEValue:
0
A value representing no options enabled.
3721
of file common/rail_types.h
RAIL_RX_OPTIONS_DEFAULT#
#define RAIL_RX_OPTIONS_DEFAULTValue:
RAIL_RX_OPTIONS_NONE
All options are disabled by default.
3723
of file common/rail_types.h
RAIL_RX_OPTION_STORE_CRC#
#define RAIL_RX_OPTION_STORE_CRCValue:
(1UL << RAIL_RX_OPTION_STORE_CRC_SHIFT)
An option to configure whether the CRC portion of the packet is included in the packet payload exposed to the app on packet reception.
Defaults to false.
3730
of file common/rail_types.h
RAIL_RX_OPTION_IGNORE_CRC_ERRORS#
#define RAIL_RX_OPTION_IGNORE_CRC_ERRORSValue:
(1UL << RAIL_RX_OPTION_IGNORE_CRC_ERRORS_SHIFT)
An option to configure whether CRC errors will be ignored.
If this is set, RX will still be successful, even if the CRC does not pass the check. Defaults to false.
Note
An expected ACK that fails CRC with this option set will still be considered the expected ACK, terminating the RAIL_AutoAckConfig_t::ackTimeout period.
3740
of file common/rail_types.h
RAIL_RX_OPTION_ENABLE_DUALSYNC#
#define RAIL_RX_OPTION_ENABLE_DUALSYNCValue:
(1UL << RAIL_RX_OPTION_ENABLE_DUALSYNC_SHIFT)
An option to control which sync words will be accepted.
Setting it to 0 (default) will cause the receiver to listen for SYNC1 only. Setting it to 1 causes the receiver to listen for either SYNC1 or SYNC2. RX appended info will contain which sync word was detected. Note, this only affects which sync word(s) are received, but not what each of the sync words actually are. This feature may not be available on some combinations of chips, PHYs, and protocols. Use the compile time symbol RAIL_SUPPORTS_DUAL_SYNC_WORDS or the runtime call RAIL_SupportsDualSyncWords() to check whether the platform supports this feature. Also, DUALSYNC may be incompatible with certain radio configurations. In these cases, setting this bit will be ignored. See the data sheet or support team for more details.
3755
of file common/rail_types.h
RAIL_RX_OPTION_TRACK_ABORTED_FRAMES#
#define RAIL_RX_OPTION_TRACK_ABORTED_FRAMESValue:
(1UL << RAIL_RX_OPTION_TRACK_ABORTED_FRAMES_SHIFT)
An option to configure whether frames which are aborted during reception should continue to be tracked.
Setting this option allows viewing Packet Trace information for frames which get discarded. Defaults to false.
This option is ignored when doing a RAIL_IDLE_FORCE_SHUTDOWN or RAIL_IDLE_FORCE_SHUTDOWN_CLEAR_FLAGS.
Note
This option should not be used with coded PHYs since packet data received after the abort will not be decoded properly.
3768
of file common/rail_types.h
RAIL_RX_OPTION_REMOVE_APPENDED_INFO#
#define RAIL_RX_OPTION_REMOVE_APPENDED_INFOValue:
(1UL << RAIL_RX_OPTION_REMOVE_APPENDED_INFO_SHIFT)
An option to suppress capturing the appended information after received frames.
Defaults to false. When suppressed, certain RAIL_RxPacketDetails_t details will not be available for received packets whose RAIL_RxPacketStatus_t is among the RAIL_RX_PACKET_READY_ set.
Warnings
This option should be changed only when the radio is idle and the receive FIFO is empty or has been reset, otherwise RAIL_GetRxPacketInfo() and RAIL_GetRxPacketDetails() may think appended info is packet data or vice-versa.
3782
of file common/rail_types.h
RAIL_RX_OPTION_ANTENNA0#
#define RAIL_RX_OPTION_ANTENNA0Value:
(1UL << RAIL_RX_OPTION_ANTENNA0_SHIFT)
An option to select the use of antenna 0 during receive (including Auto-ACK receive).
If no antenna option is selected, the packet will be received on the last antenna used for receive or transmit. Defaults to false. This option is only valid on platforms that support Antenna Control and have been configured via RAIL_ConfigAntenna().
3791
of file common/rail_types.h
RAIL_RX_OPTION_ANTENNA1#
#define RAIL_RX_OPTION_ANTENNA1Value:
(1UL << RAIL_RX_OPTION_ANTENNA1_SHIFT)
An option to select the use of antenna 1 during receive (including Auto-ACK receive).
If no antenna option is selected, the packet will be received on the last antenna used for receive or transmit. Defaults to false. This option is only valid on platforms that support Antenna Control and have been configured via RAIL_ConfigAntenna().
3800
of file common/rail_types.h
RAIL_RX_OPTION_ANTENNA_AUTO#
#define RAIL_RX_OPTION_ANTENNA_AUTOValue:
(RAIL_RX_OPTION_ANTENNA0 | RAIL_RX_OPTION_ANTENNA1)
An option combination to automatically choose an antenna during receive (including Auto-ACK receive).
If both antenna 0 and antenna 1 options are set, the radio will dynamically switch between antennas during packet detection and choose the best one for completing the reception. This option is only valid when the antenna diversity field is properly configured via Simplicity Studio. This option is only valid on platforms that support Antenna Control and have been configured via RAIL_ConfigAntenna().
3812
of file common/rail_types.h
RAIL_RX_OPTION_DISABLE_FRAME_DETECTION#
#define RAIL_RX_OPTION_DISABLE_FRAME_DETECTIONValue:
(1UL << RAIL_RX_OPTION_DISABLE_FRAME_DETECTION_SHIFT)
An option to disable frame detection.
This can be useful for doing energy detection without risking packet reception. Enabling this will abort any frame currently being received in addition to preventing further frames from being received. Defaults to false.
3820
of file common/rail_types.h
RAIL_RX_OPTION_CHANNEL_SWITCHING#
#define RAIL_RX_OPTION_CHANNEL_SWITCHINGValue:
(1U << RAIL_RX_OPTION_CHANNEL_SWITCHING_SHIFT)
An option to enable IEEE 802.15.4 RX channel switching.
See RAIL_IEEE802154_ConfigRxChannelSwitching() for more information. Defaults to false.
Note
This option is only supported on specific chips where RAIL_IEEE802154_SUPPORTS_RX_CHANNEL_SWITCHING is true.
This option overrides RAIL_RX_OPTION_ANTENNA0, RAIL_RX_OPTION_ANTENNA1 and RAIL_RX_OPTION_ANTENNA_AUTO antenna selection options.
3854
of file common/rail_types.h
RAIL_RX_OPTION_FAST_RX2RX#
#define RAIL_RX_OPTION_FAST_RX2RXValue:
(1U << RAIL_RX_OPTION_FAST_RX2RX_SHIFT)
An option to enable fast RX2RX state transition.
Once enabled, the sequencer will send the radio to RXSEARCH and get ready to receive the next packet while still processing the previous one. This will reduce RX to RX state transition time but risks impacting receive capability.
Note
This option is only supported on specific chips where RAIL_SUPPORTS_FAST_RX2RX is true.
3866
of file common/rail_types.h
RAIL_RX_OPTION_ENABLE_COLLISION_DETECTION#
#define RAIL_RX_OPTION_ENABLE_COLLISION_DETECTIONValue:
(1U << RAIL_RX_OPTION_ENABLE_COLLISION_DETECTION_SHIFT)
An option to enable collision detection.
Once enabled, when a collision with a strong enough packet is detected, the demod will stop the current packet decoding and try to detect the preamble of the incoming packet.
Note
This option is only supported on specific chips where RAIL_SUPPORTS_COLLISION_DETECTION is true.
3878
of file common/rail_types.h
RAIL_RX_OPTIONS_ALL#
#define RAIL_RX_OPTIONS_ALLValue:
0xFFFFFFFFUL
A value representing all possible options.
3881
of file common/rail_types.h
RAIL_RSSI_INVALID_DBM#
#define RAIL_RSSI_INVALID_DBMValue:
(-128)
The value returned by RAIL for an invalid RSSI, in dBm.
3884
of file common/rail_types.h
RAIL_RSSI_INVALID#
#define RAIL_RSSI_INVALIDValue:
((int16_t)(RAIL_RSSI_INVALID_DBM * 4))
The value returned by RAIL for an invalid RSSI: in quarter dBm.
3886
of file common/rail_types.h
RAIL_RSSI_LOWEST#
#define RAIL_RSSI_LOWESTValue:
((int16_t)(RAIL_RSSI_INVALID + 1))
The lowest RSSI value returned by RAIL: in quarter dBm.
3888
of file common/rail_types.h
RAIL_RSSI_OFFSET_MAX#
#define RAIL_RSSI_OFFSET_MAXValue:
35
Maximum absolute value for RSSI offset.
3891
of file common/rail_types.h
RAIL_GET_RSSI_WAIT_WITHOUT_TIMEOUT#
#define RAIL_GET_RSSI_WAIT_WITHOUT_TIMEOUTValue:
((RAIL_Time_t)0xFFFFFFFFU)
A sentinel value to indicate waiting for a valid RSSI without a timeout.
3894
of file common/rail_types.h
RAIL_GET_RSSI_NO_WAIT#
#define RAIL_GET_RSSI_NO_WAITValue:
((RAIL_Time_t)0U)
A sentinel value to indicate no waiting for a valid RSSI.
3896
of file common/rail_types.h
RAIL_RX_PACKET_HANDLE_INVALID#
#define RAIL_RX_PACKET_HANDLE_INVALIDValue:
(NULL)
An invalid RX packet handle value.
4065
of file common/rail_types.h
RAIL_RX_PACKET_HANDLE_OLDEST#
#define RAIL_RX_PACKET_HANDLE_OLDESTValue:
((RAIL_RxPacketHandle_t) 1)
A special RX packet handle to refer to the oldest unreleased packet.
This includes the newest unread packet which is possibly incomplete or not yet started. This handle is used implicitly by RAIL_ReadRxFifo().
4072
of file common/rail_types.h
RAIL_RX_PACKET_HANDLE_OLDEST_COMPLETE#
#define RAIL_RX_PACKET_HANDLE_OLDEST_COMPLETEValue:
((RAIL_RxPacketHandle_t) 2)
A special RX packet handle to refer to the oldest unreleased complete packet.
This never includes incomplete or unstarted packets. (Using RAIL_RX_PACKET_HANDLE_OLDEST is inappropriate for this purpose because it can refer to an unstarted, incomplete, or unheld packet which are inappropriate to be consumed by the application.)
4080
of file common/rail_types.h
RAIL_RX_PACKET_HANDLE_NEWEST#
#define RAIL_RX_PACKET_HANDLE_NEWESTValue:
((RAIL_RxPacketHandle_t) 3)
A special RX packet handle to refer to the newest unreleased packet when in callback context.
For a callback involving a completed receive event, this refers to the packet just completed. For other callback events, this refers to the next packet to be completed, which might be in-progress or might not have even started yet.
4089
of file common/rail_types.h