Table of Contents |
---|
To create a virtual bluetoothBT-com-port you may use the samples found at:
%_WINCEROOT%\public\common\sdk\samples\bluetoothbl…th\comtest
%_WINCEROOT%\public\common\sdk\samples\bluetoothbl…th\sca
%_WINCEROOT% is the directory of your platform-builder installation.
...
View the Windows CE Platform Builder help for details:
Networking - Wireless → Bluetooth Bl…th → Bluetooth Bl….th Application Development →
Registering a Bluetooth BT Service
Creating a Connection to a Remote Device Using a Virtual COM Port
...
Where %s is either comtest or sca.
server will create a serial bluetoothBT-port, to which other bluetoothBT-devices may connect to.
client will create a serial bluetoothBT-port and connect to the bluetoothBT-device specified by target bt_addr.
channel is the RFCOMM-channel number. Use a value between 1 and 31 or 0xfe to select a availlable channel.
port_index should be a free COM-port-index not already used by another driver.
Making it discoverable
To make the created COM-port discoverable by other bluetoothBT-devices, your application needs to register a SDP-record for the new COM-port-service. SDP stands for Service-Discovery-Protocoll and is used everytime a bluetoothBT-device queries for availlable services on another device.
...
To create a custom SDP-record have a look at the bthnscreate-utility found at %_WINCEROOT%\public\common\sdk\samples\bluetoothbl...th
. The input rec-file to create the rgbSdpRecordRFCOMM
-structure is availlable in the download section.
Example-usage of the modified sca-sample:sca server 1 6
This creates a bluetoothBT-COM-port on RFCOMM-Channel 1 and associates it with device COM6:.
Downloads
Modified SCA-sample: sca.zip
RFCOMM-REC-file to generate SDP: serial.zip
...