lrwn: Fix clocksync time_correction type.

The correct type is i32 instead of u32, as the value can be negative.
This commit is contained in:
Orne Brocaar 2025-02-17 09:41:43 +00:00
parent ceb8523ebd
commit aa11db15de

View File

@ -180,7 +180,7 @@ pub struct AppTimeReqPayloadParam {
#[derive(Debug, PartialEq)]
pub struct AppTimeAnsPayload {
pub time_correction: u32,
pub time_correction: i32,
pub param: AppTimeAnsPayloadParam,
}
@ -194,7 +194,7 @@ impl PayloadCodec for AppTimeAnsPayload {
time_correction: {
let mut bytes = [0; 4];
bytes.copy_from_slice(&b[0..4]);
u32::from_le_bytes(bytes)
i32::from_le_bytes(bytes)
},
param: AppTimeAnsPayloadParam {
token_ans: b[4] & 0x0f,