I am in no way an expert… but it was easier that I thought (after lot of trial and error). This is the core…
void SendToSim(int IDadd, std::string idVar)
{
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, WASM_EVENT+IDadd, _strdup(idVar.c_str()));
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_A, WASM_EVENT + IDadd);
hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_A, SIMCONNECT_GROUP_PRIORITY_HIGHEST);
SimConnect_TransmitClientEvent(hSimConnect, objectID, WASM_EVENT + IDadd, 0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
}
Looks familiar, does it not?
this is my functioncall…
SendToSim(26, "mobiflight.AS1000_MFD_ENT_Push");
So IDadd has to be different for every event. and I have not noticed but I think it can mingle with other plug-ins. I used 1 to 50 for my events. I have no other add-ons in my community folder.
You first have to set it up with a Handle and some enums and the connection like…
hr = SUCCEEDED(SimConnect_Open(&hSimConnect, "--- Begin Send Event ---", NULL, 0, 0, 0));
but how this is done can be found everywhere because it is standard simconnect stuff.
So the most important things;
the simconnect_client_event_id has to be something (different for every event) and the
const char " EventName = " has to start with mobiflight. Everything simconnect does not recognize is interpreted by the mobiflight module… translated and send again to simconnect.
If you install mobiflight with the wasm module you can find an event.txt in de module directory in the community directory containing all possibilities added so far. On the website hubhop.mobiflight.com you can maybe find more or in an easier fashion.
This is only the event send part. I still have to find out how to get variables.
Hope this helps.