Bluetooth COM port on WIDCOMM/Broadcom stack - Windows Mobile Development and Hacking General

I am programming the Bluetooth COM port on an MDA III using the Smart Device Framework (www.opennentcf.org). Everything works like the wired way as long as the partner is connected to the SPP session. When I shut down the partner the communication hangs and I have to remove the hung program with the Memory control panel.
I would like to be informed by system events in advance so my application can have a graceful shutdown instead of me having to kicking it out.
Is there are known way to achieve this? Any hints would be appreciated.
Thanks
Udo

Related

Multiple Simultaneous Serial Port Profile Connections?

G'Day
I'm trying to set up 2 simultaneous serial port profile bluetooth connections on an XDA II to different devices.
I've tried using the default MS Bluetooth stack, with and without BTHTools, and also the Widcomm stack, but can't seem to get it working.
I'm connecting the XDA to a Brainboxes RS-232 to BT adapter, and a Connectland USB Bluetooth dongle.
I can get both adapters working separately (testing with terminal emulators on PC/XDA) and I can get 2 concurrent connections to the USB dongle (one in one out) but I can't seem to get the same happening with both the BT adapters.
Does anyone know a way of doing this, or a way of assigning different COM ports to each serial port profile associated with a separate device on the XDA (as I think this would help)??
Any help is appreciated,
Cheers.
Sammy,
Please checkout this thread for something called GpsGate :
http://www.pocketpcthoughts.com/forums/viewtopic.php?t=29540
Its designed to multiply the number of Com ports assigned to a BT connection. Not sure if this is what you are after but sounded to me somewhat close so I decided to reply. Hope it helps.
Best Regards
Hi Sammy,
Have you installed the relevant ROM updates that correct problems with the MS and Widcomm Bluetooth stack on the XDA II ? Did you pair and bond the devices before connecting ? I have been developing applications that use the bluetooth serial profile for sometime now and I recommend that you use the MS Bluetooth Stack. I ran into countless problems trying to develop application using the Widcomm bluetooth stack without using their Bluetooth SDK. If you trying to assign different port for your device its best to use the Windows Ce Remote Registry Editor tool because you can't change Serial Port profile Com port values from the Bluetooth Settings menu option. For example for the Widcomm stack the Outbound serial port settings are set in the registry key
[HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BTConfig\Applications\0001]
___________________________________________________________
Name Data
___________________________________________________________
(Default)
Name Bluetooth Serial Port
. .
. .
ComPortNumber 8
____________________________________________________________
This is the port that used by the device that initiates the connection.
Turn Off Blueetooth Stack and Backup your Registry first.
Check the settings for other Bluetooth Profiles from Registry Key value
[HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BTConfig\Applications\0001]
to
[HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BTConfig\Applications\0011]
Note all the Com port values that are assinged for profiles that need to use a port. i.e Dial-Up Networking, Fax etc
Change the value of the ComPortNumber to your desired value. You should assign a Com port value that is not in use. Exit from the Registry Edit tool and Turn the Bluetooth stack On. Go into the Bluetooth Settings and check to that the values you have assigned have taken effect. Viola, you can now use that port for communacting provided you are intiating the comms.
For incoming connections that are intiated from other Bluetooth devices the settings are found in Registry key
[HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BTConfig\Services\0001]
Do the same as above.
Good Luck
k_kirk:
Thanks for the link, unfortunately not quite what I need. Please correct me if I'm wrong, but it looks like GPSGate takes an incoming Serial Port Profile connection and sticks the data into either a 'virtual com port' (COM0) or multiple hardware COM ports. What I was after was actually a way of having 2 concurrent SPP connections (incoming/outgoing) to two separate bluetooth devices.
panashe:
Which ROM updates would I need to correct the stack problems?
I was using an older ROM (the original one) and couldn't get BT working at all, I've since flashed it with a newer ROM (not sure which one) and bluetooth seems to work fine now.
Yes, devices are both paired and bonded.
I was trying to use the MS BT stack but it's limited functionality turned me off. I also had a few problems with very high latency data (it would take a few seconds for a single char to be transmitted).
Thanks for the registry info. I'd actually had a bit of a play with most of those keys before and have tried again, but it seems that no matter what values I change the incoming COM port to, it always uses COM4 regardless.
Note all the Com port values that are assinged for profiles that need to use a port. i.e Dial-Up Networking, Fax etc
Change the value of the ComPortNumber to your desired value
Click to expand...
Click to collapse
You can still only have a single outgoing COM port for the SPP profile though right?
So even if I can change the port settings for other profiles (My devices only support SPP, DUN LAN and FAX), I'd still be stuck with SPP on a single COM port wouldn't I?
Or can I somehow use another profile that uses a COM port as a pseudo-serial port profile??
Thanks for your help.
PS: Does anyone know how the device is chosen (when multiple SPP devices are paired/bonded) if you connect to a COM port to make an outgoing connection without first Connecting a particular device from Bluetooth Manager?
Does it just choose the last active device, or is it based on something else?

Software to manage BT pairing

anyone can recommend a software that can manage BT pairing?. It seems my mini uses com 5 for my gps and also the BT keyboard and when i have one paired the other does not work or vice versa.
Cna someone help?. Thanks.
Try this.
http://forum.xda-developers.com/viewtopic.php?t=15734&highlight=bluetooth
Thanks to Yhlee!
"I can successful install and run the said program.
It need to do, after pairing and before/after entering device name,
than press [Start]->[Today] to bring up the device profile select interface. As the MS BT will bring to front and cover that dialog."
The name of the sofware is "Pocket bluetooth tools", and you can download it here, http://www.bluetooth.jazztel.es/
//Oliwen

Auspicious development project - Is it even possible?!

Hi all
I need to develop an IT project for my HNC in Computing.
I'm a mature student with 5 years programming experience in VB. I've also got non-commercial experience with C#.
I was considering developing an application that would run on my QTEK 2020i.
I'm also a member of and MR2 owners club www.imoc.co.uk
I was thinking of combining these two interests and developing a diagnostic application.
Basically, as with most cars, the MR2 has a diagnostic port into which you can plug a diagnostic tool. Most of these tools simply run into a box with a single LED...the idea being that if there's a problem with your engine, the LED will blink and you are left to count those blinks and then look up that number of blinks to determine the error.
I was hoping to fabricate a connector from this diagnostic plug that I could connect to my QTEK 2020i. I would then read the pulses from the diagnostic port and interpret them programatically; presnenting the user of my application with an on-screen display of the erros and an option to print a report!
This could be expanded to encompass multiple vehicles...perhaps by providing the user with the ability to enter their own diganostic parameters etc.
Anyhow, I have no knowledge of developing on the .NET CE and even less when it comes to the potential uses of the various imputs on the QTEK.
Can anyone tell me if ANY of this sounds plausible?
Cheers
Wayne
This sounds a fun little project. Have you thought about using a modified Bluetooth GPS reciever to transmit the signal via bluetooth to your PDA which you could then check up apon when your running the engine on the move.
All you'd need to do is listen to the bluetooth com port and display the relavent data regarding your engine.
Just an idea to make it a wireless mod for a more impressive feature.
(Now I'm wondering if a QTEK 2020i could program an ECU for full engine customisation on the move.)
I saw a bluetooth car diagnostic system using a Microsoft smartphone at the Modaco meetup last year. Didn't get me excited, but did a full job at getting full diagnostics...
V
symondavis said:
This sounds a fun little project. Have you thought about using a modified Bluetooth GPS reciever to transmit the signal via bluetooth to your PDA which you could then check up apon when your running the engine on the move.
All you'd need to do is listen to the bluetooth com port and display the relavent data regarding your engine.
Just an idea to make it a wireless mod for a more impressive feature.
(Now I'm wondering if a QTEK 2020i could program an ECU for full engine customisation on the move.)
Click to expand...
Click to collapse
tbh I'd have no idea where to start with modding a Bluetooth receiver (don't yo umean transmitter though?).
Once I've got the application running it would be easy to expand later as I would hopefully develop it in a way that the different aspects of the application work very much "black box". I'd just have to write something to do the bluetooth side of things as an additional "black box" later on.
So, it sounds as though this is very possible then!
any idea if anyone on here knows enough about the numerous QTEK ports or how to access those via the .NET CE! :S
Cheers
Wayne
There is already a C# based OBDII diagnostic program out and contains all Source Code as well
OBDGauge 1.3 for PocketPC
http://www.qcontinuum.org/obdgauge/
I was coding my own version before until i found it, and decided not to reinvent the wheel
I used a XDAII Serial cable and connect it to the OBDII Port to my XDAII. Works perfectly, however, my Universal doesn't have a Serial Port, unless u get a Bluetooth version

Bluetooth Navman 4400 not working..?

Hi all,
Just a quick question:
On my Hermes I have detected and setup my Bluetooth Navman 4400 via the Bluetooth Manager. Under Comm Ports it is showing as Com5. Authentication Pass Key Required is checked (Though I have tried both On & Off). In Settings/Connections/GPS I have set the Active port for Applications to 4 and the Hardware Port to 5 (Baud Rate 4800).
I have Tried OziExplorer and the Applet "GPS Info" and neither seem to get or instigate a session with the Navman device.. Now I have noticed that the Navman Continues to "Double Blink" which means it has not instigated a session with anything and thus is blissfully unaware that the Hermes should or is trying to communicate with it.
Funny thing is, the Navman unit works perfectly with my 2003SE Blue Angle PDA..
So am I doing something wrong or made and oversight?
Any Help would be appreciated..
Thankyou in advance..
outgoing com port
apologies if this was obvious to you when you set it up.
Make sure when you set up com port to associate with your navman, that you pick 'outgoing' and not 'incoming'. this was not obvious to me because I was thinking of the direction of data flow, not which side initiates the connection. I would re-pair and reconfigure the port a few times, but I suspect you already have. I use com9 with my iblue, perhaps com5 is already used by something else.
wwwes said:
apologies if this was obvious to you when you set it up.
Make sure when you set up com port to associate with your navman, that you pick 'outgoing' and not 'incoming'. this was not obvious to me because I was thinking of the direction of data flow, not which side initiates the connection. I would re-pair and reconfigure the port a few times, but I suspect you already have. I use com9 with my iblue, perhaps com5 is already used by something else.
Click to expand...
Click to collapse
Yeah had similar problems initially, but got that sorted (In & Out). I was told that The GPS Manager would handle the "in's" I just need to set the OUT (Hardware)..
If you try to use an allocated Port (say Com6) it comes up with an error indicating the port is not available.
My GPS Software (Both Oziexplorer & GPS Info) both show the port allocated by the GPS manager as "active" ..
All strange'ness to me..

Bluetooth Quick Connect / Favorites Today Plugin and/or Command-line app

I'm a Desktop .Net developer with NO bluetooth experience and only a bit of low-level networking experience so I'm speaking from limited knowledge, but not complete ignorance.
I use my phone as an A2DP source and AVRCP client for quite a few devices (Jabra JX20 Pura, Jabra BT3030, Windows Vista, various BT speaker systems) and Alpine BT300) around my house, garage, car, and on the go. They all work wonderfully (some have better range than others, some better sound), but using any of them presents a couple common issues.
Some devices (like my car), constantly seek out the last paired device until they connect, while most of the other require a connection to be initiated from the phone. The phone doesn't care which is around or has the best signal, just which one successfully connects first.
I'd like an app that could have profiles setup which would let me control certain variables OR at a more basic function (see below):
Bluetooth Profile
Device Priority
Minimum Strength (to be used when more than one device has the same priority)
That would be my ultimate goal, but in the meantime I'd be happy with something as simple as a command line app that could be bound to a key or shortcut which would try to connect to a predefined list of BT MACs for a given profile and stop when the first one connects successfully. Variations on this might allow a connection attempt to a specific device instead of a list. This way I could have StartMenu or Today shortcuts.
The point here is largely to have to avoid nagivigating all the menus needed to initiate an A2DP connection, but I'm sure there are MANY other uses people would find.
If someone could point me in the right direction (I'm researching already of course) to the namespace(s) and or class(es) in .Net 2 or newer which would allow me to enumerate and/or initiate connections, this may be something I could bring to the community (assuming it doesn't already exist, and I have asked MANY times).
I've created a poll also to see what kind of interest is out there for this software and how much support I might receive.
I've been knocking an app up to suit my own personal A2DP needs... and a lot of yours by the look of things ;-) Things it does:
Kinetic scrolling finger friendly list of A2DP devices known to your phone (tap to select then tap again to attempt connection).
Toolbar buttons indicating active A2DP connection status (tap to disconnect active connection).
Bluetooth devices applet shortcut.
Switch bluetooth on (a good few of my devices need the phone to be discoverable so the app forces the phone to be discoverable at all times *blush*).
Switch bluetooth off.
Shortcut to program launcher list (automatically displays this list when you initiate a connection to a selected device... and there's items to display in the list of course).
Command line access (via secondary exe) allowing you to attempt connection (to a named , the last connected or first found device) and disconnect an active A2DP connection. I've only really tested the named device connection but the other 2 modes *should* work
QVGA / VGA and orientation aware.
I've been wanting to work towards getting it up on XDA... but time constraints (and a baby on the way ) have gotten in the way and it's unlikely I'll have the time to do it for a good while. I'd be happy to pass on the code to someone willing to take it further if that's any use. It's written (very quickly!) in VB.net BTW.
It uses a few bits and bobs from other people though:
A2DPToggle's "a2dp.exe" to handle initiating a connection.
Icons from lord only knows where I found them.
The kinetic list code found on here (http://forum.xda-developers.com/showthread.php?t=333124&highlight=klist). IIRC, I used the gingercat updated version and tweaked it to my own needs. There's many a kludge I've put in to the code to get things working quick-smart (D-Pad navigation mainly).
InTheHand 32feet.NET libraries (http://inthehand.com/content/32feet.aspx). These work with MS Bluetooth stack only.
So permission from the respective folks above would be needed before releasing it into the wild I guess.
Here's a screeny
Hey great tool! When I click a device will it auto connect or only open the BT Explorer and will it work with Broadcom BT Stack? Thanks
Oops, meant to say it's been developed for the MS bluetooth stack only. Sorry about that.
When you attempt to connect to a device it first checks the device is reachable and only then attempts to initiate an A2DP connection.
Northernmost said:
I've been knocking an app up to suit my own personal A2DP needs... and a lot of yours by the look of things ;-) Things it does:
Click to expand...
Click to collapse
Absolutely. I can get around in VB.Net and C# just fine. If you don't want to publish the code publicly, PM me your email address and I'll invite you to my Sharepoint site (easiest way I know to share files and manage communique), otherwise attach here.
It sounds like you've already covered 99% of what I was looking for, but I'd be more than happy to do what I can to more the idea forward, even taking suggestions from others in this thread.
About the BT stack, I'm running a Vogue with a ROM cooked in PPCKitchen, how do I determine which stack I'm running and can that be changed?
rainabba said:
About the BT stack, I'm running a Vogue with a ROM cooked in PPCKitchen, how do I determine which stack I'm running and can that be changed?
Click to expand...
Click to collapse
I've no idea what stack Vogues come with but the MS stack device list looks like the attachment below. If yours looks the same it's the MS one. I guess the Vogue forum should have any info on swapping stacks if it's possible.
Sounds like I found the correct people to answer my question about BT. Is there a way / how can I: enable my Mogul 6800 phone to transmit the sound that would normally go through the speaker to my BT headset in order to listen to streaming audio from the net using Kinoma Play which goes out and picks up all sorts of "radio programs" , i.e. not using a direct URL. I am also not able to listen to audio files from the Audio Recorder through anything except the speaker, even not through a head phone. Do I need to download a program or set up my phone differently. I currently have Titan WM6.1 Build 20755 GPS kitchen from PPC Geeks. Thanks so much for your help.
jminor4326 said:
Sounds like I found the correct people to answer my question about BT. Is there a way / how can I: enable my Mogul 6800 phone to transmit the sound that would normally go through the speaker to my BT headset in order to listen to streaming audio from the net using Kinoma Play which goes out and picks up all sorts of "radio programs" , i.e. not using a direct URL. I am also not able to listen to audio files from the Audio Recorder through anything except the speaker, even not through a head phone. Do I need to download a program or set up my phone differently. I currently have Titan WM6.1 Build 20755 GPS kitchen from PPC Geeks. Thanks so much for your help.
Click to expand...
Click to collapse
You need an A2DP capable device (high quality), connected, THEN start your audio program OR use a program called Audio Gateway with a basic Bluetooth headset (low quality audio).
thank you very much.
Northernmost, how about that source code? If you want to pass it along less privately than a post here, PM me and I'll provide a solution (source control, WSS, etc.)
Sent you a PM the other day. Let's go the private way for now.

Categories

Resources