Struct dlt_core::dlt::FixedPoint [−][src]
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Mutably borrows from an owned value. Read more