Skip to content

sputnikdev/bluetooth-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central Build Status Coverage Status Codacy Badge Join the chat at https://gitter.im/sputnikdev/bluetooth-utils

bluetooth-utils

A small library of utility classes to work with Bluetooth Smart objects.

Features:

Bluetooth Uniform Resource Locator (URL).

Bluetooth URL diagram

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:

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. More examples can be found here.


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:

mvn clean install

To cut a new release and upload it to the Maven Central Repository:

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.