This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Central can't find primary service successfully

Hi,nordics

I failed to find primary service successfully .The sdk version is 10.00 and I reffered to the example is ble_app_uart_c_s120.The pripheral is a gamepad .I can connect to the gamepad successfully ,but I can't find the primary service .When the central start to find the primary service,I read the status of p_ble_gattc_evt->gatt_status and I find the value of p_ble_gattc_evt->gatt_status is BLE_GATT_STATUS_ATTERR_INVALID . Why this happened ?What can I do now ?I just want to communicate with the gamepad through the uuid .

Parents
  • When do you read p_ble_gattc_evt->gatt_status ? in which event ?

    If it's not in a relevant event, the value of p_ble_gattc_evt->gatt_status doesn't have any meaning.

    How did you do primary service discovery ? Please post the snippet of you code when you trigger service discovery.

  • I add a log in the function of on_primary_srv_discovery_rsp,

    static void on_primary_srv_discovery_rsp(ble_db_discovery_t * const    p_db_discovery,                                const  ble_gattc_evt_t * const p_ble_gattc_evt)
    {
                                             
           DB_LOG("[DB]: status is %d\r\n" , p_ble_gattc_evt->gatt_status); 
          if (p_ble_gattc_evt->gatt_status == BLE_GATT_STATUS_SUCCESS) 
          .....
     }    
    

    when the central connect to the device successfully ,the central begin to do primary service discovery .I used the project of ble_app_uart_c_s120 .I just changed the base uuid and service uuid .And the central connect to the device through target name .

Reply
  • I add a log in the function of on_primary_srv_discovery_rsp,

    static void on_primary_srv_discovery_rsp(ble_db_discovery_t * const    p_db_discovery,                                const  ble_gattc_evt_t * const p_ble_gattc_evt)
    {
                                             
           DB_LOG("[DB]: status is %d\r\n" , p_ble_gattc_evt->gatt_status); 
          if (p_ble_gattc_evt->gatt_status == BLE_GATT_STATUS_SUCCESS) 
          .....
     }    
    

    when the central connect to the device successfully ,the central begin to do primary service discovery .I used the project of ble_app_uart_c_s120 .I just changed the base uuid and service uuid .And the central connect to the device through target name .

Children
No Data
Related