Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
added migrated code for BlueZ over DBUS support - not yet working!
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer committed Nov 14, 2017
1 parent 66ca70f commit 5593a4b
Show file tree
Hide file tree
Showing 33 changed files with 1,855 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?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="output" path="target/classes"/>
</classpath>
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# FIXME: please substitute the xx_XX with a proper locale, ie. de_DE
# FIXME: please do not add the file to the repo if you add or change no content
# binding
binding.ble.bluegiga.name = <Your localized Binding name>
binding.ble.bluegiga.description = <Your localized Binding description>

# thing types
thing-type.ble.bluegiga.sample.label = <Your localized Thing label>
thing-type.ble.bluegiga.sample.description = <Your localized Thing description>

# channel types
channel-type.ble.bluegiga.sample-channel.label = <Your localized Channel label>
channel-type.ble.bluegiga.sample-channel.description = <Your localized Channel description>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="bluegiga">
<label>BlueGiga Bluetooth Dongle</label>
<description>Serial interface to the BlueGiga dongle</description>

<config-description>
<parameter name="port" type="text" required="true">
<label>Port</label>
<description>Serial Port</description>
</parameter>
</config-description>
</bridge-type>

</thing:thing-descriptions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: BlueZ Bluetooth Adapter
Bundle-SymbolicName: org.eclipse.smarthome.binding.bluetooth.bluez
Bundle-Vendor: Eclipse.org/SmartHome
Bundle-Version: 0.9.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .
Import-Package: gnu.io,
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.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.freedesktop,
org.freedesktop.dbus,
org.freedesktop.dbus.exceptions,
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>June 5, 2006</p>
<h3>License</h3>

<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>

<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source..=src/main/java/
output..=target/classes
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
ESH-INF/,\
about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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.9.0-SNAPSHOT</version>
</parent>

<artifactId>org.eclipse.smarthome.binding.bluetooth.bluez</artifactId>
<version>0.9.0-SNAPSHOT</version>

<name>Eclipse SmartHome BlueZ Bluetooth Adapter</name>
<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* Copyright (c) 2014-2017 by the respective copyright holders.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.smarthome.binding.bluetooth.bluez;

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 Chris Jackson - Initial contribution and API
*/
public class BlueZAdapterConstants {

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_BLUEZ = new ThingTypeUID(BluetoothBindingConstants.BINDING_ID, "bluez");

public final static String BLUEZ_DBUS_CONFIGURATION = "smarthome.bluetooth.bluez.dbus";
public final static String BLUEZ_DBUS_SERVICE = "org.bluez";
public final static String BLUEZ_DBUS_PATH = "/org/bluez";

public final static String BLUEZ_DBUS_INTERFACE_ADAPTER1 = "org.bluez.Adapter1";
public final static String BLUEZ_DBUS_INTERFACE_DEVICE1 = "org.bluez.Device1";
public final static String BLUEZ_DBUS_INTERFACE_GATTSERVICE1 = "org.bluez.GattService1";
public final static String BLUEZ_DBUS_INTERFACE_GATTCHARACTERISTIC1 = "org.bluez.GattCharacteristic1";
public final static String BLUEZ_DBUS_INTERFACE_GATTDESCRIPTOR1 = "org.bluez.GattDescriptor1";

public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_NAME = "Name";
public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_ALIAS = "Alias";
public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_ADDRESS = "Address";
public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_CLASS = "Class";
public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_UUIDS = "UUIDs";
public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_DISCOVERING = "Discovering";
public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_DISCOVERABLE = "Discoverable";
public final static String BLUEZ_DBUS_ADAPTER_PROPERTY_POWERED = "Powered";

public final static String BLUEZ_DBUS_ADAPTER_FILTER_TRANSPORT = "Transport";
public final static String BLUEZ_DBUS_ADAPTER_FILTER_PATHLOSS = "Pathloss";
public final static String BLUEZ_DBUS_ADAPTER_FILTER_RSSI = "RSSI";
public final static String BLUEZ_DBUS_ADAPTER_FILTER_UUID = "UUIDs";

public final static String BLUEZ_DBUS_ADAPTER_TRANSPORT_LE = "le";
public final static String BLUEZ_DBUS_ADAPTER_TRANSPORT_BREDR = "bredr";
public final static String BLUEZ_DBUS_ADAPTER_TRANSPORT_AUTO = "auto";

public final static String BLUEZ_DBUS_DEVICE_PROPERTY_NAME = "Name";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_ALIAS = "Alias";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_ADDRESS = "Address";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_ADAPTER = "Adapter";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_MANUFACTURER = "ManufacturerData";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_CLASS = "Class";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_CONNECTED = "Connected";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_GATTSERVICES = "GattServices";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_PAIRED = "Paired";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_TRUSTED = "Trusted";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_RSSI = "RSSI";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_UUID = "UUIDs";
public final static String BLUEZ_DBUS_DEVICE_PROPERTY_TXPOWER = "TxPower";

public final static String BLUEZ_DBUS_GATTSERVICE_PROPERTY_DEVICE = "Device";
public final static String BLUEZ_DBUS_GATTSERVICE_PROPERTY_UUID = "UUID";
public final static String BLUEZ_DBUS_GATTSERVICE_PROPERTY_PRIMARY = "Primary";
public final static String BLUEZ_DBUS_GATTSERVICE_PROPERTY_CHARACTERISTICS = "Characteristics";

public final static String BLUEZ_DBUS_GATTCHARACTERISTIC_PROPERTY_VALUE = "Value";
public final static String BLUEZ_DBUS_GATTCHARACTERISTIC_PROPERTY_DESCRIPTORS = "Descriptors";
public final static String BLUEZ_DBUS_GATTCHARACTERISTIC_PROPERTY_FLAGS = "Flags";
public final static String BLUEZ_DBUS_GATTCHARACTERISTIC_PROPERTY_NOTIFYING = "Notifying";
public final static String BLUEZ_DBUS_GATTCHARACTERISTIC_PROPERTY_SERVICE = "Service";
public final static String BLUEZ_DBUS_GATTCHARACTERISTIC_PROPERTY_UUID = "UUID";

public final static String BLUEZ_DBUS_GATTDESCRIPTOR_PROPERTY_UUID = "UUID";
public final static String BLUEZ_DBUS_GATTDESCRIPTOR_PROPERTY_VALUE = "Value";

public final static Object BLUEZ_DBUS_SIGNAL_PROPERTIESCHANGED = "PropertiesChanged";
public final static Object BLUEZ_DBUS_SIGNAL_INTERFACESADDED = "InterfacesAdded";

public static final long bleUuid = 0x800000805f9b34fbL;

}
Loading

0 comments on commit 5593a4b

Please sign in to comment.