Closed pelikhan closed 3 years ago
When applying the max_bytes constraint to a string, the jdpack format s[n] complains if the string is shorter than n characters.
s[n]
command send_string @ 0x80 { message: string { max_bytes=18 } }
Seems to work for me:
> jacdac.jdpack("s[18]", ["foo"]) [102, 111, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] > jacdac.jdunpack( jacdac.jdpack("s[18]", ["foo"]), "s[18]" ) ["foo"]
When applying the max_bytes constraint to a string, the jdpack format
s[n]
complains if the string is shorter than n characters.