How to know status of the camera devices from background plugin that runs on event server ?

I want to know whether a camera is online/offline from my background plugin that runs on event server.

Registered for response using:

 _obj3 = _messageCommunication.RegisterCommunicationFilter(ProvideCurrentStateResponseHandler,
                new VideoOS.Platform.Messaging.CommunicationIdFilter(MessageCommunication.ProvideCurrentStateResponse));

Requesting for current state using:

 Collection<object> result = EnvironmentManager.Instance.SendMessage(new Message(MessageCommunication.ProvideCurrentStateRequest));
or
Collection<object> result3 = EnvironmentManager.Instance.SendMessage(new Message(MessageCommunication.ProvideCurrentStateRequest, data.EventHeader.Source.FQID));

‘result’/‘result3’ has no objects returned, neither the ‘ProvideCurrentStateResponseHandler’ is getting called.

Admin plugin provides me the callback on ProvideCurrentStateResponseHandler. The same doesn’t work in Event server’s background plugin. Please let me know the possible way of finding the current state of a camera from event server’s background plugin.

Use _messageCommunication.TransmitMessage() instead.

There is some sample code if you find VideoOS.Platform.Messaging.MessageCommunication Class Reference

and scroll down to the detailed descriptions and find

void VideoOS.Platform.Messaging.MessageCommunication.TransmitMessage

http://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_messaging_1_1_message_communication.html&tree=tree_search.html?search=transmitmessage

Ok, thanks. By this it is possible to retrieve the state of, e.g., an input, whether it is activated or deactivated.

At the link it is stated:

1. “This message should be used as few times as possible, as the result can be very large.”

and then

2. “For asking for a set of Items, fill the Message.Data field with an array of guids (as String)”.

If we fill the Message.Data with an array of Guids made of one element, does the system potentially generate a lot of data as in 1. or is the request sent to just the addressed GUID, thus not generating a lot of data?

Thanks

You will only get the data for the items in the array. E.g.

try
{
	// Ask for current state of one Items
	_messageCommunication.TransmitMessage(
		new VideoOS.Platform.Messaging.Message(MessageCommunication.ProvideCurrentStateRequest, new String[] { item.FQID.ObjectId.ToString() }), null, null, null);
}
catch (MIPException)
{
	MessageBox.Show(
		"Unable to connect to EventServer's MessageCommunication service (default port 22333) - will retry every 5 seconds",
		"Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}

-will only give you the state for the one item.

PS. I modified the StatusViewer sample to test this..