CoreLinkFormatConfiguration constructor

CoreLinkFormatConfiguration(
  1. Uri baseUrl, {
  2. DiscoveryType discoveryType = DiscoveryType.thing,
  3. String coreLinkFormatPath = "/.well-known/core",
})

Instantiates a new CoreLinkFormatConfiguration object.

The baseUrl can either be a unicast or – when using a multicast-capable protocol such as CoAP – a multicast Uri. The default URI path used for discovering Thing Descriptions is the standardized /.well-known/core (see RFC 6690, section 4).

By default, the discovery process used with this configuration will try to obtain Thing Descriptions for Things, as indicated by the discoveryType.

Implementation

CoreLinkFormatConfiguration(
  Uri baseUrl, {
  super.discoveryType = DiscoveryType.thing,
  String coreLinkFormatPath = "/.well-known/core",
}) : uri = baseUrl.replace(
        path: coreLinkFormatPath,
        queryParameters: {
          "rt": discoveryType.coreLinkFormatResourceType,
        },
      );