Reputation: 1
I am using my raspberry pi to perform LEScan at fixed intervals and connect to new found BLE devices. Performing a general scan is easy and can be easily done by using the bluez libraries. http://people.csail.mit.edu/albert/bluez-intro/x45.html
But i can't figure out how to perform LE scan using Bluetooth programming in C language.
I have to find new BLE devices, connect to them and receive json data from the connected devices.
Upvotes: 0
Views: 5642
Reputation: 3222
To write a C program to scan BLE devices you can have a look at BlueZ hcitool
sources.
To connect to the BLE device and interact with the GATT protocol you can either use the experimental DBUS Bluez API in Bluez v5.x (recommended to use v5.39+) or use a library like 'gattlib'.
Upvotes: 1
Reputation: 180
The link you are pointing is for classic bluetooth;for BLE lescan go
through scantest.c in link
https://github.com/carsonmcdonald/bluez-experiments/tree/master/experiments
Upvotes: 0