1 #include "msg_0001_hello.hxx"
\r
3 main(int argc, char **argv)
\r
6 FGMPSMsg0001Hello msg1, *msg2;
\r
8 FGMPSMsg0001Hello::registerme();
\r
13 msg1.servname = "test";
\r
15 str = msg1.encodemsg();
\r
17 printf("Message ID = %ui\n", msg1.getmessageid());
\r
18 printf("major = %u\n", msg1.vermajor);
\r
19 printf("minor = %u\n", msg1.verminor);
\r
20 printf("patch = %u\n", msg1.verpatch);
\r
21 printf("sname = %s\n", msg1.servname.c_str());
\r
24 for (int i=0; i<str.length(); i++) printf("%02x ", (unsigned char)str[i]);
\r
28 msg2 = (FGMPSMsg0001Hello*)FGMPSMessage::decodemsg(str);
\r
29 } catch (FGMPSDataException e) {
\r
30 printf("Exception: %s\n", e.what());
\r
34 printf("Message ID = %u\n", msg2->getmessageid());
\r
35 printf("major = %u\n", msg2->vermajor);
\r
36 printf("minor = %u\n", msg2->verminor);
\r
37 printf("patch = %u\n", msg2->verpatch);
\r
38 printf("sname = %s\n", msg2->servname.c_str());
\r