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.

HCI_EXT_ModemTestTxCmd and HCI_EXT_EndModemTestCmd events

I am trying to Run code on the Command Complete event of HCI_EXT_EndModemTestCmd and HCI_EXT_ModemTestTxCmd. But I cannot figure out how to get the events returned. I can see the Rx and Tx tests are running correctly just not seeing an Command Complete event. Also, HCI_READ_RSSI is working correctly. I have tried many variations, and this is the last attempt I made:

static void gapCentralRole_ProcessOSALMsg( osal_event_hdr_t *pMsg )
{
  switch ( pMsg->event )
  {
    case HCI_EXT_CMD_EVENT:
    case HCI_GAP_EVENT_EVENT:
      if ( pMsg->status == HCI_COMMAND_COMPLETE_EVENT_CODE )
      {
        hciEvt_CmdComplete_t *pPkt = (hciEvt_CmdComplete_t *) pMsg;

        switch(pPkt->cmdOpcode){
        case HCI_READ_RSSI:
          {
            uint16 connHandle = BUILD_UINT16( pPkt->pReturnParam[1], pPkt->pReturnParam[2] );
            int8 rssi = (int8) pPkt->pReturnParam[3];
            print("%i\r\n",rssi);
             
            // Report RSSI to app
            if ( pGapCentralRoleCB && pGapCentralRoleCB->rssiCB )
            {
              pGapCentralRoleCB->rssiCB( connHandle, rssi );
            }
          }
          break;
        case HCI_EXT_MODEM_TEST_TX:
        case HCI_EXT_MODEM_HOP_TEST_TX:
          {
            Currently_Testing = TRUE;
          }
          break;
        case HCI_EXT_MODEM_TEST_RX:
          {
            Currently_Testing = TRUE;
          }
          break;
        case HCI_EXT_END_MODEM_TEST:
          {
            Currently_Testing = FALSE;
            GAPCentralRole_CancelRssi();
          }
          break;
        }
      }else if(pMsg->status == HCI_VE_EVENT_CODE){
        print("else: %i",pMsg->status);
      }
      break;
   }
}



  • Hi,

    It seems this event is not sent to the application, unfortunately, only to external devices (such as BTool or a BT tester).

    After you call the end test command, at least for CC254x, the test should immediately be finished and you can go on doing whatever you want. Test end is really just a fancy LL_Reset.

    For the transmitter test, however, you can get an event - it goes to the same place you have shown in the code snippet above and is HCI_LE_TEST_END.

    BR,
    Aslak
  • I could not get the HCI_LE_TEST_END to work,but I had to figure out a different way to handle the testing anyways.

    Thanks for the help