Coder Social home page Coder Social logo

ble-java's Introduction

ble-java logo

ble-java is a java library for building BLE GATT peripherals role application in JAVA.

ble-java is based on BlueZ, the Linux Bluetooth stack implemented on D-Bus.

Features

  • Create GATT Services
  • Create GATT Characteristic
  • Customize the Peripheral name
  • JAVA library with minimal JNI interfaces to BlueZ over D-Bus

Dependencies

  1. Java 8 or better
  2. BlueZ 5.43 or better
  3. libunixsocket-java (apt-get install libsocket-java)
  4. d-bus Java library libdbus-java

Raspbian install:

sudo apt-get install libdbus-java

you may also have to do run

sudo ldconfig

Install

Clone the repository and build with Gradle:

./gradlew build

Example

MainExample.java in src/test/java/example demonstrates a sample main that creates a BLE Application with one Service and 2 Characteristics.

Before running the example, copy example.conf to /etc/dbus-1/system.d/

To run from command line: sudo ./gradlew runExample

Press ctrl-c to stop service.

BlueZ compatibility

Tested with BlueZ 5.46 on Raspbian distribution.

ble-java usees the GattManager and LEAdvertising that was marked "Experimental" since 5.47. You need to enable the Experimental features with the --experimental parameter in the BlueZ startup service.

For Raspbian and Ubuntu /lib/systemd/system/bluetooth.service

...
bluetoohd --experimental
...

If you are using BlueZ 5.48, the --experimental tag may not be needed for LEAdvertising features. But we have not tried this yet.

For more info about BlueZ see http://www.bluez.org.

Help

If you need help you can write me an email or you can open a new issue.

ble-java's People

Contributors

sobakasu avatar tongo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.