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

encode_application_enumerated is not defined in bacnet-asn1.js #3

Closed
narbuzov opened this issue Apr 13, 2017 · 1 comment
Closed

encode_application_enumerated is not defined in bacnet-asn1.js #3

narbuzov opened this issue Apr 13, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@narbuzov
Copy link

encode_application_enumerated is referenced in bacapp_encode_application_data:

case baEnum.BacnetApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED:
  encode_application_enumerated(buffer, value.Value);
  break;

but not defined as a function. Here is my version to make it work:

var encode_application_enumerated = module.exports.encode_application_enumerated = function(buffer, value) {
var len;
if (value < 0x100) {
len = 1;
} else if (value < 0x10000) {
len = 2;
} else if (value < 0x1000000) {
len = 3;
} else {
len = 4;
}
encodeTag(buffer, baEnum.BacnetApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, false, len);
encodeBacnetEnumerated(buffer, value);
};

Thank you!

@fh1ch fh1ch added the bug label Apr 13, 2017
@fh1ch fh1ch self-assigned this Apr 13, 2017
@fh1ch fh1ch added this to the 0.0.1-beta.3 milestone Apr 13, 2017
fh1ch added a commit that referenced this issue Apr 14, 2017
@fh1ch
Copy link
Owner

fh1ch commented Apr 14, 2017

Hi @narbuzov

Thank you also very much for your input here 👍

The static code analysis showed that I even forgot to implement some more stubs (around 6). They're now all implemented and the static code analysis is happy now, so something like this shouldn't repeat itself in the future.

The problem is now solved in the latest release "0.0.1-beta.3".

Cheers

@fh1ch fh1ch closed this as completed Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants