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

How to modify the BPS format to insert custom data in nrf52

I am currently working on sending some custom data using BLE nrf52.

I find the BPS format best suited for my application but I want to modify the systolic and diastolic keys with something else.

How do I make that happen? I have searched the documentation and the header files but I am unable to find anything for that.

Could you please let me know on how it is done?

Parents
  • Hi,

    How do I make that happen? I have searched the documentation and the header files but I am unable to find anything for that.

    You can take the ble_bps.c and ble_bps.h files, rename them and adapt them to your needs in any way you like. Just remember that you should use a different UUID, as this is a registered/official 16 bit service UUID. You can refer to for instance the NUS service implementation (ble_nus.c) to see an example of a custom 128 bit service.

    Other than that, what to change and how depends on what you want to do?

  • Hello,

    I have added the 128 bit as follows:

    #define BLE_UUID_WB                  0x03beb05229f8435fb5912f57a464106f /**< Used vendor specific UUID. */
    
    
    static ble_uuid_t m_adv_uuids[] =                                       /**< Universally unique service identifiers. */
    {
        {BLE_UUID_WB,BLE_UUID_TYPE_BLE},
        {BLE_UUID_BATTERY_SERVICE,            BLE_UUID_TYPE_BLE},
        {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
    };
    

    However it shows "integer constant is too large for its type" alert after building.

    I am trying to replace the bps with this thing. However the bps UUID still is being read.

Reply
  • Hello,

    I have added the 128 bit as follows:

    #define BLE_UUID_WB                  0x03beb05229f8435fb5912f57a464106f /**< Used vendor specific UUID. */
    
    
    static ble_uuid_t m_adv_uuids[] =                                       /**< Universally unique service identifiers. */
    {
        {BLE_UUID_WB,BLE_UUID_TYPE_BLE},
        {BLE_UUID_BATTERY_SERVICE,            BLE_UUID_TYPE_BLE},
        {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
    };
    

    However it shows "integer constant is too large for its type" alert after building.

    I am trying to replace the bps with this thing. However the bps UUID still is being read.

Children
Related