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 coap.me test server. Also a fully populated default configuration file is present in the examples directory.
- Pana/Pub check updates
- Initial version
/* * Package : Coap * Author : S. Hamblett <email@example.com> * 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 coap.me 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:
dependencies: coap: ^1.0.1
2. Install it
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
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]
We analyzed this package on Oct 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.5.1
- pana: 0.12.21
Detected platforms: other
|Dart SDK||>=2.0.0-dev <3.0.0|