Skip to content

Commit

Permalink
Created forked version with:
Browse files Browse the repository at this point in the history
- sputnikdev#15 included
- version number bumped to 2.0.0
- org.openhab namespace
- dependencies updated to latest versions
- updated README
- removal of travis

Signed-off-by: Kai Kreuzer <[email protected]>
  • Loading branch information
kaikreuzer committed Jul 14, 2022
1 parent cd239f9 commit 99ad6ee
Show file tree
Hide file tree
Showing 52 changed files with 175 additions and 415 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode
target
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .travis/before-deploy.sh

This file was deleted.

Binary file removed .travis/codesigning.asc.enc
Binary file not shown.
14 changes: 0 additions & 14 deletions .travis/deploy.sh

This file was deleted.

23 changes: 0 additions & 23 deletions .travis/settings.xml

This file was deleted.

17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
[![Maven Central](https://img.shields.io/maven-central/v/org.sputnikdev/bluetooth-gatt-parser.svg)](https://mvnrepository.com/artifact/org.sputnikdev/bluetooth-gatt-parser)
[![Build Status](https://travis-ci.org/sputnikdev/bluetooth-gatt-parser.svg?branch=master)](https://travis-ci.org/sputnikdev/bluetooth-gatt-parser)
[![Coverage Status](https://coveralls.io/repos/github/sputnikdev/bluetooth-gatt-parser/badge.svg?branch=master)](https://coveralls.io/github/sputnikdev/bluetooth-gatt-parser?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/42d4968bc4ae4474b2cda4d01f8e4d56)](https://www.codacy.com/app/vkolotov/bluetooth-gatt-parser?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=sputnikdev/bluetooth-gatt-parser&amp;utm_campaign=Badge_Grade)
[![Join the chat at https://gitter.im/sputnikdev/bluetooth-gatt-parser](https://badges.gitter.im/sputnikdev/bluetooth-gatt-parser.svg)](https://gitter.im/sputnikdev/bluetooth-gatt-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# bluetooth-gatt-parser
[![Maven Central](https://img.shields.io/maven-central/v/org.openhab/bluetooth-gatt-parser.svg)](https://mvnrepository.com/artifact/org.openhab/bluetooth-gatt-parser)

A **simple** library/framework to work with Bluetooth Smart (BLE) GATT services and characteristics.

Note: This is a fork from the no longer maintained project at https://github.com/sputnikdev/bluetooth-gatt-parser.

Have a look at an example of parsing a standard characteristic ([Battery Level 0x2A19](https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.battery_level.xml)) value:
```java
BluetoothGattParserFactory.getDefault().parse("2A19", new byte[] {51}).get("Level").getInteger(null);
Expand All @@ -25,7 +22,7 @@ This would print 51.
**Start using the library by including a maven dependency in your project:**
```xml
<dependency>
<groupId>org.sputnikdev</groupId>
<groupId>org.openhab</groupId>
<artifactId>bluetooth-gatt-parser</artifactId>
<version>X.Y.Z</version>
</dependency>
Expand Down Expand Up @@ -81,10 +78,7 @@ parser.registerParser(CHARACTERISTIC_UUID, customParser);
---
## 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.
You are welcome to contribute to the project.

The build process is streamlined by using standard maven tools.

Expand All @@ -98,4 +92,3 @@ 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.
74 changes: 19 additions & 55 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.sputnikdev</groupId>
<groupId>org.openhab</groupId>
<artifactId>bluetooth-gatt-parser</artifactId>
<version>1.9.5-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
<description>A simple library/framework to work with Bluetooth Smart (BLE) GATT services and characteristics.</description>
<url>https://github.com/sputnikdev/bluetooth-gatt-parser</url>
<url>https://github.com/openhab/bluetooth-gatt-parser</url>

<licenses>
<license>
Expand All @@ -18,10 +18,10 @@
</licenses>

<organization>
<name>Sputnik Dev</name>
<url>http://sputnikdev.org/</url>
<name>openHAB</name>
<url>https://www.openhab.org/</url>
</organization>
<inceptionYear>2017</inceptionYear>
<inceptionYear>2022</inceptionYear>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand All @@ -37,22 +37,24 @@
<organization>Sputnik Dev</organization>
<organizationUrl>https://sputnikdev.org/</organizationUrl>
</developer>
<developer>
<name>Kai Kreuzer</name>
<email>[email protected]</email>
<organization>openHAB</organization>
<organizationUrl>https://www.openhab.org/</organizationUrl>
</developer>
</developers>

<scm>
<url>https://github.com/sputnikdev/bluetooth-gatt-parser/tree/master</url>
<connection>scm:git:git@github.com:sputnikdev/bluetooth-gatt-parser.git</connection>
<developerConnection>scm:git:git@github.com:sputnikdev/bluetooth-gatt-parser.git</developerConnection>
<url>https://github.com/openhab/bluetooth-gatt-parser/tree/main</url>
<connection>scm:git:https://github.com/openhab/bluetooth-gatt-parser</connection>
<developerConnection>scm:git:https://github.com/openhab/bluetooth-gatt-parser</developerConnection>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<id>maven</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
Expand All @@ -71,26 +73,6 @@
</repositories>

<profiles>
<profile>
<id>release-no-deploy</id>
<activation>
<property>
<name>!travis</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>sign</id>
<build>
Expand All @@ -109,13 +91,6 @@
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>build-extras</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand All @@ -142,17 +117,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -172,17 +136,17 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.7</version>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<version>31.1-jre</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.sputnikdev.bluetooth.gattparser;
package org.openhab.bluetooth.gattparser;

import org.openhab.bluetooth.gattparser.spec.BluetoothGattSpecificationReader;
import org.openhab.bluetooth.gattparser.spec.Characteristic;
import org.openhab.bluetooth.gattparser.spec.Field;
import org.openhab.bluetooth.gattparser.spec.Service;

/*-
* #%L
* org.sputnikdev:bluetooth-gatt-parser
* %%
* Copyright (C) 2017 Sputnik Dev
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -22,10 +24,6 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sputnikdev.bluetooth.gattparser.spec.BluetoothGattSpecificationReader;
import org.sputnikdev.bluetooth.gattparser.spec.Characteristic;
import org.sputnikdev.bluetooth.gattparser.spec.Field;
import org.sputnikdev.bluetooth.gattparser.spec.Service;

import java.net.URL;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
package org.sputnikdev.bluetooth.gattparser;
package org.openhab.bluetooth.gattparser;

/*-
* #%L
* org.sputnikdev:bluetooth-gatt-parser
* %%
* Copyright (C) 2017 Sputnik Dev
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

import org.sputnikdev.bluetooth.gattparser.num.FloatingPointNumberFormatter;
import org.sputnikdev.bluetooth.gattparser.num.IEEE11073FloatingPointNumberFormatter;
import org.sputnikdev.bluetooth.gattparser.num.IEEE754FloatingPointNumberFormatter;
import org.sputnikdev.bluetooth.gattparser.num.RealNumberFormatter;
import org.sputnikdev.bluetooth.gattparser.num.TwosComplementNumberFormatter;
import org.sputnikdev.bluetooth.gattparser.spec.BluetoothGattSpecificationReader;
import org.openhab.bluetooth.gattparser.num.FloatingPointNumberFormatter;
import org.openhab.bluetooth.gattparser.num.IEEE11073FloatingPointNumberFormatter;
import org.openhab.bluetooth.gattparser.num.IEEE754FloatingPointNumberFormatter;
import org.openhab.bluetooth.gattparser.num.RealNumberFormatter;
import org.openhab.bluetooth.gattparser.num.TwosComplementNumberFormatter;
import org.openhab.bluetooth.gattparser.spec.BluetoothGattSpecificationReader;

/**
* A factory class for some main objects in the library:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package org.sputnikdev.bluetooth.gattparser;
package org.openhab.bluetooth.gattparser;

/*-
* #%L
* org.sputnikdev:bluetooth-gatt-parser
* %%
* Copyright (C) 2017 Sputnik Dev
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package org.sputnikdev.bluetooth.gattparser;
package org.openhab.bluetooth.gattparser;

/*-
* #%L
* org.sputnikdev:bluetooth-gatt-parser
* %%
* Copyright (C) 2017 Sputnik Dev
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -23,7 +20,7 @@
import java.util.Collection;
import java.util.LinkedHashMap;

import org.sputnikdev.bluetooth.gattparser.spec.Characteristic;
import org.openhab.bluetooth.gattparser.spec.Characteristic;

/**
* A root interface for all GATT characteristic parsers in the framework. It defines simple read and write operations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package org.sputnikdev.bluetooth.gattparser;
package org.openhab.bluetooth.gattparser;

/*-
* #%L
* org.sputnikdev:bluetooth-gatt-parser
* %%
* Copyright (C) 2017 Sputnik Dev
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -31,12 +28,12 @@
import org.apache.commons.beanutils.converters.IntegerConverter;
import org.apache.commons.beanutils.converters.LongConverter;
import org.apache.commons.beanutils.converters.StringConverter;
import org.sputnikdev.bluetooth.gattparser.num.TwosComplementNumberFormatter;
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;
import org.sputnikdev.bluetooth.gattparser.spec.FlagUtils;
import org.openhab.bluetooth.gattparser.num.TwosComplementNumberFormatter;
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.bluetooth.gattparser.spec.FlagUtils;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
Expand Down
Loading

0 comments on commit 99ad6ee

Please sign in to comment.