- Подключиться к DBus
- Запустите обнаружение с помощью адаптера «по умолчанию» (только жестко запрограммированного в hci0)
- Используйте org.freedesktop.DBus. ObjectManager.GetManagedObjects() для поиска доступных устройств.
< pre class="lang-cpp Prettyprint-override">#include
#include
struct DBusDeleter
{
void operator()(DBusConnection *connection) {dbus_connection_unref(connection);}
void operator()(DBusMessage *msg) {dbus_message_unref(msg);}
void operator()(DBusError *err) {dbus_error_free(err);}
};
void print_managed_objects(std::unique_ptr message)
{
DBusMessageIter message_iter;
dbus_message_iter_init(message.get(), &message_iter);
std::cout
Подробнее здесь: https://stackoverflow.com/questions/783 ... -parameter
Мобильная версия