The device shadow represents represents the current state of each device’s resource. Each connected device notifies the plgd hub about every change using the CoAP Gateway observations, which are started right after the device successfully connects and authenticates. All changes are persisted in form of an audit log in the EventStore, from which is the latest version returned to clients through the Resource Directory.
Update a resource from CoAP Gateway
Update a resource from OCF Client
Disable Device Shadow feature
All changes that occur on the connected device are observed and stored in the EventStore. There are few use cases where Device Shadow - active observation of all changes is not desired. For example, if the device is in the maintenance state and produces test data that shall not be part of the audit log, Device Shadow should be for this device disabled. To do so, a client needs to send the request UpdateDeviceMetadataRequest with ShadowSynchronization and CorrelationId.
The Device Shadow feature is disabled only after the successful recipient of the DeviceMetadataUpdated event containing the same correlation id used in the Update request. This confirmation event is received only if the device is/comes online.