Epson TM-H6000IV-DT ePOS-Device XML Users Manual - Page 143
Configuration Example of Device Control Script, Device Control Script
View all Epson TM-H6000IV-DT manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 143 highlights
Chapter 5 Device Control Script Configuration Example of Device Control Script exports.Keyboard_Generic = Keyboard_Generic; function Keyboard_Generic(clientConn, deviceConn){ this.DEVICE_TYPE = 'type_keyboard'; this.DEVICE_GROUP = 'group_hid'; this.clientConn = clientConn; this.deviceConn = deviceConn Keyboard_Generic.prototype = { onDeviceData : function(event, keycode, ascii){...}, setprefix : function(data){...} } // Exports declaration // Having two arguments and the same name as the file name // Having the "DEVICE_TYPE" property // Having the "DEVICE_GROUP" property // Having the "onDeviceData" method // Having the method corresponding to the device object 5 143
143
Chapter 5
Device Control Script
5
Configuration Example of Device Control Script
exports.Keyboard_Generic = Keyboard_Generic;
// Exports declaration
function Keyboard_Generic(clientConn, deviceConn){
// Having two arguments
and the same name as the
file name
this.DEVICE_TYPE = ‘type_keyboard’;
// Having the
"DEVICE_TYPE" property
this.DEVICE_GROUP = ‘group_hid’;
// Having the
"DEVICE_GROUP" property
this.clientConn = clientConn;
this.deviceConn = deviceConn;
......
......
}
Keyboard_Generic.prototype = {
onDeviceData : function(event, keycode, ascii){…},
// Having the
"onDeviceData" method
setprefix : function(data){…}
// Having the method
corresponding to the
device object
}