Radio Control Layer (RCL)
ieee.h File Reference
+ Include dependency graph for ieee.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RCL_IEEE_SourceMatchingUpdate
 

Enumerations

enum  RCL_IEEE_UpdateResult {
  RCL_IEEE_UpdateDone, RCL_IEEE_UpdatePending, RCL_IEEE_UpdateCmdError, RCL_IEEE_UpdateParamError,
  RCL_IEEE_UpdateIndexError
}
 Result of IEEE command update API. More...
 
enum  RCL_IEEE_AckEntryResult {
  RCL_IEEE_AckOk, RCL_IEEE_AckPartial, RCL_IEEE_AckNotExpected, RCL_IEEE_AckAborted,
  RCL_IEEE_AckError, RCL_IEEE_AckNotProcessed
}
 Result of entering ACK frame. More...
 
enum  RCL_IEEE_SourceMatchingOperation {
  RCL_IEEE_DisableEntry, RCL_IEEE_EnableEntry, RCL_IEEE_FrameNotPending, RCL_IEEE_FramePending,
  RCL_IEEE_NewAddrFrameNotPending, RCL_IEEE_NewAddrFramePending
}
 

Functions

RCL_Events RCL_Handler_Ieee_RxTx (RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEventsIn)
 
RCL_Events RCL_Handler_Ieee_TxTest (RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEventsIn)
 
RCL_IEEE_UpdateResult RCL_IEEE_updateRxAction (RCL_CmdIeeeRxTx *cmd)
 Update RX Action contents. More...
 
RCL_IEEE_UpdateResult RCL_IEEE_updateSourceMatchingTableShort (RCL_CmdIeeeRxTx *cmd, RCL_IEEE_SourceMatchingUpdate description, RCL_CmdIeee_PanIdAddr newPanIdAddr)
 Update short source matching table. More...
 
RCL_IEEE_UpdateResult RCL_IEEE_updateSourceMatchingTableExt (RCL_CmdIeeeRxTx *cmd, RCL_IEEE_SourceMatchingUpdate description, const uint64_t *newAddr)
 Update extended source matching table. More...
 
RCL_IEEE_UpdateResult RCL_IEEE_updateTxPower (RCL_CmdIeeeRxTx *cmd, RCL_Command_TxPower newTxPower)
 Update TX power. More...
 
RCL_IEEE_AckEntryResult RCL_IEEE_enterAck (RCL_CmdIeeeRxTx *cmd, uint32_t *ackData, uint8_t numWords)
 Provide ACK data to be transmitted in response to received frame. More...
 
RCL_IEEE_AckEntryResult RCL_IEEE_cancelAck (RCL_CmdIeeeRxTx *cmd)
 Cancel transmission of ACK in response to received frame. More...
 
size_t RCL_IEEE_readPartialFrame (RCL_CmdIeeeRxTx *cmd, RCL_Buffer_DataEntry *dataEntry, size_t entrySize)
 Read partially received frame into buffer. More...
 
RCL_CommandStatus RCL_IEEE_Tx_submit (RCL_CmdIeeeRxTx *cmd, RCL_CmdIeee_TxAction *txAction)
 Update tx action. More...
 
RCL_CommandStatus RCL_IEEE_Tx_stop (RCL_CmdIeeeRxTx *cmd, RCL_StopType stopType)
 Stop a Tx action in an IEEE command. More...
 
int8_t RCL_IEEE_getRxRssi (const RCL_Buffer_DataEntry *rxEntry)
 Get received RSSI from frame. More...
 
uint8_t RCL_IEEE_getRxLqi (const RCL_Buffer_DataEntry *rxEntry)
 Get received LQI from frame. More...
 
uint32_t RCL_IEEE_getRxTimestamp (const RCL_Buffer_DataEntry *rxEntry)
 Get received timestamp from frame. More...
 

Data Structure Documentation

§ RCL_IEEE_SourceMatchingUpdate

struct RCL_IEEE_SourceMatchingUpdate
Data Fields
uint8_t panNo

PAN number to update (only 0 supported in this version)

uint8_t index

Index into source matching table to update

RCL_IEEE_SourceMatchingOperation operation

Operation to perform on entry

Enumeration Type Documentation

§ RCL_IEEE_UpdateResult

Result of IEEE command update API.

Tells if update of IEEE command fields succeeded

Enumerator
RCL_IEEE_UpdateDone 

Update was successfully done; no wait needed

RCL_IEEE_UpdatePending 

Update was successfully submitted; callback will be sent when done

RCL_IEEE_UpdateCmdError 

The requested update was not applicable or another update was pending

RCL_IEEE_UpdateParamError 

An invalid parameter was provided

RCL_IEEE_UpdateIndexError 

Index was out of range

§ RCL_IEEE_AckEntryResult

Result of entering ACK frame.

Tells if ACK frame was entered successfully

Enumerator
RCL_IEEE_AckOk 

ACK was entered successfully

RCL_IEEE_AckPartial 

Part of ACK entered successfully; more data expected

RCL_IEEE_AckNotExpected 

Ack was not expected or payload was provided too late

RCL_IEEE_AckAborted 

Ack transmission was aborted because of request or error

RCL_IEEE_AckError 

Data entry or pointer was not correct

RCL_IEEE_AckNotProcessed 

Ack processing not finished as expected

§ RCL_IEEE_SourceMatchingOperation

Enumerator
RCL_IEEE_DisableEntry 

Disable the entry

RCL_IEEE_EnableEntry 

Enable the entry

RCL_IEEE_FrameNotPending 

Set frame not pending

RCL_IEEE_FramePending 

Set frame pending

RCL_IEEE_NewAddrFrameNotPending 

Change the address of the entry, enable, and set frame not pending

RCL_IEEE_NewAddrFramePending 

Change the address of the entry, enable, and set frame pending

Function Documentation

§ RCL_Handler_Ieee_RxTx()

RCL_Events RCL_Handler_Ieee_RxTx ( RCL_Command *  cmd,
LRF_Events  lrfEvents,
RCL_Events  rclEventsIn 
)

References RCL_SchedulerState::actualStartTime, RCL_SchedulerStopInfo::apiStopEnabled, COEX_GRANT_GLOBAL_ENABLE, COEX_REQUEST_GLOBAL_ENABLE, customEvent, customHardStop, RCL_FeatureControl::enableTemperatureMonitoring, RCL_SchedulerState::gracefulStopInfo, hal_power_release_swtcxo_update_constraint(), hal_power_set_swtcxo_update_constraint(), hal_setup_sync_found_cap(), RCL_SchedulerState::hardStopInfo, IEEE_BACKOFF_PERIOD, IEEE_CCA_START_TIME_MARGIN, IEEE_MAC_FCF_LEN, IEEE_PHY_HDR_LEN, LRF_CoexConfiguration::ieeeCorrMask, ieeeHandlerState, LRF_CoexConfiguration::ieeeTSync, LRF_CoexConfiguration::invertedPriority, LRF_clearHwInterrupt(), LRF_deassertCoexRequest(), LRF_disable(), LRF_disableCoexGrant(), LRF_disableHwInterrupt(), LRF_disableSynthRefsys(), LRF_disableTemperatureMonitoring(), LRF_enable(), LRF_enableCoexGrant(), LRF_enableHwInterrupt(), LRF_enableSynthRefsys(), LRF_enableTemperatureMonitoring(), LRF_EventOpDone, LRF_EventOpError, LRF_EventRfesoft0, LRF_EventRfesoft1, LRF_EventRxCtrl, LRF_EventRxEmpty, LRF_EventTxDone, LRF_getTxFifoWritable(), LRF_peekRxFifo(), LRF_prepareRxFifo(), LRF_prepareTxFifo(), LRF_programFrequency(), LRF_programTxPower(), LRF_readRssi(), LRF_readRxFifoWords(), LRF_RSSI_INVALID, LRF_sendGracefulStop(), LRF_sendHardStop(), LRF_updateTemperatureCompensation(), LRF_waitForTopsmReady(), LRF_writeTxFifoWords(), noEvent, noSrcMatchUpdate, RCL_Buffer_bytesToWords, RCL_Buffer_DataEntry_paddedLen, RCL_CMD_IEEE_MAX_NUM_PAN, RCL_CmdIeee_CcaMode1Energy, RCL_CmdIeee_CcaMode2Signal, RCL_CmdIeee_CcaMode3EnergyAndSignal, RCL_CmdIeee_CcaMode3EnergyOrSignal, RCL_CmdIeee_CcaMode4Aloha, RCL_CmdIeee_NoCca, RCL_CommandStatus_Active, RCL_CommandStatus_ChannelBusy, RCL_CommandStatus_CoexNoGrant, RCL_CommandStatus_DescheduledApi, RCL_CommandStatus_Error, RCL_CommandStatus_Error_MissingTxBuffer, RCL_CommandStatus_Error_Param, RCL_CommandStatus_Error_RxBufferCorruption, RCL_CommandStatus_Error_StartTooLate, RCL_CommandStatus_Error_TxBufferCorruption, RCL_CommandStatus_Finished, RCL_CommandStatus_FramePending, RCL_CommandStatus_GracefulStopApi, RCL_CommandStatus_HardStopApi, RCL_CommandStatus_isAnyStop, RCL_CommandStatus_NoSync, RCL_CommandStatus_RxErr, RCL_CommandStatus_Scheduled, RCL_HANDLER_IEEE_ACK_LENGTH_ABORT, RCL_HANDLER_IEEE_ACK_LENGTH_IDLE, RCL_HANDLER_IEEE_ACK_LENGTH_MAX, RCL_Handler_Ieee_findPbeErrorEndStatus(), RCL_Handler_Ieee_initStats(), RCL_Handler_Ieee_processCoexTxPriority(), RCL_Handler_Ieee_processRxAction(), RCL_Handler_Ieee_restoreStopTime(), RCL_Handler_Ieee_setCoexEndMode(), RCL_Handler_Ieee_setCoexPriority(), RCL_Handler_Ieee_setCustomEventTime(), RCL_Handler_Ieee_updateRxCurBufferAndFifo(), RCL_Handler_Ieee_updateStats(), RCL_IEEE_AckAborted, RCL_IEEE_AckError, RCL_IEEE_AckNotExpected, RCL_IEEE_AckOk, RCL_IEEE_AckPartial, RCL_MultiBuffer_commitBytes(), RCL_MultiBuffer_getBuffer(), RCL_MultiBuffer_getNextWritableByte(), RCL_ProfilingEvent_PostprocStart, RCL_ProfilingEvent_PreprocStop, RCL_Schedule_AbsTime, RCL_Schedule_Now, RCL_Scheduler_delta(), RCL_Scheduler_findStopStatus(), RCL_Scheduler_getCurrentTime(), RCL_Scheduler_isLater(), RCL_Scheduler_setCustomStartStopTimeEarliestStart(), RCL_Scheduler_setNewStartAbsTime(), RCL_Scheduler_setNewStartNow(), RCL_Scheduler_setStartStopTimeEarliestStart(), RCL_StopType_Graceful, RCL_StopType_Hard, RCL_StopType_None, rclFeatureControl, rclSchedulerState, rxStateNoRx, rxStateRunning, rxStateWaitForStart, srcMatchUpdateStart, LRF_CoexConfiguration::T1, LRF_CoexConfiguration::T2, txAckStateAckAborted, txAckStatePayloadComplete, txAckStatePayloadExpected, txAckStatePending, TxPowerResult_Ok, txStateCheckAck, txStateFinished, txStateNewAction, txStateNoTx, txStateSetTxTime, txStateSetupCca, txStateStopToSetTx, txStateTx, txStateTxRx, txStateTxRxAck, txStateWaitForCca, txStateWaitForCmdEnd, and txStateWaitForTx.

§ RCL_Handler_Ieee_TxTest()

§ RCL_IEEE_updateRxAction()

RCL_IEEE_UpdateResult RCL_IEEE_updateRxAction ( RCL_CmdIeeeRxTx *  cmd)

Update RX Action contents.

Re-read the contents of the receive action of the given command. All elements will be re-read at an appropriate time; until then, the old value is used. The rxBuffers element should only be updated through normal RCL_Buffer functions, though. If the status indicates that the update is pending, a cmdUpdateDone event is raised when it is done. If an error occurred during the update, the command will end with error.

Parameters
cmdExisting IEEE command for which to re-read the RX action contents
Returns
Result telling if update was successful

References ieeeHandlerState, noSrcMatchUpdate, RCL_CMDID_IEEE_RX_TX, RCL_CommandStatus_Active, RCL_EventHandlerCmdUpdate, RCL_IEEE_UpdateCmdError, RCL_IEEE_UpdateDone, RCL_IEEE_UpdatePending, RCL_Scheduler_postEvent(), and result.

§ RCL_IEEE_updateSourceMatchingTableShort()

RCL_IEEE_UpdateResult RCL_IEEE_updateSourceMatchingTableShort ( RCL_CmdIeeeRxTx *  cmd,
RCL_IEEE_SourceMatchingUpdate  description,
RCL_CmdIeee_PanIdAddr  newPanIdAddr 
)

§ RCL_IEEE_updateSourceMatchingTableExt()

RCL_IEEE_UpdateResult RCL_IEEE_updateSourceMatchingTableExt ( RCL_CmdIeeeRxTx *  cmd,
RCL_IEEE_SourceMatchingUpdate  description,
const uint64_t *  newAddr 
)

Update extended source matching table.

Update the given source matching table in a way that is safe even if a running command is using the source matching table.

Parameters
cmdExisting IEEE command for which to update the source matching table
descriptionDescription of operation to perform
newAddrIf entry is changed: Pointer to the new address to set
Returns
Result telling if update was successful
Note
Not supported in this version

§ RCL_IEEE_updateTxPower()

RCL_IEEE_UpdateResult RCL_IEEE_updateTxPower ( RCL_CmdIeeeRxTx *  cmd,
RCL_Command_TxPower  newTxPower 
)

Update TX power.

Update the TX power used for future frames sent with TX actions or as ACKs for a running command. The command structure will be updated with the new value if the update was successful.

Parameters
cmdExisting IEEE command for which to update the TX power
newTxPowerNew TX power value
Returns
Result telling if update was successful

References LRF_programTxPower(), LRF_TxPower_None, LRF_TxPowerTable_Index::rawValue, RCL_CMDID_IEEE_RX_TX, RCL_CommandStatus_Active, RCL_IEEE_UpdateCmdError, RCL_IEEE_UpdateDone, RCL_IEEE_UpdateParamError, result, and TxPowerResult_Ok.

§ RCL_IEEE_enterAck()

RCL_IEEE_AckEntryResult RCL_IEEE_enterAck ( RCL_CmdIeeeRxTx *  cmd,
uint32_t *  ackData,
uint8_t  numWords 
)

Provide ACK data to be transmitted in response to received frame.

Provide an ACK frame or the parts of it, which will be transmitted if the frame was received successfully

Parameters
cmdExisting IEEE command for which to enter ACK
ackDataPointer to data that will be appended; first part should be of type RCL_Buffer_DataEntry
numWordsNumber of 32-bit words provided at this point; 0 if entry is complete
Returns
Result telling if update was successful
Note
All pieces of data must be provided in portions of 32-bit words

References RCL_Buffer_bytesToWords, RCL_Buffer_DataEntry_paddedLen, RCL_HANDLER_IEEE_ACK_LENGTH_ABORT, RCL_HANDLER_IEEE_ACK_LENGTH_MAX, RCL_Handler_Ieee_txAckUpdate(), and RCL_IEEE_AckError.

§ RCL_IEEE_cancelAck()

RCL_IEEE_AckEntryResult RCL_IEEE_cancelAck ( RCL_CmdIeeeRxTx *  cmd)

Cancel transmission of ACK in response to received frame.

Cancel transmission of an ACK by not starting it or aborting transmission

Parameters
cmdExisting IEEE command for which to enter ACK
Returns
Result telling if update was successful

References RCL_HANDLER_IEEE_ACK_LENGTH_ABORT, RCL_Handler_Ieee_txAckUpdate(), and RCL_IEEE_AckError.

§ RCL_IEEE_readPartialFrame()

size_t RCL_IEEE_readPartialFrame ( RCL_CmdIeeeRxTx *  cmd,
RCL_Buffer_DataEntry *  dataEntry,
size_t  entrySize 
)

Read partially received frame into buffer.

Parameters
cmdExisting IEEE command receiving the frame
dataEntryEntry for storing data
entrySizeNumber of bytes available in entry, including header fields (should be a multiple of 4)
Returns
Number of bytes read into entry, including header fields

References data, ieeeHandlerState, LRF_getUncommittedFifoStatus(), LRF_peekRxFifoWords(), and RCL_CommandStatus_Active.

§ RCL_IEEE_Tx_submit()

RCL_CommandStatus RCL_IEEE_Tx_submit ( RCL_CmdIeeeRxTx *  cmd,
RCL_CmdIeee_TxAction *  txAction 
)

Update tx action.

Parameters
cmdExisting IEEE command to submit the TX on top of
txActionTX action to apply
Returns
RCL_CommandStatus result of the submission

References RCL_SchedulerState::currCmd, ieeeHandlerState, RCL_CommandStatus_Error, RCL_CommandStatus_Error_AlreadySubmitted, RCL_CommandStatus_Finished, RCL_CommandStatus_Idle, RCL_EventHandlerCmdUpdate, RCL_Scheduler_postEvent(), rclSchedulerState, txStateNewAction, and txStateNoTx.

§ RCL_IEEE_Tx_stop()

RCL_CommandStatus RCL_IEEE_Tx_stop ( RCL_CmdIeeeRxTx *  cmd,
RCL_StopType  stopType 
)

Stop a Tx action in an IEEE command.

Sends the message to try to stop a TX action. When the function returns, the command may still be running. Depending on the stop type, the operation may stop after some time.

Parameters
cmd[in] IEEE command
stopType[in] Stop type; telling which situations the operation will stop
Returns
Status of the TX operation; if the operation is not finished, a wait is needed.

References ieeeHandlerState, RCL_CommandStatus_Active, RCL_CommandStatus_DescheduledApi, RCL_CommandStatus_Error_Param, RCL_CommandStatus_Finished, RCL_EventHandlerCmdUpdate, and RCL_Scheduler_postEvent().

§ RCL_IEEE_getRxRssi()

int8_t RCL_IEEE_getRxRssi ( const RCL_Buffer_DataEntry *  rxEntry)

Get received RSSI from frame.

Returns the RSSI field of a received frame, or LRF_RSSI_INVALID if appending RSSI is not enabled

Parameters
rxEntryReceived data entry
Returns
Reported RSSI of received frame

References ieeeHandlerState, LRF_RSSI_INVALID, and RCL_Handler_IEEE_findNumExtraBytes().

§ RCL_IEEE_getRxLqi()

uint8_t RCL_IEEE_getRxLqi ( const RCL_Buffer_DataEntry *  rxEntry)

Get received LQI from frame.

Returns the LQI field of a received frame, or 0 if appending LQI is not enabled

Parameters
rxEntryReceived data entry
Returns
Reported LQI of received frame

References ieeeHandlerState, and RCL_Handler_IEEE_findNumExtraBytes().

§ RCL_IEEE_getRxTimestamp()

uint32_t RCL_IEEE_getRxTimestamp ( const RCL_Buffer_DataEntry *  rxEntry)

Get received timestamp from frame.

Returns the timestamp in 0.25 us units of a received frame, adjusted to point to the start of the preamble. If appending timestamp is not enabled, 0 is returned. Note that 0 is a valid value, so it cannot be used for error checking.

Parameters
rxEntryReceived data entry
Returns
Timestamp of received frame

References IEEE_TIMESTAMP_ADJUST, and ieeeHandlerState.