supportsOperation method
Indicates whether this ProtocolClientFactory supports a given
operationType
and subprotocol.
Implementation
@override
bool supportsOperation(OperationType operationType, String? subprotocol) {
const observeOperations = [
OperationType.observeproperty,
OperationType.unobserveproperty,
OperationType.subscribeevent,
OperationType.unsubscribeevent,
];
if (observeOperations.contains(operationType)) {
return CoapSubprotocol.tryParse(subprotocol ?? "") ==
CoapSubprotocol.observe;
}
return subprotocol == null;
}