My Project
|
++_BLE_Serial_README Application for connecting Bluetooth LE devices to COM ports.
Scans for BLE
timeout
- how long should the scan be running for (in seconds) [Default: 5 seconds] devices for timeout
seconds and prints the results.Connects to a BLE device with the given address and queries it for all its services and characteristics.
device_addr
- address of the device that we are trying to connect to (can be obtained with ble_serial ls
)timeout
- maximum time for estabilishing a connection with the device (in seconds) [Default: 5 seconds]Connects to a BLE device and subscribes to the characteristic with the given characteristic_id
and binds it to a COM port and makes a bidirectional tunnel.
Any data written to the bound COM port will be written to the bound BLE characteristic.
After the bound characteristic changes the data will be written to the bound COM port.
device_addr
- address of the device that we are trying to connect to (can be obtained with ble_serial ls
)service_id
- id of the service to be bound to the COM portcharacteristic_id
- id of the service to be bound to the COM portcom_port_number
- number of a com port that will be used for bindingtimeout
- maximum time for estabilishing a connection with the device (in seconds) [Default: 5 seconds]baud
, data
, stop
, parity
- COM port settings (baud rate, data bits, stop bits, parity bits) [Default: 8-N-1]refresh_ms
- every how many milliseconds should the COM port be refreshed [Default: 100 ms]The BLE_Serial can be used also as a C++ library for interfacing with BLE devices and COM ports.
This project uses CMake. You can use git submodules to directly add the project's source tree to your project.
Then you can link against BLE_Serial_Lib
target in your project.
The library documentation can be found here