2 Replies Latest reply on Jul 11, 2018 12:40 AM by Gyan Chand

    No Disconnect or Connection supervision timeout

    MikeMitchell

      My issue is that the BLE device does not see a disconnect.

       

      Using the USB HID Keyboard Demo,  with some modifications. There is no BLE sleeping, and the main loop is using CySysPmSleep() which is woke by a 1mS hardware interrupt from a timer.  Therefore, CyBle_ProcessEvents() is called at least every ms.    BLE version is current: 3.52

      Scenario:

      • Connect
      • Use Battery Service
      • Backout of Android app until phone says "Device is disconnected"

       

      Expectation: BLE Stack should indicate CYBLE_EVT_GAP_DEVICE_DISCONNECTED or CYBLE_EVT_TIMEOUT, depending on whether it heard the disconnect message. The connection state should change and it should go back to advertising.

       

      Auto come: Neither event happens and stack continues to say CyBle_GetState() == CYBLE_STATE_CONNECTED is true forever.

       

      What am I doing wrong? Thanks.

       

      Log Output

      > BLE Upgradable Stack HID Keyboard

      > Version: 1.20

      > Compile Date and Time: Jul  6 2018 10:15:29

       

      Bluetooth On, StartAdvertisement with addr: 00a050000615

      CYBLE_EVT_ADVERTISING, state: 3

      CYBLE_EVT_GATT_CONNECT_IND: 0, 4

      CYBLE_EVT_GAP_DEVICE_CONNECTED

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      CYBLE_EVT_AUTH_FAILED: 6

      CYBLE_EVT_GATTS_XCNHG_MTU_REQ, final mtu= 23

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      CYBLE_EVT_GATT_DISCONNECT_IND

      CYBLE_EVT_GAP_DEVICE_DISCONNECTED

      CYBLE_EVT_ADVERTISING, state: 3

      CYBLE_EVT_GATT_CONNECT_IND: 0, 4

      CYBLE_EVT_GAP_DEVICE_CONNECTED

      SimulBatteryLevelUpdate: 2

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      CYBLE_EVT_GATTS_XCNHG_MTU_REQ, final mtu= 23

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      SimulBatteryLevelUpdate: 2

      OTHER event: 57

      OTHER event: 33

      CYBLE_EVT_AUTH_REQ: security=3, bonding=1, ekeySize=10, err=0

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      CYBLE_EVT_GAP_ENCRYPT_CHANGE: 1

      CYBLE_EVT_GAP_KEYINFO_EXCHNGE_CMPLT

      AUTH_COMPLETE: security:1, bonding:1, ekeySize:10, authErr 0

      OTHER event: fa

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      OTHER event: 104

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      OTHER event: 57 //Manual Read

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      SimulBatteryLevelUpdate: 2

      SimulBatteryLevelUpdate: 2

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0  // Only indication of phone disconnecting

      CYBLE_EVT_CONNECTION_UPDATE_COMPLETE: 0

      SimulBatteryLevelUpdate: 2  // Should never happen - no longer connected.

      SimulBatteryLevelUpdate: 2

      SimulBatteryLevelUpdate: 2

      SimulBatteryLevelUpdate: 2