Git Product home page Git Product logo

splot-java's Introduction

Splot for Java

Splot for Java is an experimental set of Java libraries implementing the Splot Object Model (SOM), enabling easy-to-use monitoring, control, and thing-to-thing/machine-to-machine behaviors. It is broken down into five subprojects:

  • splot-base: Provides the base classes and interfaces for the Splot Object Model.
  • splot-processor: An annotation processor for processing trait definitions.
  • splot-traits: A standard set of defined traits.
  • splot-local: Classes for implementing local things, as well as a local technology implementation.
  • smcp: A library for using the experimental CoAP-based Splot Monitoring and Control Protocol using the Splot Object Model as implemented in splot-base.

Splot for Java should be considered experimental and should not yet be considered production-ready. This is an early release for testing and discussion.

The ultimate goal for Splot is the development of an object model, API, and protocol for IoT devices to facilitate straightforward, easy to use machine-to-machine/thing-to-thing behaviors that are configured locally and do not rely on cloud infrastructure.

Protocol Implementation Features

  • Uses open standards like CoAP, CBOR, etc.
  • Fully working discovery, observing, groups, scenes, transitions, etc.
  • Type-safe property API
  • Easy to implement new things
  • Over 200 unit tests and growing.
  • In-band-manageable automation primitives

Current Protocol Limitations

  • No native C/C++ implementation available yet.
  • No transport-layer security yet, security currently relies on link-layer security.
  • Java API is experimental and subject to change.

Ongoing Work

  • Support for Automation Pairing and Automation Rules.
  • Native C implementation for SMCP that works on highly constrained devices, based on libnyoci
  • Splot Security Model Development
    • Defines how native Splot/SMCP devices will securely operate.
    • Broad strokes worked out, but details still being defined.
    • Will likely use COSE, OSCORE, possibly DTLS under certain circumstances.

Documentation

Examples

Related Projects

Adding to Projects

In general, you do not need to build and install this project in order to use it: by simply adding the appropriate dependencies to your project's build.gradle or pom.xml file, the appropriate jar files should be automatically downloaded.

Gradle:

dependencies {
  compile 'com.google.iot.m2m:splot-base:0.02.00'
  compile 'com.google.iot.m2m:splot-traits:0.02.00'
  compile 'com.google.iot.m2m:splot-local:0.02.00'
  compile 'com.google.iot.m2m:smcp:0.02.00'
}

Maven:

<dependency>
  <groupId>com.google.iot.m2m</groupId>
  <artifactId>splot-base</artifactId>
  <version>0.02.00</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>com.google.iot.m2m</groupId>
  <artifactId>splot-traits</artifactId>
  <version>0.02.00</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>com.google.iot.m2m</groupId>
  <artifactId>splot-local</artifactId>
  <version>0.02.00</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>com.google.iot.m2m</groupId>
  <artifactId>smcp</artifactId>
  <version>0.02.00</version>
  <scope>compile</scope>
</dependency>

Building and Installing

This project uses Maven for building. Once Maven is installed, you should be able to build and install the project by doing the following:

mvn verify
mvn install

When building the project yourself, the version field for the built artifacts will be HEAD-SNAPSHOT.

Note that the master branch of this project depends on CborTree and CoapBlaster, so you may need to download, build, and install those projects first.

License

Splot for Java is released under the Apache 2.0 license.

Copyright 2019 Google Inc.

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.

Disclaimer

This is not an officially supported Google product.

splot-java's People

Contributors

darconeous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

splot-java's Issues

More docs?

Are there any additional docs? I'm especially interested in automation pairings and automation rules
What do they look like? What is their internal components?

Also, what vocabulary is being used to express the values (v and d)? Is it based on SenML?

{"onof":{"v":false},"levl":{"v":0.2},"tran":{"d":0}}

PS: I think that Functional Endpoint illustrated in som-objects.png is missing a self connection because Functional Endpoint can generate children, which are also Functional Endpoint

Stop using Doclava

Doclava is currently used for Javadoc generation because it supports @hide, which is currently in use to hide experimental methods and classes from the Javadocs. Ultimately the real solution is to not use @hide, but this will require some refactoring of code.

Some unit tests are failing occasionally

I'm noticing that some unit tests are failing occasionally (on some platforms, reliably). The specific tests that seem to be having trouble are:

  1. SmcpFunctionalEndpointTest.fetchPropertyTestCoap()
  2. SmcpFunctionalEndpointTest.childAddedRemovedTest()

Ultimately, all unit tests should be updated to no longer require the use of specific network ports (which can cause cross-test interference), but that doesn't fix the issue with number 2 above, which only uses the loopback scheme. More investigation is required.

IPv6 not working properly on macOS

It turns out that the use of IPv6 with the standard Java Socket/MulticastSocket classes is broken when not bound to a specific network interface, which is breathtakingly lame. The problem doesn't seem to affect Linux or Android.

While I would love for this to be #NotOurProblem, this bug has been present in Java for so long that it doesn't look like it is ever going to get fixed.

This means that if we want we want to support IPv6 when used on a Mac, we will eventually need to take matters into our own hands and explicitly bind to specific network interfaces. Unfortunately, most IoT stuff is going to be using IPv6 exclusively, so we ignore it at our peril.

This issue is for discussing possible strategies for best working around this problem and tracking the eventual fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.