automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
openxcplugin.h
1 /*
2 Copyright (C) 2012 Intel 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 OPENXCPLUGIN_H
20 #define OPENXCPLUGIN_H
21 
22 #include <abstractsource.h>
23 #include <string>
24 
25 #include "serialport.hpp"
26 
27 using namespace std;
28 
30 {
31 public:
32  OpenXCPlugin(AbstractRoutingEngine* re, map<string, string> config);
33 
34  const string uuid();
35  void getPropertyAsync(AsyncPropertyReply *reply);
36  void getRangePropertyAsync(AsyncRangePropertyReply *reply);
37  AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
38  void subscribeToPropertyChanges(VehicleProperty::Property property);
39  void unsubscribeToPropertyChanges(VehicleProperty::Property property);
40  PropertyList supported();
41 
42  int supportedOperations();
43 
44  void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, string uuid) {}
45  void supportedChanged(PropertyList) {}
46 
47  void processData();
48 
49 private:
50  PropertyList mRequests;
51 
52  bool translateOpenXCEvent(std::string json);
53 
54  void testParseEngine();
55  std::map<std::string, std::string> openXC2AmbMap;
56 
57  SerialPort* device;
58 
59 };
60 
61 #endif // EXAMPLEPLUGIN_H