Skip to content

Commit 451b676

Browse files
authored
Merge pull request project-chip#45 from thekuwayama/modify__valid_invoke_cmd_testcase
modify test_valid_invoke_cmd; proper test case & command type
2 parents 10ca1f0 + dc8befb commit 451b676

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

matter/tests/interaction_model.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use std::sync::{Arc, Mutex};
4040
struct Node {
4141
pub endpoint: u16,
4242
pub cluster: u32,
43-
pub command: u16,
43+
pub command: u32,
4444
pub variable: u8,
4545
}
4646

@@ -82,7 +82,7 @@ impl InteractionConsumer for DataModel {
8282
let mut common_data = self.node.lock().unwrap();
8383
common_data.endpoint = cmd_path_ib.path.endpoint.unwrap_or(1);
8484
common_data.cluster = cmd_path_ib.path.cluster.unwrap_or(0);
85-
common_data.command = cmd_path_ib.path.leaf.unwrap_or(0) as u16;
85+
common_data.command = cmd_path_ib.path.leaf.unwrap_or(0);
8686
data.confirm_struct().unwrap();
8787
common_data.variable = data.find_tag(0).unwrap().u8().unwrap();
8888
}
@@ -178,8 +178,9 @@ fn test_valid_invoke_cmd() -> Result<(), Error> {
178178
// An invoke command for endpoint 0, cluster 49, command 12 and a u8 variable value of 0x05
179179

180180
let b = [
181-
0x15, 0x28, 0x00, 0x28, 0x01, 0x36, 0x02, 0x15, 0x37, 0x00, 0x24, 0x00, 0x00, 0x24, 0x01,
182-
0x31, 0x24, 0x02, 0x0c, 0x18, 0x35, 0x01, 0x24, 0x00, 0x05, 0x18, 0x18, 0x18, 0x18,
181+
0x15, 0x28, 0x00, 0x28, 0x01, 0x36, 0x02, 0x15, 0x37, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26,
182+
0x01, 0x31, 0x00, 0x00, 0x00, 0x26, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x18, 0x35, 0x01, 0x24,
183+
0x00, 0x05, 0x18, 0x18, 0x18, 0x18,
183184
];
184185

185186
let mut out_buf: [u8; 20] = [0; 20];

0 commit comments

Comments
 (0)