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.

Enumerations

enum  RCL_IEEE_UpdateResult { RCL_IEEE_UpdateOk, RCL_IEEE_UpdateIndexError }
 Result of IEEE command update API. More...
 
enum  RCL_IEEE_AckEntryResult { RCL_IEEE_AckOk, RCL_IEEE_AckNotExpected, RCL_IEEE_AckTooLate, RCL_IEEE_AckError }
 Result of entering ACK frame. More...
 

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_updateSourceMatchingTableShort (RCL_CmdIeee_PanIdAddr *newAddr, uint8_t framePending, RCL_CmdIeee_SourceMatchingTableShort *table, uint32_t index)
 Update short source matching table. More...
 
RCL_IEEE_UpdateResult RCL_IEEE_updateSourceMatchingTableExt (RCL_CmdIeeeRxTx *cmd, RCL_CmdIeee_PanConfig *newPanConfig, uint32_t panNumber)
 Update frame filtering settings extended source matching table. More...
 
RCL_IEEE_AckEntryResult RCL_IEEE_enterAck (RCL_CmdIeeeRxTx *cmd, RCL_Buffer_DataEntry *ackEntry)
 Provide ACK frame to be transmitted in response to received packet. 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...
 
RCL_CommandStatus RCL_IEEE_Tx_pend (RCL_CmdIeeeRxTx *cmd)
 Wait for a submitted TX operation to complete. More...
 
int8_t RCL_IEEE_getRxRssi (const RCL_Buffer_DataEntry *rxEntry)
 Get received RSSI from packet. More...
 
uint32_t RCL_IEEE_getRxTimestamp (const RCL_Buffer_DataEntry *rxEntry)
 Get received timestamp from packet. More...
 

Enumeration Type Documentation

§ RCL_IEEE_UpdateResult

Result of IEEE command update API.

Tells if update of IEEE command fields succeeded

Enumerator
RCL_IEEE_UpdateOk 

Update was successful

RCL_IEEE_UpdateIndexError 

Index was out of range or pointer was NULL

§ 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_AckNotExpected 

Ack was not expected

RCL_IEEE_AckTooLate 

Ack was provided too late

RCL_IEEE_AckError 

Data entry or pointer was not correct

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_CmdIeee_PanConfig::autoAckMode, customEvent, customHardStop, RCL_CmdIeee_PanConfig::defaultPend, hal_setup_sync_found_cap(), IEEE_BACKOFF_PERIOD, IEEE_CCA_START_TIME_MARGIN, IEEE_MAC_FCF_LEN, IEEE_PHY_HDR_LEN, ieeeHandlerState, RCL_CmdIeee_PanConfig::localExtAddr, RCL_CmdIeee_PanConfig::localPanId, RCL_CmdIeee_PanConfig::localShortAddr, LRF_clearHwInterrupt(), LRF_disable(), LRF_disableHwInterrupt(), LRF_disableSynthRefsys(), LRF_enable(), LRF_enableHwInterrupt(), LRF_enableSynthRefsys(), LRF_EventOpDone, LRF_EventOpError, LRF_EventRfesoft0, LRF_EventRxBufFull, LRF_EventRxCtrlAck, LRF_EventRxEmpty, LRF_EventRxIgnored, LRF_EventRxNok, LRF_EventRxOk, LRF_EventTxDone, LRF_getTxFifoWritable(), LRF_peekRxFifo(), LRF_prepareRxFifo(), LRF_prepareTxFifo(), LRF_programFrequency(), LRF_programTxPower(), LRF_readRssi(), LRF_readRxFifoWords(), LRF_RSSI_INVALID, LRF_sendHardStop(), LRF_waitForTopsmReady(), LRF_writeTxFifoWords(), RCL_CmdIeee_PanConfig::maxFrameVersion, noEvent, RCL_CmdIeee_PanConfig::panCoord, RCL_Buffer_DataEntry_paddedLen, RCL_CMD_IEEE_MAX_NUM_PAN, RCL_CmdIeee_AutoAck_ImmAckAutoPendAll, RCL_CmdIeee_AutoAck_ImmAckAutoPendDataReq, RCL_CmdIeee_AutoAck_ImmAckNoAutoPend, RCL_CmdIeee_AutoAck_Off, RCL_CmdIeee_CcaMode1Energy, RCL_CmdIeee_NoCca, RCL_CommandStatus_Active, RCL_CommandStatus_ChannelBusy, 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_GracefulStopApi, RCL_CommandStatus_HardStopApi, RCL_CommandStatus_isAnyStop, RCL_CommandStatus_NoSync, RCL_CommandStatus_RxErr, RCL_CommandStatus_Scheduled, RCL_Handler_Ieee_findPbeErrorEndStatus(), RCL_Handler_Ieee_initStats(), RCL_Handler_Ieee_maskEventsByFifoConf(), RCL_Handler_Ieee_restoreStopTime(), RCL_Handler_Ieee_setCustomEventTime(), RCL_Handler_Ieee_updateRxCurBufferAndFifo(), RCL_Handler_Ieee_updateStats(), 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, rclSchedulerState, rxStateNoRx, rxStateRunning, rxStateWaitForStart, TxPowerResult_Ok, txStateCheckAck, txStateFinished, txStateNewAction, txStateNoTx, txStateSetTxTime, txStateSetupCca, txStateTx, txStateTxRx, txStateTxRxAck, txStateWaitForCca, txStateWaitForCmdEnd, and txStateWaitForTx.

§ RCL_Handler_Ieee_TxTest()

§ RCL_IEEE_updateSourceMatchingTableShort()

RCL_IEEE_UpdateResult RCL_IEEE_updateSourceMatchingTableShort ( RCL_CmdIeee_PanIdAddr newAddr,
uint8_t  framePending,
RCL_CmdIeee_SourceMatchingTableShort table,
uint32_t  index 
)

Update short source matching table.

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

Parameters
newAddrNew address and PAN ID to apply; NULL to leave unchanged
framePendingValue of frame pending bit
tableSource matching table to update
indexIndex into source matching table to update
Returns
Result telling if update was successful

§ RCL_IEEE_updateSourceMatchingTableExt()

RCL_IEEE_UpdateResult RCL_IEEE_updateSourceMatchingTableExt ( RCL_CmdIeeeRxTx *  cmd,
RCL_CmdIeee_PanConfig newPanConfig,
uint32_t  panNumber 
)

Update frame filtering settings extended source matching table.

Update the given frame filtering settings in a way that is safe even if a running command is receiving a frame

Parameters
cmdExisting IEEE command to update
newPanConfigNew PAN configuration to apply
panNumberIndex of PAN to update
Returns
Result telling if update was successful

§ RCL_IEEE_enterAck()

RCL_IEEE_AckEntryResult RCL_IEEE_enterAck ( RCL_CmdIeeeRxTx *  cmd,
RCL_Buffer_DataEntry *  ackEntry 
)

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

Provide an ACK frame, which will be transmitted if the frame was received successfully

Parameters
cmdExisting IEEE command for which to enter ACK
ackEntryACK to be transmitted over the air
Returns
Result telling if update was successful

§ 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_Tx_pend()

RCL_CommandStatus RCL_IEEE_Tx_pend ( RCL_CmdIeeeRxTx *  cmd)

Wait for a submitted TX operation to complete.

Uses SemaphoreP_pend to block in the callers context.

Precondition
This function must be called from a task context, with interrupts enabled.
Parameters
[in]cmd- IEEE command running
Returns
Status of the TX operation

§ RCL_IEEE_getRxRssi()

int8_t RCL_IEEE_getRxRssi ( const RCL_Buffer_DataEntry *  rxEntry)

Get received RSSI from packet.

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

Parameters
rxEntryReceived data entry
Returns
Reported RSSI of received packet

§ RCL_IEEE_getRxTimestamp()

uint32_t RCL_IEEE_getRxTimestamp ( const RCL_Buffer_DataEntry *  rxEntry)

Get received timestamp from packet.

Returns the timestamp a received packet, adjusted to point to the start of the preamble. If timestamp is not enabled, 0 is returned. Note that this is a valid value, so it can not be used for error checking.

Parameters
rxEntryReceived data entry
Returns
Timestamp of received packet