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
  • The changes doesn't look correct at all. You will get two BLE_NUS_C_EVT_DISCOVERY_COMPLETE events.

    One with valid handles for

    nus_tx_cccd_handle
    nus_tx_handle
    nus_rx_handle
    

    and invalid handle (0x0000) for handles.nus_rx2_handle

    With this event you want to set:

        p_ble_nus->handles.nus_tx_cccd_handle = p_peer_handles->nus_tx_cccd_handle;
        p_ble_nus->handles.nus_tx_handle      = p_peer_handles->nus_tx_handle;
        p_ble_nus->handles.nus_rx_handle      = p_peer_handles->nus_rx_handle;
    

    and call ble_nus_c_tx_notif_enable().

    Second with valid handles for

    handles.nus_rx2_handle
    

    and invalid handles (0x000) for nus_tx_cccd_handle, nus_tx_handle, nus_rx_handle

    With this event you want to set

    p_ble_nus->handles.nus_rx2_handle      = p_peer_handles->nus_rx2_handle;
    
Reply
  • The changes doesn't look correct at all. You will get two BLE_NUS_C_EVT_DISCOVERY_COMPLETE events.

    One with valid handles for

    nus_tx_cccd_handle
    nus_tx_handle
    nus_rx_handle
    

    and invalid handle (0x0000) for handles.nus_rx2_handle

    With this event you want to set:

        p_ble_nus->handles.nus_tx_cccd_handle = p_peer_handles->nus_tx_cccd_handle;
        p_ble_nus->handles.nus_tx_handle      = p_peer_handles->nus_tx_handle;
        p_ble_nus->handles.nus_rx_handle      = p_peer_handles->nus_rx_handle;
    

    and call ble_nus_c_tx_notif_enable().

    Second with valid handles for

    handles.nus_rx2_handle
    

    and invalid handles (0x000) for nus_tx_cccd_handle, nus_tx_handle, nus_rx_handle

    With this event you want to set

    p_ble_nus->handles.nus_rx2_handle      = p_peer_handles->nus_rx2_handle;
    
Children
No Data
Related