Skip to content

Commit

Permalink
mavgen_javascript_stable: use 'A' in struct definitions for 'int8_t',…
Browse files Browse the repository at this point in the history
… 'uint8_t' types. We found issus with jspack when treating these binary arrays as strings. Specifying A (byte array) makes more sense anyway.
  • Loading branch information
AndreasAntener committed Sep 21, 2023
1 parent 2f9f684 commit 0d8bed4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion generator/mavgen_javascript_stable.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,10 @@ def mavfmt(field):
}

if field.array_length:
if field.type in ['char', 'int8_t', 'uint8_t']:
if field.type in ['char']:
return str(field.array_length)+'s'
if field.type in ['int8_t', 'uint8_t']:
return str(field.array_length)+'A'
return str(field.array_length)+map[field.type]
return map[field.type]

Expand Down

0 comments on commit 0d8bed4

Please sign in to comment.