Download Print this page

Socket ScanAPI Reference Manual page 135

Advertisement

Socket ScanAPI Reference
// retrieve the Result
Result=pScanObj->Msg.Result;
// retrieve the device handle
hDevice=pScanObj->Msg.Device.hDevice;
if(SKTSUCCESS(Result))
{
switch(pScanObj->Property.ID)
{
// we care only about refreshing the device
// friendly name
case
kSktScanPropIdFriendlyNameDevice:
}
}
else
{
DisplayError(_T("Error %d during Get operation for
}
return
Result;
}
SKTRESULT
HandleAsynchronousEvent(
IN TSktScanObject* pScanObj
)
{
SKTRESULT Result=ESKT_NOERROR;
switch(pScanObj->Msg.Event.ID)
{
case
kSktScanEventError:
DisplayError(_T("Receive error
break;
case
kSktScanEventDecodedData:
DisplayData(
break;
case
kSktScanEventLowBattery:
DisplayMessage(_T("Low
case
kSktScanEventButtons:
break;
default:
DisplayError(_T("Receive unexpected
}
return
Result;
}
Here is a sample in Java for the BlackBerry platform.
import
com.SocketMobile.ScanAPI.ISktScanApi;
import
com.SocketMobile.ScanAPI.ISktScanDecodedData;
import
com.SocketMobile.ScanAPI.ISktScanDevice;
import
com.SocketMobile.ScanAPI.ISktScanEvent;
import
com.SocketMobile.ScanAPI.ISktScanMsg;
import
com.SocketMobile.ScanAPI.ISktScanObject;
© 2013 Socket Mobile, Inc.
UpdateFriendlyName(hDevice,pScanObj->Property.String.pValue);
break;
pScanObj->Property.ID);
%d"),
pScanObj->Msg.Result);
pScanObj->Msg.Event.Data.DecodedData.String.pValue);
Battery"));
Event!!!"));
%d"),
135/152

Advertisement

loading
Need help?

Need help?

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