]> git.basschouten.com Git - openhab-addons.git/commitdiff
[bluetooth] Switch to fork of gatt parser library in order to fix incompatibility...
authorKai Kreuzer <kai@openhab.org>
Tue, 19 Jul 2022 15:58:25 +0000 (17:58 +0200)
committerGitHub <noreply@github.com>
Tue, 19 Jul 2022 15:58:25 +0000 (17:58 +0200)
* Switch to fork of gatt parser library in order to fix incompatibility with xstream
* Add SAT suppressions
* Add gson dependency

Signed-off-by: Kai Kreuzer <kai@openhab.org>
bundles/org.openhab.binding.bluetooth.generic/pom.xml
bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/BluetoothChannelUtils.java
bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/CharacteristicChannelTypeProvider.java
bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/GenericBluetoothHandler.java
bundles/org.openhab.binding.bluetooth.generic/suppressions.xml [new file with mode: 0644]

index c3ed3d8ffafca90ab3beabe61bdf7efbffb62deb..d1a63d06d487054dea678cb8b016440cd567cc83 100644 (file)
@@ -22,9 +22,9 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>org.sputnikdev</groupId>
+      <groupId>org.openhab</groupId>
       <artifactId>bluetooth-gatt-parser</artifactId>
-      <version>1.9.4</version>
+      <version>2.0.0</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <version>1.9.4</version>
       <scope>compile</scope>
     </dependency>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+      <version>2.9.0</version>
+    </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.openhab.tools.sat</groupId>
+        <artifactId>sat-plugin</artifactId>
+        <configuration>
+          <spotbugsExclude>${project.basedir}/suppressions.xml</spotbugsExclude>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
 </project>
index 81a0fe031f861f56e39eeff8e89a761cc8ccd9cf..3178c5e18e32525434f2dc4fdee78348887c2442 100644 (file)
@@ -22,6 +22,13 @@ import java.util.stream.Collectors;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
+import org.openhab.bluetooth.gattparser.BluetoothGattParser;
+import org.openhab.bluetooth.gattparser.FieldHolder;
+import org.openhab.bluetooth.gattparser.GattRequest;
+import org.openhab.bluetooth.gattparser.spec.Enumeration;
+import org.openhab.bluetooth.gattparser.spec.Field;
+import org.openhab.bluetooth.gattparser.spec.FieldFormat;
+import org.openhab.bluetooth.gattparser.spec.FieldType;
 import org.openhab.core.library.types.DecimalType;
 import org.openhab.core.library.types.OnOffType;
 import org.openhab.core.library.types.StringType;
@@ -29,13 +36,6 @@ import org.openhab.core.types.State;
 import org.openhab.core.types.UnDefType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.sputnikdev.bluetooth.gattparser.BluetoothGattParser;
-import org.sputnikdev.bluetooth.gattparser.FieldHolder;
-import org.sputnikdev.bluetooth.gattparser.GattRequest;
-import org.sputnikdev.bluetooth.gattparser.spec.Enumeration;
-import org.sputnikdev.bluetooth.gattparser.spec.Field;
-import org.sputnikdev.bluetooth.gattparser.spec.FieldFormat;
-import org.sputnikdev.bluetooth.gattparser.spec.FieldType;
 
 /**
  * The {@link BluetoothChannelUtils} contains utility functions used by the GattChannelHandler
index 1e759fbb832330fb3d31d848ad0a5e9316e8ffc5..52a80c50478df09e3b381e2bf6a3c78150695c59 100644 (file)
@@ -25,6 +25,10 @@ import java.util.stream.Collectors;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.binding.bluetooth.BluetoothBindingConstants;
+import org.openhab.bluetooth.gattparser.BluetoothGattParser;
+import org.openhab.bluetooth.gattparser.BluetoothGattParserFactory;
+import org.openhab.bluetooth.gattparser.spec.Enumerations;
+import org.openhab.bluetooth.gattparser.spec.Field;
 import org.openhab.core.thing.type.ChannelType;
 import org.openhab.core.thing.type.ChannelTypeBuilder;
 import org.openhab.core.thing.type.ChannelTypeProvider;
@@ -34,10 +38,6 @@ import org.openhab.core.types.StateOption;
 import org.osgi.service.component.annotations.Component;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.sputnikdev.bluetooth.gattparser.BluetoothGattParser;
-import org.sputnikdev.bluetooth.gattparser.BluetoothGattParserFactory;
-import org.sputnikdev.bluetooth.gattparser.spec.Enumerations;
-import org.sputnikdev.bluetooth.gattparser.spec.Field;
 
 /**
  * {@link CharacteristicChannelTypeProvider} that provides channel types for dynamically discovered characteristics.
index 04699db05e17d0aa5b490e835e369d4e7897273b..c68f01b755449f8867c3f2058149b641e2490549 100644 (file)
@@ -29,6 +29,13 @@ import org.openhab.binding.bluetooth.BluetoothBindingConstants;
 import org.openhab.binding.bluetooth.BluetoothCharacteristic;
 import org.openhab.binding.bluetooth.BluetoothDevice.ConnectionState;
 import org.openhab.binding.bluetooth.ConnectedBluetoothHandler;
+import org.openhab.bluetooth.gattparser.BluetoothGattParser;
+import org.openhab.bluetooth.gattparser.BluetoothGattParserFactory;
+import org.openhab.bluetooth.gattparser.FieldHolder;
+import org.openhab.bluetooth.gattparser.GattRequest;
+import org.openhab.bluetooth.gattparser.GattResponse;
+import org.openhab.bluetooth.gattparser.spec.Characteristic;
+import org.openhab.bluetooth.gattparser.spec.Field;
 import org.openhab.core.library.types.StringType;
 import org.openhab.core.thing.Channel;
 import org.openhab.core.thing.ChannelUID;
@@ -44,13 +51,6 @@ import org.openhab.core.types.State;
 import org.openhab.core.util.HexUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.sputnikdev.bluetooth.gattparser.BluetoothGattParser;
-import org.sputnikdev.bluetooth.gattparser.BluetoothGattParserFactory;
-import org.sputnikdev.bluetooth.gattparser.FieldHolder;
-import org.sputnikdev.bluetooth.gattparser.GattRequest;
-import org.sputnikdev.bluetooth.gattparser.GattResponse;
-import org.sputnikdev.bluetooth.gattparser.spec.Characteristic;
-import org.sputnikdev.bluetooth.gattparser.spec.Field;
 
 /**
  * This is a handler for generic connected bluetooth devices that dynamically generates
diff --git a/bundles/org.openhab.binding.bluetooth.generic/suppressions.xml b/bundles/org.openhab.binding.bluetooth.generic/suppressions.xml
new file mode 100644 (file)
index 0000000..e44ba4d
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FindBugsFilter>
+  <!-- Ignore classes from external library -->
+  <Match>    
+    <Package name="org.openhab.bluetooth.gattparser"/>
+  </Match>
+  <Match>    
+    <Package name="org.openhab.bluetooth.gattparser.spec"/>
+  </Match>
+</FindBugsFilter>