Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Set data type for Notify2

Hello.
It is almost the same as the question (devzone.nordicsemi.com/.../set-data-type-for-notify) given three days ago.
I want to “Notify” new data in the “rscs” project.
In the sample project, data is sent with the "sd_ble_gatts_hvx" command on the peripheral side to notify the central.
The transmission parameters sent by "sd_ble_gatts_hvx" are as follows.
struct ble_rscs_meas_s
{
    bool is_inst_stride_len_present; / ** <True if Instantaneous Stride Length is present in the measurement. * /
    bool is_total_distance_present; / ** <True if Total Distance is present in the measurement. * /
    bool is_running; / ** <True if running, False if walking. * /
    uint16_t inst_speed; / ** <Instantaneous Speed. * /
    uint8_t inst_cadence; / ** <Instantaneous Cadence. * /
    uint16_t inst_stride_length; / ** <Instantaneous Stride Length. * /
    uint32_t total_distance; / ** <Total Distance. * /
};

The structure when receiving on the central side is as follows.
typedef struct
{
    bool is_inst_stride_len_present; / ** <True if Instantaneous Stride Length is present in the measurement. * /
    bool is_total_distance_present; / ** <True if Total Distance is present in the measurement. * /
    bool is_running; / ** <True if running, False if walking. * /
    uint16_t inst_speed; / ** <Instantaneous Speed. * /
    uint8_t inst_cadence; / ** <Instantaneous Cadence. * /
    uint16_t inst_stride_length; / ** <Instantaneous Stride Length. * /
    uint32_t total_distance; / ** <Total Distance. * /
} ble_rsc_t;

Because the variables in the two structures are the same, they are likely associated. Since we want to add new string data, we added "uint8_t moji [30]" in these two structures. I was able to build, but only moji data was not sent correctly.
One of the questions answered in the previous question was “Data transmission format is determined by HRS”. So maybe the data format is also decided by RSCS?
What should I do if I want to add new string data?
Thank you.

SoftDevice: S132
IDE: SES
BLE Device: NRF52832
SDK version: 15.30
Central project: ble_peripheral⇒ble_app_rscs_c
multirole project: experimental⇒ble_app_rscs

Related