Download Print this page

Socket ScanAPI Reference Manual page 54

Advertisement

Socket ScanAPI Reference
9.4.2 Return Value
If the function succeeds it returns ESKT_NOERROR.
The return value is ESKT_INVALIDHANDLE if the object reference is invalid.
If the function is called before the completion of an outstanding set or get operation,
it returns ESKT_PENDINGOPERATIONNOTCOMPLETED.
9.4.3 Remarks
This function returns immediately. In the success case, it will always return the
completion code in the ScanObject that must be retrieved with Wait function. The
Wait function returns the ScanObject structure with the Property field filled with the
result of the operation if it has been successful. The success code can be retrieve
from that same structure in the Result field.
9.4.4 Example
C/C++:
// Get device friendly name
SKTRESULT GetFriendlyName(
IN SKTHANDLE hDevice,
)
{
SKTRESULT Result=ESKT_NOERROR;
TSktScanObject ScanObj;
memset(&ScanObj,0,sizeof(ScanObj);
ScanObj.Property.ID=kSktScanPropIdFriendlyNameDevice;
ScanObj.Property.Type=kSktScanPropTypeNone;
// get the friendly name here
// the final result should be fetched
// in the Get Complete handler
Result=SktScanGet(hDevice,&ScanObj);
return
Result;
}
Java or C#:
// get device friendly name
long
GetFriendlyName(ISktScanDevice device)
{
long
result=SktScanErrors.ESKT_NOERROR;
ISktScanObject scanObj;
scanObj=SktClassFactory.createScanObject();
ISktScanProperty property;
property=scanObj.getProperty();
property.setID(ISktScanProperty.propId.
© 2013 Socket Mobile, Inc.
54/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