3 Copyright (C) 2012 Intel Corporation
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef WEBSOCKETSOURCE_H
22 #define WEBSOCKETSOURCE_H
26 #include <abstractsource.h>
28 #include <libwebsockets.h>
31 class WebSocketSource : public AbstractSource
35 WebSocketSource(AbstractRoutingEngine* re, map<string, string> config);
37 void getPropertyAsync(AsyncPropertyReply *reply);
38 void getRangePropertyAsync(AsyncRangePropertyReply *reply);
39 AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
40 void subscribeToPropertyChanges(VehicleProperty::Property property);
41 void unsubscribeToPropertyChanges(VehicleProperty::Property property);
42 PropertyList supported();
43 libwebsocket *clientsocket;
44 PropertyList queuedRequests;
46 void checkSubscriptions();
47 PropertyList activeRequests;
48 PropertyList removeRequests;
49 void setSupported(PropertyList list);
50 void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, string uuid) {}
51 void supportedChanged(PropertyList) {}
52 void setConfiguration(map<string, string> config);
53 map<VehicleProperty::Property,AsyncPropertyReply*> propertyReplyMap;
56 PropertyList m_supportedProperties;
60 #endif // WEBSOCKETSOURCE_H