Giter VIP home page Giter VIP logo

coap's Introduction

Gem Version Build Status Coverage Status Code Climate Docker Hub Build Status

CoAP

This Ruby gem implements client functionality for RFC 7252, the Constrained Application Protocol (CoAP). The message parsing code included is written by Carsten Bormann, one of the RFC authors.

The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks. The nodes often have 8-bit microcontrollers with small amounts of ROM and RAM, while constrained networks such as 6LoWPAN often have high packet error rates and a typical throughput of 10s of kbit/s. The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.

Additionally supported extensions of the CoAP protocol:

Install

Add this line to your application's Gemfile:

gem 'coap'

And then execute:

$ bundle

Or install it yourself as:

$ gem install coap

Usage

In your Application

require 'coap'

CoAP::Client.new.get_by_uri('coap://coap.me/hello').payload
=> "world"

CoAP::Client.new.get('/hello', 'coap.me')
=> #<struct CoRE::CoAP::Message ver=1, tt=:ack, mcode=[2, 5], mid=51490, options={:max_age=>60, :token=>366862489, :content_format=>0}, payload="world">

c = CoAP::Client.new(host: 'coap.me')
c.get('/hello')

See the API documentation at rubydoc.info or test/test_client.rb for more examples.

On the Command Line

The command line client supports the basic CoAP methods.

coap get coap://coap.me/.well-known/core

With Docker

You can skip the install section if you want to use Docker.

docker run nning2/coap get coap://coap.me/hello

Testing

rake

Copyright

The code is published under the MIT license (see the LICENSE file).

Authors

coap's People

Contributors

nning avatar cabo avatar olleolleolle avatar smalllars avatar nmeum avatar

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.