API Question oapiBroadcastMFDMessage usage

slaver0110

Member
Joined
Mar 21, 2011
Messages
72
Reaction score
2
Points
6
In working on my StationTug I've been rifling through the Dragonfly code to get a feel for coding docking port management, and I came across oapiBroadcastMFDMessage.

In the Dragonfly code, the usage seems to make a call to the stock DockingMFD, and after playing around with it, when used in clbkDockEvent, oapiBroadcastMFDMessage seems to change the DockingMFD to another port.
(I could be wrong, wouldn't be the first time...)

In the OrbiterAPI Guide, all I can find is the function itself, without a description of how it's used:

"oapiBroadcastMFDMessage(int mode, int msg, void *data)"

Could anyone offer a little guidance on how this function is used, particularly in connection with DockingMFD?

Cheers, and thanx!!

ETA: All I can clearly see is that it sends a struct to the DockingMFD:

struct { OBJHANDLE hObj; int dock; } dockspec;
dockspec.hObj = mate;
dockspec.dock = remoteport = (dock ? 0 : -1);
oapiBroadcastMFDMessage(MFD_DOCKING, 0, (void*)&dockspec);
 
Last edited:

ADSWNJ

Scientist
Addon Developer
Joined
Aug 5, 2011
Messages
1,667
Reaction score
3
Points
38
Interesting! I have never come across that before. It's like a protoype of the ModuleMessagingExt system (though ModuleMessagingExt has much more flexibility and controls around data passing).
 

slaver0110

Member
Joined
Mar 21, 2011
Messages
72
Reaction score
2
Points
6
I've been using MMExt for quite a wile, as a prerequisite for certain addons. Had no idea this did the same thing.
Any help on it's usage?

Cheers, and thanx again!:cheers:
 

Enjo

Mostly harmless
Addon Developer
Tutorial Publisher
Donator
Joined
Nov 25, 2007
Messages
1,665
Reaction score
13
Points
38
Location
Germany
Website
www.enderspace.de
Preferred Pronouns
Can't you smell my T levels?
Andrew:
It looks like we've redesigned the wheel, but I still like our compile time checks more than void *data and friends. Such constructs contribute to Orbiter's instability in general.

Any help on it's usage?
First read the documentation.
Then see the examples. It's pretty simple:

LaunchMFD sending out ID of the currently targeted vessel:
https://sourceforge.net/p/enjomitchsorbit/codeHG/ci/default/tree/launchmfd/LaunchMFD.cpp#l511
https://sourceforge.net/p/enjomitchsorbit/codeHG/ci/default/tree/launchmfd/MessagingSender.cpp
https://sourceforge.net/p/enjomitchsorbit/codeHG/ci/default/tree/launchmfd/MessagingSender.h

TransX sending out burn parameters:
https://sourceforge.net/p/enjomitchsorbit/codeHG/ci/default/tree/TransX/src/basefunction.cpp#l873

BurnTimeCalculator receiving TransX' parameters:
https://sourceforge.net/p/enjomitch...tree/BurnTimeCalcMFD/src/DataSourceTransX.cpp
 
Last edited:

ADSWNJ

Scientist
Addon Developer
Joined
Aug 5, 2011
Messages
1,667
Reaction score
3
Points
38
Our wheel is rounder, Enjo :)

Actually - just starting a piece of work for new features for MM Ext, for delivery on a Tuesday sometime next year :).
 
Top