pub struct FixedPoint {
pub quantization: f32,
pub offset: FixedPointValue,
}
Expand description
The following equation defines the relation between the logical value (log_v) and the physical value (phy_v), offset and quantization: log_v = phy_v * quantization + offset
- phy_v is what we received in the dlt message
- log_v is the real value example: the degree celcius is transmitted, quantization = 0.01, offset = -50 now the transmitted value phy_v = (log_v - offset)/quantization = 7785
The width depends on the TYLE value * i32 bit if Type Length (TYLE) equals 1,2 or 3 * i64 bit if Type Length (TYLE) equals 4 * i128 bit if Type Length (TYLE) equals 5 (unsupported)
Fields§
§quantization: f32
§offset: FixedPointValue
Trait Implementations§
Source§impl Clone for FixedPoint
impl Clone for FixedPoint
Source§fn clone(&self) -> FixedPoint
fn clone(&self) -> FixedPoint
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FixedPoint
impl Debug for FixedPoint
Source§impl PartialEq for FixedPoint
impl PartialEq for FixedPoint
impl StructuralPartialEq for FixedPoint
Auto Trait Implementations§
impl Freeze for FixedPoint
impl RefUnwindSafe for FixedPoint
impl Send for FixedPoint
impl Sync for FixedPoint
impl Unpin for FixedPoint
impl UnwindSafe for FixedPoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more