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

How do I change type of data to send with BLE?

I want to change type from "uint32_t val1 = 0xAA01" to "uint8_t val2 = {"AA01"}.

Then, attr_char_value.p_value = val2;
=> sd_ble_gatts_characteristic_add(p_rms->service_handle,
&char_md,
&attr_char_value,
&p_rms->version_char_handles);

Can I do this?
uint8_t val2[4];
itoa(val1, val2, 16);

Related