Download Print this page

Api Functions; Open Function - Socket ScanAPI Reference Manual

Advertisement

Socket ScanAPI Reference
Once the last property has been set, the configuration of ScanAPI must be reverted
back to its original configuration so that it is waiting for an incoming connection.
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.

9 API Functions

The ScanAPI has 6 entry points: Open, Close, Get, Set, Wait and Release.
They all use a reference to either a ScanAPI object or a Device object. These
references are represented differently depending on the programming language
used.
For C/C++ language this reference is represented as SKTHANDLE. This handle is
initialized during the open function and invalidated after calling the close function.
For Java and C#, this reference is an interface. There are 2 interfaces, one for each
object it represents; ISktScanApi for representing a ScanAPI object and
ISktScanDevice for representing a Device object. The ISktScanApi interface is a
superset of the ISktScanDevice.
Objective C uses the same concept and same name except it is called protocol
instead of interface.
A request to get these interfaces instantiated can be made by using the
SktClassFactory, ie: ISktScanApi scanApi=SktClassFactory.createScanApiInstance();
Or in Objective C:
Id<ISktScanApi> scanApi=[SktClassFactory createScanApiInstance];
Having an interface or protocol instance is not enough to use the object it
represents. The open must be invoked to initialize the object, and the close will
invalidate the object.

9.1 Open Function

The Open function opens either ScanAPI object or a Device object.
ScanAPI object
© 2013 Socket Mobile, Inc.
41/152

Advertisement

loading
Need help?

Need help?

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