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

Add Device Information Service in custom_ble_app_template

Hi,
I am working on nRF52840.
I want to add Device Information Service in ble_app_template. (as shown in the attached image its from another device)
How can I add?
Kindly suggest. 
Thanks!

  • Yes I mean how can I change the order of services?
    I am trying to change here but it is not working.



    // YOUR_JOB: Use UUIDs for service(s) used in your application.
    static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
    {
        
    // YOUR_JOB: Use UUIDs for service(s) used in your application.
    {CUSTOM_SERVICE_UUID, BLE_UUID_TYPE_VENDOR_BEGIN }, /**< Universally unique service identifiers. */
    {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
    };
    

  • Hi Karl,
    I have successfully added all info in Device Info Service but getting issues in the device MAC address.

    Can you please check what I am making mistake?

    Thanks! 

    ble_gap_addr_t ble_addr;
    sd_ble_gap_addr_get(&ble_addr);
    
    
        ble_srv_ascii_to_utf8(&dis_init.p_sys_id, &ble_addr);
        ble_srv_ascii_to_utf8(&dis_init.model_num_str, (char *)MODEL_NUMBER);
        ble_srv_ascii_to_utf8(&dis_init.serial_num_str, (char *)SERIAL_NUMBER);
        ble_srv_ascii_to_utf8(&dis_init.fw_rev_str, (char *)FIRMWARE_NUMBER);
        ble_srv_ascii_to_utf8(&dis_init.hw_rev_str, (char *)HARDWARE_NUMBER);
        ble_srv_ascii_to_utf8(&dis_init.manufact_name_str, (char *)MANUFACTURER_NAME);
    
    

Related