pub struct SetDischargeMosfet;Expand description
Represents a command to enable or disable the discharging MOSFET.
Implementations§
Source§impl SetDischargeMosfet
impl SetDischargeMosfet
Sourcepub fn request(address: Address, enable: bool) -> Vec<u8> ⓘ
pub fn request(address: Address, enable: bool) -> Vec<u8> ⓘ
Creates a request frame to set the state of the discharging MOSFET.
§Arguments
address- The address of the BMS (should beAddress::Hostwhen sending from host).enable-trueto enable the discharging MOSFET,falseto disable it.
§Returns
A byte vector representing the request frame.
This is a low-level function. Users might prefer client methods.
Sourcepub fn reply_size() -> usize
pub fn reply_size() -> usize
Expected size of the reply frame for a set discharge MOSFET command. The BMS typically echoes the command or sends a status.
Sourcepub fn decode(rx_buffer: &[u8]) -> Result<(), Error>
pub fn decode(rx_buffer: &[u8]) -> Result<(), Error>
Decodes the response frame for a set discharge MOSFET command. This typically just validates the checksum and length, as the BMS response might not carry specific data.
§Arguments
rx_buffer- The response frame received from the BMS.
§Returns
An empty Result if successful, or an Error if decoding fails.
This is a low-level function. Users might prefer client methods.
Auto Trait Implementations§
impl Freeze for SetDischargeMosfet
impl RefUnwindSafe for SetDischargeMosfet
impl Send for SetDischargeMosfet
impl Sync for SetDischargeMosfet
impl Unpin for SetDischargeMosfet
impl UnwindSafe for SetDischargeMosfet
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