https://github.com/sputnikdev/bluetooth-utils
Bluetooth Smart utilities
https://github.com/sputnikdev/bluetooth-utils
Last synced: 3 days ago
JSON representation
Bluetooth Smart utilities
- Host: GitHub
- URL: https://github.com/sputnikdev/bluetooth-utils
- Owner: sputnikdev
- License: apache-2.0
- Created: 2017-03-02T07:12:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-02T08:45:32.000Z (over 5 years ago)
- Last Synced: 2025-07-28T04:41:04.543Z (6 months ago)
- Language: Java
- Size: 186 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://mvnrepository.com/artifact/org.sputnikdev/bluetooth-utils)
[](https://travis-ci.org/sputnikdev/bluetooth-utils)
[](https://coveralls.io/github/sputnikdev/bluetooth-utils?branch=master)
[](https://www.codacy.com/app/vkolotov/bluetooth-utils?utm_source=github.com&utm_medium=referral&utm_content=sputnikdev/bluetooth-utils&utm_campaign=Badge_Grade)
[](https://gitter.im/sputnikdev/bluetooth-utils?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# bluetooth-utils
A small library of utility classes to work with Bluetooth Smart objects.
**Features:**
_Bluetooth Uniform Resource Locator (URL)._

A utility class that represents a Uniform Resource Locator for bluetooth resources,
e.g. bluetooth adapters, bluetooth devices, GATT services, GATT characteristics and GATT fields.
For example, if you have an adapter with MAC address B8:27:EB:60:0C:43, a device with MAC address 54:60:09:95:86:01
which is connected to the adapter, the device has a GATT service with UUID 0000180f-0000-1000-8000-00805f9b34fb,
the service has a characteristic with UUID 00002a19-0000-1000-8000-00805f9b34fb and the characteristic has a field
called "Level", then a URL for the field can be:
```
/B8:27:EB:60:0C:43/54:60:09:95:86:01/0000180f-0000-1000-8000-00805f9b34fb/00002a19-0000-1000-8000-00805f9b34fb/Level
```
Or a URL for the service can be:
```
/B8:27:EB:60:0C:43/54:60:09:95:86:01/0000180f-0000-1000-8000-00805f9b34fb
```
Similarly, it is easy to define a URL for other components, e.g. adapters, devices and characteristics.
If there are more than one protocol used to access Bluetooth devices (e.g. DBus, serial interface etc),
then it is possible to define protocol as well:
```
tinyb://B8:27:EB:60:0C:43/54:60:09:95:86:01/0000180f-0000-1000-8000-00805f9b34fb/00002a19-0000-1000-8000-00805f9b34fb/Level
```
A simple usage would be:
```java
URL url = new URL("/54:60:09:95:86:01/11:22:33:44:55:66/0000180f-0000-1000-8000-00805f9b34fb/00002a19-0000-1000-8000-00805f9b34fb/Level");
```
The class is reasonable documented, check its [javadoc](src/main/java/org/sputnikdev/bluetooth/URL.java).
More examples can be found [here](src/test/java/org/sputnikdev/bluetooth/URLTest.java).
---
## Contribution
You are welcome to contribute to the project, the project environment is designed to make it easy by using:
* Travis CI to release artifacts directly to the Maven Central repository.
* Code style rules to support clarity and supportability. The results can be seen in the Codacy.
* Code coverage reports in the Coveralls to maintain sustainability. 100% of code coverage with unittests is the target.
The build process is streamlined by using standard maven tools.
To build the project with maven:
```bash
mvn clean install
```
To cut a new release and upload it to the Maven Central Repository:
```bash
mvn release:prepare -B
mvn release:perform
```
Travis CI process will take care of everything, you will find a new artifact in the Maven Central repository when the release process finishes successfully.