Bluetooth 蓝牙广播-主机名vs友好名称vs别名

Bluetooth 蓝牙广播-主机名vs友好名称vs别名,bluetooth,Bluetooth,我的Raspberry Pi配置为蓝牙。我使用hciconfig更改友好名称: $ sudo hciconfig hci0 name "MyTest" $ sudo hciconfig -a hci0 hci0: Type: Primary Bus: UART ... UP RUNNING PSCAN ISCAN Name: 'MyTest' ... 在另一个Ubuntu框中,我扫描附近的设备: $ sudo bluetoothctl # scan on ... [

我的Raspberry Pi配置为蓝牙。我使用hciconfig更改友好名称:

$ sudo hciconfig hci0 name "MyTest"
$ sudo hciconfig -a hci0
hci0:   Type: Primary  Bus: UART
...
UP RUNNING PSCAN ISCAN 
Name: 'MyTest'
...
在另一个Ubuntu框中,我扫描附近的设备:

$ sudo bluetoothctl
# scan on
...
[NEW] Device DC:A6:32:88:A6:12 raspberrypi
[CHG] Device DC:A6:32:88:A6:12 Name: MyTest
[CHG] Device DC:A6:32:88:A6:12 Alias: MyTest

为什么它会显示三个不同的项目?“树莓”这个名字是从哪里来的?Pi也在广播它的主机名吗?尊敬。

首先要提到的是,
hciconfig
已于2017年由BlueZ开发者发布,因此将在未来某个时候从系统中删除

此作业的当前工具是btmgmt(假设您有最新的系统)

/etc/bluetooth/main.conf
中有以下信息:

# Defaults to 'BlueZ X.YZ', if Name is not set here and plugin 'hostname' is not loaded.
# The plugin 'hostname' is loaded by default and overides the Name set here so
# consider modifying /etc/machine-info with variable PRETTY_HOSTNAME=<NewName> instead.
#Name = BlueZ
#如果此处未设置名称且未加载插件“hostname”,则默认为“BlueZ X.YZ”。
#默认情况下加载插件“hostname”,并覆盖此处设置的名称,因此
改为考虑用变量PrTyTyHistNeNe=修改/ETC/Mault信息。
#Name=BlueZ
# Defaults to 'BlueZ X.YZ', if Name is not set here and plugin 'hostname' is not loaded.
# The plugin 'hostname' is loaded by default and overides the Name set here so
# consider modifying /etc/machine-info with variable PRETTY_HOSTNAME=<NewName> instead.
#Name = BlueZ