windytan / redsea

Command-line FM-RDS decoder with JSON output.
MIT License
390 stars 36 forks source link

Consistent hex/raw-data format #74

Closed windytan closed 2 months ago

windytan commented 4 years ago

16-bit words are currently printed in varying formats in the JSON output.

  1. "0xABCD": is used for most PI codes
  2. "ABCD": used whenever multiple 16-bit words are concatenated
  3. 43981: used for TMC location codes, Program Item Number, ODA message data, in-house data

Additionally, the newly-supported transparent data channels are printed as 8-bit hex words without 0x.

Instead, one format should be chosen for all 16-bit data.

One downside to the decimal format (3) is that information about the word size is lost. Location codes and PINs are supposed to be numbers so they should be OK. But at least ODA message data and in-house data should probably be formatted as hexadecimal. This would be a schema-breaking change.