5 Replies Latest reply on Dec 5, 2016 8:31 PM by jackson_lv

    BLE central not connecting to ble device

    anne_1746161

      I have a device that I want to be a ble central. I am not able to get connected to a ble device.

       

      In wiced_bt_cfg_settings, I am using security settings BTM_SEC_NONE .

      I have called wiced_bt_stack_init()

      My p_bt_management_cback callback receives BTM_ENABLED_EVT  with p_event_data->enabled.status == WICED_BT_SUCCESS

       

      I call :

      wiced_bt_gatt_register( gtwy_gatts_callback );

      wiced_bt_ble_scan( BTM_BLE_SCAN_TYPE_HIGH_DUTY, WICED_FALSE, ble_gtwy_client_scan_results_callback );

       

      In my scan_results callback, I identify the  bd_addr which matches my device (p_scan_result->remote_bd_addr) and save the address.

       

      I make the following call, with the correct address.

      result = wiced_bt_gatt_le_connect( matched_bd_addr, BLE_ADDR_PUBLIC, BLE_CONN_MODE_HIGH_DUTY, WICED_TRUE);

       

      I was expecting that after this call, my central would connect to the device and that gtwy_gatts_callback() would get called with

      event == GATT_CONNECTION_STATUS_EVT.

       

      Instead, I never see gtwy_gatts_callback() called. If I watch with a ble sniffer, I never see CONNECT_REQ sent from the my central device.

      Am I missing a step? or does anyone have any idea about what might be the problem?

      thanks.