Exhausted everything.
Here's the guts of the code. A task is called at 2Hz to push the value, which at 1024/s makes an event time of +512. I set the cumulative RPM to +1 for testing. Both values appear correctly in the nrfConnect App. Only RPM is supported.
However, osmand shows a much higher RPM, Wahoo app shows zero. Garmin won't connect/bond. Tried a few more and nothing is working.
static uint8_t encoded_csc_meas[] = {1,0,0,0,0,0,0};void BLUETOOTH_EventCscsMotionAssess(void) {
#ifdef BLE_CSCS_DISABLE
return;
#endif
ret_code_t err_code;
lastWheelEventTime += 512; // 1/1024s units
cumulativeRPM ++;
uint32_encode(cumulativeRPM, &encoded_csc_meas[1]);
uint16_encode(lastWheelEventTime, &encoded_csc_meas[5]);
ble_gatts_hvx_params_t hvx_params;
memset(&hvx_params, 0, sizeof(hvx_params));
hvx_params.type = BLE_GATT_HVX_NOTIFICATION;
hvx_params.offset = 0;
hvx_params.p_len = &len;
hvx_params.p_data = encoded_csc_meas;
hvx_params.handle = m_cscs.meas_handles.value_handle;
for(uint8_t i = 0; i < NRF_SDH_BLE_PERIPHERAL_LINK_COUNT; i++) {
if (connections.handles[i] != BLE_CONN_HANDLE_INVALID) {
len = sizeof(encoded_csc_meas);
err_code = sd_ble_gatts_hvx(connections.handles[i], &hvx_params);
if (err_code < 0x3000) {
APP_ERROR_CHECK(err_code);
}
}
}
}