This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to add custom service to the Ble_app_template example

Hello i am using nrf52810 with SDK version 17.0.2 , i want to add custom service to the ble_app_template example and i followed this tutorial link https://github.com/edvinand/custom_ble_service_example so at first debug i got this error as expected 

next i have change the RAM_START AND RAM_SIZE as per the memory size mentioned in the error then i DEBUG it again so the i got 

so i don't know what's happening please help me to resolve this . 

thank you.

Parents
  • Hello,

    Please make sure to have DEBUG defined in your preprocessor defines, like shown in the included image:

    This will make your logger output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.
    Please do this, and let me know what the error message reads, along with which function that returned the error code pointed to in the error message.

    Best regards,
    Karl

  • Hello,

    mr Karl i am very happy to communicate with you and thank you so much for your reply, i tried as you said  and i got this error,

    thank you,

  • If it turns out that the parts are not directly relevant to your application now it is still good to know for future reference, and to better understand how the BLE protocol and communication works.

    Yes, i will follow the tutorial but now i wrote data 01 to the device and led is turn on. If i want to receive the exact data which i have sent is not possible. i tried to receive  data by adding this line but whatever the data if i write same result at the receiving side for more information please have look at this,

    this is the data i am getting for different input, but i need the same data what i sent from the mobile application and here the line i have added in the write function 

    static void on_write(ble_cus_t * p_cus, ble_evt_t const * p_ble_evt)
    {
        ble_gatts_evt_write_t * p_evt_write = &p_ble_evt->evt.gatts_evt.params.write;
        
        // Check if the handle passed with the event matches the Custom Value Characteristic handle.
     
        uint8_t *sagar=p_evt_write->data;
        printf("sagar:0x%x\r\n",sagar);
        if (p_evt_write->handle == p_cus->custom_value_handles.value_handle)
        {
    
            nrf_gpio_pin_toggle(LED_4); 
        }
    
    }
     

  • Yes, this is covered in the next step of the tutorial which concerns forwarding of service events to the application layer.
    It will show you how to pass the received data to your application using service specific events.

    Best regards,
    Karl

  • Yes, this is covered in the next step of the tutorial which concerns forwarding of service events to the application layer.

    Ok. thank you so much  Karl i will complete whole tutorial and let you know the status.

    thank you.  

  • Great, I look forward to hearing how it goes!

  • Hello,

    Hi, mr.Karl i now i am  at step 8 and i can't connect the BLE it gives the NRF_ERROR_NULL. In tutorial they have mentioned that make sure that the evt_type is not NULL but when on_connect evt_type becomes BLE_EVT_CONNECTED right.?? so how the evt becomes NULL here for more information please have look at this.

    and one more thing that adding custom characteristics i faced some issues yesterday in cus_init() exactly at sd_ble_gatts_service_add() function returns so i have  done this then only characteristic is a

    added and its working fine. is that effects here.??

    please let me know,i am looking forward for your suggestions.

    thank you.

    so 

Reply
  • Hello,

    Hi, mr.Karl i now i am  at step 8 and i can't connect the BLE it gives the NRF_ERROR_NULL. In tutorial they have mentioned that make sure that the evt_type is not NULL but when on_connect evt_type becomes BLE_EVT_CONNECTED right.?? so how the evt becomes NULL here for more information please have look at this.

    and one more thing that adding custom characteristics i faced some issues yesterday in cus_init() exactly at sd_ble_gatts_service_add() function returns so i have  done this then only characteristic is a

    added and its working fine. is that effects here.??

    please let me know,i am looking forward for your suggestions.

    thank you.

    so 

Children
No Data
Related