none
Windows App Disconnect from BLE device RRS feed

  • Question

  • I am building a plugin/DLL for a desktop application that allows for connecting to a BLE device (Nordic Thingy in this instance) in order to get the raw sensor data, etc for a WPF-based desktop application.

    I am using the UWPDesktop Nuget plugin to allow for use of the UWP API's for BLE (originally at the Windows 10 RTM version, but have tried with all versions of it). https://www.nuget.org/packages/UwpDesktop/

    In my other plugins, the workflow has been like this: Windows 10 bluetooth menu -> pair device -> write configs/set notify, etc for ble device. Now with the Nordic Thingy, windows will connect and instantly disconnect, with the device saying HCI reason 0x13, meaning windows side disconnected.

    0> m_ble         :INFO:m_ble: Current FW: v255.255.255
    0> m_env_flash   :INFO:Initialization
    0> m_env_flash   :INFO:Loading configuration
    0> m_env         :INFO:Init: ble_tes_init
    0> m_motion      :INFO:motion_service_init: ble_tms_init
    0> m_ui_flash    :INFO:Initialization
    0> m_ui_flash    :INFO:Loading configuration
    0> m_sound       :INFO:sound_service_init: ble_tss_init
    0> m_ble         :INFO:on_adv_evt: BLE_ADV_EVT_FAST
    0> MAC addr-> c5:bf:f0:b7:8a:47
    0> m_ble         :INFO:nfc string: c5:bf:f0:b7:8a:47 bc46b961
    0> drv_nfc       :INFO:NFC total message size 256 bytes
    0> drv_nfc       :INFO:NFC used message size 117 bytes
    0> adv_beacon_...:INFO:app_beacon_init:
    0> adv_beacon_...:INFO:app_beacon_start:
    0> m_ui          :INFO:Mode: BLE_UIS_LED_MODE_BREATHE
    0> main          :INFO:Voltage: 4100 V, Charge: 91 %, Event type: 0
    0> m_ble         :INFO:on_conn_params_evt: BLE_CONN_PARAMS_EVT_SUCCEEDED
    0> m_ui          :INFO:BLE connected
    0> m_ui          :INFO:Mode: BLE_UIS_LED_MODE_BREATHE
    0> m_ble         :INFO:on_ble_evt: BLE_GAP_EVT_CONNECTED
    0> main          :INFO:Thingy_ble_evt_connected
    0> m_ui          :INFO:BLE disonnected
    0> m_ui          :INFO:Mode: BLE_UIS_LED_MODE_BREATHE
    0> m_ble         :INFO:on_ble_evt: BLE_GAP_EVT_DISCONNECTED. Reason: 0x13
    0> main          :INFO:Thingy_ble_evt_disconnected

    This is the first time I've run into this being an issue. Why would the ble layer disconnect instantly?

    • Moved by Hart Wang Wednesday, November 8, 2017 7:04 AM
    Friday, November 3, 2017 2:30 PM

All replies

  • Hi Rayyeter,

    Thank you for posting here.

    Did you try to debug your project, which API cause the issue, and did you get other error message?

    Did you use the Bluetooth demo provided by Microsoft?

    As far as I know that the Nordic Thingy is third product, according to MSDN policy, you need to consult their product support. I will move the case to off-topic forum. 

    Best Regards,

    Hart


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 6, 2017 2:42 AM
  • Any Call that writes to a characteristic (Setting Client Characteristic to Notify, writing data to a R/W characteristic, etc.) Is causing this issue.

    I first asked their devzone support, who then directed me here.

    Monday, November 6, 2017 6:05 AM
  • Hi,

    Thank you for your feedback. 

    As far as i know that characteristic need to be read when you want to build a connection between client and service. 

    In fact, you can use any BLE device like a smart bulb that you can buy in Home Depot, but prior to buy anything you need to make sure that there is a document that describes all services and characteristics. Of course, using UWP API you will be able to read all available characteristics. 

    The current forum just discuss general issues about developing applications for Windows, your issue is related to third product. you can consult the hardware device forum. i will move the case to off-topic. 

    Best Regards,

    Hart

     


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Hart Wang Tuesday, November 7, 2017 7:44 AM
    Tuesday, November 7, 2017 7:43 AM