22 Control UART BLE
- 2014-08-07, rayoslee, release V0.0.1
How to port bluetooth kernel stack in S605-32 ?
- S605-32 bases on 184.108.40.206, it can not support BLE’s gatttool. So we would like to port 2.6.39’s bluetooth kernel stack.
- Luckly, you only focus on three folder sources, net/bluetooth, include/net/bluetooth, drivers/bluetooth
- In kernel config, you need select (for Quintic and CSR BLE uart module)
- L2CAP protocol support in Bluetooth subsystem support
- HCI UART driver > UART (H4) protocol support in Bluetooth device drivers
- HCI UART driver > BCSP protocol support in Bluetooth device drivers
- HCI UART driver > HCILL protocol support in Bluetooth device drivers
- HCI VHCI (Virtual HCI device) driver in Bluetooth device drivers
How to build BlueZ for S605-32 ?
- Refer to Chapter 17 BlueZ user guide.
How to communicate with BLE sensor ?
- We choose Quintic 9021(9020B1) uart single mode as our BLE Master, but it only can connect Slave but not get gatt’s attribute. So, we use CSR 8811 or 8311 uart dual mode as our BLE Master. We can get BLE sensor (TI CC2541 KeyFob) gatt’s details at http://processors.wiki.ti.com/index.php/Category:KeyFobDemo
- For Quintic’s commands, refer to BlueZ user guide.
For CSR’s commands as the following. (Details as 20140731193012.putty)
/mnt/nand1-1 # bccmd -t BCSP -d /dev/ttyS0 psload -r pb-109-csr8x11-rev16.psr /mnt/nand1-1 # hciattach /dev/ttyS0 bcsp 115200 noflow /mnt/nand1-1 # hciconfig hci0 up /mnt/nand1-1 # hciconfig /mnt/nand1-1 # hcitool -i hci0 lescan /mnt/nand1-1 # gatttool -i hci0 -b 78:C5:E5:6E:53:B2 -I /mnt/nand1-1 # gatttool -i hci0 -b 78:C5:E5:6E:53:B2 --primary /mnt/nand1-1 # gatttool -i hci1 -b 78:C5:E5:6E:53:B2 --char-write-req -a 0x0048 -n 01:00 --listen 78:C5:E5:6E:53:B2 is just TI CC2541 KeyFob.
Copy SD1-1 to your SD card for test