Skip to content

Instantly share code, notes, and snippets.

@Be-ing
Created August 3, 2017 10:27
Show Gist options
  • Save Be-ing/ece2918ae717a037dc3216f2fb4f7df8 to your computer and use it in GitHub Desktop.
Save Be-ing/ece2918ae717a037dc3216f2fb4f7df8 to your computer and use it in GitHub Desktop.
HIDPacket.prototype.createOutput = function (group, name, offset, pack,
callback, trigger) {
this.addOutput(group, name, offset, pack);
var field = this.getFieldByOffset(offset,pack);
if (callback === undefined || callback === null) {
callback = function (value, group, control) {
field.value = value << field.bit_offset;
field.toggle = value << field.bit_offset;
field.packet.send();
}
}
field.connection = engine.makeConnection(group, name, callback);
if (trigger !== false) {
field.connection.trigger();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment