I'm looking at some node.js code that is reading status from the gateway.js server.
I'm coming from a c++ world and the magical way java and javascript deals with certain things confuses me. I am used to very strict definition of everything.
In the code below, both "entry" and "status" are structures with underlying elements. Where can I find them defined?
The code was originally written for a GarageMot and I am trying to use it for a SwitchMot and now when I get an inbound status message from the SwitchMot node, the code run-time craps out on the line noted.
socket.on('UPDATENODE', function (entry) {
var status = {};
status.id = entry._id;
status.label = entry.label;
status.status = entry.metrics.Status.value; <---- run time error here
status.timestamp = entry.updated;
lastStatus = status.status;
.
.
.
Any pointers would be appreciated, thanks.