Perform a general Bluetooth device inquiry ("page scan")
to identify Bluetooth-enabled devices within proximity:
Only devices that are monitoring for paging will respond
Devices provide their address, name, type
Connect to a particular device and perform a service
discovery
Using SDP (Service Discovery Protocol)
Connect to a Bluetooth service using a profile:
SPP (Serial Port Profile) can be used be legacy
applications that (used to) rely on a COMx port, only the
COM port is controlled by Bluetooth and is virtual.
Connection to a Bluetooth service using a protocol:
RFCOMM
Custom application
Creating a SPP Connection
void CMyApp::bar()
{
// Create an SPP connection to a device whose
address and
// a specific service name have been previously
retrieved.
SPP_CLIENT_RETURN_CODE rc;
rc = CSppClient::CreateConnection(bd_addr,
service_name);
// rc is either SUCCESS or a BTW-CE DK error code
// A COM/SPP port (vport) is now available and
connected
// to the remove device bd_addr.
// NOTE: COM8 is preconfigured as an "outgoing
port" when
// installing BTW-CE
HANDLE hFile = CreateFile(_T("COM8:"), ...);
// Use regular WIN32 API to open the port,
transmit data, etc.
WriteFile(hFile, _T("Hello Bluetooth"), ...);
...
CloseHandle(hFile);
// Release the COM/SPP port for other apps to use
it.
CSppClient::RemoveConnection();
}
FOR MORE INFORMATION VISIT:
http://www.widcomm.org
bluetooth devices built-in ipaqs are from WIDCOMM.
regards
Ronald Armas
MCSD
>-----Original Message-----
>Hello
>I'm writing an application on an IPAQ 3970 that uses the
bluetooth module to
>communicate with a serial port adapter on another unit.
>The application is written in Visual Basic .NET 2003.
I'm using a com port
>component, that works like the component in VB6, for
this.
>
>The two units are configured to always be connected. Is
there any way to
>check if they are connected from my VB application? For
example by
>contacting the Bluetooth manager.
>
>/Marcus Gylling
>
>
>.
>