First, there's no uppercase C
format specifier in the struct module.
After that, I think that you want to use the s
specifier for the ext
and data
members, and not pass in that first 0x00
value as a string, like:
UDP_PKT = pack('B5s50s', 0x00, "2501", "user05")
(Note that the size/repeat count appears before the format specifier.)
...which generates a packed string like:
'\x002501\x00user05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'