Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
methmath
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 1
Join Date: Apr 2004
Default Cannot oper/register serial port for Bluetooth

I'm developing, for XDAII and in eVC4/Win32, an application that opens a serial port for incoming Bluetooth. The Bluetooth Manager sets COM4 as active port number, but my call:

CreateFile(TEXT("COM4:"),GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);

fails with error message "The specified network resource or device is no longer available".

When I then try to call:

RegisterDevice(TEXT("COM"),4,TEXT("ASIC5_BTUR.Dll" ),0))

also this call fails.

What am I doing wrong ? When I look in the Register [HKEY_LOCAL_MACHINE\Drivers\Active] I find no COM4 active so there is no obvious reason why this call should not work. Have the BTHTools1100 patch installed !
 
emandel
Old
#2  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Jan 2005
Hello, I am experiencing similiar problems. Have you resolved yours ? If yes, could you show me how you open your ports etc.?
 
pleun
Old
#3  
Senior Member
Thanks Meter 1
Posts: 180
Join Date: Oct 2004
Location: stramproy
read this :

http://forum.xda-developers.com/view...263&highlight=
OS : BuzzMobile 1.60c
Radio : 1.17.00
 
emandel
Old
#4  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Jan 2005
Default Cannot oper/register serial port for Bluetooth

I am not sure how your link to COM1 prolems regaqrding signals sould help me. My problems are with opening Bluetooth SPP ports, those that show up as the Inbound and Outbound COM ports.Though I would think that both are active, üsing CreateFile() I can open only the Incoming one (COM4) while I receive an INVALID_HANDLE_VALUE for the other one (COM5).
 
pleun
Old
#5  
Senior Member
Thanks Meter 1
Posts: 180
Join Date: Oct 2004
Location: stramproy
I just saw some info on com ports being inactive as well as a test program so I thought I'd mention it. Didn't mean to provide a solution, sorry
OS : BuzzMobile 1.60c
Radio : 1.17.00
 
vangelderp
Old
#6  
Member
Thanks Meter 1
Posts: 54
Join Date: Feb 2003
Location: London, England
I tried to get the Bluetooth working and also had trouble. I think the inbound and outbound comm ports is to do with if you are using your SPP device as a client or server. It is not as a lot of people think that TX and RX data are on different Comm ports.

I cound not get Bluetooth working at all using my original XDAII rom of 1.60. I downloaded Pocket Bluetooth Tools http://www.bluetooth.jazztel.es/ and then it worked easy on Comm7.

I recently upgraded my XDAII Rom to 1.72 and I tried the Bluetooth support again. This time the XDAII even said I am connecting to a serial SPP device and automatically allocated the Comm port. But I must say my program could still not transfer data correctly using it. It all got stuck in some initilisation sequence. Now that may of been my software so I don't want to blame the XDAII.

All I know is I installed Pocket Bluetooth tools again onto my 1.72 XDAII and all worked fine again on Comm7.

A friend of mine has a new XDAIIs and the inbuilt bluetooth support on that worked 100% first time, no need for the Pocket Bluetooth Tools on that. So I think the problem is with the XDAII and it's built in SPP support.
 
phkaccess
Old
#7  
Member
Thanks Meter 0
Posts: 30
Join Date: Mar 2005
Had the same problem, resolved it:
Strange but true, but on XDA2 etc, in order to receive COM Bluetooth, you have to open the outgoing port as shown in the Systems Bluetooth settings (You have to tick it there, too, of course), not the incoming.
Then, as it is blocking, you have to create a thread that listens on the port.
You cannot use RegisterDevice for a port number (in your case COM4)that is already used and open.
Phil
 
phkaccess
Old
#8  
Member
Thanks Meter 0
Posts: 30
Join Date: Mar 2005
OOPS.... and you have to call OpenFile(), not CreateFile() !!!!!!!!!!!

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Boot Animation Paradise for your Android Device

The default boot animations on any device, no matter whichmanufacturer, are generally pretty … more

Flash Custom ROM and Recovery to Samsung Galaxy S 4

After reading about Dan Rosenberg’s bootloader exploit for the Samsung Galaxy S 4,I … more

Windows-Based Multi-Tool for the Sony Xperia U

If you are a flashaholic and an owner of the Sony Xperia U, you may be interested in the … more

XDA University: Crafting Recovery-Flashable Packages

Those of us who use Linux on a day to day basis don’t think twice about sinking … more