MCPcopy Index your code
hub / github.com/FrameworkComputer/framework-system / mac_read

Method mac_read

framework_lib/src/smart_battery.rs:870–873  ·  view source on GitHub ↗

Read a ManufacturerAccess block command by writing the sub-command to register 0x00 and reading the response from 0x44

(&self, ec: &CrosEc, subcmd: u16, max_len: u16)

Source from the content-addressed store, hash-verified

868 /// Read a ManufacturerAccess block command by writing the sub-command
869 /// to register 0x00 and reading the response from 0x44
870 fn mac_read(&self, ec: &CrosEc, subcmd: u16, max_len: u16) -> EcResult<Vec<u8>> {
871 self.smbus_write_block(ec, 0x00, &subcmd.to_le_bytes())?;
872 self.read_block(ec, 0x44, max_len)
873 }
874
875 /// Authenticate the battery using SHA-1 HMAC challenge-response
876 pub fn authenticate_battery(&self, ec: &CrosEc, auth_key: &[u8; 16]) -> EcResult<bool> {

Callers 1

collect_dataMethod · 0.80

Calls 2

smbus_write_blockMethod · 0.80
read_blockMethod · 0.80

Tested by

no test coverage detected