Hi
I'm creating a managed C++ DLL for the BS-SDK. I followed the same program flow as the SDKsample to setup the Bluetooth adapter. I now want to start the device discovery. The problem I have is that the callback I am registering with Btsdk_RegisterCallback4ThirdParty is never invoked. Any ideas as to why this is not working when part of a managed DLL?
Code snippets:
void dummyCallback()
{
int a = 1;
}
void dummyCallback2(BTDEVHDL dev_hdl)
{
int b = 2;
}
void discoverDevices()
{
(... creating event to synchronize with the end of the discovery...)
BtSdkCallbackStru cb = { 0 };
cb.type = BTSDK_INQUIRY_RESULT_IND;
cb.func = (void*)dummyCallback2;
Btsdk_RegisterCallback4ThirdParty(&cb);
cb.type = BTSDK_INQUIRY_COMPLETE_IND;
cb.func = (void*)dummyCallback;
Btsdk_RegisterCallback4ThirdParty(&cb);
if (BTSDK_OK == Btsdk_StartDeviceDiscovery(0, 20, 5))
{
// Wait until device discovery is complete
...
(-> callbacks should get triggered while waiting for event, but it doesn't...)
...
}
}