pub struct SetChargeMosfet;Expand description
Represents a command to enable or disable the charging MOSFET.
Implementations§
Source§impl SetChargeMosfet
impl SetChargeMosfet
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 charging MOSFET.
§Arguments
address- The address of the BMS (should beAddress::Hostwhen sending from host).enable-trueto enable the charging 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 charge MOSFET command.
Sourcepub fn decode(rx_buffer: &[u8]) -> Result<(), Error>
pub fn decode(rx_buffer: &[u8]) -> Result<(), Error>
Decodes the response frame for a set charge MOSFET command. This typically just validates the checksum and length.
§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 SetChargeMosfet
impl RefUnwindSafe for SetChargeMosfet
impl Send for SetChargeMosfet
impl Sync for SetChargeMosfet
impl Unpin for SetChargeMosfet
impl UnwindSafe for SetChargeMosfet
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