Git Product home page Git Product logo

coapblaster's Introduction

CoapBlaster

CoapBlaster is an experimental open-source CoAP client/server library written in Java.

Design Goals

The initial design goals for CoapBlaster were best approximated as the following:

  • Full RFC7252 support
  • Flexible, easy-to-use API that supports both synchronous and asynchronous design patterns
  • Robust, easy-to-use resource observation
  • Easily swappable back-end to support various transports
  • Full support for DTLS, COSE, and possibly OSCORE

Most of these goals have already been met, while a few are still in progress.

Note that because CoapBlaster is still at the experimental/preview stage, it should not be considered production ready.

Current Features

Currently, CoapBlaster supports the following:

  • Full RFC7252 support for the Constrained Application Protocol
    • Retransmission/deduplication support
    • Tunable transmission parameters
  • API allows for both asynchronous and synchronous usage
  • Supports sending and receiving asynchronous CoAP responses
  • Effortless RFC7641 observation support
  • Support for block2 transfers on both client and server interfaces
  • Support for parsing and composing RFC6690-style link formats
  • Support for diverting client requests through a CoAP proxy

Planned Features

Documentation

Usage Examples

Fetching a simple resource

Program:

import com.google.iot.m2m.LocalEndpointManager;
import com.google.iot.m2m.Client;
import com.google.iot.m2m.Transaction;
import com.google.iot.m2m.Message;

LocalEndpointManager manager = new LocalEndpointManager();

Client client = new Client(manager, "coap://coap.me/test");

Transaction transaction = client.newRequestBuilder().send();

try {
    Message response = transaction.getResponse();
    System.out.println("Got response: " + response);

} catch(Exception exception) {
    System.out.println("Exception: " + exception);
}

Which will print out a long line which looks something like this:

<CONTENT IN ACK MID:44712 TOK:"f43c" 2.05 RADDR:"/134.102.218.18:5683" OPTS:[ETag:thZhiYJXp/I=, Content-Format:0] TEXT:"welcome to the ETSI plugtest! last change: 2018-1...">

Additional Examples

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

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

Adding to Projects

Gradle:

dependencies {
  compile 'com.google.iot.coap:coap:0.02.01'
}

Maven:

<dependency>
  <groupId>com.google.iot.coap</groupId>
  <artifactId>coap</artifactId>
  <version>0.02.01</version>
</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

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

See Also

License

CoapBlaster is released under the Apache 2.0 license.

Copyright 2018 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.

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.