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

Can readProperty but can't writeProperty #99

Closed
mtoko opened this issue Mar 3, 2018 · 2 comments
Closed

Can readProperty but can't writeProperty #99

mtoko opened this issue Mar 3, 2018 · 2 comments

Comments

@mtoko
Copy link

mtoko commented Mar 3, 2018

Node Version: 8.1.3

Node BACstack Version :0.0.1-beta.13

Thanks for the great work
I can read but cannot write, this is similar to issue #58

Code
const bacnet = require('bacstack');
const client = new bacnet();

client.writeProperty('192.168.1.135', {type: 4, instance: 0}, 85, [
{type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 1}
], (err, value) => {
console.log('value: ', value);
});

Error

C:\Users\User\WebstormProjects\untitled3\write.js:5
{type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 1}
^

TypeError: Cannot read property 'ApplicationTags' of undefined
at Object. (C:\Users\User\WebstormProjects\untitled3\write.js:5:23)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3

Process finished with exit code 1

@fh1ch
Copy link
Owner

fh1ch commented Mar 5, 2018

Hi @mtoko

Thanks for your bug-report.

However, I'm unable to reproduce the issue under the same circumstanzes as reported by you:

  • Used the code you provided in your description
  • Used bacstack@0.0.1-beta.13
  • Used Node.js v8.9.3

Furthermore, the provided error message it really confusing, as it implies that bacnet.enum isn't defined.

Are you sure, that the correct bacstack has been imported?

Cheers

@mtoko
Copy link
Author

mtoko commented Mar 8, 2018

Hi
Thank you for your assistance. I have specifically installed bacstack@0.0.1-beta.13 and this has fixed the issue. I am continuing to test my application

@mtoko mtoko closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants