2004年09月23日

首先要记住通信是双方的,双方必须协商通信参数,或者说通信参数一致.
要在redhat下使用串口设备, 串口设备的基本通信参数就是波特率.
好了,正式开始;
1.在windows平台下烧写蓝牙模块,
1.1. execute blueflash
    烧写hci_bc02.xdv文件
1.2. execute pstool
    配置参数
       hci host interface: bcsp
       uart baud rate: 115200 (别的值也可以,只要与主机端匹配)
1.3. execute bluetest
    we can test is paras correct to write?
2.在redhat9下使用串口蓝牙设备

2.1. 加载模块

modprobe bluez

modprobe l2cap

modprobe hci_uart

(注意,l2cap和hci_uart模块的加载顺序可以交换)

hcid

hciattach -n /dev/tts/2 bcsp 115200 &

sdpd(此命令可以暂不执行)

hciconfig

运行hciconfig后,会出现串口蓝牙设备的信息

2004年09月14日

1.bluez maillist:

bcsp not working (bcsp bluecore serial protocol)

he execute the following script to start all the bluetooth stuff:
————————————————————
#!/bin/sh
/bluez/hcid -n &
/bluez/bluezmain hciattach -n /dev/tts/2 bcsp 115200 &
/bluez/bluezmain hciconfig hci0 up
/bluez/sdpd -n &
/bluez/bluezmain sdptool add sp
#my own program
/bluez/rfcomm-server 1
————————————————————
I used “-n” because the uclinux fork call does not behave as normal linux.
The uclinux hangs in hciattach.

I successfully executed this script with the same bluetooth hardware in a Linux 2.6 PC with bluez 2.7.
Everything worked fine.

其中:

1.hcid -n: Don’t fork to run daemon in background.

& 后台执行

bluezmain应该是目录吧,/bluez/bluezmain/hciattach

2.hciattach -n /dev/tts/2 csr 115200 &

-n: Don’t detach from controlling terminal

 /dev/tts/2: This specifies the serial device to attach.(指定连那一个串口)

csr:CSR Casira serial adapter or BrainBoxes serial dongle (BL642)

bcsp: Serial adapters using CSR chips with BCSP serial protocol

3.hciconfig hci0 up

up: Open and initialize HCI device

4.sdptool add sp

Add a service to the local

sp: what service is sp?

funking source code; sp is Serial Port service