Socket ScanAPI Reference
}
else
{
}
}
C# example:
private void
HandleDeviceArrival(ISktScanObject
{
String
String
long
type=scanObject.Msg.DeviceType;
ISktScanDevicedevice=
DeviceInfo
long
result=device.Open(deviceGuid);
if(SktScanErrors.SKTSUCCESS(result))
{
}
if(_notification!=null)
}
Objective C example:
// handler for a Scanner Arrival
-(void) HandleDeviceArrival:(id<ISktScanObject>)scanObject{
NSString* friendlyName=[[scanObject Msg] DeviceName];
NSString* deviceGuid=[[scanObject Msg] DeviceGuid];
long
type=[[scanObject Msg] DeviceType];
// create a device instance and open the device so we can
// receive events from this device or we can set or get its
// properties
id<ISktScanDevice>
iDevice=[SktClassFactory
SKTRESULT
result=[iDevice open:deviceGuid];
// create a device info object to display the device main
// information in the table view
© 2013 Socket Mobile, Inc.
synchronized(UiApplication.getEventLock()){
_devices.addElement(newDevice);
int
size=_devices.size();
_displayDeviceslist.setSize(size);
}
Status.show("Unable to open the scanner
result+")");
friendlyName=scanObject.Msg.DeviceName;
deviceGuid=scanObject.Msg.DeviceGuid;
SktClassFactory.createDeviceInstance(_scanApi);
newDevice=null;
// add the new device into the list
newDevice=
new
DeviceInfo(friendlyName,device,type);
lock(_devicesList){
_devicesList.Add(newDevice);
_devicesList.Remove(_noDeviceConnected);
}
_notification.OnDeviceArrival(result,newDevice);
createDeviceInstance:_scanapi];
("+
scanObject)
126/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?