You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
needs a test, since the notecard does not handle NaN in serialized JSON. Currently the IMU temperature is never sent, which could either mean that this is a bug. Or that there's something disabled in the IMU.
#[test]
fn temp_not_f32_subnormal() {
// the notecard does not handle NaN f32's
let p = AxlPacketMeta::default();
let v: heapless::String<{10 * 1024}> = serde_json_core::to_string(&p).unwrap();
dbg!(&v);
assert!(v.contains("temperature"));
let mut p = AxlPacketMeta::default();
p.temperature = f32::NAN;
let v: heapless::String<{10 * 1024}> = serde_json_core::to_string(&p).unwrap();
dbg!(&v);
assert!(!v.contains("temperature"));
let mut p = AxlPacketMeta::default();
p.temperature = f32::INFINITY;
let v: heapless::String<{10 * 1024}> = serde_json_core::to_string(&p).unwrap();
dbg!(&v);
assert!(!v.contains("temperature"));
}
I think this gives a double negative:
https://github.com/gauteh/sfy/blob/main/sfy-buoy/src/axl.rs#L68
needs a test, since the notecard does not handle NaN in serialized JSON. Currently the IMU temperature is never sent, which could either mean that this is a bug. Or that there's something disabled in the IMU.
@stianvikanes : maybe something you can look into.
The text was updated successfully, but these errors were encountered: