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.

Host Test App - Peripheral mode - connect state notification?

(version 1.4) I am using the Host Test App in peripheral mode and I need to get connect/disconnect notifications.  Just being able to get the connection status would also work. 

I have tried to use HCI_EXT_ConnEventNoticeCmd with no success.

In a standard periperal configuration you can register a GAP role callback but how can one do that in the Host Test App?

  • The initialization sequence is:

    1. initialize in peripheral mode

    2. update advertising data

    3. make discoverable

    I can connect to the device.  When the connection is disconnected, how do I get it to start advertising again?

  • Hello Gary,

    The KeyFob example will start advertising again once the connection is lost.  

    In the CONSTANTS the following define has to be made:

    // Use limited discoverable mode to advertise for 30.72s, and then stop, or

    // use general discoverable mode to advertise indefinitely

    #define DEFAULT_DISCOVERABLE_MODE             GAP_ADTYPE_FLAGS_LIMITED

    //#define DEFAULT_DISCOVERABLE_MODE             GAP_ADTYPE_FLAGS_GENERAL

    The KeyFobApp_HandleKeys is used to manually start and stop the advertising In the

     if ( keys & HAL_KEY_SW_2 )

     ...

    You could perform the same check in your code or set a case for it as in the peropheralStateNotification.  I believe the actual restarting of the Adv is in the Proximity section.

    Thanks, 

       

  • After in inititialize the Host Test App in peripheral mode, I send down an GAP_UpdateAdvertisingData command with the GAP_ADTYPE_FLAGS_GENERAL flag which I thought would provide the same function?  Am I incorrect?