This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC26X2R1: How to calculate PER with “HCI_EXT_PacketErrorRateCmd()”

Part Number: LAUNCHXL-CC26X2R1

Tool/software:

How can I use the parameters obtained from the command to calculate the “HCI_EXT_PacketErrorRateCmd()” command PER?

  • Hi !

    The documentation about the HCI_EXT_PacketErrorRateCmd function is a bit evasive, I agree.

    You can recieve the message from by first registering with GAP for HCI/Host messages with the GAP_RegisterForMsgs(selfEntity), and then call HCI_EXT_PacketErrorRateCmd (See user guide for more details).

    Then, your function that processes stack messages (for example, the function SimplePeripheral_processStackMsg in the Simple Peripheral project) will recieve the HCI message. You can filter for the right message by checking if your message have the right event (HCI_GAP_EVENT_EVENT), that have the right status (HCI_VE_EVENT_CODE) and the right cmdOpcode (HCI_EXT_PER) when casted to hciEvt_CommandStatus_t.

    The format of the message is the following :
    - 8 bytes of the LSB of EventOpcode (the opcode should be HCI_EXT_PER_EVENT)
    - 8 bytes of the MSB of EventOpcode (the opcode should be HCI_EXT_PER_EVENT)
    - 8 bytes of the status (should be HCI_SUCCESS)
    - 8 bytes of the command (should be HCI_EXT_PER_READ)
    - 8 bytes of the LSB of the number of packets
    - 8 bytes of the MSB of the number of packets
    - 8 bytes of the LSB of the number of CRC errors
    - 8 bytes of the MSB of the number of CRC errors
    - 8 bytes of the LSB of the number of events
    - 8 bytes of the MSB of the number of events
    - 8 bytes of the MSB of the number of missed events
    - 8 bytes of the LSB of the number of missed events

    Could you try if this corresponds to the data you expect ? Could you also tell me if you recieve one or two events from calling once the HCI_EXT_PacketErrorRateCmd function ?

    Kind regards,
    Maxence

  • Hi Maxence

    Thanks for your reply.
    I understood that I get the message with HCI_EXT_PER. Thank you very much for your kindness.

    > Could you try if this corresponds to the data you expect ? 

    Here is the data I expected.

    > ould you also tell me if you recieve one or two events from calling once the HCI_EXT_PacketErrorRateCmd function ?

    One event occurred.

    I can get the number of CRC errors and the number of packets received from the message content in HCI_EXT_PER, but which of these parameters can I use to find the value of PER?

    Is it simply “CRC errors / number of packets”?

    Best regards

  • Hi !

    Yes, “CRC errors / number of packets” is the formula to compute the packet error rate.

    Kind regards,
    Maxence

  • Hi

    Understood !

    Thank you very much.Resolved !

    Best regards