Skip to content

Commit

Permalink
IPC: Serialize payload as byte array
Browse files Browse the repository at this point in the history
  • Loading branch information
jacky309 committed Sep 17, 2018
1 parent 76e7b32 commit dc9e4ca
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 62 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ find_package(Qt5 REQUIRED Core Gui Qml Quick)

set(CMAKE_CONFIG_INSTALLATION_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")
endif()
Expand Down
21 changes: 21 additions & 0 deletions src/ipc/dbus/ipc-dbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@
namespace facelift {
namespace dbus {

DBusIPCMessage DBusIPCMessage::call(const QDBusConnection &connection)
{
if (m_outputPayload) {
m_message << m_outputPayload->getContent();
}
qDebug() << "Sending IPC message : " << toString();
auto replyDbusMessage = connection.call(m_message);
DBusIPCMessage reply(replyDbusMessage);
return reply;
}


void DBusIPCMessage::send(const QDBusConnection &connection)
{
if (m_outputPayload) {
m_message << m_outputPayload->getContent();
}
qDebug() << "Sending IPC message : " << toString();
bool successful = connection.send(m_message);
Q_ASSERT(successful);
}

DBusManager::DBusManager() : m_busConnection(QDBusConnection::sessionBus())
{
Expand Down
Loading

0 comments on commit dc9e4ca

Please sign in to comment.