maxime-esa / asn1scc

ASN1SCC: An open source ASN.1 compiler for embedded systems

Home Page:https://www.thanassis.space/asn1.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] "Namespaced" include paths

dsabala opened this issue · comments

Hi

Consider this user story: you are interfacing your device against two devices.
The manufacturer of these devices provided you with ACN and ASN1 files, unfortunately both of them came from the same template, so both produce pus3.h and pus3.c files as a result of autogeneration. The source file is not a problem because symbols and data types can be prefixed using the --field-prefix and --type-prefix options. The header file causes a problem because in the final application the first found file will be substituted in the #include <pus3.h> directives. A simple solution would be to place the header files in the include/device1 and include/device2 folders and give the compiler a header search path pointing to the include folder. I currently do this by subjecting autogenerated files to additional processing after generation. It would be easier if the generator accepted an argument such as, say, --include-prefix device1, placed headers under device1 directory and added this directory as a prefix in the include directives #include <device1/pus3.h>.

Please consider adding this or similar option to asn1scc.
Best regards

Hi,

Thank you for outlining the issue you're facing with the autogenerated files from ASN.1 and ACN for interfacing with two different devices. To better understand the situation and provide a more precise solution, could you please provide a more detailed example of your current setup? Specifically, it would be helpful to know the following:

  1. The directory structure of your project, including the locations of the folders for device1, device2, and myDevice.
  2. The names and contents of the autogenerated files for each device, particularly how pus3.h and pus3.c are being used.
  3. An example of how you're currently compiling all these files, and how the pus3.h file conflicts are affecting your build process.

For instance, if you have folders like device1 and device2, each containing their respective pus3.h and pus3.c files, along with other device-specific files (like DeviceA.c, DeviceA.h, DeviceB.c, DeviceC.h), and how these are referenced in your myDevice code, it would help me understand the exact nature of the conflict.

Any additional details about your current workaround and the specific challenges you're facing would also be very helpful.

Looking forward to your response.

Best regards,