【问题标题】:How to Launch BlueZ 4.101 GATT Plugin On Ubuntu如何在 Ubuntu 上启动 BlueZ 4.101 GATT 插件
【发布时间】:2017-09-16 23:14:45
【问题描述】:

我不想使用 BlueZ 5,它是 GATT 服务器的新 DBus 接口。我想使用 BlueZ 4.101,它是蓝牙的 gatt-example 插件。在全新安装的 Ubuntu 14.04 上,我下载了一个干净的 BlueZ 4.101 压缩包并将其配置为启用 GATT,然后使用以下命令启动它:

   sudo ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --disable-systemd --enable-experimental --enable-maintainer-moden --enable-gatt --enable-test
   sudo make all
   sudo make install
   sudo hciconfig hci0 up
   sudo hcitool -i hci0 cmd 0x08 0x0008 48 45 4c 4c 4f 57 4f 52 4c 44
   sudo hciconfig hci0 leadv 0
   sudo src/bluetoothd -d -n

但是,当它运行时,它会到达应该加载插件的部分,并打印以下错误“GATT is disabled”:

bluetoothd[30917]: src/plugin.c:plugin_init() Loading plugins /usr/lib/bluetooth/plugins
bluetoothd[30917]: src/plugin.c:add_plugin() Loading external_dummy plugin
bluetoothd[30917]: plugins/service.c:register_interface() path /org/bluez/30917/any
bluetoothd[30917]: plugins/service.c:register_interface() Registered interface org.bluez.Service on path /org/bluez/30917/any
bluetoothd[30917]: DIS cannot start: GATT is disabled
bluetoothd[30917]: Failed to init deviceinfo plugin
bluetoothd[30917]: proximity/main.c:proximity_init() GATT is disabled
bluetoothd[30917]: Failed to init proximity plugin
bluetoothd[30917]: time/main.c:time_init() GATT is disabled
bluetoothd[30917]: Failed to init time plugin
bluetoothd[30917]: alert/main.c:alert_init() GATT is disabled
bluetoothd[30917]: Failed to init alert plugin
bluetoothd[30917]: thermometer/main.c:thermometer_init() GATT is disabled
bluetoothd[30917]: Failed to init thermometer plugin
bluetoothd[30917]: network/manager.c:read_config() Config options: Security=true
bluetoothd[30917]: Parsing /etc/bluetooth/input.conf failed: No such file or directory
bluetoothd[30917]: Parsing /etc/bluetooth/audio.conf failed: No such file or directory
bluetoothd[30917]: plugins/external-dummy.c:dummy_init() 
bluetoothd[30917]: plugins/hciops.c:hciops_init() 
bluetoothd[30917]: plugins/gatt-example.c:gatt_example_init() GATT is disabled
bluetoothd[30917]: Failed to init gatt_example plugin
bluetoothd[30917]: Bluetooth Management interface initialized

如何使用 BlueZ 4.101 成功运行这些插件?谢谢。

【问题讨论】:

    标签: linux ubuntu bluetooth bluetooth-lowenergy bluez


    【解决方案1】:

    想通了……

    sudo vim /etc/bluetooth/main.conf
    

    然后换行:

    # Enable the GATT functionality. Default is false
    EnableGatt = true
    
    # Enable the GATT Attribute Server. Default is false, because it is only
    # useful for testing. Attribute server is not enabled over LE if EnableLE
    # is false.
    AttributeServer = true
    

    【讨论】:

      猜你喜欢
      • 2018-02-27
      • 1970-01-01
      • 2015-11-07
      • 2014-03-07
      • 2019-08-08
      • 2019-02-11
      • 2017-04-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多