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

[Bug Report] cts_c adjust reason

According to ble specification [1] and based on my test with iOS, the cts_c library seems to have bugs on a process decoding adjust reason data.

Here is a simple diffs (line 168-171 on components/ble/ble_services/ble_cts_c/ble_cts_c.c).

// Reason for updating the time.
- p_time->adjust_reason.change_of_daylight_savings_time = (p_data[index] >> 0) & 0x01;
- p_time->adjust_reason.change_of_time_zone             = (p_data[index] >> 1) & 0x01;
- p_time->adjust_reason.external_reference_time_update  = (p_data[index] >> 2) & 0x01;
- p_time->adjust_reason.manual_time_update              = (p_data[index] >> 3) & 0x01;

+ p_time->adjust_reason.manual_time_update              = (p_data[index] >> 0) & 0x01;
+ p_time->adjust_reason.external_reference_time_update  = (p_data[index] >> 1) & 0x01;
+ p_time->adjust_reason.change_of_time_zone             = (p_data[index] >> 2) & 0x01;
+ p_time->adjust_reason.change_of_daylight_savings_time = (p_data[index] >> 3) & 0x01;

[1] developer.bluetooth.org/.../CharacteristicViewer.aspx

Related