Custom send message from admin plugin to background plugin

Hi there,

I have a plugin here in which I want to send a custom message from the admin plugin to the background plugin.

I have created a class “CallPresetMessageData”:

internal class CallPresetMessageData

{

 internal static string CallPresetMessage = "DME.CallPreset";

public string name {get; set; }

public int preset {get; set; }

public object tag {get; set; }

}

In the “Definition Class” I add this to the “_messageIdStrings”.

In the admin plugin I trigger the send in a button event:

CallPresetMessageData callPresetMessageData = new CallPresetMessageData

{

     Name = (string) ComboboxROIPreset.SelectedItem,

     Preset = ComboboxROIPreset.SelectedIndex + 1

};

EnvironmentManager.Instance.SendMessage (

new VideoOS.Platform.Messaging.Message (CallPresetMessageData.CallPresetMessage, callPresetMessageData));

And in the background plugin I did the registration in “Init”:

_callPresetReceiver = EnvironmentManager.Instance.RegisterReceiver (CallPresetHandler,

new MessageIdFilter (CallPresetMessageData.CallPresetMessage));

But the event handler doesn’t fire when I call SendMessage:

private object CallPresetHandler (Message message, FQID destination, FQID sender)

{

  EnvironmentManager.Instance.Log (false, "AutoPresetBoschPanoramicCam BackgroundPlugin", "CallPresetHandler Start call preset");

  CallPresetMessageData data = message.Data as CallPresetMessageData;

  EnvironmentManager.Instance.Log (false, "AutoPresetBoschPanoramicCam BackgroundPlugin", String.Format ("Message: \\ nName = {0} \\ nPreset = {1}", [data.Name](https://data.Name), data.Preset));

   // CallPreset ();

   return null;

}

Why is the event not triggered in the background plugin? Did I miss something there?

Best regards, Andreas

Ok, as I read in another thread, the communication in this case has to be done via “RegisterCommunicationFilter” and “TransmitMessage”, since the processes do not necessarily run on the same machine.