m365 0.1.1

A lightweight rust library to receive BLE Xiaomi M365 scooter messages
Documentation
1
2
3
4
5
6
7
8
9
use hex_literal::hex;

#[test]
fn it_guess_what_distance_is_left() {
  let bytes = hex!("230125320a6af89411");
  let distance_bytes : [u8; 2] = bytes[3..5].try_into().unwrap();
  let distance_left_meters = u16::from_le_bytes(distance_bytes);
  assert_eq!(distance_left_meters, 2610);
}