Socket ScanAPI Reference
public void
run() {
// create a ScanObject instance
ISktScanObject scanObj=
// Initialize a ScanObject to
// Trigger the device
ISktScanProperty property=
property.setID(
property.setType(
property.setByte(
// set the property with the device
// reference
long
result=_device.SetProperty(scanObj);
// check the set result
if(SktScanErrors.SKTSUCCESS(result)){
}
else
{
}
}
}
class
ScanAPIConsumer
extends
private
ISktScanApi _scanApi;
private
AppRef _appRef;
public
ScanAPIConsumer(ISktScanApi scanApi,AppRef appRef)
{
_scanApi=scanApi;
_appRef=appRef;
}
public void
run() {
ISktScanObject[]scanObj=new
// wait for scanAPI ScanObject
long
result=_scanApi.WaitForScanObject(scanObj,10);
if(SktScanErrors.SKTSUCCESS(result))
{
© 2013 Socket Mobile, Inc.
SktClassFactory.createScanObject();
scanObj.getProperty();
ISktScanProperty.propId.
kSktScanPropIdTriggerDevice);
ISktScanProperty.types.
kSktScanPropTypeByte);
ISktScanProperty.values.trigger.
kSktScanTriggerStart);
_button.setVisualState(VISUAL_STATE_DISABLED);
// display an error message
DisplayError("Unable to trigger:
TimerTask {
ISktScanObject[1];
if(result!=SktScanErrors.ESKT_WAITTIMEOUT)
{
"+result);
21/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?