|
how to implement payload data element messages 4 Months, 3 Weeks ago
|
|
|
I need to implement code that creates a ReportPayloadDataElement message with a couple of floating point data elements. I have looked at the query and report payload data element routines but I don't understand how to get the data into the ReportPayloadDataElementMessage struct. Apparently, you need to use the information interface stuff, which I have not been able to figure out how to use.
// data I want to send
int npayload_data_elements = 2;
float payload_data[2];
payload_data[0] = 42.35;
payload_data[1] = -478.3;
// create a ReportPayloadDataElementMessage message
ReportPayloadDataElementMessage message1;
message1 = reportPayloadDataElementMessageCreate();
>>>> what goes here? how to imbed payload data into the ReportPayloadDataElementMessage message? <<<<
JAUSMsg = reportPayloadDataElementMessageToJausMessage(message1);
send JAUSmsg ....
Thanks for your help.
Regards,
John
|
|
|
|
|
|
|
Re: how to implement payload data element messages 4 Months, 2 Weeks ago
|
|
|
John,
I feel your pain. I haven't used these messages in a long time, because they're so cumbersome.
The first thing to do is to create a JausPayloadInterface (see JausPayloadInterface.h)
Then you need to populate it with one or more JausCommandInterfaces or JausInformationInterfaces (again JausPayloadInterface.h)
You then send this with the PayloadInterfaceMesasge. As you want to transfer information or commands, you first change the data within the PayloadInterface struct itself. You then create a ReportPayloadDataElementMessage and set its payloadInterface pointer to the one that you already created. Finally set the index numbers equal to the ones from the payload interface that you want to send, and send the message.
See you Monday
Tom
|
|
|
|
|
|
|
Re: how to implement payload data element messages 4 Months, 2 Weeks ago
|
|
|
Thanks Tom for the insight, I will give it a go.
Regards,
John
|
|
|
|
|
|
|