This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial contribution of the generic Bluetooth binding with BlueZ support
Also-By: Chris Jackson <chris@cd-jackson.com> Signed-off-by: Kai Kreuzer <kai@openhab.org>
- Loading branch information
1 parent
da57eda
commit d006f91
Showing
60 changed files
with
6,341 additions
and
2 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/.classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src/main/java"/> | ||
<classpathentry kind="lib" path="lib/tinyb-0.5.1.jar"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
33 changes: 33 additions & 0 deletions
33
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.smarthome.binding.bluetooth.bluez</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ds.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
27 changes: 27 additions & 0 deletions
27
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/ESH-INF/thing/bluez.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<thing:thing-descriptions bindingId="bluetooth" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<bridge-type id="bluez"> | ||
<label>Bluetooth BlueZ Adapter</label> | ||
<description>Linux built-in Bluetooth support</description> | ||
|
||
<representation-property>address</representation-property> | ||
|
||
<config-description> | ||
<parameter name="address" type="text" required="true"> | ||
<label>Address</label> | ||
<description>The Bluetooth address of the adapter in format XX:XX:XX:XX:XX:XX</description> | ||
</parameter> | ||
<parameter name="discovery" type="boolean"> | ||
<label>Device Discovery</label> | ||
<description>Whether this adapter actively participates in Bluetooth device discovery</description> | ||
<advanced>true</advanced> | ||
<default>true</default> | ||
</parameter> | ||
</config-description> | ||
|
||
</bridge-type> | ||
|
||
</thing:thing-descriptions> |
34 changes: 34 additions & 0 deletions
34
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: BlueZ Bluetooth Adapter | ||
Bundle-SymbolicName: org.eclipse.smarthome.binding.bluetooth.bluez;singleton:=true | ||
Bundle-Vendor: Eclipse.org/SmartHome | ||
Bundle-Version: 0.10.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Bundle-ClassPath: ., | ||
lib/tinyb-0.5.1.jar | ||
Bundle-NativeCode: | ||
lib/armv6hf/libjavatinyb.so;lib/armv6hf/libtinyb.so;processor=arm;osname=linux, | ||
* | ||
Import-Package: org.eclipse.jdt.annotation;resolution:=optional, | ||
org.eclipse.smarthome.binding.bluetooth, | ||
org.eclipse.smarthome.binding.bluetooth.bluez, | ||
org.eclipse.smarthome.binding.bluetooth.bluez.handler, | ||
org.eclipse.smarthome.binding.bluetooth.discovery, | ||
org.eclipse.smarthome.binding.bluetooth.notification, | ||
org.eclipse.smarthome.config.core, | ||
org.eclipse.smarthome.config.discovery, | ||
org.eclipse.smarthome.core.common, | ||
org.eclipse.smarthome.core.common.registry, | ||
org.eclipse.smarthome.core.library.types, | ||
org.eclipse.smarthome.core.thing, | ||
org.eclipse.smarthome.core.thing.binding, | ||
org.eclipse.smarthome.core.thing.binding.builder, | ||
org.eclipse.smarthome.core.thing.type, | ||
org.eclipse.smarthome.core.types, | ||
org.osgi.framework, | ||
org.slf4j | ||
Service-Component: OSGI-INF/*.xml | ||
Export-Package: org.eclipse.smarthome.binding.bluetooth.bluez, | ||
org.eclipse.smarthome.binding.bluetooth.bluez.handler | ||
Bundle-ActivationPolicy: lazy |
52 changes: 52 additions & 0 deletions
52
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/NOTICE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
This content is produced and maintained by the Eclipse SmartHome project. | ||
|
||
* Project home: https://eclipse.org/smarthome/ | ||
|
||
== Declared Project Licenses | ||
|
||
This program and the accompanying materials are made available under the terms | ||
of the Eclipse Public License 2.0 which is available at | ||
https://www.eclipse.org/legal/epl-2.0/. | ||
|
||
== Source Code | ||
|
||
https://github.com/eclipse/smarthome | ||
|
||
== Copyright Holders | ||
|
||
See the NOTICE file distributed with the source code at | ||
https://github.com/eclipse/smarthome/blob/master/NOTICE | ||
for detailed information regarding copyright ownership. | ||
|
||
== Third-party Content | ||
|
||
TinyB Version: 0.5.1 | ||
* License: MIT License | ||
* Project: https://github.com/intel-iot-devkit/tinyb | ||
* Source: https://github.com/intel-iot-devkit/tinyb/tree/v0.5.1 | ||
|
||
== Third-party license(s) | ||
|
||
=== MIT License | ||
|
||
The MIT License (MIT) | ||
Copyright © 2015-2016 Intel Corporation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
1 change: 1 addition & 0 deletions
1
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/OSGI-INF/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/*.xml |
29 changes: 29 additions & 0 deletions
29
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Bluetooth BlueZ Adapter | ||
|
||
This extension supports Bluetooth access via BlueZ on Linux (ARMv6hf). | ||
|
||
## Supported Things | ||
|
||
It defines the following bridge type: | ||
|
||
| Bridge Type ID | Description | | ||
|----------------|---------------------------------------------------------------------------| | ||
| bluez | A Bluetooth adapter that is supported by BlueZ | | ||
|
||
|
||
## Discovery | ||
|
||
If BlueZ is enabled and can be accessed, all available adapters are automatically discovered. | ||
|
||
## Bridge Configuration | ||
|
||
The bluez bridge requires the configuration parameter `address`, which corresponds to the Bluetooth address of the adapter (in format "XX:XX:XX:XX:XX:XX"). | ||
Additionally, the parameter `discovery` can be set to true/false.When set to true, any Bluetooth device of which broadcasts are received is added to the Inbox. | ||
|
||
## Example | ||
|
||
This is how an BlueZ adapter can be configured textually in a *.things file: | ||
|
||
``` | ||
Bridge bluetooth:bluez:hci0 [ address="12:34:56:78:90:AB", discovery=false ] | ||
``` |
8 changes: 8 additions & 0 deletions
8
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
source..=src/main/java/ | ||
output..=target/classes | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/,\ | ||
ESH-INF/,\ | ||
NOTICE,\ | ||
lib/ |
Binary file added
BIN
+473 KB
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/lib/armv6hf/libjavatinyb.so
Binary file not shown.
Binary file added
BIN
+1.16 MB
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/lib/armv6hf/libtinyb.so
Binary file not shown.
Binary file added
BIN
+14.8 KB
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/lib/tinyb-0.5.1.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluez/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.smarthome.binding</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>0.10.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.eclipse.smarthome.binding.bluetooth.bluez</artifactId> | ||
|
||
<name>Eclipse SmartHome BlueZ Bluetooth Adapter</name> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
</project> |
35 changes: 35 additions & 0 deletions
35
...ez/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluez/BlueZAdapterConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright (c) 2014,2018 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.smarthome.binding.bluetooth.bluez; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.smarthome.binding.bluetooth.BluetoothBindingConstants; | ||
import org.eclipse.smarthome.core.thing.ThingTypeUID; | ||
|
||
/** | ||
* The {@link BlueZAdapterConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Kai Kreuzer - Initial contribution and API | ||
*/ | ||
@NonNullByDefault | ||
public class BlueZAdapterConstants { | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID THING_TYPE_BLUEZ = new ThingTypeUID(BluetoothBindingConstants.BINDING_ID, "bluez"); | ||
|
||
// Properties | ||
public static final String PROPERTY_ADDRESS = "address"; | ||
public static final String PROPERTY_DISCOVERY = "discovery"; | ||
|
||
} |
Oops, something went wrong.