Created
August 3, 2017 10:27
-
-
Save Be-ing/ece2918ae717a037dc3216f2fb4f7df8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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