rakusan2 / FRC-NT-Client

WPI NetworkTables Client for Node
https://www.npmjs.com/package/wpilib-nt-client
MIT License
21 stars 5 forks source link

Inability to overwrite existing key values #2

Closed primetoxinz closed 7 years ago

primetoxinz commented 7 years ago

In this example, the NetworkTable will only get the first assigned value and will not be able to update afterwards. I believe this has something to do with this line but I am not exactly sure why. Help would be appreciated.

rakusan2 commented 7 years ago

Sorry for the late response, The issue is not in the the line that you have specified since keymap holds keys mapped to id numbers which can only be assigned by the server.

The error lies in the code making multiple create variable requests to the server since currently Assign does not store any information and only makes create variable requests. The server then sends me the ID of that variable and that is what I store in keymap. If multiple create variable requests are made for the same key then the server only accepts the first one.

rakusan2 commented 7 years ago

Your example should now work

primetoxinz commented 7 years ago

Just got around to testing this, the example still does not function. The first value is still the only value that reaches the server

rakusan2 commented 7 years ago

I will look into it tomorrow

rakusan2 commented 7 years ago

Thank you, I have found and fixed two problems: 8932ed9

I have also added your example to the test file and tried it on a simulator