Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have just recently migrated my WM application from WM 6.1 to WM 6.5. The application all works OK apart from when I try to open up the serial port to connect to some Bluetooth hardware.
The hardware is paired to the WM device and I can connect to the device if I go to the Bluetooth settings and select connect. Thus proving I have the correct port number in my application (COM2).
However, when I try to connect to the hardware using the application, firstly I see a prompt from WM6.5 to select a connection Bluetooth shortcut. This is most annoying so is there a way of disabling this so that the application just connects to the specified COM port as it did when running on WM6.1. Secondly when I select the correct shortcut the application then throws an Argument Out of Range Exception with a message:

An error message is available for this exception but cannot be displayed because these messages are optional and are not currently installed on this device. Please install ‘NETCFv35.Messages.EN.wm.cab’ for Windows Mobile 5.0 and above or ‘NETCFv35.Messages.EN.cab’ for other platforms. Restart the application to see the message.


I have installed the 'NETCFv35.Messages.EN.wm.cab’ but this has not made any difference to providing a more useful error message.

All the parameters for Port initialization seem to be correct or at least what I would expect.

Any help would be most appreciated.

The hardware what the application is running on is a HTC mobile which is the same as what it previously ran on albeit a faster processor, more memory etc.

Many Thanks.

Andy
(MCTS)
:confused:
Posted
Comments
Espen Harlinn 7-Jan-11 16:51pm    
What sort of harware are you trying to connect to? MS seems to delight in autodetecting hw these days, could something like that be your trouble? Since you are working with it through SerialPort I guess you are using a "low level" protocol, maybe some kind of driver detects the device and locks the port. It's just a guess ...
daniharTech 8-Jan-11 4:27am    
Thanks for that. But I think that it could be that the Bluetooth stack is different. I have a suspicioun that the HTC HD2 uses a different stack to that of the previous HTC HD.

1 solution

OK, with a bit of Google'n I have found the answer. Drop the System.IO.Serial Port library and use the openNETCF.IO.Serial library from openNETcf. This works fine. Although I still haven't managed to prevent the annoying pop-up when you connect to the device. If anybody knows how to do this, let me know.

Andy
(MCTS).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900