disabled irc in bluemonkey
[profile/ivi/automotive-message-broker.git] / plugins / gpsnmea / gpsnmea.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 GPSNMEAPLUGIN_H
20 #define GPSNMEAPLUGIN_H
21
22 #include <abstractsource.h>
23 #include <string>
24
25 #include "abstractio.hpp"
26
27 using namespace std;
28
29 class Location;
30 class Bluetooth5;
31 class BluetoothDevice;
32
33 class GpsNmeaSource: public AbstractSource
34 {
35
36 public:
37         GpsNmeaSource(AbstractRoutingEngine* re, map<string, string> config);
38         ~GpsNmeaSource();
39
40         const string uuid();
41         void getPropertyAsync(AsyncPropertyReply *reply);
42         void getRangePropertyAsync(AsyncRangePropertyReply *reply);
43         AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
44         void subscribeToPropertyChanges(VehicleProperty::Property property);
45         void unsubscribeToPropertyChanges(VehicleProperty::Property property);
46         PropertyList supported();
47
48         int supportedOperations();
49
50         void supportedChanged(const PropertyList &) {}
51
52         PropertyInfo getPropertyInfo(VehicleProperty::Property property)
53         {
54                 if(propertyInfoMap.find(property) != propertyInfoMap.end())
55                         return propertyInfoMap[property];
56
57                 return PropertyInfo::invalid();
58         }
59
60         void canHasData();
61
62         void test();
63
64 private:
65         bool tryParse(std::string data);
66
67         void addPropertySupport(VehicleProperty::Property property, Zone::Type zone);
68
69         bool checksum(string sentence);
70
71         std::map<VehicleProperty::Property, PropertyInfo> propertyInfoMap;
72
73         PropertyList mRequests;
74         PropertyList mSupported;
75
76         AbstractIo* device;
77         Location *location;
78
79         std::string mUuid;
80
81         std::string buffer;
82 #ifdef USE_BLUEZ5
83         Bluetooth5 * bt;
84 #else
85         BluetoothDevice *bt;
86 #endif
87 };
88
89 #endif // EXAMPLEPLUGIN_H