On the production client, it has been necessary to convert incoming data to JSON for handling inside the .write function. eg
Device.prototype.write = function (data) {
var self = this;
data = JSON.parse(data);
// I'm being actuated with data!
However, this generates an error on the new enterprise client, given that "data" is already an object.
My work around to make the driver valid on both platforms is:
Device.prototype.write = function (data) {
var self = this;
if (Object.prototype.toString.call(data) != "[object Object]") { data = JSON.parse(data); }
// I'm being actuated with data!