1.2.7.4.4 SRV_RSNIFFER_SerialCfmMessage Function

C

uint8_t* SRV_RSNIFFER_SerialCfmMessage (
    DRV_RF215_TX_CONFIRM_OBJ* pCfmObj,
    DRV_RF215_TX_HANDLE txHandle,
    DRV_RF215_PHY_CFG_OBJ* pPhyCfgObj,
    uint16_t paySymbols,
    uint16_t channel,
    size_t* pMsgLen
);

Summary

Serializes a transmitted RF frame along with its parameters.

Description

This function takes a previously stored RF transmitted frame and its related parameters and serializes it in a buffer for further transmission through serial interface.

Parameters

ParamDescription
pCfmObjPointer to RF TX confirm object
txHandleTX handle given in TX confirm callback
pPhyCfgObjPointer to RF PHY configuration object
paySymbolsNumber of payload symbols in the transmitted frame
channelRF channel used to transmit the message
pMsgLenPointer to sniffer message length in bytes (output)

Returns

Pointer to sniffer message to be sent through serial interface.

Example

DRV_HANDLE drvRf215Handle; // returned from DRV_RF215_Open
SRV_USI_HANDLE srvUSIHandle; // returned from SRV_USI_Open

static void _APP_RF_TxCfmCb (
    DRV_RF215_TX_HANDLE txHandle,
    DRV_RF215_TX_CONFIRM_OBJ *cfmObj,
    uintptr_t ctxt
)
{
    DRV_RF215_PHY_CFG_OBJ rfPhyConfig;
    uint8_t* pRfSnifferData;
    size_t rfSnifferDataSize;
    uint16_t rfPayloadSymbols;
    uint16_t rfChannel;

    // Get payload symbols in the received message
    DRV_RF215_GetPib(drvRf215Handle, RF215_PIB_PHY_TX_PAY_SYMBOLS,
            &rfPayloadSymbols);

    // Get RF PHY configuration
    DRV_RF215_GetPib(drvRf215Handle, RF215_PIB_PHY_CONFIG, &rfPhyConfig);
    DRV_RF215_GetPib(drvRf215Handle, RF215_PIB_PHY_CHANNEL_NUM, &rfChannel);

    // Serialize received RF message
    pRfSnifferData = SRV_RSNIFFER_SerialCfmMessage(cfmObj, txHandle,
            &rfPhyConfig, rfPayloadSymbols, rfChannel, &rfSnifferDataSize);

    // Send through USI
    SRV_USI_Send_Message(srvUSIHandle, SRV_USI_PROT_ID_SNIF_PRIME,
            pRfSnifferData, rfSnifferDataSize);
}

Remarks

None.