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

How to create a new 128bit UUID services in the SDK10.0 ble_app_uart_c ?

I am working in the SDK10.0 ble_app_uart_c(master),it can connect to ble_app_hrs(slave) successfully. But if I add a new 128 bit UUID named ACC_BASE_UUID different from NUS_BASE_UUID.After I power on the master device,it can connect to slave,but the system will stop at the follow code: err_code = ble_acc_c_rx_notif_enalbe(p_ble_acc_c); APP_ERROR_CHECK_(err_code); The err_code is 0x08,so I trace the code.The system stopped at sd_ble_gattc_write(conn_handle,&acc_write_params);

**My question is how to add a new 128bit UUID in the ble_app_uart_c(master)?**The added code is same as the ble_nus_c.c,the difference is the name and the 128bit UUID.Thank you for your help.

Parents
  • Cannot say much without seeing how youa re calling ble_acc_c_rx_notif_enalbe and what you are doing inside ble_acc_c_rx_notif_enable function.

    if you are doing exactly same as NUS then it means you have not updated p_ble_acc_c->conn_handle when your device is connected like NUS did in main.c->on_ble_evt->BLE_GAP_EVT_CONNECTED

    m_ble_nus_c.conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
    

    You need to do the same for your m_ble_acc_c

    PLUS

    you need to update the p_ble_acc_c->nus_rx_cccd_handle when the db_discover_evt_handler discovers the cccd handle.

Reply
  • Cannot say much without seeing how youa re calling ble_acc_c_rx_notif_enalbe and what you are doing inside ble_acc_c_rx_notif_enable function.

    if you are doing exactly same as NUS then it means you have not updated p_ble_acc_c->conn_handle when your device is connected like NUS did in main.c->on_ble_evt->BLE_GAP_EVT_CONNECTED

    m_ble_nus_c.conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
    

    You need to do the same for your m_ble_acc_c

    PLUS

    you need to update the p_ble_acc_c->nus_rx_cccd_handle when the db_discover_evt_handler discovers the cccd handle.

Children
No Data
Related