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

ParameterType is 'NULL' #18

Open
uwsrf opened this issue Dec 15, 2020 · 3 comments
Open

ParameterType is 'NULL' #18

uwsrf opened this issue Dec 15, 2020 · 3 comments

Comments

@uwsrf
Copy link

uwsrf commented Dec 15, 2020

setValue() doesn't work for me. While debugging I found out, that the parameterType in my request was always NULL. Setting the parameterType explicitely in \Ember\Client\index.js on line 180 to qualifiedParam.contents.parameterType = 'REAL' fixed the problem.
I always get the type "NULL" on getElementsByPath().
The problem seems to be, that in BER-Decoder the parameterType is not set correctly. Since I have no idea of BER, I couldn't investigate further...

@mint-dewit
Copy link

Hi @uwsrf,

The type in the encoder is taken from the node that you pass as the first argument to the setValue function. You can change the parameter type in that node to whatever you want before you pass it to the setValue call so it's not necessary to do it in the library.

If the ember decoder returns a Parameter with type Null that means either the parameter was unreadable for some reason or the provider you are connecting to does not implement the specification properly. As far as I can tell from the specification our implementation is currently correct.

If you have an example BER buffer that we could debug this against I'd be happy to help you figure out which one it is but without more information there is little I can do.

@uwsrf
Copy link
Author

uwsrf commented Jan 20, 2021

Hi @baltedewit,
Setting the parameter type in the node works fine. Thanks.
I sent you an email with some BER buffers...

@mint-dewit
Copy link

From the BER buffers it was clear that some devices do not send a parameter type at all. And it turns out that when the ParameterType is empty there are other rules that hint the type of the parameter, the ember+ spec says the following:

To determine the effective type of a parameter, follow this rule:
 - If the parameter has the "type" field that equals "trigger", its type is "trigger".
 - If the parameter has either the "enumeration" or the "enumMap" field, its type is "enum".
 - If the parameter has the "value" field, its type corresponds to the BER type of the value.
 - If the parameter has the "type" field, its type is the value of this field

This piece of documentation for some reason never made it out of the ASN notation changelog, which is not a place one would typically look when implementing from scratch. oh well...

I will try to add this logic to the library soon.

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