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

[Feature request] "Namespaced" include paths #284

Open
dsabala opened this issue Dec 5, 2023 · 1 comment
Open

[Feature request] "Namespaced" include paths #284

dsabala opened this issue Dec 5, 2023 · 1 comment

Comments

@dsabala
Copy link

dsabala commented Dec 5, 2023

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

@usr3-1415
Copy link
Collaborator

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,

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