Page 1
ScanAPI Reference History Date Description 4/29/2011 First release supporting Windows (big and WinMo), Android and BlackBerry 6/16/2011 Added iOS details 9/16/2011 ScanApiHelper support for iOS, new Error code ESKT_OUTDATEDVERSION 10/19/2011 Added more information about xCode integration 11/04/2011 Added Recommendations chapter 12/02/2011 Adding more information regarding Android permissions in Recommendations for Android.
Socket, the Socket logo, Battery Friendly, Socket Bluetooth Cordless Hand Scanner, and SocketScan are trademarks or registered trademarks of Socket Mobile, Inc. Bluetooth and the Bluetooth logos are registered trademarks owned by Bluetooth SIG, Inc., U.S.A. and licensed to Socket Mobile, Inc. All other brand and product names are trademarks of their respective holders.
Example of sending a command ..............16 Handling asynchronous events or completion events ........25 Termination ...................... 25 ScanAPI Helper (available for Java, C# and Objective C) ........26 Handling the ScanAPI Helper notifications ............ 26 Set ScanAPI Helper notification ............... 32 Open ScanAPI Helper ..................
Page 5
Socket ScanAPI Reference Roaming ......................40 Socket EZ Pair feature ..................40 API Functions ......................41 Open Function ....................41 Close Function ....................46 Set Function....................... 48 Get Function ...................... 53 Wait Function ....................57 Release Function ....................60 ScanObject ......................62 Asynchronous messages and events ..............
The CHS 7 series scanners are shipped by default in HID profile mode and will display the following friendly name: For the 7Xi series: Socket 7Xi [xxxxxx] (where x’s are the last 6 digits of the BD address of the scanner) Or for the 7Ci/M/P series:...
Page 8
SPP mode due to the fact that some devices will cache the name and service information of the device. Socket recommends that the pairing information is removed by deleting or unpairing the device using the host device Bluetooth manager before connecting the scanner in a different mode.
Page 9
The following steps for 7Xi series is as simple as scanning a 2D barcode that has the value: “#FNC SPP INITIATOR xxxxxxxxxxxx#” with xxxxxxxxxxxx replaced by the host Bluetooth address, or by scanning out of the Socket EZ Pair screen the 2D barcode.
For the 7Xi series scanners you can just present the EZ pair barcode as part of your application setup process. Either way once that part is done your app just needs to have ScanAPI initialized and waiting to receive the incoming connection of the scanner.
3.2 iOS requirements The ScanAPI library for iOS is split in to 2 versions; one that supports the SoftScan feature and one that doesn’t. In the version that doesn’t support the SoftScan feature the required frameworks are: externalAccessory.framework...
This API defines 3 main objects: ScanAPI object, Device object and ScanObject. 4.1 ScanAPI object This object controls the API. In order to use ScanAPI, this object must be opened first and this first open initializes ScanAPI. The handle returned from this open must be used for any subsequent ScanAPI operations.
Socket ScanAPI Reference The ScanAPI object has few properties that can be retrieved or modified. When an application is ready to use ScanAPI, it can open it by using the ScanAPI Open API with no device name in the parameter.
Socket ScanAPI Reference 4.4 Using ScanAPI An application has two things to do in order to setup ScanAPI correctly. It needs first to open ScanAPI by specifying no name in the open parameter API, and then starts either a timer or a thread to consume the asynchronous events coming from ScanAPI.
Socket ScanAPI Reference ScanAPI drops the connection to a CHS if it was connected during the process of changing the ScanAPI configuration. Please refer to the ScanAPI object properties paragraph for more information. 4.6 Get or Set a property The ScanAPI object and the Device object have both properties that can be retrieved or altered by using the get property or set property API.
This section describes the steps for sending a command to a device. Let’s imagine an application using ScanAPI has a button on its UI to trigger a scan. For clarity purposes we assume the application correctly handles the connection of the scanner and has kept a handle to ScanAPI and to this scanner accessible.
Page 17
Result=HandleDeviceArrival(pSktObject); break; case kSktScanMsgIdDeviceRemoval: Result=HandleDeviceRemoval(pSktObject); break; case kSktScanMsgIdTerminate: // we are done with ScanAPI, somebody // called SktSet with Abort MsgId if(pbContinue) *pbContinue=FALSE;// quit the for TraceInfo(_T("Receive a Terminate Msg, \ then shutdown the App receiving \ thread")); break; case...
Page 18
TraceInfo(_T("unknown Message ID \ received:0x%x"), pSktObject->Msg.MsgID); break; // release the ScanObj we received in the wait SktScanRelease(hScanAPI,pSktObject); return Result; // called from the ScanAPI consumer logic // that is using SktScanWait API void CMyAppDlg::HandleGetOrSetComplete( IN TSktScanObject* pScanObj switch(pScanObj->Property.ID) case kSktScanPropIdTrigger: // ungray out the trigger btn m_TriggerBtn.Enable(TRUE);...
Page 19
= _device.SetProperty(scanObj); (SktScanErrors.SKTSUCCESS(result)) buttonTrigger.Enabled = false; else // display an error message DisplayError("Unable to trigger: " + result); // timer to checking and consuming ScanObject from ScanAPI private void timerScanAPIConsumer_Tick(object sender, EventArgs ISktScanObject scanObj=null; // wait for ScanAPI ScanObject...
Page 22
ISktScanMsg.kSktScanMsgIdDeviceArrival: result= HandleDeviceArrival(scanObj[0]); break; case ISktScanMsg.kSktScanMsgIdDeviceRemoval: result= HandleDeviceRemoval(scanObj[0]); break; case ISktScanMsg.kSktScanMsgIdTerminate: // we are done with ScanAPI, somebody // called Set with Abort as MsgID result= HandleTerminate(scanObj[0]); break; case ISktScanMsg.kSktScanMsgSetComplete: case ISktScanMsg.kSktScanMsgGetComplete: result= HandleGetOrSetComplete(scanObj[0]); break; case ISktScanMsg.kSktScanMsgEvent: break;...
Page 23
[[scanObj Property] setID:kSktScanPropIdTriggerDevice]; [[scanObj Property]setType:kSktScanPropTypeByte]; [[scanObj Property]setByte:kSktScanTriggerStart]; [_rootViewController AddPropertyToSet:scanObj]; [_rootViewController SendFirstPropertyToSet]; // timer handler for consuming ScanObject from ScanAPI // if ScanAPI is not initialized this handler does nothing -(void)onTimer{ if(_scanApiInitialized==true){ SKTRESULT result=[_scanapi WaitForScanObject:_scanObjectReceived TimeOut:0]; (SKTSUCCESS(result)) { (result!=ESKT_WAITTIMEOUT) { [self HandleScanObject:_scanObjectReceived];...
When ScanAPI is no longer needed it can be terminated by setting an Abort property to the ScanAPI object. At that point, if there are any devices open, ScanAPI sends a Removal event for each of the Device objects open, upon which the Device object should be closed by the application using the close API.
The Java version of ScanAPI Helper creates a timer task to consume asynchronous ScanObject coming from ScanAPI. The C# and Objective C version of ScanAPI Helper does not create a timer, but instead provides a method, DoScanAPIReceive, that has to be called from a timer function or a thread.
Page 27
_consumerTerminatedEvent.set(); if(_forceCloseUI){ Intent intent=new Intent(NOTIFY_CLOSE_ACTIVITY); sendBroadcast(intent); * ScanAPI is now initialized, if there is an error * then ask the activity to display it public void onScanApiInitializeComplete(long result) { // if ScanAPI couldn't be initialized // then display an error if(!SktScanErrors.SKTSUCCESS(result)){...
Page 28
Socket ScanAPI Reference intent.putExtra(EXTRA_SYMBOLOGY_NAME,decodedData.getSymbologyName()); intent.putExtra(EXTRA_DECODEDDATA,decodedData.getData()); sendBroadcast(intent); * an error occurs during the retrieval of ScanObject * from ScanAPI, this is critical error and only a restart * can fix this. public void onErrorRetrievingScanObject(long result) { Intent intent=new Intent(NOTIFY_ERROR_MESSAGE); String text="Error unable to retrieve ScanAPI message: ";...
Example: _scanApiHelper.open(); 5.4 Close ScanAPI Helper Once the application is done with ScanAPI, it can close it by calling the close method of the ScanAPIHelper object as shown below: _scanApiHelper.close(); The close method doesn’t return any value, but the notification onScanApiTerminated will be called when ScanAPI has effectively shutdown.
5.6 Decoded data notification Each time a scanner decodes correctly a barcode, ScanAPI Helper calls the onDecodedData notification with the device information object and the decoded data. In the Scanner Settings for Android case the activity that has registered for the NOTIFY_DATA_ARRIVAL intent will receive and display the decoded data.
6.1 C/C++ Version ScanAPI has been compiled with Microsoft Visual Studio 2008. The inclusion of ScanAPI in this environment in your C/C++ project can be done in 2 ways; by adding the following lines in your source file directly: #include “<SDK Install Path>\include\ScanAPI.h”...
Page 35
Socket ScanAPI Reference ScanAPI is composed of two JAR files located under the lib directory of the SDK Java portion. Following are the steps required in order to include ScanAPI into your project and workspace. 6.2.1 Setting up the Eclipse workspace From Eclipse select the menu Window / Preferences.
Socket ScanAPI Reference The recommended way to integrate ScanAPI in your Xcode project is to drag and drop the ScanAPI folder located at the root of the ScanAPI SDK into your Xcode project. The application must add the External accessory framework, and in the info plist the “Supported External Accessory Protocol”...
It is important to note that your application must request the permission to use Bluetooth and to write in the external storage. This last permission is required because the ScanAPI settings are stored into a file on the external storage. These permissions are identified respectively as follow: android.permission.BLUETOOTH,...
If the scanner is a 1D Laser scanner, 7 series, the connect barcode must be printed out on paper. Socket EZ Pair can configure the scanner to have it connect back to the host without the need to scan a connect barcode. In this case, the 1D scanner must be paired with the host first using the Bluetooth functionality present on the host.
For the scanner to connect back to the host, ScanAPI needs to be re-configured to use a generic inbound communications port that the scanner will connect back on.
The ScanAPI property kSktScanPropIdConfiguration “SerialPorts” is used in order to read and modify the ScanAPI communication port. NOTE: It is not recommended to use ScanAPI as the initiator of the connection. It doesn’t have reconnection logic, and it will need to get restarted each time a connection has to be made.
Page 42
Socket ScanAPI Reference In order to open a ScanAPI object, the device name should be set to NULL. The first open of a ScanAPI object initializes the ScanAPI layer and starts the process of listening for device connections. Once this open is successful the application can use this ScanAPI object reference to call the wait API in its consumer logic.
Page 43
Socket ScanAPI Reference deviceName: [in] usually set to NULL in order to open ScanAPI object or it could be set to “{11D47F36-BE62-4D28-9177-89F1BF3DDD4B}” to open ScanAPI object without a listener thread. This last case is mostly used to edit a ScanAPI configuration without conflicting with another application using ScanAPI.
Socket ScanAPI Reference 9.2 Close Function This function closes ether a ScanAPI object or a Device object. 9.2.1 Syntax C/C++: SKTRESULT SktScanClose( SKTHANDLE hDevice hDevice [in] Handle to the scanner device or ScanAPI to close. Java or C#: long ISktScanDevice.Close(); or long ISktScanApi.Close();...
Page 49
ESKT_PENDINGOPERATIONNOTCOMPLETED. 9.3.3 Remarks The Set function allows an application to set a property of a scanner or ScanAPI, or to send a command such as triggering a scan. The ScanObject contains a property structure that defines the property to set. This structure has a property ID field, a property type field and a value field.
Socket ScanAPI Reference 9.4 Get Function The Get function retrieves a property from ScanAPI object or from a device object identified by its reference. This function returns immediately, and its final result should be checked by using Wait function. 9.4.1 Syntax...
Socket ScanAPI Reference 9.5 Wait Function The Wait function waits for any asynchronous events. Only a ScanAPI object can be used as reference for the wait function. Most of the time, applications using ScanAPI, use a timer to consume the ScanAPI asynchronous events.
Page 58
ISktScanObject out scanObj, long ulTimeout scanObj [out] reference to a ScanObject that is allocated by ScanAPI. This object must be released when it is no longer needed. ulTimeout [in] a timeout value expressed in milliseconds. The timeout cannot be bigger than 10000ms otherwise an error will be returned.
Page 59
Socket ScanAPI Reference If the object reference specified is not a ScanAPI object, the function returns ESKT_INVALIDHANDLE. If the timeout value is bigger than 10000 the function returns ESKT_INVALIDTIMEOUT. If the timeout occurs, the function returns ESKT_WAITTIMEOUT. 9.5.3 Remarks The ScanObject retrieved using this API should be released by using the Release API.
9.6 Release Function The Release function releases the ScanObject the Wait function has allocated. This function must be called each time the Wait function returns success. Only a ScanAPI object can be used as referenced when calling this Release function.
Page 61
Socket ScanAPI Reference 9.6.2 Return Value If the function succeeds it returns ESKT_NOERROR. If the object reference specified is not to a ScanAPI object, the function returns ESKT_INVALIDHANDLE. 9.6.3 Remarks 9.6.4 Example See the Sample handling asynchronous events of ScanAPI.
ScanAPI object or a Device object. The Message member is relevant only when the application is receiving a ScanObject from ScanAPI. The Property member is only relevant if the Message ID received is a Get Complete or a Set Complete.
When this message is received it is safe to stop the consumer logic that was waiting on the asynchronous events, to release this last ScanObject and the ScanAPI object reference can be safely close using the Close API.
Page 65
C/C++: The helper macro can be found in the SktScanPropIds.h file. Java: The helper macro can be found in com.SocketMobile.ScanAPI.SktScan.helper. The helper macro can be found in ScanAPI.SktScan.helper. Objective C: The helper macro can be found in the SktScanPropIds.h file.
Page 67
Socket ScanAPI Reference Java: The helper macro can be found in com.SocketMobile.ScanAPI.SktScan.helper. The helper macro can be found in ScanAPI.SktScan.helper. Objective C: The helper macro can be found in the SktScanPropIds.h file. Event Data Type: kSktScanEventDataTypeByte. See also: Property kSktScanPropIdButtonStatusDevice 11.6.4...
Page 68
Property kSktScanPropIdBatteryLevelDevice 11.6.6 Listener Started Event When ScanAPI starts and is initialized, a listener started event is sent indicating the listener is running and listening on the communication ports. If the ScanAPI communication port configuration is modified, the listener will restart in order to retrieve and apply the new configuration.
The current property holds a reference to an object. The object definition depends on the Property. There are two sets of properties; the first set applies to a ScanAPI object and the second set applies to a Device object. An error (ESKT_INVALIDHANDLE) is returned if a property is applied to a wrong object.
Socket ScanAPI Reference message by using Release API and close ScanAPI by using the Close API with the ScanAPI object reference. This property can only be set. A get operation on this property will return an error. Parameter type Get Complete...
This is important for an application that uses ScanAPI as a separate component such as a DLL, where ScanAPI can be updated without the need of the application code to be recompiled. Therefore the ScanAPI DLL installed on the host might be different from the ScanAPI used during the development of an application.
Not applicable Not applicable Version ScanAPI Interface Version 1.0.0 or higher 13.4 Property kSktScanPropIdConfiguration This property is used to set or get a ScanAPI property. The following property values can be used: Name Description Values kSktScanConfigSerialComPort Contains the list of COM3:;COM4:…...
Decoded data can be acknowledged at three different locations; locally on the scanner device, remotely on the host at the ScanAPI level or at the application level. The advantage of acknowledging the data locally on the device is speed, but the operator doesn’t know for sure the data has arrived at the application level.
Page 77
This property value is a type of byte and its value is summarized in the following table: Name Description kSktScanDataConfirmationModeOff ScanAPI layer doesn’t try to alter the actual device configuration. It will be whatever the device has its local acknowledgment set. kSktScanDataConfirmationModeDevice The decoded data is confirmed locally on the device.
The Data Confirmation Action is used by ScanAPI only if the Data Confirmation Mode is set to kSktScanDataConfirmationModeScanAPI. In that mode, when ScanAPI receives decoded data, it will respond with the Action defined by this property. The Action is defined by a set of bits. There are 3 actions that can be configured;...
NOTE: C/C++ and C#: This property works only if ScanAPI has been compiled in Debug mode. It will have no effect on a release build. Only release builds are included with the SDK. The monitor mode output traces in a remote debugger.
SoftScan scanner. ScanAPI generates a device removal when the SoftScan scanner is disabled by using this same property to turn this feature off. The possible values for the byte data field are described in the following table:...
Page 83
For the device camera used as barcode scanner. NOTE: The CRS family is supported by ScanAPI since version 10.0.4. The SoftScan feature is supported by ScanAPI since version 10.0.9. A set of predefined macros can be used in order to retrieve one of the two information types contained in the device type.
This property can send a device specific command. The command depends on the device type connected to the host. ScanAPI acts just as a pass-through without interpreting any data in the command that is sent to the device using this property.
14.4 Property kSktScanPropIdSymbologyDevice This property is used to retrieve or set the status of a particular symbology. A symbology is identified by a unique ID. A ScanAPI symbology structure is used in order to manipulate the setting of a symbology.
The Trigger defines can be found in SktScanPropIds.h file. Java: The Trigger defines can be found in com.SocketMobile.ScanAPI.ISktScanProperty.values.trigger The Trigger defines can be found in ScanAPI.ISktScanProperty.values.trigger. Objective C: The helper macro can be found in the SktScanPropIds.h file. Property type...
The 7 series 3.2 or higher scanners support a limited preamble. The preamble can only be one character long. It can be used without ScanAPI once it is setup. The 7 series version can be determined by the Version property Major and Middle values.
Get Complete Property is an unsigned long (Ulong) describing the Local Functions capability. In the current version of ScanAPI, the Bit 0 is set to 1 if the device supports Rumble mode and the Bit 1 is set to 1 if the Change ID feature is present.
Page 91
ISktScanProperty.propId.kSktScanPropIdCapabilitiesDevice: (SktScanErrors.SKTSUCCESS(result)) selectedScanner.OriginalProperties.Configuration.DoesRumble = ((scanObj.Property.Ulong& ISktScanProperty.values.capabilityLocalFunctions.kSktScanCapabilityLocalFunctionRumble)== ISktScanProperty.values.capabilityLocalFunctions.kSktScanCapabilityLocalFunctionRumble); else // unable to get the capabilities even after multiple // retries by ScanAPI Helper StopRetrievingPropertiesAndDisplayError("Failed to retrieve the Capabilities: " result); break; case ISktScanProperty.propId.kSktScanPropIdPostambleDevice: /………………/ break; C/C++: The constants definitions for the capabilities can be found in SktScanPropIds.h file.
This property returns a Change ID of the device symbology configuration and the device preamble and postamble. This Change ID will reflect any configuration change in the scanner engine that could have been made outside ScanAPI by scanning a scanner engine configuration barcode.
Socket ScanAPI Reference NOTE: For the 7 series v3.1, ScanAPI uses the friendly name memory to store the preamble and the postamble. The total amount of characters for the friendly name, preamble and postamble cannot be bigger than 28 characters.
C/C++: The helper macro can be found in the SktScanPropIds.h file. Java: The helper macro can be found in com.SocketMobile.ScanAPI.SktScan.helper. The helper macro can be found in ScanAPI.SktScan.helper. Objective C: The helper macro can be found in the SktScanPropIds.h file.
The host can acknowledge the decoded data by using the kSktScanPropIdDataConfirmationDevice property. Depending on how the ScanAPI kSktScanPropIdDataConfirmationMode is set, ScanAPI can confirm the decoded data automatically. Please refer to paragraph 17 Data confirmation feature.
14.21 Property kSktScanPropIdDataConfirmationDevice This property acknowledges positively or negatively on decoded data. This property is mostly used by the application when the ScanAPI Data Confirmation Mode has been set to kSktScanDataConfirmationModeApp. This property can be sent at any time by the application to make the device beep, flash or rumble.
C/C++: The helper macro and the constant definitions can be found in the SktScanPropIds.h file. Java: The helper macro can be found in com.SocketMobile.ScanAPI.SktScan.helper. The constant definition can be found in Com.SocketMobile.ScanAPI.ISktScanProperty.values.dataConfirmation The helper macro can be found in ScanAPI.SktScan.helper.
ESKT_NOTSUPPORTED error will be returned in the Get Complete event for these devices. In Java only, ScanAPI provides a static function to convert this Bluetooth address array of 6 bytes into a string. It can be found in SktJava.helper. This function is formatBluetoothAddress.
The helper macro can be found in com.SocketMobile.ScanAPI.SktScan.helper and the constant definition can be found in com.SocketMobile.ScanAPI.ISktScanProperty.values.powerStates. The helper macro can be found in ScanAPI.SktScan.helper and the constant definition can be found in ScanAPI.ISktScanProperty.values.powerStates. Objective C: The helper macro and the constant definition can be found in the SktScanPropIds.h file.
ScanAPI will send a data confirmation to the scanner to make it beep. If the scanner is used without ScanAPI in SPP mode, the connection beep can be configured using this property so the scanner beeps each time it connects.
The helper macro can be found in com.SocketMobile.ScanAPI.SktScan.helper and the constant definition can be found in Com.SocketMobile.ScanAPI.ISktScanProperty.values.connectBeepConfig. The helper macro can be found in ScanAPI.SktScan.helper and the constant definition can be found in ScanAPI.ISktScanProperty.values.connectBeepConfig. Objective C: The helper macro and the constant definition can be found in the SktScanPropIds.h file.
1.0.1 or higher 15 ScanAPI Error handling and definitions The result of the ScanAPI functions can be negative which means the API failed, or it can be 0 which means the API succeeded or it can be a positive value indicating the API succeeds but is returning information about its operation.
Page 125
The ScanAPI error is defined by the type SKTRESULT. All the ScanAPI APIs returns a SKTRESULT result. Java and C#: The ScanAPI error is defined as a long. All the ScanAPI APIs return a long result. The SKTSUCCESS function is defined in the SktScanErrors class as well as the error codes.
The symbology is identified in ScanAPI by a Symbology ID. The kSktScanSymbologyLastSymbologyID is actually not a symbology but instead indicates the number total of symbologies supported in ScanAPI (this value could change with different versions). A symbology status is retrieved by using the Get API with a kSktScanPropIdSymbologyDevice property as described in this document.
In order to indicate to ScanAPI at which level the data confirmation should be done, the kSktScanPropIdDataConfirmationMode should be set with its byte value set to the appropriate value. If the choice is to have either ScanAPI or the device to confirm the decoded data, there is another property that needs to be used in order to specify what action should be made when ScanAPI or the device confirms the data.
The default setting is data confirmation has done locally in the device. 18 Sample handling asynchronous events of ScanAPI In most cases, the application using ScanAPI has some sort of UI. Since ScanAPI is based on asynchronous API, it fits very well in an architecture that has some UI involved.
Page 133
The main windproc message handler can have these 2 entries: // on create of the window case WM_CREATE: Socket ScanAPI Reference Global.hWnd=hWnd; SKTRESULT Result=SktScanOpen(NULL,&Global.hScanAPI); if(!SKTSUCCESS(Result)) DisplayError("Unable to Open ScanAPI:%d",Result); else // start the timer to consume ScanAPI ScanObject SetTimer(hWnd,TIMER_ID,200,NULL); break; case WM_TIMER: TimerHandler(); break; void TimerHandler() TSktScanObject* pScanObj=NULL; bool bTerminate=false;...
Page 136
_scanApiConsumer.schedule(_ScanAPIConsumerTimer, 1, 200); * _ScanAPIConsumerTimer * This is a timer task that checks every once a while * if there is a ScanObject to retrieve from ScanAPI * and it checks if there is a command to send private TimerTask...
Page 137
// if there is a command to send // now might be a good time sendNextCommand(); * HandleScanObject * This method is called each time this application receives a * ScanObject from ScanAPI. protected boolean HandleScanObject(ISktScanObject scanObject) { boolean closeScanApi=false;...
Why it is important to use this SktScanApiOwnership API? If your application works with other Socket applications such as SocketScan 10 Keyboard wedge, Scanner Settings or Socket EZ Pair, then this API will prevent any conflict using ScanAPI as they all use the same SktScanApiOwnership API.
Socket ScanAPI Reference 7) When the application is shutting down, it closes ScanAPI and it releases ScanAPI ownership, unregisters from ScanAPI ownership. 19.1 Constructor The ScanAPIOwnership object constructor requires the name of the application and the notification interface implementation to receive the notification from ScanAPI ownership change.
Page 141
19.2.3 Remarks This method installs the notification handler, and makes the application aware of any change in ScanAPI ownership. The unregister method must be called when the application is done with ScanAPI otherwise a memory leak might occur. 19.2.4 Example...
ScanAPI and it doesn’t have already its ownership. When the request is honored the ScanApiOwnership callback is called with released flag set to false. At this point the application can safely claim the ScanAPI ownership by using the claimOwnership API.
Not available 19.5 claimOwnership This method claims the ScanAPI ownership. This method is usually called just before opening ScanAPI. The recommended way of calling this method is directly in the ScanApiOwnership notification, when the released flag is set to false.
Page 145
SktScanApiOwnership.Error.kNoError in case of success. 19.5.3 Remarks When an application receives a ScanAPI ownership notification indicating it can now take the ownership of ScanAPI, it must call this method in order to claim the ScanAPI ownership prior opening ScanAPI. 19.5.4 Example...
A Boolean called release indicates what to do with the current ScanAPI ownership. If the Boolean release is set to true, then the application has to release the ScanAPI ownership and close ScanAPI. If this Boolean is false then the application can take the ScanAPI ownership by calling the claimOwnership method and then can open ScanAPI.
Page 148
[in] If this Boolean is true then the ownership has to be released and ScanAPI has to be closed. If it is false, then the ScanAPI ownership can be claimed and ScanAPI can be opened. Not available.
Page 149
Socket ScanAPI Reference * Only one application at a time can have access to ScanAPI. * When another application is claiming ScanAPI ownership, this * callback is called with release set to true asking this application * to release scanAPI. When the other application is done with ScanAPI * it calls releaseOwnership, causing this callback to be called again * but this time with release set to false.
20.1 Usage ScanAPI provides a property to enable or disable this feature. If the SoftScan feature is enabled, a device arrival event is fired assuming the host device has the necessary hardware to support this feature.
SoftScan feature with the help of the RedLaser SDK. ScanAPI provides a camera overlay view to help the aiming of the camero onto the barcode. This overlay is active as soon as the trigger starts.
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?
Questions and answers