Download Print this page

Sample Handling Asynchronous Events Of Scanapi - Socket ScanAPI Reference Manual

Advertisement

Socket ScanAPI Reference
to kSktScanPropIdDataConfirmationDevice, with the confirmation action
specified.
Steps for a data confirmation locally at the device:
1- Configure the device local confirmation action by using the
kSktScanPropIdLocalDecodeActionDevice.
2- Configure ScanAPI to indicate the device is confirming the data locally by
using the kSktScanPropIdDataConfirmationMode with its byte value set to
kSktScanDataConfirmationModeDevice
Steps for a data confirmation at ScanAPI level
1- Configure ScanAPI confirmation action by using the
kSktScanPropIdDataConfirmationAction.
2- Configure ScanAPI to indicate it should confirm the data by using the
kSktScanPropIdDataConfirmationMode with its byte value set to
kSktScanDataConfirmationModeScanAPI.
Steps for a data confirmation at the Application level
1- Configure ScanAPI to indicate the application is doing the data confirmation
by using the kSktScanPropIdDataConfirmationMode with its byte value set to
kSktScanDataConfirmationModeApp.
2- Confirm the data by using the kSktScanPropIdDataConfirmationDevice with
the appropriate action the device should perform. In this case the action can
indicate if the decoded data was what the application expected, or, if the data
didn't match with what the application is expecting.
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.
Usually there is no need to create another thread other than the one that is already
used for the UI.
One of the approaches could be to use a simple timer. The timer handler calls the
Wait API with no timeout, and if a ScanObject is available it can be acted upon in this
handler.
Here are the basic steps an application can follow in order to use ScanAPI:
1) Open the ScanAPI object by using Open API with NULL as the device name.
2) If the open is successful then a timer can be started.
© 2013 Socket Mobile, Inc.
131/152

Advertisement

loading
Need help?

Need help?

Do you have a question about the ScanAPI and is the answer not in the manual?

Subscribe to Our Youtube Channel