@@ -39,8 +39,11 @@ pub struct AudioControlFlags {
39
39
stop_stream : bool ,
40
40
}
41
41
42
- #[ derive( Debug , Clone , PartialEq , Eq ) ]
43
- pub struct AudioDataFlags { }
42
+ #[ derive( Debug , Clone , DekuRead , DekuWrite , PartialEq , Eq ) ]
43
+ pub struct AudioDataFlags {
44
+ // TODO: Found out what these are
45
+ pub unknown : u32 ,
46
+ }
44
47
45
48
#[ derive( Debug , Clone , DekuRead , DekuWrite , PartialEq , Eq ) ]
46
49
pub struct PCMAudioFormat {
@@ -80,7 +83,7 @@ pub struct AudioControl {
80
83
81
84
#[ derive( Debug , Clone , DekuRead , DekuWrite , PartialEq , Eq ) ]
82
85
pub struct AudioData {
83
- pub flags : u32 ,
86
+ pub flags : AudioDataFlags ,
84
87
pub frame_id : u32 ,
85
88
pub timestamp : u64 ,
86
89
#[ deku( update = "self.data.len()" ) ]
@@ -106,13 +109,9 @@ mod tests {
106
109
#[ test]
107
110
fn parse_audio_control_flags ( ) {
108
111
fn create_flag ( val : [ u8 ; 4 ] ) -> AudioControlFlags {
109
- let ( rest , flags) =
112
+ let ( _ , flags) =
110
113
AudioControlFlags :: from_bytes ( ( & val, 0 ) ) . expect ( "Failed to create flags" ) ;
111
114
112
- // Ensure all bits were processed
113
- assert ! ( rest. 0 . is_empty( ) ) ;
114
- assert_eq ! ( rest. 1 , 0 ) ;
115
-
116
115
flags
117
116
}
118
117
let start_flag = create_flag ( [ 0x10 , 0 , 0 , 0 ] ) ;
0 commit comments