Using Bluetooth low energy in linux command line

匿名 (未验证) 提交于 2019-12-03 01:10:02

问题:

I am working on using the Bluetooth low energy modem with Linux. I am using the command line option for that i.e. hcitool . I am able to the find the devices using the command: $ hcitool scan

It is working fine for me, also I am able to broadcast my device using :

 sudo hciconfig hci0 leadv 

It is also working fine. But I want to add the services and characteristic to the modem device which can be detected by other device. I have tried sdptool add but it is not working for me. Does anyone know how to add the services and characteristics to the peripheral using the command line tools in ubuntu?

Edit: My modem is broadcasting but not able to explore the services and characteristic to the other BLE device. Now I am able to set the name of device using hcio name command

Edit: Now I am able to render the services and characteristic, by simultaneously running sudo hcidump command. But I am not able to track from where I am getting those services and characteristics. One definite observation is those services are rendering from the machine.

回答1:

SDP is absent in BLE. Broadcast/advertise frame and GATT client/server are used instead.

Several links:



回答2:

I used to broadcast BT services by following this article. This page not only shouws you how to advertise a profile, but also gives you an example on how to implement the HSP profile.

To know the bt class you need to announce, you can check this other page.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!