Welcome, Guest

how to implement payload data element messages
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: how to implement payload data element messages
#178
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
johnbogle
OpenJAUS Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#179
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
tgalluzzo
Admin
Posts: 78
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#180
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
johnbogle
OpenJAUS Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Copyright © 2010 OpenJAUS. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.