dslink 0.6.1

  • README.md
  • Installing
  • Versions
  • 0

DSLink SDK for Dart Build Status Coverage Status Slack

DSLink SDK for Dart

Getting Started

Prerequisites

Install

pub global activate -sgit https://github.com/IOT-DSA/broker-dart.git # Globally install the DSA Broker

Start a Broker

dsbroker # If you have the pub global executable path setup.
pub global run dsbroker:broker # If you do not have the pub global executable path setup.

You can edit the server configuration using broker.json. For more information about broker configuration, see this page.

For documentation, see this page. For more examples, see this page.

import "package:dslink/dslink.dart";

LinkProvider link;

main(List<String> args) async {
  // Process the arguments and initializes the default nodes.
  link = new LinkProvider(args, "Simple-", defaultNodes: {
    "Message": {
      r"$type": "string", // The type of the node is a string.
      r"$writable": "write", // This node's value can be set by a responder link.
      "?value": "Hello World" // The default message value.
    }
  });

  // Connect to the broker.
  link.connect();

  // Save the message when it changes.
  link.onValueChange("/Message").listen((_) => link.save());
}
dart path/to/link.dart # Start a link that connects to a broker at http://127.0.0.1:8080/conn
dart path/to/link.dart --broker http://my.broker:8080/conn # Start a link that connects to the specified broker.

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate dslink

2. Use it

The package has the following executables:


$ dsbeacon

Use this package as a library

1. Depend on it

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


dependencies:
  dslink: ^0.6.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:dslink/dslink.dart';
  
Version Uploaded Documentation Archive
0.6.1 Jun 7, 2016 Go to the documentation of dslink 0.6.1 Download dslink 0.6.1 archive
0.6.0 Apr 24, 2016 Go to the documentation of dslink 0.6.0 Download dslink 0.6.0 archive
0.5.8 Feb 18, 2016 Go to the documentation of dslink 0.5.8 Download dslink 0.5.8 archive
0.5.7+1 Jan 30, 2016 Go to the documentation of dslink 0.5.7+1 Download dslink 0.5.7+1 archive
0.5.7 Jan 30, 2016 Go to the documentation of dslink 0.5.7 Download dslink 0.5.7 archive
0.5.6+1 Jan 28, 2016 Go to the documentation of dslink 0.5.6+1 Download dslink 0.5.6+1 archive
0.5.6 Jan 24, 2016 Go to the documentation of dslink 0.5.6 Download dslink 0.5.6 archive
0.5.5 Jan 23, 2016 Go to the documentation of dslink 0.5.5 Download dslink 0.5.5 archive
0.5.4+1 Jan 22, 2016 Go to the documentation of dslink 0.5.4+1 Download dslink 0.5.4+1 archive
0.5.4 Jan 14, 2016 Go to the documentation of dslink 0.5.4 Download dslink 0.5.4 archive

All 16 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
1
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

We analyzed this package on Jul 20, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.69.0
  • pana: 0.11.7

Platforms

Detected platforms: Flutter, other

Primary library: package:dslink/dslink.dart with components: io, isolate.

Issues and suggestions

Fix lib/src/responder/simple/simple_node.dart.

Analysis of lib/src/responder/simple/simple_node.dart failed with 4 errors:

line 674 col 15: The argument type '(String, dynamic) → Null' can't be assigned to the parameter type '(dynamic, dynamic) → void'.

line 1174 col 16: The return type 'String' isn't a 'void', as defined by the method '[]='.

line 1176 col 16: The return type 'SimpleNode' isn't a 'void', as defined by the method '[]='.

line 1179 col 16: The return type 'Object' isn't a 'void', as defined by the method '[]='.

Fix lib/src/historian/rollup.dart.

Analysis of lib/src/historian/rollup.dart failed with 2 errors, 6 hints, including:

line 117 col 13: Couldn't infer type parameter 'T'.\n\nTried to infer 'dynamic' for 'T' which doesn't work:\n Type parameter 'T' declared to extend 'num'.\nThe type 'dynamic' was inferred from:\n Parameter 'a' declared as 'T'\n but argument is 'dynamic'.\n Parameter 'b' declared as 'T'\n but argument is 'dynamic'.\n\nConsider passing explicit type argument(s) to the generic.\n\n

line 139 col 13: Couldn't infer type parameter 'T'.\n\nTried to infer 'dynamic' for 'T' which doesn't work:\n Type parameter 'T' declared to extend 'num'.\nThe type 'dynamic' was inferred from:\n Parameter 'a' declared as 'T'\n but argument is 'dynamic'.\n Parameter 'b' declared as 'T'\n but argument is 'dynamic'.\n\nConsider passing explicit type argument(s) to the generic.\n\n

line 47 col 32: 'onError' is deprecated and shouldn't be used.

line 74 col 32: 'onError' is deprecated and shouldn't be used.

line 110 col 32: 'onError' is deprecated and shouldn't be used.

Maintain CHANGELOG.md.

Changelog entries help clients to follow the progress in your code.

Use constrained dependencies.

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: cipher.

Package is too old.

The package was released more than two years ago.

Fix additional 18 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/broker_discovery.dart (2 errors, 4 hints)
  • lib/src/requester/default_defs.dart (2 errors)
  • lib/nodes.dart (1 error, 1 hint)
  • lib/io.dart (1 error, 17 hints)
  • lib/src/requester/request/subscribe.dart (1 error)
  • lib/browser.dart (Make sure that the imported libraries are not in conflict. Detected components: html, isolate.)
  • lib/src/requester/node_cache.dart (1 error)
  • lib/browser_client.dart (Make sure that the imported libraries are not in conflict. Detected components: html, isolate.)
  • lib/src/responder/base_impl/local_node_impl.dart (1 error)
  • lib/src/common/value.dart (3 hints)
  • lib/client.dart (2 hints)
  • lib/src/http/websocket_conn.dart (2 hints)
  • lib/src/nodes/json.dart (2 hints)
  • lib/src/storage/simple_storage.dart (2 hints)
  • lib/server.dart (1 hint)
  • lib/src/responder/base_impl/def_node.dart (1 hint)
  • lib/src/utils/timer.dart (1 hint)
  • lib/utils.dart (1 hint)

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use dslink.dart.

Use analysis_options.yaml.

Rename old .analysis_options file to analysis_options.yaml.

Read more about the setup of analysis-options.yaml.

Enable strong mode analysis.

Strong mode helps detect bugs and potential issues earlier. Start your analysis_options.yaml file with the following:

analyzer:
  strong-mode: true

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.11.0
args ^0.13.4 0.13.7 1.4.4
bignum ^0.1.0 0.1.0
cipher 0.7.2
crypto 0.9.1 0.9.1 2.0.6
json_diff ^0.1.2 0.1.2
logging ^0.11.3 0.11.3+2
msgpack ^0.4.0 0.4.0 0.9.0
Transitive dependencies
collection 1.14.11
diff_match_patch 0.2.1
fixnum 0.10.8
Dev dependencies
browser ^0.10.0
dsbroker
test >=0.12.13