#define GPSNMEAPLUGIN_H
#include <abstractsource.h>
+
#include <string>
-#include "abstractio.hpp"
+#include <abstractio.hpp>
+#include <ambpluginimpl.h>
using namespace std;
class Location;
+class Bluetooth5;
+class BluetoothDevice;
-class GpsNmeaSource: public AbstractSource
+class GpsNmeaSource: public AmbPluginImpl
{
public:
- GpsNmeaSource(AbstractRoutingEngine* re, map<string, string> config);
+ GpsNmeaSource(AbstractRoutingEngine* re, map<string, string> config, AbstractSource &parent);
~GpsNmeaSource();
-
- const string uuid();
- 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 propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, string uuid) {}
- void supportedChanged(PropertyList) {}
-
- PropertyInfo getPropertyInfo(VehicleProperty::Property property)
- {
- if(propertyInfoMap.find(property) != propertyInfoMap.end())
- return propertyInfoMap[property];
-
- return PropertyInfo::invalid();
- }
+
+ const string uuid() const;
void canHasData();
-
-private:
- void addPropertySupport(VehicleProperty::Property property, Zone::Type zone);
+ void test();
+
+ int supportedOperations() const;
+
+ void init();
- std::map<VehicleProperty::Property, PropertyInfo> propertyInfoMap;
+private:
+ bool tryParse(std::string data);
+
+ bool checksum(string sentence);
PropertyList mRequests;
PropertyList mSupported;
Location *location;
std::string mUuid;
+
+ std::string buffer;
+
+ std::shared_ptr<AbstractPropertyType> rawNmea;
+
+#ifdef USE_BLUEZ5
+ Bluetooth5 * bt;
+#else
+ BluetoothDevice *bt;
+#endif
};
#endif // EXAMPLEPLUGIN_H