This seems like it should be simple but I'm having problem correlating multiple services for a device. I need to read characteristics for
I have multiple devices, each has a custom service as well as implementations for some of the generic services.
I thought that if I enumerated based on my custom service, BluetoothGATTGetServices would return all of it's associated services...nope
hDevInfo = SetupDiGetClassDevs( NULL, 0, 0, DIGCF_PRESENT | DIGCF_ALLCLASSES | DIGCF_DEVICEINTERFACE );
for ( DWORD j = 0; SetupDiEnumDeviceInterfaces( hDevInfo, NULL, &MyService, j, &did ); ++j )
{
...
m_Handle = CreateFile(
pInterfaceDetailData->DevicePath,
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL );
...
USHORT numServices;
hr = BluetoothGATTGetServices( hLEDevice, serviceBufferCount, pServiceBuffer, &numServices, BLUETOOTH_GATT_FLAG_NONE );
numServices always just gives me MyService but not any of the generic interfaces it implements.
Any ideas?
What I have tried:
I have tried multiple things without any luck. If I use SetupDiEnumDeviceInfo to enumerate the devices and then use the SP_DEVINFO_DATA of a device that I decide is mine based on it's friendly name in the call to SetupDiEnumDeviceInterfaces, I am not able to retrieve any interfaces at all.
I have also gone down the road of just pulling out all of the interfaces than trying to associate them later but am having a hard time finding something at the interface level that will tell me which device it actually is associated with