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

Bypass or skip the discovery service nRF52 SDK 12.2

Hi all,

I am trying to reduce the connection time between each connection to the minimal posible

Connect -->Transfer data -- Disconnect

I am facing two options:

  1. On the BLE_GAP_EVT_CONNECTED event avoid to call ble_db_discovery_start(), but it require in some way set BLE_LBS_C_EVT_DISCOVERY_COMPLETE with a valid event and how to assing the conn_handle to static handles on the GATT server

  2. From the BLE_GAP_EVT_CONNECTED event Set handles and enable a Notificiation to the peripheral.

Which is the most viable option? or Are there some example doing something similar?

Thanks

Parents
  • Hi,

    No problem with issuing (G)ATT Write once you know 16-bit handle number, here is paraphrase of nRF5 SDK v12.2.0 example:

    //...
    
    uint32_t                 err_code;
    ble_gattc_write_params_t write_params;
    uint8_t                  your_data_buffer[YOUR_DATA_MAX_LEN];
    
    //...
    your_data_buffer[0] = 0x41;
    your_data_buffer[1] = 0x42;
    //...
    
    write_params.write_op = BLE_GATT_OP_WRITE_REQ;
    write_params.handle   = your_write_handle_number;
    write_params.offset   = 0;
    write_params.len      = sizeof(your_data_buffer);
    write_params.p_value  = your_data_buffer;
    
    err_code = sd_ble_gattc_write(my_connection_handle, &write_params);
    APP_ERROR_CHECK(err_code);
    

    If you need GATT Client Service Discovery example (oriented to find specific UUID not all of them and so you can use much shorter algorithm to crawl through GATT handle tree) here are some hints.

  • I don't see any violation of BT SIG Core specification here, also you use Soft Device API and it's main purpose of BLE stack implementation by Nordic to be compliant;) I don't understand the second part of your question, you will need to elaborate...

  • Hi,

    I am trying this method .In my project the NRF51  Bluetooth is connected to the other Bluetooth .So even i need to skip the service discovery .can you tell me how to  get  your_write_handle_number in the other controller Bluetooth.I am not getting how to get the writable handle number

Reply Children
No Data
Related