remove hard coded path into CMake files
[profile/ivi/ico-vic-amb-plugin.git] / src / standardmessage.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 STANDARDMESSGAE_H_
20 #define STANDARDMESSGAE_H_
21
22 #include <sys/time.h>
23
24 /**
25  * This class handles the common parts of the message.
26  */
27 class StandardMessage {
28 public:
29     /**
30      * Constructor.
31      */
32     StandardMessage();
33     /**
34      * Destoructor.
35      */
36     ~StandardMessage();
37     /**
38      * This function will attempt to decode the message.
39      *
40      * @param msg Message to be deceded.
41      * @param size the size of the message.
42      */
43     virtual void
44     decode(char *msg, int size);
45     /**
46      * This function decodes the data portion of the data message.
47      *
48      * @param keyeventtype The name of vehicle information of MW.
49      * @param time The recordtime of vehicle information of MW.
50      * @param opt The data portion of the data message.
51      */
52     char*
53     encode(char *name, timeval time);
54
55     /**
56      * Get the name of vehicle information of MW.
57      *
58      * @return The name of vehicle information of MW.
59      */
60     char *
61     getKeyEventType();
62     /**
63      * Get the recordtime of vehicle information of MW.
64      *
65      * @return The recordtime of vehicle information of MW.
66      */
67     timeval
68     getRecordtime();
69
70     /**
71      * The size of message buffer.
72      */
73     static const int BUFSIZE = 256;
74     /**
75      * The size of name of vehicle information of MW.
76      */
77     static const int KEYEVENTTYPESIZE = 64;
78
79 protected:
80     char messagebuf[BUFSIZE];
81     char KeyEventType[KEYEVENTTYPESIZE];
82     timeval recordtime;
83 };
84 #endif // #ifndef STANDARDMESSGAE_H_