Open mcondarelli opened 1 year ago
Perhaps, you can treat the content of OCTET STRING
that "wraps"BSMblob_t
as OER-encoded buffer? And create another PDU containing what's commented out in your ASN.1 as BSMblob
?
Thanks mouse07410, unfortunately I am a bit too inexperienced (about ASN.1, at the very least) to follow the second part of your advice. I do attach complete asn definition (quite long) in case it makes sense for you. The following is a real excerpt of data I have to handle (base64 encoded):
[
{
"typ": "RX_CV2X",
"b64": "AYjcAACIAAAAAAAAAAAAAAAAbJwo////////AAA2AIjcAwAgfgOAewAUeEZzYsNrQDIoPRSTN+a6XI4kFBQAAHB7VsD9+h+hAH//gAAAAAEBJMDhAC2/v6/6ALIQFFv14P/AJCEDS79iz9YE1hBIM/Qy+uBsoQTcPr3PxAlKEFK763b9gJhhBXk+U5AQCz4QW9vg+QFEzyf1o8AgZgBwwBwmAA=="
},
{
"typ": "RX_CV2X",
"b64": "AYjcAACIAAAAAAAAAAAAAAAAWsGi////////AAA2AIjcAwAggL0DgIG5ABSAtVHBLG4BAEsoPRNuN+a5qY4QyzW0BPCEVij9+h+hAH//gAAAAAECAhTBwQAAv+ywAAAmEABr+9cBgAnBAAe/dPAaAQIQCoP09wJgHeECk786L+IDvhAww/Vo/WBCAQSFPyzP1gXGEFXz7VUBIHkhBhM+w5AGCAoQYGPq5wCAhsEGpD6JcAII0hBsc+V2/wCeoQaTvikP3grEEG8D3jz+g2DBB1u9wM/MQPx/n1AAIGYAcMAcJgA="
},
{
"typ": "RX_CV2X",
"b64": "AYjcAACIAAAAAAAAAAAAAAAAQKfL////////AAA2AIjcAwAgdgOAcwAUcFK/Kf4jQEsoPRQDt+a55Y4PFBQAAHB/V3j9+h+hAH//gAAAAAEBBMDBACA/vO/6ALIQEqP1vP+gJCEDpj9RD/QFJhBPO/DI/+B1YQWBvhgv/Ax+EGcT4Zj/5XpBBjg+HPAVRMJ/MjwAIGYAcMAcJgA="
},
{
"typ": "TX_CV2X",
"b64": "AQnGCccAAAAAAAAAIAAAAGQAAAC0AogAAAD///////8AAACMK/3///////8AADYAiNwDACCAmgOAgZYAFICSTyuGTCmAQig9E7035rmvjiyUFAAAcIZXUP2CL6EAe2GAgFoPAAGswWEAPL+9L/wAshAU8/Zq/6AhoQNZP1VwAARyEE2780b/4GZhBdU+v4/iCSIQYSvqqv0gmaEGEz6EL9gKThBlW+Me/IC94QaKPidvvgx+EHND4u74qGhhBwa+OHABOjYQbYvk/wWc/6fz08A="
},
{
"typ": "NAV",
"tim": 1645434780.364,
"lon": 7.5735328,
"lat": 45.0182784,
"hig": 316.12,
"maj": 2.0,
"min": 2.0,
"ori": 0.0,
"spd": 18.972,
"cspd": 1.4400000000000002,
"hea": 277.8
},
{
"typ": "RX_CV2X",
"b64": "AYjcAACIAAAAAAAAAAAAAAAAbJwo////////AAA2AIjcAwAgfgOAewAUeEazYsNrQEsoPRSWt+a6PI4kFBQAAHB91zj9+h+hAH//gAAAAAEBJMDhADE/t6/6AMYQFJP1YP/AJWEDTz9az9YE6hBIa/Oy+uBt4QTfvrXPxAleEFLz6vb9gJmhBXy+S5AQC1IQXBPgeQFE0GftIoAgZgBwwBwmAA=="
},
{
"typ": "RX_CV2X",
"b64": "AYjcAACIAAAAAAAAAAAAAAAAWsGi////////AAA2AIjcAwAggL0DgIG5ABSAtVIBLG4BAGQoPRNvt+a5ho4QyzW0BPCH1gD9+h+hAH//gAAAAAECAhTBwQACP+PwAAA6EACD+0sBYAsBAAk/bDAaARYQCpv0awJgHyEClT8xb+AD0hAw2/Tc/WBDQQSGvyQP1gXaEFYL7MkBIHphBhS+utAGCB4QYHvqWwCAiAEGpb6AsAII5hBsi+Tq/wCf4QaVPiBP3grYEG8b3bD+Y2IBB109uA/MQRB/higAIGYAcMAcJgA="
},
{
"typ": "TX_CV2X",
"b64": "AQnGCccAAAAAAAAAIAAAAGQAAAC0AogAAAD///////8AAACMK/3///////8AADYAiNwDACCAmgOAgZYAFICST2uGTCmAWyg9E8A35rmPjiyUFAAAcIPW0P1+X6EAesWAgFoPAAGswWEAP7+1L/wAxhAVI/Xq/6Ai4QNcP01wAASGEE3r8sb/4GehBdg+t4/iCTYQYVvqKv0gmuEGFj58L9gKYhBli+Ke/IC/IQaNPh9vvgySEHNz4m74qGmhBwm+MHABOkoQbbvkfwWdAOf0hQA="
},
{
"typ": "RX_CV2X",
"b64": "AYjcAACIAAAAAAAAAAAAAAAAQKfL////////AAA2AIjcAwAgdgOAcwAUcFL/Kf4jQGQoPRQBt+a5v44PlBQAAHCHVcD9+h+hAH//gAAAAAEBBMDBAB4/s2/6AMYQEoP1JP+gJWEDpD9Hj/QFOhBPG/Aw/+B2oQV/vg6v/AySEGbz4QD/5XuBBjY+E3AXRNZ/gygAIGYAcMAcJgA="
},
{
"typ": "NAV",
"tim": 1645434780.465,
"lon": 7.5735263,
"lat": 45.018279,
"hig": 316.16,
"maj": 2.0,
"min": 2.0,
"ori": 0.0,
"spd": 19.008,
"cspd": 1.332,
"hea": 276.7
},
]
[DSRC_R36_Source.asn.gz](https://github.com/mouse07410/asn1c/files/11419065/DSRC_R36_Source.asn.gz)
Content of BSM should be very similar to plain text JSON data. If deemed useful I have no problem in sharing also my test program, of course. Any further hint would be deeply appreciated. TiA!
Hi, most likely this is not the right place to ask, but I have no clue (yet). Please be lenient and redirect me as needed.
My problem is I need to decode complex (C-V2X) messages coming from "unknown source". AFAIK these have been encoded with DSRC_R36_Source.asn (I am not even sure this is the exact specification and it has not been superseded somehow, but it should be close enough for "non exotic" messages).
I built a program feeding messages to asn_decode() (apparently both ATS_CANONICAL_OER and ATS_BASIC_OER seem to work... at least I get RC_OK result).
Basic message I need to decode is defined as:
decoding snippet is:
So far so good.
At this point I have a
bsm
struct containingbsm.blob1
which is a binary array (buf address/ size) I don't know how to further decode (it doesn't look like it is a packedstruct
). All "blobs" e.g.:BSMblob_t
) are defined astypedef OCTET_STRING_t BSMblob_t;
and I am missing the next link.Any comment welcome.