Hi, I'm trying to establish with a IPAQ PDA a serial port with a Bluetooth
device with address 00803719C4BB.

If I use COM8 like a normal serial port I establish the communication ok,
it's works, but before it opens a bluetooth window where I choose the device.
Well I want to establish the comm without this selection Window, directly,
and I found in MSDN the following code, in which the handle "h" of
RegisterDevice returns a error number 2.

Anyone knows about using this functions?Please any help will be very
appreciated.
Regards.
CODE:
/////////////////////////////////
PORTEMUPortParams pp;
memset (&pp, 0, sizeof(pp));
pp.device = 0x00803719C4BB; //Address device is placed like this way ??
pp.channel = 2;
pp.flocal = FALSE;
pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;

int puerto= 8;
h = RegisterDevice (L"COM", puerto, L"btd.dll", (DWORD)&pp);

if (h == NULL) {
CString Fallo;
Fallo.Format(_T("Fallo:%d"),GetLastError () ); //RETURNS "2"
}
// Open the port normally like a normal serial port...

CString strPort;
strPort.Format(_T("COM%d:"),puerto);

HandlePort = CreateFile(strPort, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, 0, NULL);
/////////////////////////////////////////////////////

Re: Using bluetooth virtual serial port by Peter

Peter
Wed Dec 01 07:41:29 CST 2004

The RegisterDevice code is specific to devices with the Microsoft bluetooth
stack. iPaqs use the Widcomm stack which works differently. In this case
you'll need either the WidComm SDK or a library such as that available from
http://www.high-point.com/

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"iLLiDaN" <iLLiDaN@discussions.microsoft.com> wrote in message
news:28C26C27-EC22-4F73-8141-CA8B66FA7E66@microsoft.com...
> Hi, I'm trying to establish with a IPAQ PDA a serial port with a Bluetooth
> device with address 00803719C4BB.
>
> If I use COM8 like a normal serial port I establish the communication ok,
> it's works, but before it opens a bluetooth window where I choose the
> device.
> Well I want to establish the comm without this selection Window, directly,
> and I found in MSDN the following code, in which the handle "h" of
> RegisterDevice returns a error number 2.
>
> Anyone knows about using this functions?Please any help will be very
> appreciated.
> Regards.
> CODE:
> /////////////////////////////////
> PORTEMUPortParams pp;
> memset (&pp, 0, sizeof(pp));
> pp.device = 0x00803719C4BB; //Address device is placed like this way ??
> pp.channel = 2;
> pp.flocal = FALSE;
> pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;
>
> int puerto= 8;
> h = RegisterDevice (L"COM", puerto, L"btd.dll", (DWORD)&pp);
>
> if (h == NULL) {
> CString Fallo;
> Fallo.Format(_T("Fallo:%d"),GetLastError () ); //RETURNS "2"
> }
> // Open the port normally like a normal serial port...
>
> CString strPort;
> strPort.Format(_T("COM%d:"),puerto);
>
> HandlePort = CreateFile(strPort, GENERIC_READ | GENERIC_WRITE, 0, NULL,
> OPEN_EXISTING, 0, NULL);
> /////////////////////////////////////////////////////



Re: Using bluetooth virtual serial port by iLLiDaN

iLLiDaN
Wed Dec 01 09:31:01 CST 2004

ok, thanks. I only need to stablish a virtual com port to a device. The only
way to do this is with a Bluetooth stack?


"Peter Foot [MVP]" wrote:

> The RegisterDevice code is specific to devices with the Microsoft bluetooth
> stack. iPaqs use the Widcomm stack which works differently. In this case
> you'll need either the WidComm SDK or a library such as that available from
> http://www.high-point.com/
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.inthehand.com | www.opennetcf.org
>
> "iLLiDaN" <iLLiDaN@discussions.microsoft.com> wrote in message
> news:28C26C27-EC22-4F73-8141-CA8B66FA7E66@microsoft.com...
> > Hi, I'm trying to establish with a IPAQ PDA a serial port with a Bluetooth
> > device with address 00803719C4BB.
> >
> > If I use COM8 like a normal serial port I establish the communication ok,
> > it's works, but before it opens a bluetooth window where I choose the
> > device.
> > Well I want to establish the comm without this selection Window, directly,
> > and I found in MSDN the following code, in which the handle "h" of
> > RegisterDevice returns a error number 2.
> >
> > Anyone knows about using this functions?Please any help will be very
> > appreciated.
> > Regards.
> > CODE:
> > /////////////////////////////////
> > PORTEMUPortParams pp;
> > memset (&pp, 0, sizeof(pp));
> > pp.device = 0x00803719C4BB; //Address device is placed like this way ??
> > pp.channel = 2;
> > pp.flocal = FALSE;
> > pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;
> >
> > int puerto= 8;
> > h = RegisterDevice (L"COM", puerto, L"btd.dll", (DWORD)&pp);
> >
> > if (h == NULL) {
> > CString Fallo;
> > Fallo.Format(_T("Fallo:%d"),GetLastError () ); //RETURNS "2"
> > }
> > // Open the port normally like a normal serial port...
> >
> > CString strPort;
> > strPort.Format(_T("COM%d:"),puerto);
> >
> > HandlePort = CreateFile(strPort, GENERIC_READ | GENERIC_WRITE, 0, NULL,
> > OPEN_EXISTING, 0, NULL);
> > /////////////////////////////////////////////////////
>
>
>

Re: Using bluetooth virtual serial port by Peter

Peter
Wed Dec 01 11:55:33 CST 2004

You can setup a Bluetooth port using the Bluetooth Manager but you will need
to use the WidComm APIs if you want to avoid the software displaying the
dialog to select a device at runtime.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"iLLiDaN" <iLLiDaN@discussions.microsoft.com> wrote in message
news:DD0B7600-0120-492E-91C2-46E10D18E16C@microsoft.com...
> ok, thanks. I only need to stablish a virtual com port to a device. The
> only
> way to do this is with a Bluetooth stack?
>
>
> "Peter Foot [MVP]" wrote:
>
>> The RegisterDevice code is specific to devices with the Microsoft
>> bluetooth
>> stack. iPaqs use the Widcomm stack which works differently. In this case
>> you'll need either the WidComm SDK or a library such as that available
>> from
>> http://www.high-point.com/
>>
>> Peter
>>
>> --
>> Peter Foot
>> Windows Embedded MVP
>> www.inthehand.com | www.opennetcf.org
>>
>> "iLLiDaN" <iLLiDaN@discussions.microsoft.com> wrote in message
>> news:28C26C27-EC22-4F73-8141-CA8B66FA7E66@microsoft.com...
>> > Hi, I'm trying to establish with a IPAQ PDA a serial port with a
>> > Bluetooth
>> > device with address 00803719C4BB.
>> >
>> > If I use COM8 like a normal serial port I establish the communication
>> > ok,
>> > it's works, but before it opens a bluetooth window where I choose the
>> > device.
>> > Well I want to establish the comm without this selection Window,
>> > directly,
>> > and I found in MSDN the following code, in which the handle "h" of
>> > RegisterDevice returns a error number 2.
>> >
>> > Anyone knows about using this functions?Please any help will be very
>> > appreciated.
>> > Regards.
>> > CODE:
>> > /////////////////////////////////
>> > PORTEMUPortParams pp;
>> > memset (&pp, 0, sizeof(pp));
>> > pp.device = 0x00803719C4BB; //Address device is placed like this way
>> > ??
>> > pp.channel = 2;
>> > pp.flocal = FALSE;
>> > pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;
>> >
>> > int puerto= 8;
>> > h = RegisterDevice (L"COM", puerto, L"btd.dll", (DWORD)&pp);
>> >
>> > if (h == NULL) {
>> > CString Fallo;
>> > Fallo.Format(_T("Fallo:%d"),GetLastError () ); //RETURNS "2"
>> > }
>> > // Open the port normally like a normal serial port...
>> >
>> > CString strPort;
>> > strPort.Format(_T("COM%d:"),puerto);
>> >
>> > HandlePort = CreateFile(strPort, GENERIC_READ | GENERIC_WRITE, 0, NULL,
>> > OPEN_EXISTING, 0, NULL);
>> > /////////////////////////////////////////////////////
>>
>>
>>



Re: Using bluetooth virtual serial port by andrej

andrej
Wed Dec 01 13:23:41 CST 2004

Hello,

there is a regestry hack to desable displaying the bluetooth dialog.
set the value
"AutoConnect"
to
"NULL"
under
HKLM\Software\Widcom\BtConfig\AutoConnect\008

then the last active device will be taken for connection.

Works only with WidComm BT-Stack!
Andrej

Peter Foot [MVP] schrieb:

> You can setup a Bluetooth port using the Bluetooth Manager but you will need
> to use the WidComm APIs if you want to avoid the software displaying the
> dialog to select a device at runtime.
>
> Peter
>

Re: Using bluetooth virtual serial port by iLLiDaN

iLLiDaN
Wed Dec 01 13:55:03 CST 2004

Ok, thank you. The problem is that I want to connect the IPAQ PDA with a
Bluetooth GPS and a bluetooth RS232 at the same time, both using virtual
serial port.

Is it possible to have two serial connection and the same time??
I think not..., then If I must to connect to one, disconnect and connect to
the other all the time, it's not usefulness.

At another hand, working with this value of registry, Is it possible to
select between two devices, or only the last one?

Regards.

"andrej.koehler(at).gmx.net" <"andrej.koe" wrote:

> Hello,
>
> there is a regestry hack to desable displaying the bluetooth dialog.
> set the value
> "AutoConnect"
> to
> "NULL"
> under
> HKLM\Software\Widcom\BtConfig\AutoConnect\008
>
> then the last active device will be taken for connection.
>
> Works only with WidComm BT-Stack!
> Andrej
>
> Peter Foot [MVP] schrieb:
>
> > You can setup a Bluetooth port using the Bluetooth Manager but you will need
> > to use the WidComm APIs if you want to avoid the software displaying the
> > dialog to select a device at runtime.
> >
> > Peter
> >
>

Re: Using bluetooth virtual serial port by andrej

andrej
Fri Dec 03 16:20:51 CST 2004

I think in generally is it possible to have two or more bluetooth
connection at the same time but for that you will need an additional
virtual com port.
I think only the last one but there is maybe some other registry setting
where the last device is stored and you can change them by your own.

Regards, Andrej

iLLiDaN schrieb:
> Ok, thank you. The problem is that I want to connect the IPAQ PDA with a
> Bluetooth GPS and a bluetooth RS232 at the same time, both using virtual
> serial port.
>
> Is it possible to have two serial connection and the same time??
> I think not..., then If I must to connect to one, disconnect and connect to
> the other all the time, it's not usefulness.
>
> At another hand, working with this value of registry, Is it possible to
> select between two devices, or only the last one?
>
> Regards.
>
> "andrej.koehler(at).gmx.net" <"andrej.koe" wrote:
>
>
>>Hello,
>>
>>there is a regestry hack to desable displaying the bluetooth dialog.
>>set the value
>>"AutoConnect"
>>to
>>"NULL"
>>under
>>HKLM\Software\Widcom\BtConfig\AutoConnect\008
>>
>>then the last active device will be taken for connection.
>>
>>Works only with WidComm BT-Stack!
>>Andrej
>>
>>Peter Foot [MVP] schrieb:
>>
>>
>>>You can setup a Bluetooth port using the Bluetooth Manager but you will need
>>>to use the WidComm APIs if you want to avoid the software displaying the
>>>dialog to select a device at runtime.
>>>
>>>Peter
>>>
>>