target_link_libraries(bluetoothplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib amb-plugins-common -L${CMAKE_CURRENT_BINARY_DIR}/plugins/common ${link_libraries} ${gio_LIBRARIES} ${QT_LIBRARIES})
install(TARGETS bluetoothplugin LIBRARY DESTINATION lib/automotive-message-broker)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ambbt.conf DESTINATION /etc/dbus-1/system.d )
+
add_executable(testAmbBt "testAmbBt.cpp")
target_link_libraries(testAmbBt ${link_libraries} amb -L${CMAKE_CURRENT_BINARY_DIR}/lib amb-plugins-common -L${CMAKE_CURRENT_BINARY_DIR}/plugins/common ${QT_LIBRARIES})
--- /dev/null
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <policy context="default">
+ <allow own="org.automotive.message.broker.bluetooth"/>
+ <allow send_destination="org.automotive.message.broker.bluetooth"/>
+
+
+ <allow send_interface="org.bluez.Profile1"
+ send_path="/org/bluez/spp" />
+
+ </policy>
+
+</busconfig>
{
new BtProfileAdaptor(this);
- QDBusConnection::systemBus().registerObject("/org/bluez/spp", this);
+ if(!QDBusConnection::systemBus().registerService("org.automotive.message.broker.bluetooth"))
+ DebugOut(DebugOut::Error)<<"Failed to register DBus service name: "<<QDBusConnection::systemBus().lastError().message().toStdString()<<endl;
+
+ if(!QDBusConnection::systemBus().registerObject("/org/bluez/spp", this))
+ DebugOut(DebugOut::Error)<<"Failed to register DBus object"<<endl;
QDBusInterface profileManagerIface("org.bluez", "/org/bluez", "org.bluez.ProfileManager1", QDBusConnection::systemBus());