#RTL8723DS蓝牙测试
#开启蓝牙电源
killall rtk_hciattach || killall dbus-daemon || killall bluetoothd || \
echo 0 > /sys/class/rfkill/rfkill0/state && sleep 1 && \
echo 1 > /sys/class/rfkill/rfkill0/state && sleep 1 && \
(rtk_hciattach -n -s 115200 /dev/ttyAS1 rtk_h5 &) && sleep 1 && \
(mkdir -p /var/run/dbus/ && dbus-daemon --system &) && sleep 1 && \
(bluetoothd -n &) && sleep 1 && \
hciconfig hci0 up && hcitool lescan
bt_test -p gatt-server
手机测试软件是 nRF Connect:
离线
root@TinaLinux:/#
root@TinaLinux:/# bt_test -p gatt-server
root@TinaLinux:/# [ACT D][ring_buff_init,27]enter
[ACT D][ring_buff_start,173]ring buffer start enter
[ACT D][ring_buff_start,187]ring buffer start quit
[ACT D][ring_buff_init,27]enter
[ACT D][ring_buff_start,173]ring buffer start enter
[ACT D][ring_buff_start,187]ring buffer start quit
Bluetooth init has been completed!!
[ 676.659974] Bluetooth: hu 9e07aaa3 retransmitting 1 pkts
add service,uuid:1112
add service handle: 11, handle max number: 10
add char,uuid: 2223,chr handle is 0x000d
desc handle is 0x000e
add char,uuid: 3334,chr handle is 0x0010
desc handle is 0x0011
add char,uuid: 5555,chr handle is 0x0013
add service,uuid:6e400001-b5a3-f393-e0a9-e50e24dcca9e
add service handle: 21, handle max number: 10
add char,uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e,chr handle is 0x0017
add char,uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e,chr handle is 0x0019
desc handle is 0x001a
1970-01-01 06:05:15:147: BTMG[bt_le_set_advertising_params:150]: advertising channel map: 0x7
1970-01-01 06:05:15:150: BTMG[bt_le_set_random_address:297]: *************************************************
1970-01-01 06:05:15:150: BTMG[bt_le_set_random_address:298]: [RandomAddress 3F:17:7F:BB:A1:6D ]
1970-01-01 06:05:15:150: BTMG[bt_le_set_random_address:299]: *************************************************
1970-01-01 06:05:15:150: BTMG[le_set_adv_data:262]: ble name = [aw-ble-test-007]
1970-01-01 06:05:15:153: BTMG[bt_le_advertising_enable:341]: set adv enable:1
1970-01-01 06:06:08:110: BTMG[l2cap_le_att_accept:127]: Connect from 5E:B0:64:18:CB:5E
1970-01-01 06:06:08:111: BTMG[server_listen_cb:182]: gatt connected
gatt server Connected: 5E:B0:64:18:CB:5E.
1970-01-01 06:06:33:460: BTMG[bt_test_gatt_char_write_request_cb:158]: write need rsp: 1
1970-01-01 06:06:33:460: BTMG[bt_test_gatt_char_write_request_cb:160]: attr_handle: 0x0017, tran_id: 1, len: 10
30 31 32 33 34 35 36 37 38 39
enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# 1970-01-01 06:07:18:260: BTMG[bt_test_gatt_char_write_request_cb:158]: write need rsp: 1
1970-01-01 06:07:18:260: BTMG[bt_test_gatt_char_write_request_cb:160]: attr_handle: 0x0017, tran_id: 2, len: 10
30 31 32 33 34 35 36 37 38 39
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# 1970-01-01 06:08:17:539: BTMG[bt_test_gatt_char_write_request_cb:158]: write need rsp: 0
1970-01-01 06:08:17:539: BTMG[bt_test_gatt_char_write_request_cb:160]: attr_handle: 0x0017, tran_id: 25, len: 396
30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37
38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35
36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34
35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32
33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30
31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38
39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36
37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35
35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33
34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31
32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39
30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37
38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35
36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34
35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32
33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39 30
31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36 37 38
39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35 35 36
37 38 39 30 31 32 33 34 35 35 36 37 38 39 30 31 32 33 34 35
35 36 37 38 39 30 31 32 33 34 35 35 36 37 38 39
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
enter
desc_write->need_rsp: 1
desc_write->attr_handle: 0x001a
send write response success!
离线