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.

CC2640: Why can't execute CW command after set up connection

Part Number: CC2640

Hi

SDK2.2.1

Why can't execute CW command during BLE connection. We hope switch to CW mode after receive a specific command via BLE data exchange. Thanks.

GAPRole_TerminateConnection();

/*Task_sleep(2*1000/10);*/

g_advEnabled = FALSE;
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &g_advEnabled );

/*Task_sleep(2*1000/10);*/

HCI_EXT_SetTxPowerCmd( HCI_EXT_TX_POWER_0_DBM );

HCI_EXT_ModemTestTxCmd( HCI_EXT_TX_UNMODULATED_CARRIER,  0  );

while(1);

  • Hi,

    Most likely the connection hasn't terminated yet since the next connection event hasn't been reached where it will send the LL_TERMINATE_IND over the air.

    You can try using the HCI EXT Disconnect Immediate command to end the connection. That will effectively result in a supervision timeout on the peer device since no LL_TERMINATE_IND will be sent. Otherwise, you need to wait for the terminate event to be received at your app, then enable test mode.

    Best wishes