What is the recommended method to connect to a specific Bluetooth HID?
This question refers to code in WiimoteDemo under Visual C++ 2008 (Bluesolei driver, Win 7 64).
I am using OnDiscoveryComplete to accumulate a list of available devices and storing the name and device address of each into my own list of objects. To connect to a specific device, call EnumHID(wcl::CwclStringList& LIST) to obtain a list of devices.
(1) My first question is what does each string retrieved by LIST.GetItems(i) where LIST is the wcl::CwclStringList populated by EnumHID represent? I would like to compare each of these strings to either the names or device addresses found by OnDiscoveryComplete.
(2) My second question is about the following loop inside OnDiscoveryComplete().
Why does this loop repeat up to 5 times if we are getting the name of one device in list position I?
CAtlString aName = L"";
J = 0;
while (aName == L"" && J < 5)
{
// GetItems returns type CwclBluetoothDevice*
// int GetName(CwclBluetoothRadio& rRadio, CAtlStringW& rsValue);
pDevices->GetItems(I)->GetName(*pRadio, aName);
J++;
}// end while J loop.