Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Bluetooth low energy in linux command line

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.

like image 244
V-Xtreme Avatar asked Jul 24 '13 13:07

V-Xtreme


People also ask

What is Hcitool Linux?

DESCRIPTION. hcitool is used to configure Bluetooth connections and send some special command to Bluetooth devices. If no command is given, or if the option -h is used, hcitool prints some usage information and exits.

What is Bluetooth Low Energy mode?

Bluetooth Low Energy is a power-conserving variant of Bluetooth personal area network (PAN) technology, designed for use by Internet-connected machines and appliances. Also marketed as Bluetooth Smart, Bluetooth LE was introduced in the Bluetooth 4.0 specification as an alternative to Bluetooth Classic.


1 Answers

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

Several links:

  • BlueZ gatttool: command line tool to run common GATT procedures
  • BlueZ GATT's ready profiles
  • hint: DBUS
  • GATT and DBUS example
  • How can I connect to the FitBit Zip over Bluetooth 4.0 LE on Linux with bluez?
  • Bluetooth Low Energy: listening for notifications/indications in linux
  • http://comments.gmane.org/gmane.linux.bluez.kernel/29547
like image 180
nopsoft Avatar answered Sep 19 '22 16:09

nopsoft