pub struct CellTemperatures;Expand description
Represents a command to request individual cell temperatures. The BMS returns cell temperatures in multiple frames.
Implementations§
Source§impl CellTemperatures
impl CellTemperatures
Sourcepub fn reply_size(n_sensors: u8) -> usize
pub fn reply_size(n_sensors: u8) -> usize
Calculates the total expected reply size in bytes for all frames for a given number of temperature sensors.
§Arguments
n_sensors- The number of temperature sensors in the battery pack.
Sourcepub fn decode(rx_buffer: &[u8], n_sensors: u8) -> Result<Vec<i32>, Error>
pub fn decode(rx_buffer: &[u8], n_sensors: u8) -> Result<Vec<i32>, Error>
Decodes the individual cell temperature data from a concatenated multi-frame response.
§Arguments
rx_buffer- The concatenated response frames received from the BMS.n_sensors- The total number of temperature sensors expected.
§Returns
A Result containing a Vec<i32> of cell temperatures in degrees Celsius or an Error if decoding fails.
Note that the BMS adds an offset of 40 to the temperature values, which is handled by this function.
This is a low-level function. Users might prefer client methods.
Auto Trait Implementations§
impl Freeze for CellTemperatures
impl RefUnwindSafe for CellTemperatures
impl Send for CellTemperatures
impl Sync for CellTemperatures
impl Unpin for CellTemperatures
impl UnwindSafe for CellTemperatures
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