2 * Copyright (C) 2012 TOYOTA MOTOR CORPORATION.
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.
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.
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
19 #ifndef DATAMESSAGE_H_
20 #define DATAMESSAGE_H_
22 #include "messageformat.h"
24 class StandardMessage;
27 * This class handled the data message.
29 class DataMessage : public StandardMessage {
31 static const int STATUSSIZE = BUFSIZE - KEYEVENTTYPESIZE - sizeof(timeval)
42 * This function will attempt to decode the message.
44 * @param msg Message to be deceded.
45 * @param size the size of the message.
48 decode(char *msg, int size);
50 * This function decodes the data portion of the data message.
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.
57 decodeOpt(char *keyeventype, timeval time, void *opt);
59 * This function will attempt to encode the message.
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.
67 encode(char *name, timeval time, DataOpt opt);
70 * Get the data portion of the data message.
72 * @return The data portion of the data message.
80 #endif // #ifndef DATAMESSAGE_H_