Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using json as Output format #56

Open
mcgrche opened this issue Sep 18, 2024 · 1 comment
Open

Using json as Output format #56

mcgrche opened this issue Sep 18, 2024 · 1 comment

Comments

@mcgrche
Copy link

mcgrche commented Sep 18, 2024

Hello,

I’m working at the TOPS Lab at the University of Wisconsin-Madison. In the acm.cpp file, I’m using the filetest() function to decode a hex string. Currently, the decoder outputs the result in XML format, but for our project, we would prefer to store the data in JSON format in our database. Is there an option or method available to modify the output to JSON format within this project?

Thank you for your assistance!

@iyourshaw
Copy link
Contributor

iyourshaw commented Nov 16, 2024

Currently the decoder generated by asn1c that this application uses has the "-no-gen-JER" option set, so it is not capable of producing JSON. Decoder generation happens here:

https://github.com/usdot-jpo-ode/asn1_codec/blob/asn1-codec-2.2.0/asn1c_combined/generate-files.sh

I have an example here of a codec that is capable of producing JER for the latest (2024) version of J2735. It is in the context of interoperation with Java with an HTTP API, but there is a C library containing codec functions that could be used from native code:

https://github.com/iyourshaw/j2735-2024-ffm-lib

Or if you need a general purpose command line tool you could simply use the "Mouse" fork of asn1c, which supports JER, to compile the "converter-example" command line tool from the ASN.1 as shown in the docs here:

https://github.com/mouse07410/asn1c/blob/vlm_master/doc/asn1c-usage.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants