Neil Sutton
February 13th, 2009, 05:48 AM
Hi all,
I am currently playing with the Bluesoleil Bluetooth Stack SDK and I have got stuck with registering callbacks..
I only know some Vb.net but they provide a DLL which exports the SDK functions - I have used DLLImport to access some of these but I'm unsure how to do the callbacks.
Some info from the SDK Guide regarding the callback function;
Btsdk_RegisterCallback4ThirdParty
Prototype BTINT32 Btsdk_RegisterCallback4ThirdParty (
PbtSdkCallbackStru call_back
);
Description The Btsdk_RegisterCallback4ThirdParty function registers an
application-defined callback function.
Parameters call_back Pointer to a BtSdkCallbackStru structure that
contains information about the callback function
to be registered.
[I]Return: If the function succeeds, the return value is BTSDK_OK.
If the function fails, the return value is an error code listed in Table 1.
They have provided a sample of this function in C++ I believe;
/* This sample demonstrates how to register a callback to process inquiry result indication. */
void AppInquiryResultInd(BTDEVHDL dev_hdl)
{
/* Process the Indication. */
}
void AppRegisterCallback(void)
{
BtSdkCallbackStru cb;
cb.type = BTSDK_INQUIRY_RESULT_IND;
cb.func = (PVOID) AppInquiryResultInd;
Btsdk_RegisterCallback4ThirdParty (&cb);
}
Would anybody be able to give me an example of how to correct call that function in the DLL from Vb.net, so that I can register the callbacks in my application?
I have done quite a bit of searching this morning but I'm more confused than when I started!
A working example that I could then apply to some of the other functions would help me immensly!
Many Thanks
I am currently playing with the Bluesoleil Bluetooth Stack SDK and I have got stuck with registering callbacks..
I only know some Vb.net but they provide a DLL which exports the SDK functions - I have used DLLImport to access some of these but I'm unsure how to do the callbacks.
Some info from the SDK Guide regarding the callback function;
Btsdk_RegisterCallback4ThirdParty
Prototype BTINT32 Btsdk_RegisterCallback4ThirdParty (
PbtSdkCallbackStru call_back
);
Description The Btsdk_RegisterCallback4ThirdParty function registers an
application-defined callback function.
Parameters call_back Pointer to a BtSdkCallbackStru structure that
contains information about the callback function
to be registered.
[I]Return: If the function succeeds, the return value is BTSDK_OK.
If the function fails, the return value is an error code listed in Table 1.
They have provided a sample of this function in C++ I believe;
/* This sample demonstrates how to register a callback to process inquiry result indication. */
void AppInquiryResultInd(BTDEVHDL dev_hdl)
{
/* Process the Indication. */
}
void AppRegisterCallback(void)
{
BtSdkCallbackStru cb;
cb.type = BTSDK_INQUIRY_RESULT_IND;
cb.func = (PVOID) AppInquiryResultInd;
Btsdk_RegisterCallback4ThirdParty (&cb);
}
Would anybody be able to give me an example of how to correct call that function in the DLL from Vb.net, so that I can register the callbacks in my application?
I have done quite a bit of searching this morning but I'm more confused than when I started!
A working example that I could then apply to some of the other functions would help me immensly!
Many Thanks