diff options
Diffstat (limited to 'plugins/common')
-rw-r--r-- | plugins/common/abstractdbusinterface.cpp | 2 | ||||
-rw-r--r-- | plugins/common/bluetooth.hpp | 1 | ||||
-rw-r--r-- | plugins/common/bluetooth5.cpp | 10 | ||||
-rw-r--r-- | plugins/common/dbusplugin.cpp | 4 | ||||
-rw-r--r-- | plugins/common/dbussignaller.h | 2 | ||||
-rw-r--r-- | plugins/common/jsonprotocol.cpp | 3 | ||||
-rw-r--r-- | plugins/common/jsonprotocol.h | 2 | ||||
-rw-r--r-- | plugins/common/serialport.hpp | 6 | ||||
-rw-r--r-- | plugins/common/varianttype.cpp | 2 |
9 files changed, 11 insertions, 21 deletions
diff --git a/plugins/common/abstractdbusinterface.cpp b/plugins/common/abstractdbusinterface.cpp index 8dcba0cd..d40a954f 100644 --- a/plugins/common/abstractdbusinterface.cpp +++ b/plugins/common/abstractdbusinterface.cpp @@ -237,7 +237,7 @@ void AbstractDBusInterface::handleMyMethodCall(GDBusConnection *connection AbstractDBusInterface::AbstractDBusInterface(string interfaceName, string objectName, GDBusConnection* connection) - : mInterfaceName(interfaceName), mConnection(connection), mPropertyName(objectName), supported(false), zoneFilter(Zone::None), mTime(0), regId(0) + : zoneFilter(Zone::None), supported(false), mTime(0), mInterfaceName(interfaceName), mPropertyName(objectName), mConnection(connection), regId(0) { startRegistration(); diff --git a/plugins/common/bluetooth.hpp b/plugins/common/bluetooth.hpp index a5799b56..1510f7c4 100644 --- a/plugins/common/bluetooth.hpp +++ b/plugins/common/bluetooth.hpp @@ -176,7 +176,6 @@ public: return ; } - gchar* serialDeviceName; if(!org_bluez_serial_call_disconnect_sync(serialDevice,"spp",NULL,&error)) { DebugOut(DebugOut::Warning)<<"Error disconnecting bluetooth serial device: "<<address<<" - "<<error->message<<endl; diff --git a/plugins/common/bluetooth5.cpp b/plugins/common/bluetooth5.cpp index c2c63275..936f5e25 100644 --- a/plugins/common/bluetooth5.cpp +++ b/plugins/common/bluetooth5.cpp @@ -200,9 +200,6 @@ std::string findDevice(std::string address, std::string adapterPath) Bluetooth5::Bluetooth5() { GError* errorIntrospection = NULL; - - GDBusNodeInfo* introspection = g_dbus_node_info_new_for_xml(introspection_xml, &errorIntrospection); - auto errorIntrospectionPtr = amb::make_super(errorIntrospection); if(errorIntrospectionPtr) @@ -212,9 +209,6 @@ Bluetooth5::Bluetooth5() } GError* errorBus = nullptr; - - GDBusInterfaceInfo* mInterfaceInfo = g_dbus_node_info_lookup_interface(introspection, "org.bluez.Profile1"); - mConnection = amb::make_super(g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &errorBus)); auto errorBusPtr = amb::make_super(errorBus); @@ -226,11 +220,7 @@ Bluetooth5::Bluetooth5() } GError* errorRegister = nullptr; - - int regId = g_dbus_connection_register_object(mConnection.get(), "/org/bluez/spp", mInterfaceInfo, &interfaceVTable, this, NULL, &errorRegister); - auto errorRegisterPtr = amb::make_super(errorRegister); - if(errorRegisterPtr) { diff --git a/plugins/common/dbusplugin.cpp b/plugins/common/dbusplugin.cpp index e56b403b..9e51f94e 100644 --- a/plugins/common/dbusplugin.cpp +++ b/plugins/common/dbusplugin.cpp @@ -29,8 +29,8 @@ std::map<std::string, std::string> DBusSink::dbusConfig; DBusSink::DBusSink(std::string propertyName, AbstractRoutingEngine* engine, GDBusConnection* connection, std::map<std::string, std::string> config) - :AbstractDBusInterface("org.automotive."+propertyName, propertyName, connection), - AbstractSink(engine, dbusConfig) + : AbstractSink(engine, dbusConfig), + AbstractDBusInterface("org.automotive."+propertyName, propertyName, connection) { AbstractDBusInterface::re = engine; diff --git a/plugins/common/dbussignaller.h b/plugins/common/dbussignaller.h index fb82383d..fd076489 100644 --- a/plugins/common/dbussignaller.h +++ b/plugins/common/dbussignaller.h @@ -95,7 +95,7 @@ private: for(auto itr : queue) { std::string objectPath; - GDBusConnection* connection; + GDBusConnection* connection = NULL; std::string interfaceName; std::string signalName; diff --git a/plugins/common/jsonprotocol.cpp b/plugins/common/jsonprotocol.cpp index a5349006..3d11e82c 100644 --- a/plugins/common/jsonprotocol.cpp +++ b/plugins/common/jsonprotocol.cpp @@ -404,7 +404,7 @@ bool amb::BaseJsonMessageReader::hasJson() incompleteMessage = incompleteMessage.substr(start-1); } - int end = incompleteMessage.find("\n"); + unsigned int end = incompleteMessage.find("\n"); if(end == std::string::npos) { @@ -578,6 +578,7 @@ bool amb::GetMethodCall::fromJson(const picojson::value &json) MethodCall::fromJson(json); value = Object::fromJson(json.get("data").get<picojson::object>()); + return true; } diff --git a/plugins/common/jsonprotocol.h b/plugins/common/jsonprotocol.h index 9bf6e3aa..e7a06aea 100644 --- a/plugins/common/jsonprotocol.h +++ b/plugins/common/jsonprotocol.h @@ -170,7 +170,7 @@ class MethodReply public: MethodReply(): MethodReply(nullptr, false) {} - MethodReply(std::shared_ptr<T> t, bool success): mMethod(t), methodSuccess(success), err(AsyncPropertyReply::NoError) { } + MethodReply(std::shared_ptr<T> t, bool success): methodSuccess(success), mMethod(t), err(AsyncPropertyReply::NoError) { } bool methodSuccess; picojson::value toJson() diff --git a/plugins/common/serialport.hpp b/plugins/common/serialport.hpp index 1d5038e6..8577fb06 100644 --- a/plugins/common/serialport.hpp +++ b/plugins/common/serialport.hpp @@ -21,7 +21,7 @@ private: public: SerialPort() - :fd(0), speed(B9600) + :speed(B9600), fd(0) { } @@ -35,7 +35,7 @@ public: } SerialPort(std::string _tty) - :tty(_tty), fd(0) + :fd(0), tty(_tty) { speed = B9600; } @@ -95,7 +95,7 @@ public: char buff; std::string result; int bytesread = 0; - while( bytesread = ::read(fd, &buff, 1) > 0 ) + while((bytesread = ::read(fd, &buff, 1)) > 0 ) { result += buff; } diff --git a/plugins/common/varianttype.cpp b/plugins/common/varianttype.cpp index 37024261..615ae52b 100644 --- a/plugins/common/varianttype.cpp +++ b/plugins/common/varianttype.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <listplusplus.h> VariantType::VariantType(AbstractRoutingEngine* re, VehicleProperty::Property ambPropertyName, std::string propertyName, Access access) - :mPropertyName(propertyName), mAccess(access), mValue(nullptr), mZoneFilter(Zone::None), mUpdateFrequency(0), mInitialized(false) + :mZoneFilter(Zone::None), mUpdateFrequency(0), mPropertyName(propertyName), mAccess(access), mValue(nullptr), mInitialized(false) { mAmbPropertyName = ambPropertyName; routingEngine = re; |