summaryrefslogtreecommitdiff
path: root/plugins/testplugin/testplugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/testplugin/testplugin.h')
-rw-r--r--plugins/testplugin/testplugin.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/plugins/testplugin/testplugin.h b/plugins/testplugin/testplugin.h
new file mode 100644
index 00000000..1b91efae
--- /dev/null
+++ b/plugins/testplugin/testplugin.h
@@ -0,0 +1,78 @@
+
+/*
+Copyright (C) 2012 Intel Corporation
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#ifndef OBD2SOURCE_H
+#define OBD2SOURCE_H
+
+
+
+#include <abstractsource.h>
+#include <string>
+#include <sstream>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <termios.h>
+#include <glib.h>
+
+
+
+
+class TestPlugin : public AbstractSource
+{
+
+public:
+ TestPlugin(AbstractRoutingEngine* re, map<string, string> config);
+ ~TestPlugin();
+ const string uuid();
+ int portHandle;
+ void getPropertyAsync(AsyncPropertyReply *reply);
+ void getRangePropertyAsync(AsyncRangePropertyReply *reply){}
+ AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
+ void subscribeToPropertyChanges(VehicleProperty::Property property);
+ void unsubscribeToPropertyChanges(VehicleProperty::Property property);
+ PropertyList supported();
+
+ int supportedOperations();
+
+ void supportedChanged(const PropertyList &) {}
+ void setConfiguration(map<string, string> config);
+ //void randomizeProperties();
+ void updateProperty(VehicleProperty::Property property, AbstractPropertyType *value);
+
+ PropertyInfo getPropertyInfo(const VehicleProperty::Property & property);
+ void propertyChanged(AbstractPropertyType *value);
+
+private:
+ bool testCoreSetSupported();
+ bool testCoreUpdateSupported();
+ bool testSetAndGet();
+ bool testSubscription();
+
+ PropertyList m_supportedProperties;
+ int subscriptionsToSupportedCounter;
+ int subscriptionsToUnsupportedCounter;
+ int unsubscriptionsToSupportedCounter;
+ int unsubscriptionsToUnsupportedCounter;
+ int propertyChanges;
+ int supportedPropertyChanges;
+};
+
+#endif // OBD2SOURCE_H