Hi,
Am using update operation command, and it is executing successfully, But I don’t know how to read its response in my machine
Hi,
Am using update operation command, and it is executing successfully, But I don’t know how to read its response in my machine
Hi,
can you share more information on what you are trying to achieve?
Are you developing a device agent or what do you mean by reading the response on your machine?
Thanks for your response.
Actually am using one update command({“Update”:“MotorStatus”}) via POST method from my laptop. But I don’t know the the way to get back the response of this command.
Hi, operations are working in an asynchronous way. That means you won’t directly receive the response in your POST request. Operations are updated by the source device, e.g. to change their state to PENDING, SUCCESSFUL or FAILED.
If you want to track that in the UI, you need to register for realtime updates of your source device using the OperationRealtimeService. That way, you get notified once operations are updated:
import { OperationRealtimeService } from '@c8y/ngx-components';
constructor(private operationRealtime: OperationRealtimeService) {}
this.operationRealtime.onUpdate$(deviceId).susbscribe(update => {
// do sth
});