Skip to content

Common Java utility library for RuuviTag related things, ie. RuuviTag raw data parsing

License

Notifications You must be signed in to change notification settings

Scrin/ruuvitag-common-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RuuviTag Common

ruuvitag-common is a library of utilities to work with RuuviTags, main purpose is providing parsers for parsing raw data from RuuviTags

Do note that this library is still being developed so comments, suggestions and other contributions are more than welcome. :)

How to use

  1. Add the repository to your pom:
<repositories>
    <repository>
        <id>ruuvitag-common-java-mvn-repo</id>
        <url>https://raw.github.com/Scrin/ruuvitag-common-java/mvn-repo/</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

Alternative option: You can also clone this repository, then build and install the library locally with: mvn clean install

  1. Add the dependency to your project:
<dependency>
    <groupId>fi.tkgwf.ruuvi</groupId>
    <artifactId>ruuvitag-common</artifactId>
    <version>1.0.2</version>
</dependency>
  1. Use the library in your code:
import fi.tkgwf.ruuvi.common.bean.RuuviMeasurement;
import fi.tkgwf.ruuvi.common.parser.DataFormatParser;
import fi.tkgwf.ruuvi.common.parser.impl.AnyDataFormatParser;

public class Example {

    public void showTemperature() {
        DataFormatParser parser = new AnyDataFormatParser();
        byte[] rawData = getRawDataFromSomewhere();
        RuuviMeasurement measurement = parser.parse(rawData);
        System.out.println("Temperature is " + measurement.getTemperature());
    }
}

About

Common Java utility library for RuuviTag related things, ie. RuuviTag raw data parsing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages