28

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.

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72
V-Xtreme
  • 7,230
  • 9
  • 39
  • 79
  • 3
    I'm not sure if there's anything in Bluez to simulate a GATT server. (I tried looking in the past and couldn't find one) SDP is regular non-LE bluetooth, so it's not there. – Tim Tisdall Jul 25 '13 at 13:25

2 Answers2

41

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

Several links:

Community
  • 1
  • 1
nopsoft
  • 922
  • 7
  • 10
  • Minimal introduction: http://www.imd.uni-rostock.de/ma/gol/lectures/embedded/Literatur/Low%20Energy%20Training.pdf http://chapters.comsoc.org/vancouver/BTLER3.pdf http://www.glynstore.com/content/docs/bluegiga/BLE_getting_started.pdf Remember to distinguish Bluetooth classic, single mode (Bluetooth Smart, ie. LE) and dual mode (Smart Ready) devices. – nopsoft Oct 29 '13 at 07:28
  • one more related: http://i-miss-erin.blogspot.com/2010/12/gatt-related-dbus-api.html and http://i-miss-erin.blogspot.com/2010/12/gatttool-in-bluez-over-bredr.html – nopsoft May 29 '14 at 14:47
  • GATT definitions: https://developer.bluetooth.org/gatt/Pages/default.aspx To track characteristic you have to turn on notify or indication flag in Characteristic Configuration if allowed. http://stackoverflow.com/questions/15657007/bluetooth-low-energy-listening-for-notifications-indications-in-linux – nopsoft May 29 '14 at 14:53
  • Let's note that 2 bytes of the characteristic are swapped (Big/Little Endian issue). – nopsoft May 29 '14 at 15:01
-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.

Ottavio Campana
  • 4,088
  • 5
  • 31
  • 58
  • 2
    I think all of that applies only to standard bluetooth, not LE. – Tim Tisdall Aug 02 '13 at 17:06
  • 1
    This does not work with Bluetooth Low Energy, it is for standard Bluetooth, as Tim said. SDP and all that is implemented as GATT in BLE. – Zimano Sep 28 '15 at 10:45