Skip to content

WIP: Add simple array access example

Patrick Dohmen requested to merge DL4PD/satnogs-decoders:array-test into master

A WIP MR to easily show an issue!

There is an issue with accessing array indexes with the current :field abc:. The result that I am getting with this current approach is the following:

$ decode_frame Arrayexm ../sampledata/array_access.bin 
{
    "alt_value_0": 257,
    "alt_value_1": 514,
    "alt_value_2": 771,
    "alt_value_3": 1028,
    "alt_value_4": null,
    "alt_value_5": null,
    "alt_value_6": null,
    "alt_value_7": null,
    "alt_value_8": null,
    "alt_value_9": null
}

I don't know if it is OK to have null as value. Julien (@deckbsd) made a MR that would solve all those problems without having to do all this if: checking and also supports "dynamical" sized arrays in !127. !126 makes extensive use of that.

I can't see a point worth it shipping around that simple solution.

The binary file can be generated as follows:

$ echo "04 01 01 02 02 03 03 04 04" | xxd -r -p - > array.bin"

Signed-off-by: Patrick Dohmen dl4pd@darc.de

Merge request reports