File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -610,6 +610,41 @@ fn serialize_arg(
610
610
bail ! ( "non-newtype structure arguments currently unsupported" ) ;
611
611
}
612
612
}
613
+ HubrisType :: Array ( & HubrisArray { goff, count } ) => {
614
+ let t = hubris. lookup_type ( goff) ?;
615
+ if !matches ! (
616
+ t,
617
+ HubrisType :: Base ( HubrisBasetype {
618
+ encoding: HubrisEncoding :: Unsigned ,
619
+ size: 1 ,
620
+ } )
621
+ ) {
622
+ bail ! (
623
+ "array type in {} ({t:?}) not yet supported" ,
624
+ member. name
625
+ ) ;
626
+ }
627
+ match value {
628
+ IdolArgument :: String ( value) => {
629
+ let bytes = bytes_from_str ( value) ?;
630
+ if bytes. len ( ) != count {
631
+ bail ! (
632
+ "Cannot convert '{value}' to [u8; {count}]; \
633
+ wrong length"
634
+ ) ;
635
+ }
636
+
637
+ for byte in bytes {
638
+ hubpack_serialize_append ( buf, & byte) ?;
639
+ }
640
+
641
+ Ok ( ( ) )
642
+ }
643
+ _ => {
644
+ bail ! ( "Bad idol argument value" ) ;
645
+ }
646
+ }
647
+ }
613
648
_ => {
614
649
bail ! ( "type of {} ({:?}) not yet supported" , member. name, t) ;
615
650
}
You can’t perform that action at this time.
0 commit comments