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

Problem detecting 128-bit service w/ 16-bit char using pc-ble-driver

I use pc-ble-driver-master/hrc as central to  connect the target device which runs with modified ble_app_uart hex.

I can discover service and characteristic correctly, but the characteristic descriptor is not.

Only one descriptor(0x2803) can be found. Actually I want match the cccd UUID (0x2902) which can be found when use nrfConnect to connect 

#------------------------------------------------------------------------------------------------------------------------------------#

Received descriptor discovery response, descriptor count: 1
Handle: 0x000D, UUID: 0x2803

#-----------------------------------------------------------------------------------------------------------------------------------#

Parents
  • Hello,

    Can you describe what you do to find what you have already found?

    Are you sure that the characteristic you are looking at has notifications?

    It is notifications you are looking for, right? Have you tried to enable notifications like it is done in the ble_app_uart_c example?

    When discovery is complete, in the ble_nus_c_evt_handler(), it calls ble_nus_c_tx_notif_enable(p_ble_nus):

    static void ble_nus_c_evt_handler(ble_nus_c_t * p_ble_nus_c, ble_nus_c_evt_t const * p_ble_nus_evt)
    {
        ret_code_t err_code;
    
        switch (p_ble_nus_evt->evt_type)
        {
            case BLE_NUS_C_EVT_DISCOVERY_COMPLETE:
                NRF_LOG_INFO("Discovery complete.");
                err_code = ble_nus_c_handles_assign(p_ble_nus_c, p_ble_nus_evt->conn_handle, &p_ble_nus_evt->handles);
                APP_ERROR_CHECK(err_code);
    
                err_code = ble_nus_c_tx_notif_enable(p_ble_nus_c);
                APP_ERROR_CHECK(err_code);
                NRF_LOG_INFO("Connected to device with Nordic UART Service.");
                break;
    
            case BLE_NUS_C_EVT_NUS_TX_EVT:
                ble_nus_chars_received_uart_print(p_ble_nus_evt->p_data, p_ble_nus_evt->data_len);
                break;
    
            case BLE_NUS_C_EVT_DISCONNECTED:
                NRF_LOG_INFO("Disconnected.");
                scan_start();
                break;
        }
    }

    BR,

    Edvin

  • Thanks for your reply! 

    • I used example of pc-ble-driver (hrc) as templates and  moodified the target service uuid value and type(16 bit type before) .

    #define NUS_BASE_UUID                   {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E}} /**< Used vendor specific UUID. */               
    
    #define BLE_UUID_PRIMARY_SERVICE		 0x0001/**< primary service UUID. */
    #define BLE_UUID_PRIMARY_SERVICE_CHAR 0x0002 /**< primary service characteristic UUID. */

        //srvc_uuid.type = BLE_UUID_TYPE_BLE;
    	srvc_uuid.type = BLE_UUID_TYPE_VENDOR_BEGIN;
        //srvc_uuid.uuid = BLE_UUID_HEART_RATE_SERVICE;
    	srvc_uuid.uuid = BLE_UUID_PRIMARY_SERVICE;
        // Initiate procedure to find the primary BLE_UUID_HEART_RATE_SERVICE.
    
    	err_code = sd_ble_uuid_vs_add(m_adapter, &base_uuid, &srvc_uuid.type);

    • log is as below

    #--------------------------------------------------------------------------------------------------------#
    
    sd_ble_uuid_vs_add success.
    Success to initiate or continue a GATT Primary Service Discovery procedure
    Received BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST
    Received an un-handled event with ID: 36
    Received service discovery response
    Discovered heart rate service. UUID: 0x0001, start handle: 0x000B, end handle: 0xFFFF
    Discovering characteristics
    Received characteristic discovery response, characteristics count: 2
    Characteristic handle: 0x000C, UUID: 0x0002
    GET BLE_UUID_PRIMARY_SERVICE_CHAR SUCESSFULLY.
    Characteristic handle: 0x000E, UUID: 0x0003
    Discovering characteristic's descriptors
    Received descriptor discovery response, descriptor count: 1
    Descriptor handle: 0x000C, UUID: 0x2803
    
    #--------------------------------------------------------------------------------------------------------#

    • Screenshots of nrfConect can show the existence of  the nocification.

     

Reply
  • Thanks for your reply! 

    • I used example of pc-ble-driver (hrc) as templates and  moodified the target service uuid value and type(16 bit type before) .

    #define NUS_BASE_UUID                   {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E}} /**< Used vendor specific UUID. */               
    
    #define BLE_UUID_PRIMARY_SERVICE		 0x0001/**< primary service UUID. */
    #define BLE_UUID_PRIMARY_SERVICE_CHAR 0x0002 /**< primary service characteristic UUID. */

        //srvc_uuid.type = BLE_UUID_TYPE_BLE;
    	srvc_uuid.type = BLE_UUID_TYPE_VENDOR_BEGIN;
        //srvc_uuid.uuid = BLE_UUID_HEART_RATE_SERVICE;
    	srvc_uuid.uuid = BLE_UUID_PRIMARY_SERVICE;
        // Initiate procedure to find the primary BLE_UUID_HEART_RATE_SERVICE.
    
    	err_code = sd_ble_uuid_vs_add(m_adapter, &base_uuid, &srvc_uuid.type);

    • log is as below

    #--------------------------------------------------------------------------------------------------------#
    
    sd_ble_uuid_vs_add success.
    Success to initiate or continue a GATT Primary Service Discovery procedure
    Received BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST
    Received an un-handled event with ID: 36
    Received service discovery response
    Discovered heart rate service. UUID: 0x0001, start handle: 0x000B, end handle: 0xFFFF
    Discovering characteristics
    Received characteristic discovery response, characteristics count: 2
    Characteristic handle: 0x000C, UUID: 0x0002
    GET BLE_UUID_PRIMARY_SERVICE_CHAR SUCESSFULLY.
    Characteristic handle: 0x000E, UUID: 0x0003
    Discovering characteristic's descriptors
    Received descriptor discovery response, descriptor count: 1
    Descriptor handle: 0x000C, UUID: 0x2803
    
    #--------------------------------------------------------------------------------------------------------#

    • Screenshots of nrfConect can show the existence of  the nocification.

     

Children
No Data
Related