Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ucsi/lpm/get_connector_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ pub mod test {
status: Some(ConnectedStatus {
power_op_mode: PowerOperationMode::Pd,
power_direction: PowerRole::Sink,
partner_flags: ConnectorPartnerFlags::from(0),
partner_flags: ConnectorPartnerFlags::from(0x03),
partner_type: ConnectorPartnerType::DfpAttached,
rdo: Some(0x78563412),
battery_charging_status: Some(BatteryChargingCapabilityStatus::Nominal),
Expand All @@ -798,7 +798,8 @@ pub mod test {
bytes[2] = 0x0b;

// Connector partner flags - 1 byte
// DFP
// DFP, usb + alt_mode set (lower 2 bits of partner_flags = bits 21,22 = byte 2 bits 5,6)
bytes[2] |= 0x60;
bytes[3] = 0x20;

// RDO - 4 bytes
Expand Down
17 changes: 15 additions & 2 deletions src/ucsi/lpm/get_error_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,25 @@ mod test {
.set_contract_failure(true)
.set_overcurrent(true),
vendor: [
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE,
],
};

bytes[0] = 0xf0;
bytes[2] = 0x01;
bytes[2] = 0x11;
bytes[3] = 0x22;
bytes[4] = 0x33;
bytes[5] = 0x44;
bytes[6] = 0x55;
bytes[7] = 0x66;
bytes[8] = 0x77;
bytes[9] = 0x88;
bytes[10] = 0x99;
bytes[11] = 0xAA;
bytes[12] = 0xBB;
bytes[13] = 0xCC;
bytes[14] = 0xDD;
bytes[15] = 0xEE;

let (response_data, consumed): (ResponseData, usize) =
decode_from_slice(&bytes, standard().with_fixed_int_encoding()).unwrap();
Expand Down
Loading
Loading