coap 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 68

Build Status

coap #

A CoAP client library for Dart developers.

The Constrained Application Protocol (CoAP) is a RESTful web transfer protocol for resource-constrained networks and nodes.

COAP is an implementation in Dart providing CoAP-based services to Dart applications.

The code is a port from the C# .NET project CoAP.NET. The dart implementation is that of a CoAP client only, not a server although the CoAP.NET project does supply a server.

The COAP client provides many high level functions to control the request/response nature of the CoAP protocol, fine grained control however can be obtained by users directly constructing their own request messages.

Configuration is achieved by editing a yaml based config file containing many of CoAP protocol configurations.

This is a full implementation of the CoAP protocol including block wise transfer, deduplication, transmission retries using request/response token/id matching, piggy-backed and separate response handling is also supported. Proxying options can be set in request messages however full proxying support is not guaranteed. All CoAP options(if-match, if-none match, uri path/query, location path/query, content format, max age, etags et al.) are supported

Observation of resources is supported with the client 'listening' for observed resource updates when configured for this. The client supports both IPV4 and IPV6 communications and multicast operation. CoAP over DTLS(secure CoAP) is not supported.

Many examples of usage are provided in the examples directory both using a .NET based CoAP server for local testing and testing using the test server. Also a fully populated default configuration file is present in the examples directory.

1.0.3 #

  • Pana/Pub check updates

1.0.2 #

  • Pana/Pub check updates

1.0.1 #

  • Pana/Pub check updates

1.0.0 #

  • Initial version


 * Package : Coap
 * Author : S. Hamblett <>
 * Date   : 01/10/2019
 * Copyright :  S.Hamblett

// The example usages for this package are split between this directory and
// its testserver-example subdirectory.
// This directory contains examples showing basic usage such as ping, discover, put/post etc. and raw request
// handling using the test server.
// The testserver-example directory contains a .NET based CoAP server that can
// be used for testing purposes on a Windows platform. The test server attaches
// itself to localhost on both IPV4 and IPV6 interfaces and is started
// using the net40server.bat file.
// The testserver-example directory also contains a README describing
// the resources supported by the server, of particular note is the
// time_obs_resource example, this shows how query an endpoint for
// observable resources and listen for the observed updates.
// A reasonable starting point are the ping examples.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  coap: ^1.0.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:coap/coap.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
collection ^1.14.11 1.14.12
date_format ^1.0.6 1.0.8
event_bus ^1.0.1 1.1.1
executor ^2.1.0 2.2.1
hex ^0.1.2 0.1.2
logging ^0.11.3+2 0.11.4
pedantic ^1.5.0 1.9.0
safe_config ^2.0.1 2.0.2 3.0.0-b2
string_scanner ^1.0.5 1.0.5
typed_data ^1.1.6 1.1.6
Transitive dependencies
charcode 1.1.3
meta 1.1.8
path 1.6.4
source_span 1.7.0
stack_trace 1.9.3
term_glyph 1.1.0
yaml 2.2.0
Dev dependencies
test ^1.3.0