Using Bluetooth low energy in linux command line
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
Bluetooth Low Energy: listening for notifications/indications in linux
Try this...
Run gatttool -b <MAC Address> --interactive
like you did before. You'll get a prompt and then you type connect
. You should see a CON
in the prompt indicating that you've connected to the device. Then type char-read-uuid 2902
. You should get a list of all CCC (Client Characteristic Configuration) attributes on the device. You can try setting them all to 0100 to get notifications, 0200 for indications, 0300 for both, or 0000 for everything off. Type help
to see all the commands and their arguments.
EDIT:
The use of the --listen
argument requires you to couple it with other commands to turn on the notifications and/or indications. So here's an example that works in Bluez 4.101:
gatttool -b <MAC Address> --char-write-req --handle=0x0031 --value=0100 --listen
Obviously you need to change the handle to the handle of the CCC that you want to turn on notifications for. However, I still find it way easier to just use the interactive mode.
Related Topics
Reading Memory Pointed by Register with Gdb
How to Compare 3 Files Together (To See What Is in Common Between Them)
How to Lock The Cursor to The Inside of a Window on Linux
Add Timestamp to Cat Output from Shell Script
Trouble with Installing Nloptr by Locally on Ubuntu
How to Add More Algorithm in Cryptoapi in Linux
Correct Way to Export Multiple Ld_Library_Paths
How to Get a Hex Color Code from a Solid-Color Image for a Script
How to Test If a Directory Is Empty with Find
Shared Libraries (Dlopen) and Thread-Safety of Library Static Pointers
How to Store Data Permanently in /Tmp Directory in Linux
Bluetooth Low-Energy on Linux API
Incomplete Lsb Comment. Insserv: Missing Valid Name for 'Provides:' Please Add
Update .Bashrc from Provisioning Shell Script with Vagrant
Get Access to Usb Device on Linux (Libusb-1.0)
App Engine Ignores Symlinks to Directories
Docker Container Started in Detached Mode Stopped After Process Execution