Struct dlt_core::dlt::FixedPoint
source · 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
sourceimpl Clone for FixedPoint
impl Clone for FixedPoint
sourcefn clone(&self) -> FixedPoint
fn clone(&self) -> FixedPoint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for FixedPoint
impl Debug for FixedPoint
sourceimpl PartialEq<FixedPoint> for FixedPoint
impl PartialEq<FixedPoint> for FixedPoint
sourcefn eq(&self, other: &FixedPoint) -> bool
fn eq(&self, other: &FixedPoint) -> bool
sourceimpl Serialize for FixedPoint
impl Serialize for FixedPoint
impl StructuralPartialEq for FixedPoint
Auto Trait Implementations
impl RefUnwindSafe for FixedPoint
impl Send for FixedPoint
impl Sync for FixedPoint
impl Unpin for FixedPoint
impl UnwindSafe for FixedPoint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more