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

Central device can not find 2 services(0x1001,0x0001)

Peripheral device has 2 services,but central can find only 1 service(0x1001). I want to find other service(0x0001) According to the message seems to be looking for 0x1001,but ! want to looking for every services.

I don not know why this program look for only 0x1001.

Incidentally Central program is based ble_app_uart_c.

Please tell me how to find every services.

I Hope to have a central sample program that handles multiple services

Message is Starting discovery of service with UUID 0x1001 on connection handle 0x0. Found service UUID 0x1001. Discovery of service with UUID 0x1001 completed with success on connection handle 0x0

Parents
  • Seems to me you have to modify ble_nus_c_handles_assign() and ble_nus_c_tx_notif_enable(). BLE_NUS_C_EVT_DISCOVERY_COMPLETE will be received twice. Once with valid handles for

    nus_tx_cccd_handle
    nus_tx_handle
    nus_rx_handle
    

    Second for valid handle for

    handles.nus_rx2_handle
    

    So when calling ble_nus_c_handles_assign() the second time with only a valid rx2 handle, the other handles seems to be set to 0, and then you get an error when ble_nus_c_tx_notif_enable() is called the second time.

Reply
  • Seems to me you have to modify ble_nus_c_handles_assign() and ble_nus_c_tx_notif_enable(). BLE_NUS_C_EVT_DISCOVERY_COMPLETE will be received twice. Once with valid handles for

    nus_tx_cccd_handle
    nus_tx_handle
    nus_rx_handle
    

    Second for valid handle for

    handles.nus_rx2_handle
    

    So when calling ble_nus_c_handles_assign() the second time with only a valid rx2 handle, the other handles seems to be set to 0, and then you get an error when ble_nus_c_tx_notif_enable() is called the second time.

Children
No Data
Related