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 GPSNMEAPLUGIN_H
20 #define GPSNMEAPLUGIN_H
22 #include <abstractsource.h>
25 #include "abstractio.hpp"
31 class GpsNmeaSource: public AbstractSource
35 GpsNmeaSource(AbstractRoutingEngine* re, map<string, string> config);
39 void getPropertyAsync(AsyncPropertyReply *reply);
40 void getRangePropertyAsync(AsyncRangePropertyReply *reply);
41 AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
42 void subscribeToPropertyChanges(VehicleProperty::Property property);
43 void unsubscribeToPropertyChanges(VehicleProperty::Property property);
44 PropertyList supported();
46 int supportedOperations();
48 void supportedChanged(const PropertyList &) {}
50 PropertyInfo getPropertyInfo(VehicleProperty::Property property)
52 if(propertyInfoMap.find(property) != propertyInfoMap.end())
53 return propertyInfoMap[property];
55 return PropertyInfo::invalid();
62 bool tryParse(std::string data);
64 void addPropertySupport(VehicleProperty::Property property, Zone::Type zone);
66 bool checksum(string sentence);
68 std::map<VehicleProperty::Property, PropertyInfo> propertyInfoMap;
70 PropertyList mRequests;
71 PropertyList mSupported;
81 #endif // EXAMPLEPLUGIN_H