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

Issues on implementing DIS client on multilink central

Hi all,

I'm trying to writing a device information service client on top of ble_app_multilink_central example on nRF52830 using SDK14.1.0 and softdevice 5.0 and have a big trouble getting it works.

I have defined only one instance do m_db_disc as on this link.

But it is very strange that the end_handle reported on BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP is invalid (65536). The UUID looks fine (0x180A) and start_handle returned is 17. Also, it can scan the UUIDs of all the characteristics. But it doesn't feel right to have an end_handle 65536.

Another issue is that the discovery stops on discovering the descriptors for the second service. If I call lbs_init_c() first, I could get the discovery success message on debug log for LBS. If I call the dis_init_c() first, then I could have a successful discovery for DIS but LBS stuck at descriptor discovery. The code is broken somewhere in descriptors_discover() in ble_db_discovery.c but I cannot pinpoint the exact location yet.

Any help and comment is very much appreciated and thanks in advance!

Arthur

ble_dis_c.c ble_dis_c.h Makefile sdk_config.h ble_db_discovery.c main.c ble_app_blinky_dis.zip

Parents
  • I think this is happening because you have dis_c_init_obj.evt_handler = NULL; in dis_c_init() in main.c and when the discovery is complete the application jumps to an invalid address.

    I also think that there should be something like

    VERIFY_PARAM_NOT_NULL(p_ble_lbs_c_init->evt_handler);

    in ble_dis_c_init() like it is in ble_lbs_c_init().

    Try doing dis_c_init_obj.evt_handler = dis_c_evt_handler; and something like:

    /**@brief Handles events coming from the DIS central module.
     *
     * @param[in] p_dis_c     The instance of DIS_C that triggered the event.
     * @param[in] p_dis_c_evt The DIS_C event.
     */
    static void dis_c_evt_handler(ble_dis_c_t * p_lbs_c, ble_dis_c_evt_t * p_dis_c_evt)
    {
        switch (p_dis_c_evt->evt_type)
        {
            case BLE_DIS_C_EVT_DISCOVERY_COMPLETE:
            {
    
                NRF_LOG_INFO("DIS service discovered on conn_handle 0x%x",
                             p_dis_c_evt->conn_handle);
    
            } break; // BLE_DIS_C_EVT_DISCOVERY_COMPLETE
            default:
                // No implementation needed.
                break;
        }
    }
    
  • Sorry for the late reply, I have had the flu for some days now. Have you solved this? The end handle of primary service discovery response being 0xFFFF shouldn't be a problem, it is normal. It is not used for anything is it?

    If you haven't solved it, I will try to look into the fault. Let me know.

Reply Children
No Data
Related