Closed ifsnop closed 8 years ago
You format looks OK. For now just check if you have fx="1" on all fx bits.
e.g.: <Bits bit="1" fx="1">
Anywhere I could upload a small sample for you to test? El 23/02/2016 07:37, "Damir Salantić" notifications@github.com escribió:
— Reply to this email directly or view it on GitHub https://github.com/CroatiaControlLtd/asterix/issues/23#issuecomment-187568767 .
You can zip it and drop it here in comment box of github.
I have uploaded the new xml definition (1.8 + cat21 re 1.1) and a small asterix example. Activate the json output. cat21_18_re.zip
The first datablock failed to decode properly, the last "{}" doesn't make sense.
IRE":[{
"SGV_presence":{
"STP":1,
"HTS":1,
"HTT":1,
"HRD":1,
"GSS":0.0000000,
"FX":1,
"HGT":137.8125000,
"FX":0}},{}]}},
The second datablock decodes something very strange in the RE dataitem (BPS presence is 0, but it is decoded to 1). Further inspection with valgrind shows that asterix is reading outside allocated memory (clearly the xml definition is wrong).
"IRE":[{
"SGV_presence":{
"STP":0,
"HTS":1,
"HTT":1,
"HRD":1,
"GSS":15.0000000,
"FX":1,
"HGT":90.0000000,
"FX":0}},{
"BPS_presence":{
"spare":4,
"BPS":0.0000000},
"SelH_presence":{
"spare":0,
"HRD":0,
"Stat":0,
"SelH":0.0000000},
"NAV_presence":{
"AP":1,
"VN":0,
"AH":0,
"AM":1,
"spare":8},
"GAO_presence":{
"GAO":46}}]}},
Are you looking to correct specification ? In: http://www.eurocontrol.int/sites/default/files/content/documents/nm/asterix/20150904-AppendixCat021pt12Aed13.pdf
Last bit of compound is not fx, but MES.
So, it should be:
`
<BitsName>Military Extended Squitters</BitsName>
<BitsPresence>8</BitsPresence>
</Bits>`
Am I wrong ?
But, nevertheless, this is not the cause of the problem. XML looks fine for me, probably some problem in application. I'll check and let you know.
I think I found the problem in explicit format. Please use the branch fix_issue_23 to try. I need to make additional checks before I include it in master branch. thanks
I think now it's working ok.
Thank you very much for your quick fix!
Regarding the RE version, my implementation is for the 1.1, and you linked the 1.3. Yours has a compound inside a compound inside a explicit... will it work?
Now I fixed it properly. There was a problem in Explicit format parsing. The fact is that RE and SP fields use explicit format, but it is nowhere defined what can be inside this explicit. Now I fixed it, so any format can be included.
I'm having some problems adding the RE definitions for the cat21. I haven't found documentation for the use of explicit, compound and variable/fixed xml tags, so for sure I'm doing something wrong.
In the Eurocontrol pdf, the RE definition is as follows:
Length indicator -> compound -> -> fixed (BPS) -> -> fixed (SelH) -> -> fixed (NAV) -> -> fixed (GAO) -> -> variable (2 bytes with fx, 1 byte) (SGV) -> -> variable (1 byte with fx) (STA) -> -> fixed (TNH)
How should I encode this? This is my current try:
Although the resulting xml is parsed ok, decoding fails.
"IRE":[{ "SGV_presence":{ "STP":1, "HTS":1, "HTT":1, "HRD":1, "GSS":0.0000000, "FX":1, "HGT":137.8125000, "FX":0}},{}]}},
after the last FX, output should end.
Could you give any advice? Thanks.