Home  >> Developers Forum  >> CallBack functions not called

Bruns

Add new friend

Join Date:2016/1/13

Location:

Posts:3

Posted at 2016-01-13 19:03:21
[ CallBack functions not called ]

Hello,

When I try the BlueSoleil sdk example application, all it's working correctly. The BT devices are correctly enumerated.

But when I integrated the SDK code in a dll, called by a IHM Qt application the CallBack in my dll are not called.
I would like to know if anyone encountered a similar problem.

In my dll
if (BTSDK_OK == Btsdk_StartDeviceDiscovery(0, MAX_DEV_NUM, 45))
{
    /*wait BTSDK_INQUIRY_COMPLETE_IND. When complete inquiry, AppInqCompInd will notify*/
    WaitForSingleObject(s_hBrowseDevEventHdl, INFINITE);    <- I m bloqued indefinitely    
    
    DisplayRemoteDevices(0);
    printf("Search for remote devices completely.\n");
}

Bruns

Add new friend

Join Date:2016/1/13

Location:

Posts:3

Posted at 2016-01-13 19:05:32

I made the below test.
I added the call Btsdk_StartEnumRemoteDevice in the loop and so the CallBack are called !
But I think it's not good way to work (later in the code the pairing not work), I think I have to find why the callback are not called in the first example.

BTINT32 l_Status = Btsdk_StartDeviceDiscovery(0, MAX_DEV_NUM, 45);
if (BTSDK_OK == l_Status)
{
    //wait BTSDK_INQUIRY_COMPLETE_IND. When complete inquiry, AppInqCompInd will notify        
    DWORD dwWaitResult;
    int l_iRetry=0;
    do
    {
        l_iRetry++;            
        dwWaitResult = WaitForSingleObject(s_hBrowseDevEventHdl, 500);                                        
        Btsdk_StartEnumRemoteDevice(BTSDK_ERD_FLAG_NOLIMIT, 0);  //Else not work with dll ???
        Sleep(100);
    }
    while ((dwWaitResult==WAIT_TIMEOUT)&&(l_iRetry<50));    

    if (dwWaitResult==WAIT_OBJECT_0)
    {
        printf("Search for remote devices completely.\n");   <- it's ok                      
    }
}

Bruns

Add new friend

Join Date:2016/1/13

Location:

Posts:3

Posted at 2016-01-18 16:10:43

I made a test with the same dll.
Dll loaded by win32 application => CallBack "void AppInquiryInd(BTDEVHDL dev_hdl)" and "void AppInqCompInd(void)" in dll are called
Dll loaded by Qt application => CallBack "void AppInquiryInd(BTDEVHDL dev_hdl)" and "void AppInqCompInd(void)" in dll aren't called

I found an other solution without used AppInquiryInd and AppInqCompInd CallBack.

poonam

Add new friend

Join Date:2020/2/14

Location: India

Posts:0

NOTE:
1.The reply should be more than 20 characters.
2.Image Size: less than 1MB, max pixel: 300 * 300.