Open marius190 opened 2 years ago
Use the following algorithm to read packet by packet from file:
If you want to send string data directly to parser you need to convert it to byte array like in this example: `asterix_packet = bytearray( [0x30, 0x00, 0x30, 0xfd, 0xf7, 0x02, 0x19, 0xc9, 0x35, 0x6d, 0x4d, 0xa0, 0xc5, 0xaf, 0xf1, 0xe0, 0x02, 0x00, 0x05, 0x28, 0x3c, 0x66, 0x0c, 0x10, 0xc2, 0x36, 0xd4, 0x18, 0x20, 0x01, 0xc0, 0x78, 0x00, 0x31, 0xbc, 0x00, 0x00, 0x40, 0x0d, 0xeb, 0x07, 0xb9, 0x58, 0x2e, 0x41, 0x00, 0x20, 0xf5])
parsed = asterix.parse(asterix_packet) `
Hello everyone,
I have a resource problem when decoding an .ast file. Since the file contain 4h of ADS-B data when I use
parse
the computer run out of ram memory:The .ast file has about 52 MB.
If I read let's say,
data[0:500]
it works fine and decodes the first messages. So I had an idea and is to use parse on pieces of data:piece=data[k:k+500]
The problem I get when doing this is that parse does give incorrect decoding since (I suspect) I can not break data into equally sized pieces, because then I break the first and/or the last message in two pieces, and parse does not interpret correctly when a message starts and finish, giving 0's CRC check.
Questions: