Broadcom/Widcomm Bluetooth Stack and SetSecurityLevel

By Jerome at September 05, 2007 15:37 Tags: ,

C++, my almost favorite language. This language had good intentions, really. But this is such a pain -- a  pit of despair -- to have to deal with library compatibility and compilation parameters matching issues, where it should be handled by the system.

Anyway, if you're trying to use the Broadcom Bluetooth SDK for Windows CE with VS2005 or VS2008, you might encounter this pretty message :

error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl CRfCommIf::SetSecurityLevel(wchar_t *,unsigned char,int)" (__imp_?SetSecurityLevel@CRfCommIf@@QAAHPA_WEH@Z)

The symbol actually exists in the broadcom provided library (BtSdkCE30.lib or BtSdkCE30.lib)  but is defined like this :


which, undecorated, means :

int CRfCommIf::SetSecurityLevel(unsigned short *,unsigned char,int)

See the difference ? The wchar_t type the compiler is using should be an unsigned short. Basically, both types are binary equivalents but the compiler is treating them as different, hence the different signature.

To fix this, just set the option "Treat wchar_t as Built-in Type" to No.

This way, the wchar_t will go back to being a short, and then match the method built in the static library.

I'm going back to my C# code, now.

0.8.2 Re-Release

By Jerome at August 25, 2007 03:05 Tags:

It seems that I forgot to update some scripts in my build process, and that the cab files were not updated in the last release.

So, I you downloaded version 0.8.2 and that the version of the software on your mobile device is not (See options / About...), then you should download it again to run the latest.

These things happen sometimes :)

Bluetooth Remote Control 0.8.2

By Jerome at August 22, 2007 15:44 Tags:

This kind of a fix only release. I'm trying to fix the "MissingMethodException". This is a bit weird since the function I'm calling should always be here, as said in the SDK documentation... Some documentation or ISV glich, maybe.

I've also added a more visual bluetooth availability check. Now, if the background of the desktop server is in some kind of red color, then bluetooth is not available. Of course, nothing won't work until it becomes gray again.

On a side note, I'm trying some of the new features of Visual Studio 2008, like the multi-targeting of frameworks. Too bad they did not include the .NET Compact Framework 1.0. This is not good news for Bluetooth Remote Control, since I'm keeping .NET CF 1.0 to run on older devices like Smartphones with WM2003. I guess I'm going to have to drop support of these devices in future version.

Get the new release here :

Bluetooth Remote Control 0.8.1

By Jerome at July 23, 2007 01:00 Tags:

Yet an other release of Bluetooth Remote Control for Windows Mobile, 0.8.1.

This time, it did not take me long to add control from the mobile device of the desktop mouse. To use it, just point on the device screen, and it will move the mouse pointer... Tap, and it will left click. Double Tap, it will left double click :) It works kinda great on my HTC Touch ;)

There's no actual interface for that, but it will work with any active application, for now at least. The acceleration is not configurable, but it will in the next release.

I'll also add support for non touch screen mobile devices.

Have fun !

Bluetooth Remote Control 0.8.0-Beta1

By Jerome at June 09, 2007 15:30 Tags:

There it is : Bluetooth Remote Control for Windows Mobile, 0.8.0-Beta1

A lot of updates for this release, like support for iTunes, or support for external events like phone ringing, or taking a call and binding it to an application command. Now the last used application is remembered, and it is possible to disable an application, to have only applications that are actually used.

There's still no documentation for all that, but I'm sensing that the application has reached a "critical mass" that starts to need a documentation to avoid letting some features in the dark.

Anyway, on the menu, you'll find :

  1. Added support for phone event binding to application commands, such as Ringing and Take Call or Hang Up. (Windows Mobile 5+ only)
  2. Added the ability to disable an application, rendering it invisible from the mobile device, see the key bindings section.
  3. Added support for iTunes.
  4. Added last application remembered upon launch.
  5. Fixed sound mixer support for Windows Vista.
  6. Added sound volume binding in Media Player Classic.
  7. Fixed device search on mobile side not ending when bluetooth stack is not supported.
  8. Fixed Media Center icon.
  9. Fixed Media Center name not fitting on smartphone screen.
  10. Added support for Windows Mobile 2003 for PPC.

Have fun :) And of course, if you find bugs -- and I'm sure someone will -- please drop me a mail or a comment !

Vista's Sound Mixer in Bluetooth Remote Control

By Jerome at May 26, 2007 12:04 Tags: ,

If you're using Vista, you might have noticed that you can't change the volume using the "Windows Mixer" remote control section.

Actually, the volume do change, but for the application itself. BTRC is not generating any sound, this is particularly not useful. Vista's got a new feature that allows the user to control the volume of applications independently, which is pretty cool from the user point of view.

But from the developer's perspective, this modifies a bit the way for setting the sound volume. The "old" api still works but for the current application; and if you set the application in Windows XP compatibility mode, the behavior will be restored. Since I don't want to set that compatibility mode, I had to add specific support for vista using the new IAudioEndpointVolume, COM interface (COM, when'll that disapear...) that allows getting back the original behavior, which is changing the master volume.

It'll be in the next release.

Remote Control 0.7.0-Beta2

By Jerome at March 17, 2007 14:43 Tags:

Download here this new release 0.7.0-Beta2.

Since it's snowing a bit in Montreal, I've had a bit of time to look around problems on the 0.7.0-Beta1 problems.

Most of the reported problems were about Widcomm support. The stack was crashing randomly on server shutdown... I hate those API that don't do what they should : Close means close, and you should be able to destroy the object. Well, not with the widcomm API. Some worker thread is still trying to tell by callback that the connection is being closed... This is a bit annoying where there is no connection !

Anyway, this new Beta should fix this. There's also now in the stats bar a "bluetooth" status, whether it is using Microsoft Stack or Widcomm Stack.

I'm also working on some remote display of the PC screen, and to have some commands executed upon Bluetooth status change... This should be cool ! Wait and see !

Bluetooth Remote Control for Windows Mobile 0.7.0-Beta1 : Widcomm Support

By Jerome at March 08, 2007 18:01 Tags:

There it is ! The support for the Widcomm bluetooth stack on the desktop side.

Download it here : Bluetooth Remote Control for Windows Mobile 0.7.0-Beta1

For now, this is a beta release, but this should work fine. You can now use Bluetooth Remote Control along with your A2DP headphones :)

On the dev side, working with a event driven API with C++ can pose some problems... The widcomm API is pretty different from the Microsoft stack. I have to admit, I prefer the Microsoft way of doing things, where you can call a blocking Receive method, instead of being notified asynchronously by some random thread, where I prefer managing my own threads. Also, handles are not closed if you application crashes, leaving a connection or an advertised service as an orphan. Annoying during the debugging...

Well, it works now. Maybe next time I'll try to updated the mobile side...

Support for Widcomm Stack on the Way !

By Jerome at March 07, 2007 14:41 Tags: ,

This has been the main complaint since the first release of this little piece of software, and since Broadcom (formerly Widcomm) has released its SDK for Bluetooth communication, I'm now updating my software to support it.

Preliminary tests are conclusive, I'm going to include Widcomm stack support in the next release !

For those of you wondering where this SDK is, go download it here for both desktop and mobile sides.

Stay tuned :)

Bluetooth Remote Control 0.6.0

By Jerome at January 26, 2007 16:57 Tags:

Since I had some spare time to work on Bluetooth Remote Control for Windows Mobile, here is version 0.6.0 :

  • Added support for Windows Media Center
  • Added Shuffle key for winamp
  • Fixed Media Player Classic bindings
  • Fixed bluetooth support for some HP devices having "Error getting bluetooth mode"
  • Has been tested on Windows Vista (RTM build 6000)

Since I do not own a Windows Media Center 2005, I've only tested on Media Center for Vista. If someone has one to try on to, let me know. I should work, though.

About the HP devices, a few of you having devices like acer N311, iPaq hw6915, you can now run this software properly.

You can download this new release here :

Have fun !

About me

My name is Jerome Laban, I am a Software Architect, C# MVP and .NET enthustiast from Montréal, QC. You will find my blog on this site, where I'm adding my thoughts on current events, or the things I'm working on, such as the Remote Control for Windows Phone.