I am trying to check thing enabled status on SDK side. based on thing enabled status, i want to perform different operations.
Please find the code below to get thing enabled status on SDK side:
VirtualThing thing = mClient.getThing(ThingName);
bool b = thing.isEnabled();
This Enabled status always returns true though thing is not active on the server. Please provide your inputs on this.
The isEnabled property and method you are using pertain to the VirtualThing, meaning the Thing running on the Edge device.
Since the Thing on Composer was disabled there is no ability to access the properties, services, or events to check the value of the isEnabled property on the Thing because they would fail with a sequence of messages stating something like the following, when using the SteamSensor Example specifically:
[O: com.thingworx.communications.client.TwApiWrapper] [Error] twWApi_InvokeService: Error invoking service on Platform. EntityName: SteamSensor1 ServiceName: UpdateSubscribedPropertyValues
[O: com.thingworx.communications.client.TwApiWrapper] Error invoking Service for Entity. Internal Server Error. (Code 1110) twWApi_InvokeService returned 1110. EntityType: Things EntityName: SteamSensor1 ServiceName: UpdateSubscribedPropertyValues
[O: com.thingworx.communications.client.things.VirtualThing] overwriting Property value in PendingPropertyUpdate collection