remove hard coded path into CMake files
[profile/ivi/ico-vic-amb-plugin.git] / src / datamessage.h
1 /**
2  * Copyright (C) 2012  TOYOTA MOTOR CORPORATION.
3  * 
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  * 
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  * 
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17  * 
18  */
19 #ifndef DATAMESSAGE_H_
20 #define DATAMESSAGE_H_
21
22 #include "messageformat.h"
23
24 class StandardMessage;
25
26 /**
27  * This class handled the data message.
28  */
29 class DataMessage : public StandardMessage {
30 public:
31     static const int STATUSSIZE = BUFSIZE - KEYEVENTTYPESIZE - sizeof(timeval)
32             - sizeof(int);
33     /**
34      * Constructor.
35      */
36     DataMessage();
37     /**
38      * Destructor.
39      */
40     ~DataMessage();
41     /**
42      * This function will attempt to decode the message.
43      *
44      * @param msg Message to be deceded.
45      * @param size the size of the message.
46      */
47     void
48     decode(char *msg, int size);
49     /**
50      * This function decodes the data portion of the data message.
51      *
52      * @param keyeventtype The name of vehicle information of MW.
53      * @param time The recordtime of vehicle information of MW.
54      * @param opt The data portion of the data message.
55      */
56     void
57     decodeOpt(char *keyeventype, timeval time, void *opt);
58     /**
59      * This function will attempt to encode the message.
60      *
61      * @param name The name of vehicle information of MW.
62      * @param time The recordtime of vehicle information of MW.
63      * @param opt The data portion of the data message.
64      * @return Binary data.
65      */
66     char *
67     encode(char *name, timeval time, DataOpt opt);
68
69     /**
70      * Get the data portion of the data message.
71      *
72      * @return The data portion of the data message.
73      */
74     DataOpt
75     getDataOpt();
76
77 public:
78     DataOpt dataopt;
79 };
80 #endif // #ifndef DATAMESSAGE_H_