CoapClient constructor
CoapClient(
- Uri baseUri, {
- InternetAddressType addressType = InternetAddressType.any,
- InternetAddress? bindAddress,
- PskCredentialsCallback? pskCredentialsCallback,
- DefaultCoapConfig? config,
Instantiates. A supplied request is optional depending on the API call being used. If it is specified it will be prepared and used. Note that the host name part of the URI can be a name or an IP address, in which case it is not resolved.
You can define a custom config
for the creation of a CoapClient.
If no config
is provided, then an instance of the CoapConfigDefault
class will be used instead.
Implementation
CoapClient(
this.baseUri, {
this.addressType = InternetAddressType.any,
this.bindAddress,
final PskCredentialsCallback? pskCredentialsCallback,
final DefaultCoapConfig? config,
}) : _config = config ?? CoapConfigDefault(),
_pskCredentialsCallback = pskCredentialsCallback {
_eventBus = CoapEventBus(namespace: hashCode.toString());
}