| 727 | } |
| 728 | |
| 729 | void Muse::peripheral_on_accel (simpleble_peripheral_t peripheral, simpleble_uuid_t service, |
| 730 | simpleble_uuid_t characteristic, const uint8_t *data, size_t size) |
| 731 | { |
| 732 | std::lock_guard<std::mutex> callback_guard (callback_lock); |
| 733 | if (size != 20) |
| 734 | { |
| 735 | safe_logger (spdlog::level::warn, "unknown size for accel callback: {}", size); |
| 736 | return; |
| 737 | } |
| 738 | |
| 739 | for (int i = 0; i < 3; i++) |
| 740 | { |
| 741 | double accel_valx = (double)cast_16bit_to_int32 ((unsigned char *)&data[2 + i * 6]) / 16384; |
| 742 | double accel_valy = (double)cast_16bit_to_int32 ((unsigned char *)&data[4 + i * 6]) / 16384; |
| 743 | double accel_valz = (double)cast_16bit_to_int32 ((unsigned char *)&data[6 + i * 6]) / 16384; |
| 744 | current_aux_buf[i][board_descr["auxiliary"]["accel_channels"][0].get<int> ()] = accel_valx; |
| 745 | current_aux_buf[i][board_descr["auxiliary"]["accel_channels"][1].get<int> ()] = accel_valy; |
| 746 | current_aux_buf[i][board_descr["auxiliary"]["accel_channels"][2].get<int> ()] = accel_valz; |
| 747 | } |
| 748 | } |
| 749 | |
| 750 | void Muse::peripheral_on_gyro (simpleble_peripheral_t peripheral, simpleble_uuid_t service, |
| 751 | simpleble_uuid_t characteristic, const uint8_t *data, size_t size) |
no test coverage detected