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

Packet size in ble_app_hrs nRF51822?

Hello Guys,

I am interested in what is the packet size of Heart Rate application board example included in nRF51 SDK 6.0. I am using nRF51822 Evaluation board. Could help me with some ideas how to determine the packet that goes between board PCA10001 and USB PCA10000, and is there a quick way to modify the application and sent a custom packet size?

Thank you for any help that you could provide me.

  • Hello Mitko,

    The HRM service is a standardized bluetooth service, which has a certain set of rules it has to follow. Data size is one of these restrictions. You can read more about this on http://developer.bluetooth.org

    If you want to make your own proprietary bluetooth service (ie: not follow one of the main-stream services, like HRS/HID/proximity/etc), I would recommend that you look into nAN-36: www.nordicsemi.com/.../15228873

    Firmware can be found here: github.com/.../nrf51-ble-app-lbs

    This firmware is yet to be updated to SDK 6.0.0, unfortunately. You need to make a small adjustment in firmware, change function ble_stack_init to this:

    static void ble_stack_init(void)
    {
        uint32_t err_code;
    
        // Initialize the SoftDevice handler module.
        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, false);
    
        // Enable BLE stack 
        ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
        err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
    
        // Register with the SoftDevice handler module for BLE events.
        err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
        APP_ERROR_CHECK(err_code);
    
        // Register with the SoftDevice handler module for BLE events.
        err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
        APP_ERROR_CHECK(err_code);
    }
    

    And in the top of main.c, add this define:

    #define IS_SRVC_CHANGED_CHARACT_PRESENT      0
    

    Cheers, Håkon

Related