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 more
sourceimpl 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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &FixedPoint) -> bool
fn ne(&self, other: &FixedPoint) -> bool
This method tests for !=
.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more