Bluetooth API? - Windows Mobile Software Development

Hey,
i want to start programming an app for my HD2 which should connect one of my bluetooth devices by starting it. I only know a bit about programming under desktop-windows. Where do I find a reference for the programmers api on WM6.5 / where can i look for the commands i need?
//Edit: The functions i found in the MSDN are for connecting - communicating - closing in this way, but i only want to connect a profile (serialport for tmc) and end.
Hope you can help. Thanks.
125

Found the 32Feet.net SDK but still i can't get the procedures i need.

Nobody with information on programming bluetooth apps?
Somebody must have down something similiar in the past or?

These?:
http://www.codeproject.com/KB/windows/BluetoothDevicesDiscovery.aspx
http://www.mobile-soft-dev.blogspot.com/2010/03/c-wrapper-for-nearby-bluetooth-devices.html

Thanks for the links. Ok that is how to enumerate the devices and i could do a connection over winsock, but still i can't find information on not really do a connection but only pair the bt device so other applications can use it afterwards. Damn
(More Information: App should be used on WIDCOMM stack to connect tmc and start navigation after that to get rid of the annoying selector window which disappears to quick)

Related

Direct Access to the internal GPS ??

Hello there,
Did anybody find out how to access the internal GPS of the HTC P3300 without using the GPSID (GPS Intermediate Driver)?
Although the internal GPS works fine for me with many programs (TomTom, Pathaway, Fugawi, VisualGPSce, etc.) I did not find a way to program the internal GPS using any of the common GPS tools (such as SirfTech, Aplsirf, CeMonitor, GPSTweak, etc.). In particular I'm very interested in enabling/disabling the SN and the SBAS Mode.
I'm guessing that programming the internal GPS via the GPSID is not possible (or not supported) while it might be possible by accessing the hardware GPS directly. However, I don't know how to do so...
During my investigations I found out the following details:
Based on the MS GPSID Reference the HTC P3300 must have a plug'n'play based internal GPS receiver, as there's no valid registry key found in the corresponding HKLM/System/CurrentControlSet/GPS Intermediate Drivers section.
Looking into the HKLM/Drivers/Active section for a suitable pnp GPS driver I only found COM3 (SerialGPS.dll) which for me seems to be the corresponding hardware driver for the internal GPS. However, accessing COM3 always fails for me with any program.
Does anybody know how to get COM3 (SerialGPS) to work?
Or does anybody know how the GPSID talks to the internal GPS and why I can't do it directly (or how I can do it directly too)?
Any help and discussion is higly appreciated.
Thanks, GeenZ.
Have you tired to delete the gps driver in registry, and after a softreset tried to access direct on com 3 ?
pklein90 said:
Have you tired to delete the gps driver in registry, and after a softreset tried to access direct on com 3 ?
Click to expand...
Click to collapse
I already have tried disabling the GPSID. This can be done either by the GPS control panel or directly in the registry by setting the key HLKM/System/CurrentControlSet/GPS Intermediate Driver/IsEnabled to "0".
The effect was that the virtual GPS COM port from the GPSID (COM4) was no longer available, but COM 3 still did not work.
Does deleting and softreseting make a difference to disabling?
How could I "completey delete" the GPSID in the registry?
Thanks, GeenZ
I'm interested in this too since I've found reading from COM4 using CF 2 is really buggy and hangs the device. I wanted to see if talking directly to the GPS instead of the intermediate driver would speed things up a bit.
Hi,
As I reported in this Thread I did not find any solution to get direct access to the GPS port.
GeenZ
indiekiduk said:
talking directly to the GPS instead of the intermediate driver would speed things up a bit.
Click to expand...
Click to collapse
it would also probably solve the problem of M650 users stucked with a different firmware version of this internal GPS which doesn't work under wm6
If you would take a look at my following thread
it explains the problem.
Alot of people think they cant connect to the GPS device, but actually it is connection but just nog receiving data the right way.
Slovek said:
If you would take a look at my following thread
it explains the problem.
Alot of people think they cant connect to the GPS device, but actually it is connection but just nog receiving data the right way.
Click to expand...
Click to collapse
Thanks Slovek
Should we Thank HTC for this great feature ?!
Already had contact with them, initially they put this up as a 'feature' but about a month ago i received a short list of questions regarding the GPS module. so i hope their going to change this.
Hope so
at least for the "perennity" of this device !

Incoming Port (Bluetooth)

Hello,
I am trying to allow my Apple Mac to use the phone as a modem. Before I upgraded to WM6 I had this working with no problems.
In order to get it to work, once I had paired the devices I had to create a new incoming port on comm 0. Unfortunately in WM6 I no longer have the "New Incoming Port" option.
Does anyone know how I enable this?
Cheers,
Tim
You really should do some searching...
I'm going to try not to completely jump all over you on this...but you should really read more about the stuff you're putting on your device before you start question threads like this.
Tethering in WM6 does NOT work like it did in WM5...Instead of using silly modem strings and jumping through crazy port hoops and stuff...now there is the internet sharing option in WM6. If you'll start that up you can then use your phone to tether with your mac. If you want to use bluetooth to do this...you'll need Mac OS 10.4.9 to enable the bluetooth PAN profile. If you want to do this through USB...you'll need The Missing Sync for Mac OS X by Markspace. Do some searching...do some reading...the info is already here on how to do it.
enjoy the forums...
Thanks for the reply, your right I found all that info just after posting. I should have said and stopped you waisting your time.
Still can't get it to work properly as it's not allocating an IP from the phone to the mac.

WM6 and Linux - Bluetooth issue

I am trying to get my laptop running linux to use my hermes as a modem over bluetooth. So far I am not succeeding, I have paired the phone and the laptop, but no services show up to share. I have sent files over bluetooth to the laptop and that is just fine.
Has anyone else done this? I really don't want to change my laptop back to windows just so I can surf the net using my phone.
Thanks
What distribution of linux and what window manager do you use?
And does the file transfer work both ways? (to the phone and from it).
I might help you a little
Using Ubuntu - Edgy Eft and Gnome.
I don't have a way for files to be sent from the latop, I am using the blue tooth file sharing program - which seems to be one way only.
I did this a long time ago, so I might have forgot something, but let's give it a try.
First check if you have a rfcomm device in /dev/, there should be something like rfcomm0.
And this is there if you have edited and paired your phone correctly!
(you should add your device to /etc/bluetooth/rfcomm.conf)
Try Gnome-PPP, it's a very good program for dialup rutines ^^
Code:
sudo apt-get install gnome-ppp
The gnome-ppp should be run in root mode because rfcomm device has no privileges, or then you could just chmod it.
But anyways, I've made a script for myself to turn on BT and start gnome-ppp, to run it with root privileges with the following command
Code:
gksudo -u root gnome-ppp
after that you see a window with username password etc.
press setup and put in the following config..
Setup
Now we need a init string! I have no idea what is your provider and what init string is needed for it.
In the Setup window press Init Strings...
And in the first place you set the string.
With Saunalahti as a provider I have a init string of:
AT+CGDCONT=1,"IP","internet.saunalahti"
notice that internet.saunalahti is the APN name for my providers internet gprs connections! So replace this with yours, or then contact your provider and ask for that info
Now back to the first window.
My ISP doesn't require any username but you can't connect without them so put in whatever you like for example
username: none and password: none
or
if you need username and password for your providers GPRS, then add them here
For the phonenumber set the number: *99#
Nothing else, that should be it then if I got it all and remember correct
Then just connect (notice that on TyTN there isn't any "connecting to GPRS" popups when you use a PPP from linux).
in WM6, the phone internet sharing no longer behaves like a modem. not sure how to get it working with Linux
joej said:
in WM6, the phone internet sharing no longer behaves like a modem. not sure how to get it working with Linux
Click to expand...
Click to collapse
what do you mean, the "Wireless Modem" program that you can find in the Programs folder?
I never used that, there's no need of it.
In fact, don't use it, propably wont work with it.
StewartG said:
I am trying to get my laptop running linux to use my hermes as a modem over bluetooth. So far I am not succeeding, I have paired the phone and the laptop, but no services show up to share. I have sent files over bluetooth to the laptop and that is just fine.
Has anyone else done this? I really don't want to change my laptop back to windows just so I can surf the net using my phone.
Click to expand...
Click to collapse
I've been successfully using my Wizard and Hermes as BT modems for GPRS/EDGE/UMTS connections, but only with WM5 (check out my tutorial here: http://klamstwo.org/evad/archives/20 ). After upgrading Hermes to WM6 I am no longer able to create rfcomm device, and I don't know why.
However, it is still possible to use GPRS/UMTS connection under Linux! I've managed to get it working through Bluetooth PAN profile. I'm planning to write some kind of tutorial on my blog pretty soon, but in meanwhile have a look here: http://bluez.sourceforge.net/contrib/HOWTO-PAN - this HOWTO describes quite comprehensively BT PAN usage under Linux.
Basically, you need to set up Internet Sharing via BT on your Hermes, and then connect from your Linux using pand daemon. Check out HOWTO, give it a try, if nothings comes up - feel free to ask here. Good luck.
Btw, my distro is FC6.
gvoima said:
what do you mean, the "Wireless Modem" program that you can find in the Programs folder?
I never used that, there's no need of it.
In fact, don't use it, propably wont work with it.
Click to expand...
Click to collapse
In WM5 it didn't work even with Windows (or I didn't know how to set it up properly). WM6 brings completely new Internet Sharing application which is accessible from Linux without big problems via Bluetooth PAN profile - check out my post above.
I'm planning to try connecting to internet through Hermes/WM6 via USB cable. I guess it's just a matter of installing some usb-driver. It's worth to try, as UMTS/HSDPA connection together with BT drains battery really (I mean REALLY) fast, and also - USB cable offers higher speeds than BT...
Nice to know, i'm using WM5 atm, waiting the official WM6 release from sweden (I live in finland and tried to contact finnish HTC regarding that matter), then I might look into it more.
eva_d said:
I've been successfully using my Wizard and Hermes as BT modems for GPRS/EDGE/UMTS connections, but only with WM5 (check out my tutorial here: http://klamstwo.org/evad/archives/20 ). After upgrading Hermes to WM6 I am no longer able to create rfcomm device, and I don't know why.
However, it is still possible to use GPRS/UMTS connection under Linux! I've managed to get it working through Bluetooth PAN profile. I'm planning to write some kind of tutorial on my blog pretty soon, but in meanwhile have a look here: http://bluez.sourceforge.net/contrib/HOWTO-PAN - this HOWTO describes quite comprehensively BT PAN usage under Linux.
Basically, you need to set up Internet Sharing via BT on your Hermes, and then connect from your Linux using pand daemon. Check out HOWTO, give it a try, if nothings comes up - feel free to ask here. Good luck.
Btw, my distro is FC6.
Click to expand...
Click to collapse
I see your point now, I upgraded to a new ROM and AKU, now the wireless modem is gone and I cannot connect to a rfcomm device anymore. But there is the Internet Sharing application, I'm going to try your tutorial in a moment
What about USB modem?
eva_d said:
[...]I'm planning to try connecting to internet through Hermes/WM6 via USB cable. I guess it's just a matter of installing some usb-driver. It's worth to try, as UMTS/HSDPA connection together with BT drains battery really (I mean REALLY) fast, and also - USB cable offers higher speeds than BT...
Click to expand...
Click to collapse
Hi all,
It's my first post on this forum. But I'm looking forward to finding a way to use my HTC Wizard has a USB modem...
I've seen on another forum that configuring this device as an USB modem can be quite easy done on Windows. So it would be nice to have this working for Linux
joej said:
in WM6, the phone internet sharing no longer behaves like a modem. not sure how to get it working with Linux
Click to expand...
Click to collapse
You can get it working as modem the same way you could do it in WM5 - using the "internet sharing " application.
The problem described here is that when you do
$ sdptool browse <bluetooth_mac_address>
you see no services.
I have the same problem with ubuntu.
When I browse the services of another phone - a nokia for example - I see all of them .
However I had this problem with ubuntu even before upgrading to WM6.
So it seems the problem is in the bluez version delivered with ubuntu.
What I am going to try the next few days is to uninstall the ubuntu release of bluez and build the source code and install.
I had an issue with synce also with ubuntu - not working. So I downloaded synce 's sources and everything works now.
deyanmf said:
You can get it working as modem the same way you could do it in WM5 - using the "internet sharing " application.
The problem described here is that when you do
$ sdptool browse <bluetooth_mac_address>
you see no services.
I have the same problem with ubuntu.
When I browse the services of another phone - a nokia for example - I see all of them .
However I had this problem with ubuntu even before upgrading to WM6.
So it seems the problem is in the bluez version delivered with ubuntu.
What I am going to try the next few days is to uninstall the ubuntu release of bluez and build the source code and install.
I had an issue with synce also with ubuntu - not working. So I downloaded synce 's sources and everything works now.
Click to expand...
Click to collapse
This is mainly because the connection method has changed in WM6.
In WM5 it was done via DUN (Dialup Networking Profile). WM6 Internet Connection Sharing does not utilise or advertise this profile when in place, but sets up a PUNU (Personal Area Network) profile, basically turning the Hermes into a router with dhcp services.
I followed the referenced howto and was able to get my laptop running FC6 connected to the Hermes and auto-assigning an IP address. Unfortunately, though, the connection was not stable and disconnects not long after it was established.
I'll have another read at the howto as I've noticed persistent connection flags that should force reconnection, however if I'm connected to the Company VPN, then I suspect that will continually drop also.
Can anyone post any success stories and configuration/command output that they used to create a stable connection?
Ta
Darren
numanoids said:
Can anyone post any success stories and configuration/command output that they used to create a stable connection?
Click to expand...
Click to collapse
Check out my solution: http://klamstwo.org/evad/archives/40
It actually works stable, however I have never used single connection for more than like 30-60 minutes, yet - I guess.
Btw, works also with Fedora 7.

Sending GPS coordinates through GPRS

Hello all,
I have a HTC p3600i (Trinity) and I would like to create a program which would send coordinates detected with the built in GPS via GPRS to a server. This is actually my final year project, and it should be done in Java.
I have never programmed for windows mobile before so hopefully someone could assist me with this project. I have a few questions:
1) Is it necessary for me to upgrade my ROM first before I could use the built in GPS on my Trinity? I just got this phone today, so I'm not really sure about this. It has a GPS navigation software installed (mapking), does this mean it's ROM has been upgraded?
2) What are the tools that I need? I currently have Java ME installed on my laptop, should this be enough or do I need any other applications for this project?
3) Could someone point me in the right direction, as to where I can get the related API to program this or even maybe a guide? Right now I don't know where to start.
I hope I didn't ask too many questions for a newbie
I really appreaciate all help!
Thanks!
It might be worth having a look at Microsoft's Intermediate GPS device driver.
http://msdn.microsoft.com/en-us/library/bb202086.aspx
This stuff is in GPSAPI.DLL which should already be in your device but it is a hidden file.
You use the GPSOpenDevice, GPSGetPosition, and GPSCloseDevice functions to get it to work. These are 'C' type function calls.
To go lower than this you will have to open the COM port of the GPS device, read the data from the port and then parse the NMEA strings yourself, and then do whatever with the values returned. A complete pain in the backside!
GPSGetPosition will fill a GPS_POSITION structure with the values you need.
Good luck!
stephj said:
It might be worth having a look at Microsoft's Intermediate GPS device driver.
http://msdn.microsoft.com/en-us/library/bb202086.aspx
This stuff is in GPSAPI.DLL which should already be in your device but it is a hidden file.
You use the GPSOpenDevice, GPSGetPosition, and GPSCloseDevice functions to get it to work. These are 'C' type function calls.
To go lower than this you will have to open the COM port of the GPS device, read the data from the port and then parse the NMEA strings yourself, and then do whatever with the values returned. A complete pain in the backside!
GPSGetPosition will fill a GPS_POSITION structure with the values you need.
Good luck!
Click to expand...
Click to collapse
Hey, thanks for the reply. Will look into it. How bout sending out the data through GPRS? Any ideas?
Don't know exactly. I have only ever written .NET CF C# code to drag data from the net, never to put it back. I assume that many of the SYSTEM.NET namespace objects could be used to transfer data over to a server.
You can push data directly using the WebClient class methods OpenWrite(), UploadData(), UploadFile(), and UploadString().
UploadFile would be used as a Batch Job to push a series of saved values at once.
These functions will use whatever path is available to send the data. Wifi, LAN or GPRS. If you are out in the field, it should start the GPRS connection automatically in order to complete the WebClient transaction.
To use the .NET objects you will have to code it in C# or VB, unless you can access them in Java. Any clues anyone? The GPS stuff can be accessed from .NET by declaring it as a P/Invoke function.

bluetooth questions

Hello
i just got my desire and i have some questions regarding bluetooth use.
maybe im just not finding the right menus but im a little bit stuck
so first the setup and what i have done: i have a bluetooth gps receiver and im trying to connect it to my desire.
i searched, then paired
and after that i get paired but not connected.
a) so how do i connect ? tapping on it didnt do anything and holding got me a menu to unpair the device
b) after i connect how do i create a serial port ? as i understand serial port profile should be usable on android
c) is there a way to autoconnect ?
d) are there any special menus for bluetooth other than the settings menu ?
i'm coming from winmo and im a little bit stuck here
and related to that, is there even a navigation software that can make use of a bluetooth gps receiver ? it seems at least navigon has no option to change the source
thanks in advance
I've not tried with a gps receiver, but I have to ask, why? Is the built in gps no good?
TulpiX said:
and related to that, is there even a navigation software that can make use of a bluetooth gps receiver ? it seems at least navigon has no option to change the source
Click to expand...
Click to collapse
The currently available navigation software all use the Android system location services to get GPS information, and therefore do not have an option to connect to an external GPS unit.
I'm sure it a navigation solution developer could code their app to use external GPS if they so choose, as the APIs are there, but given that most Android devices have built in GPS they probably can't be bothered as it probably has limited appeal (though I do understand why some people might want it).
Regards,
Dave
hmm ok that answers some of my questions. thanks
what about the adding and connecting questions ?

Categories

Resources