opendroneid / opendroneid-core-c

Open Drone ID Core C Library
Apache License 2.0
170 stars 64 forks source link

Difference between different message types #66

Closed michaelzing closed 1 year ago

michaelzing commented 1 year ago

Hi,

So the ASTM standard requires 6 different types of messages:

int encodeBasicIDMessage(ODID_BasicID_encoded outEncoded, ODID_BasicID_data inData); int encodeLocationMessage(ODID_Location_encoded outEncoded, ODID_Location_data inData); int encodeAuthMessage(ODID_Auth_encoded outEncoded, ODID_Auth_data inData); int encodeSelfIDMessage(ODID_SelfID_encoded outEncoded, ODID_SelfID_data inData); int encodeSystemMessage(ODID_System_encoded outEncoded, ODID_System_data inData); int encodeOperatorIDMessage(ODID_OperatorID_encoded outEncoded, ODID_OperatorID_data inData); int encodeMessagePack(ODID_MessagePack_encoded outEncoded, ODID_MessagePack_data inData);

One of encodeMessagePack()'s parameters is the struct inData. Does inData have to contain all of the individual messages? Or can it contain some and not others, as long as the periodicity requirements are met for all messages?

And just to clarify, for legacy advertising, you do not need encodeMessagePack() at all? You just broadcast the individual messages one at a time as long as you meet the periodicity requirement?

Thanks in advance, this is a great project 🙏

gabrielcox commented 1 year ago

inData can contain a subset of the messageTypes in the standard, but it must contain "all message types being sent" (F3411-22a, 5.4.5.22). For example: an FAA compliant implementation may only send the 3 required messages types of BasicID, LocationVector, and System. Just send them all in a single messagePack each time rather that encoding 1 messagePack with BasicID and another messagePack with the rest.

Note that inData is of type ODID_MessagePack_data, and within ODID_MessagePack_data you'll see that it contains an array of messages. Also be sure to be familiar with how union typedefs work (it's relevant in how the array of messages work within ODID_MessagePack_data.

For legacy broadcasts, you don't use messagePacks at all. Just send the (separate) individual messages of each desired type in sequence (with all required messages being sent within the periodicity requirement).

If this is for FAA compliance, be sure to use the MOC which overrides the periodicity of all required message to be of the dynamic periodicity (1 second).

michaelzing commented 1 year ago

Thank you so much for your help! That clears it all up.