The 5 basic commands follow the same pattern:
-
They cannot be specialized outside of the CK.DeviceModel.
-
Their
StoppedBehavior
andImmediateStoppedBehavior
properties are both "RunAnyway" (they can run on a stopped device). -
Their
ImmediateSending
property is true by default. -
They all respect the
ControllerKey
optional guard. -
They can be sent via SendCommand or are simply useless since the 5 device's methods
SetControllerKeyAsync, StartAsync, StopAsync, ReconfigureAsync or DestroyAsync (see IDevice) helpers do the job.
Specificities are:
- Destroy has no result and always succeeds (thanks to the OnError and OnCanceled implementations).
- Start and Stop are boolean commands. Exceptions or cancellation are transformed into a `false' result.
- Stop can specify
IgnoreAlwaysRunning
to stop a device even if its configuration state that it must beAlwaysRunning
. The daemon then enters into play. - ReconfigureDeviceCommand<TConfiguration> is parametrized on the Device and non-generic on IDevice).
Cancellations are transformed into
ConfigurationCanceled
, exceptions are transformed intoInvalidControllerKey
orUnexpectedError
result (see DeviceApplyConfigurationResult). - SetControllerKey exposes the
NewControllerKey
(in addition to the standardControllerKey
guard).