Findnextbtdevice – Argox PT-9130 User Manual

Page 64

Advertising
background image

PT-90 Mobile Computer SDK Programming Manual 57

FindNextBTDevice

This function retrieves the results of an nearby Bluetooth device search.

DWORD FindNextBTDevice

{

HANDLE

hLookup

,

LPTSTR

szDeviceName

,

ULONGLONG *

btAddress

,

int

nNameLen

}

Parameters

hLookup

[in] Handle obtained from InitSearchBTDevice function

szDeviceName

[out] The buffer to receive the device name string

btAddress

[out] Receive the device address of 64-bit unsigned integer

nNameLen

[in] The szDeviceName buffer max size. If terminal device name length > nNameLen, the

szDeviceName buffer store data of nNameLen length

Returned Values

If the action succeeds, the returned value is

E_FUNC_SUCCEED

. If the action fails, possible returned values are

E_FUNC_ERROR

,

E_FUNC_PAR_ERROR

,

BT_ERR_DEVICE_ERROR

.

Remarks

Must call EndSearchBTDevice function frees the handle after calls to the InitSearchBTDevice and

FindNextBTDevice function.

Example

#define GET_NAP(_bt_addr) ( (USHORT) (((_bt_addr) & (ULONGLONG)0xFFFF00000000) >> (8*4)) )

#define GET_SAP(_bt_addr) ( (ULONG) (((_bt_addr) & (ULONGLONG)0x0000FFFFFFFF) >> (0)) )

DWORD dwRe;

HANDLE hLookup;

ULONGLONG btAddress;

WCHAR szAddress[16], szDeviceName[128];

dwRe = InitSearchBTDevice(&hLookup)

while(dwRe == E_FUNC_SUCCEED){

Advertising