ProvideCurrentStateRequest returns removed cameras with state “Communication stopped”. It works properly after restarting of Event server service. Why does it return removed cameras?
Your observation is correct, this is the way it works.
While the message is correct, it is also confusing, I agree that a better behavior would be that the camera is no longer in the list if has been removed.
I will make a request to see if we can get a change to this behavior for a future version.
And sometimes it returns removed cameras in status responding. I am not able to reproduce it but it happens often. I am not able to synchronize configuration because ProvideCurrentStateRequest does not reflect the real state on server. Is there any alternative for ProvideCurrentStateRequest?
No.
You can subscribe to ConfigurationChangedIndication and build an awareness that you are subscribing to a device that have been removed.
I recommend the ConfigUpdated sample for a better understanding of the options to keep configuration updated.
ProvideCurrentStateRequest returns collection on ItemState objects and I know status from these objects (responding, not responding, etc.). I can show cameras with statuses to user. This contains all I need but it is not reliable. I would need to restart event server before every ProvideCurrentStateRequest but it is not the best solution of others who listen on MessageCommunication.ConnectionStateChangedEvent
ConfigUpdated works via GetChildren and it returns collection of Item objects. These objects do not have statuses. If camera is not connected to the network I do not know it from this object. I can just diplay camera as working but it is not true.
I have 3 cameras: 2 connected to the network and 1 is not connected (cable is off). Provided status from SDK is: 3 cameras responding, 1 camera not responding. I am really not able to get current configuration with current status and keep it updated.
I think you might have misunderstood my reply.
Using the ConfigurationChangedIndication and methods of ConfigUpdated sample you can get an understanding of which devices are no longer in the configuration so that you know to ignore the information for these devices you get in the ProvideCurrentStateRequest.
The operation of ProvideCurrentStateRequest will be modified in XProtect 2019R2 so that it will stop reporting on devices when they are removed.
ahaa, now I see. I’ve tried this workaround and this works fine. I will skip this workaround with 2019R2. Thanks.
