2 Copyright (C) 2012 Intel 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 EXAMPLEPLUGIN_H
20 #define EXAMPLEPLUGIN_H
22 #include <abstractsource.h>
27 class ExampleSourcePlugin: public AbstractSource
31 ExampleSourcePlugin(): AbstractSource(nullptr, map<string, string>()) {}
32 ExampleSourcePlugin(AbstractRoutingEngine* re, map<string, string> config);
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();
42 int supportedOperations();
44 void supportedChanged(const PropertyList &) {}
46 void randomizeProperties();
48 PropertyInfo getPropertyInfo(const VehicleProperty::Property & property)
50 if(propertyInfoMap.find(property) != propertyInfoMap.end())
51 return propertyInfoMap[property];
53 return PropertyInfo::invalid();
58 void addPropertySupport(VehicleProperty::Property property, Zone::Type zone);
60 std::map<VehicleProperty::Property, PropertyInfo> propertyInfoMap;
61 std::map<Zone::Type, Airbag::Status> airbagStatus;
62 std::map<Zone::Type, bool> acStatus;
63 PropertyList mRequests;
64 PropertyList mSupported;
68 VehicleProperty::VehicleSpeedType vel;
69 VehicleProperty::EngineSpeedType es;
70 VehicleProperty::AccelerationXType ac;
71 VehicleProperty::SteeringWheelAngleType swa;
72 VehicleProperty::TransmissionShiftPositionType tsp;
73 VehicleProperty::TransmissionGearPositionType tgp;
74 VehicleProperty::ThrottlePositionType tp;
75 VehicleProperty::EngineCoolantTemperatureType ec;
76 VehicleProperty::MachineGunTurretStatusType mgt;
79 #endif // EXAMPLEPLUGIN_H