Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 2.09 KB

README.md

File metadata and controls

46 lines (33 loc) · 2.09 KB

doIt.sh Script

The doIt.sh script will copy the generated C code for the specified year into the asn1c_combined directory. It will also compile the example converter program.

This script expects the necessary files to have already been generated by the generate-files.sh script.

Generating the C Code

The necessary files can be generated using the generate-files.sh script. This script will reference the necessary ASN.1 files from the j2735-asn-files directory from the specified year and generate the C code in the generated-files directory.

Installing asn1c

The generate-files.sh script requires the asn1c compiler to be installed. The asn1c compiler can be installed in WSL using the following commands:

cd ./usdot-asn1c
aclocal
test -f configure || autoreconf -iv
./configure
make
sudo make install

J2735 ASN Files

The 'j2735-asn-files' subdirectory should contain the ASN.1 files for the J2735 standard. These are organized by year.

The generate-files.sh script will reference the necessary files from the j2735-asn-files directory when generating the C code.

Obtaining the J2735 ASN Files

Redistribution of the ASN files is not permitted, so they are not included in this repository. You must obtain them from SAE and place them in the j2735-asn-files directory under the appropriate year subdirectory.

A table of the ASN files for each year is provided below.

Year Source
2016 https://www.sae.org/standards/content/j2735set_201603/
2020 https://www.sae.org/standards/content/j2735set_202007/

Environment Variables

The doIt.sh and generate-files.sh scripts uses the following environment variables:

  • J2735_YEAR - The year of the J2735 standard to use. For example, 2020.

Troubleshooting

Fix for Makefile

The following compile flags must be set for the converter-example.c to compile (whether you need this or not is another story).

  • -DPDU= // this allows the #ifndef statements in the above c file to work correctly.
  • -DASN_PDU_COLLECTION // if you have several message types you want to use.