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

Unable to get content in regionExtension J2735 example #253

Open
vkooistra opened this issue Dec 10, 2017 · 6 comments
Open

Unable to get content in regionExtension J2735 example #253

vkooistra opened this issue Dec 10, 2017 · 6 comments

Comments

@vkooistra
Copy link

vkooistra commented Dec 10, 2017

For some reason I can't seem to be able to get regional extension open types to work. Or perhaps the open types in general i'm not sure.

Looking at issue #121 I tried compiling with the example (using J2735_201603.asn1). While it all seems so compile just fine I keep ending up with an empty ext_value union in the regionextension.h. I would expect to see the extension types there but I could be wrong for sure (for example RestrictionUserType-addGrpC or something like that along with the present flag which also remains empty).

Is there a way to fix this? Or a workaround in which the padding remains OK when encoding to UPER.

A noteworthy warning could be this one. It's a warning I didn't get using another compiler (on which I did get the regionalextensions to work.)

WARNING: Parameterized type REG-EXT-ID-AND-TYPE expected for REG-EXT-ID-AND-TYPE at line 125 in ../J2735_201603.asn1

edit: the above was performed at the master branch of the post date

@brchiu
Copy link
Contributor

brchiu commented Dec 11, 2017

hi, @vkooistra,

Could you have a trial to merge #234 ?

In that pull request, I have a commit 988f647 which tries to solve some problems I found. You can ignore the last commit of this pull request because it will change name of some generated structures.

@vkooistra
Copy link
Author

vkooistra commented Dec 11, 2017

After merging the pull request the largest part it is working fine (except from my old crappy compiler not liking empty unions, but that's ok).

There is one particular case what does give problems. That is if I use a regional extension containing another regional extension. This seems to end up in not defined structs (probably due to circular references).

While I don't actually need the nested extensions and can just edit them out, it is obviously worth mentioning as it can occur.

@brchiu
Copy link
Contributor

brchiu commented Dec 11, 2017

@vkooistra, there is a command line option of asn1c called -findirect-choice which perhaps can solve this circular reference problem, though with the price that application code need access choice type fields through pointer, that's why called indirect-choice.

@qswawrq
Copy link

qswawrq commented Jan 11, 2018

@brchiu Hi. I am also trying to add some regional extension on J2735. I use your commit 988f647, but I still have an empty union for choice in the struct RegionalExtension_99P0 of RegionalExtension.h. And my warnings are something like:

WARNING: Parameterized type REG-EXT-ID-AND-TYPE expected for REG-EXT-ID-AND-TYPE at line 100 in .../J2735_201603.asn1

or

WARNING: Parameterized type PARTII-EXT-ID-AND-TYPE expected for PARTII-EXT-ID-AND-TYPE at line 127 in .../J2735_201603.asn1

@vkooistra
Copy link
Author

I had the same warnings. After a while I figured they occur when an extension is compiler which leads to a stub. So in my case the issue (well not realy an issue, just a warning) was asn1 file sided

@qswawrq
Copy link

qswawrq commented Jan 12, 2018

@vkooistra Thank you for your response, but I am not sure I follow. Back to the problem of empty RegionalExtension, we should expect to see some enums in RegionalExtension.h, right?

typedef enum RegionalExtension_99P0__regExtValue_PR {
	RegionalExtension_99P0__regExtValue_PR_NOTHING,	/* No components present */
	
} RegionalExtension_99P0__regExtValue_PR;

Since the message frame and regional extension were defined in a very similar way, I expect to see some types just as I saw different message type in the enum of MessageFrame.h. I only know a little in ASN1, so let me know if I misunderstand anything.

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

3 participants