|
|
使用RemiPi开发板,使用出厂SDK进行Gatt蓝牙广播开发,使用nRFConnect 手机工具,可以识别广播,开发板出现ACL错误拒绝连接。
下述是使用bluetoothctl工具进行开发的过程:
附件为nRFConnect手机工具截图
root@myir-remi-1g:~# bluetoothctl
Agent registered
[CHG] Controller C8:FE:0F:3D:96:93 Pairable: yes
[bluetooth]# menu advertise
Menu advertise:
Available commands:
-------------------
uuids [uuid1 uuid2 ...] Set/Get advertise uuids
service [uuid] [data=xx xx ...] Set/Get advertise service data
manufacturer [id] [data=xx xx ...] Set/Get advertise manufacturer data
data [type] [data=xx xx ...] Set/Get advertise data
discoverable [on/off] Set/Get advertise discoverable
discoverable-timeout [seconds] Set/Get advertise discoverable timeout
tx-power [on/off] Show/Enable/Disable TX power to be advertised
name [on/off/name] Configure local name to be advertised
appearance [on/off/value] Configure custom appearance to be advertised
duration [seconds] Set/Get advertise duration
timeout [seconds] Set/Get advertise timeout
secondary [1M/2M/Coded] Set/Get advertise secondary channel
clear [uuids/service/manufacturer/config-name...] Clear advertise config
back Return to main menu
version Display version
quit Quit program
exit Quit program
help Display help about this program
export Print environment variables
[bluetooth]# tx-power on
[bluetooth]# name on
[bluetooth]# discoverable on
[bluetooth]# uuids FFF0 FFF1 FFF2
[bluetooth]# back
Menu main:
Available commands:
-------------------
advertise Advertise Options Submenu
scan Scan Options Submenu
gatt Generic Attribute Submenu
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available devices
paired-devices List paired devices
system-alias <name> Set controller alias
reset-alias Reset controller alias
power <on/off> Set controller power
pairable <on/off> Set controller pairable mode
discoverable <on/off> Set controller discoverable mode
discoverable-timeout [value] Set discoverable timeout
agent <on/off/capability> Enable/disable agent with given capability
default-agent Set agent as the default one
advertise <on/off/type> Enable/disable advertising with given type
set-alias <alias> Set device alias
scan <on/off> Scan for devices
info [dev] Device information
pair [dev] Pair with device
cancel-pairing [dev] Cancel pairing with device
trust [dev] Trust device
untrust [dev] Untrust device
block [dev] Block device
unblock [dev] Unblock device
remove <dev> Remove device
connect <dev> Connect device
disconnect [dev] Disconnect device
menu <name> Select submenu
version Display version
quit Quit program
exit Quit program
help Display help about this program
export Print environment variables
[bluetooth]# show
Controller C8:FE:0F:3D:96:93 (public)
Name: myir-remi-1g
Alias: RemiPi
Class: 0x00000000
Powered: yes
Discoverable: no
DiscoverableTimeout: 0x000000b4
Pairable: yes
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1D6Bp0246d0537
Discovering: no
Roles: central
Roles: peripheral
Advertising Features:
ActiveInstances: 0x00 (0)
SupportedInstances: 0x04 (4)
SupportedIncludes: tx-power
SupportedIncludes: appearance
SupportedIncludes: local-name
SupportedSecondaryChannels: 1M
SupportedSecondaryChannels: 2M
SupportedSecondaryChannels: Coded
[bluetooth]# advertise on
[bluetooth]# [10104.508902] Bluetooth: hu 00000000be1bddd7 retransmitting 1 pkts
[CHG] Controller C8:FE:0F:3D:96:93 SupportedInstances: 0x03 (3)
[CHG] Controller C8:FE:0F:3D:96:93 ActiveInstances: 0x01 (1)
Advertising object registered
UUID: (FFF0)
UUID: (FFF1)
UUID: (FFF2)
Tx Power: on
Name: on
Appearance: off
Discoverable: on
[bluetooth]# [10172.677047] Bluetooth: hci0: ACL packet for unknown connection handle 24
[10172.797047] rtk_btcoex: disconn cmpl evt: status 0x00, handle 0018, reason 0x13
[10172.804587] rtk_btcoex: process disconn complete event.
[10172.809975] rtk_btcoex: hci conn handle 0x0018 not found
[10199.676652] Bluetooth: hci0: ACL packet for unknown connection handle 24
[10199.917078] rtk_btcoex: disconn cmpl evt: status 0x00, handle 0018, reason 0x13
[10199.925174] rtk_btcoex: process disconn complete event.
[10199.933463] rtk_btcoex: hci conn handle 0x0018 not found
|
-
|