Example
import Agent from '@meldcx/agent';
const agent = new Agent();
const init = async() => {
await agent.onReadyAsync();
if (!agent.Touch) throw new Error('3M Touch Controller not found');
if (!agent.Touch['3M']) throw new Error('3M Touch Controller not found');
if (!agent.Touch['3M'].MicroTouch) throw new Error('3M Touch Controller not found');
// You can now proceed to make any of the below calls.
};
init();
Methods
(async) getControllerID() → {Promise.<MicroTouch~ControllerInformation>}
Get the Controller Information
(async) hardReset() → {Promise}
Perform a hard reset on the touch controller
Note: Some types of reset will cause the driver to throw an error such as 'USB Transfer Stall' this is due to the controller resetting without acknowledging the transfer.
You should place any call to the reset method within a try catch block.
Example
try {
const {MicroTouch} = agent.Touch['3M'];
await MicroTouch.hardReset();
} catch (ex) {
console.error(ex);
}
(async) maximumTouchCount() → {Promise.<MicroTouch~TouchPoints>}
Retrive the maximum number of touch points
onStatus(callback)
Register a callback for the status event.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
The callback to call when a status event is received. |
(async) rebootEEP() → {Promise}
Perform a EEP reboot on the touch controller
Note: Some types of reset will cause the driver to throw an error such as 'USB Transfer Stall' this is due to the controller resetting without acknowledging the transfer.
You should place any call to the reset method within a try catch block.
Example
try {
const {MicroTouch} = agent.Touch['3M'];
await MicroTouch.rebootEEP();
} catch (ex) {
console.error(ex);
}
(async) rebootROM() → {Promise}
Perform a ROM reboot on the touch controller
Note: Some types of reset will cause the driver to throw an error such as 'USB Transfer Stall' this is due to the controller resetting without acknowledging the transfer.
You should place any call to the reset method within a try catch block.
Example
try {
const {MicroTouch} = agent.Touch['3M'];
await MicroTouch.rebootROM();
} catch (ex) {
console.error(ex);
}
reset(resetTypeopt) → {Promise.<undefined>}
Request the touch controller to perform a provided type of reset.
Note: Some types of reset will cause the driver to throw an error such as 'USB Transfer Stall' this is due to the controller resetting without acknowledging the transfer.
You should place any call to the reset method within a try catch block.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resetType |
ResetType |
<optional> |
0x01 |
The type of reset to perform. |
Example
try {
const {MicroTouch} = agent.Touch['3M'];
await MicroTouch.reset(0x01);
} catch (ex) {
console.error(ex);
}
(async) resetUSB() → {Promise}
Reset the touch controller using the USB reset API call.
(async) restoreDefaults() → {Promise}
Restore the touch controller to its defaults
Example
try {
const {MicroTouch} = agent.Touch['3M'];
await MicroTouch.restoreDefaults();
} catch (ex) {
console.error(ex);
}
(async) softReset() → {Promise}
Perform a soft reset on the touch controller
Note: Some types of reset will cause the driver to throw an error such as 'USB Transfer Stall' this is due to the controller resetting without acknowledging the transfer.
You should place any call to the reset method within a try catch block.
Example
try {
const {MicroTouch} = agent.Touch['3M'];
await MicroTouch.softReset();
} catch (ex) {
console.error(ex);
}
(async) status() → {Promise.<MicroTouch~Status>}
Retrieve the status of the touch controller