This project is a fork of the libble.git project. If you have that one already cloned locally, you can use
git clone --reference /path/to/your/libble.git/incarnation mirror_URL
to save bandwidth during cloning.
 
descriptionBLE comm lib, to connect with libsigrok
ownergerhard.sittig@gmx.net
last changeSun, 20 Oct 2019 10:01:43 +0000 (20 12:01 +0200)
content tags
add:
README.md

Deprecation notice

The libble project's features have moved into the libsigrok library on 2019-06-04. This version here is out of maintenance.

libble, a BLE communication helper library

This library supports serial communication over Bluetooth, especially to measurement devices which use Bluetooth Low Energy. The intention is to integrate the library with the sigrok project, similar to the libserialport library.

The implementation of the library started from the GPLv3 licensed mrnuke's experiment and got modified to support more platforms in the future.

The library implements an RFCOMM client which can connect to an RFCOMM server, as well as a BLE central which can connect to BLE peripherals.

Current status

Build the library

There's nothing fancy to it, straight cmake approach, like so:

$ mkdir build; cd build; cmake ..
$ [ cmake -DCMAKE_INSTALL_PREFIX=$HOME .; ccmake . ]
$ make
$ [ make install ]

Example use

See the builtin help

$ ./ble-test -h

Select device address, see raw bytes in text and binary format

$ ADDR=88:6B:12:34:56:78
$ ./ble-test -m $ADDR -r 8 -c 9 -C 0x0003
$ ./ble-test -m $ADDR
$ ./ble-test -m $ADDR -b | hexdump -Cv

Feed a COM port

This example assumes a loopback between two COM ports. Notice that COM port loopback becomes obsolete when libsigrok grows native libble support.

$ COM_FEED=/dev/ttyUSB1; COM_READ=/dev/ttyUSB0
$ ( exec > $COM_FEED; exec < $COM_FEED; stty 115200; ./ble-test -m $ADDR -b ) &
$ sigrok-cli -d eevblog-121gw:conn=$COM_READ --scan
$ sigrok-cli -d eevblog-121gw:conn=$COM_READ --samples 100

Scan for BT devices

$ ./ble-test -s 8

Notice that LE scan may require priviledges, depending on the internal implementation and/or the availability of external components (and their versions).

Communicate to an RFCOMM server

$ SRV_ADDR=11:22:33:44:55:66
$ [ ./rfcomm-test & ]
$ ./ble-test -m $SRV_ADDR -R 1 -d 100
$ [ kill $! ]

Known issues, TODO items

shortlog
2019-10-20 Gerhard Sittigdoc: update README, libble is unmaintained, has moved... master
2019-01-27 Gerhard Sittigadd license headers to source files and build rules
2019-01-27 Gerhard Sittigcomment nits, text folds
2019-01-27 Gerhard Sittigdoc: some proper terminology in overview, DBus scan...
2019-01-27 Gerhard Sittiglib: use more 'const' qualifiers in the API of write...
2019-01-01 Gerhard Sittigmain, lib: fixup "write vs init" handle/value confusion
2018-12-30 Gerhard Sittigbuild: only install pkgconfig file for UNIX builds
2018-12-30 Gerhard Sittiglib: make version and system information available...
2018-12-28 Gerhard Sittigdoc: switch README to markdown syntax, create HTML...
2018-12-28 Gerhard Sittigdoc: move "NOTES" to "README" document for improved...
2018-12-28 Gerhard Sittiglib: move log support into separate library source...
2018-12-28 Gerhard Sittigbuild: nits, comments in cmake rules
2018-12-27 Gerhard Sittigbuild: create and install a pkgconfig file for the...
2018-12-27 Gerhard Sittigmain: adjust for config calls, fixup read delay initial...
2018-12-27 Gerhard Sittiglib: separate config routines (mechanical change)
2018-12-26 Gerhard Sittigmain: nit, make scan/rfcomm/notify strict alternatives...
...
heads
4 years ago master
7 years ago devel