I'm trying to connect a D-Bus signal to a Qt slot. For example, I'm interested to catch the CallAdded signal:
http://git.kernel.org/cgit/network/ofono/ofono.git/tree/doc/voicecallmanager-api.txt
I did the folloging:
QDBusConnection::systemBus().connect(OFONO_SERVICE, m_modem.path(), OFONO_VOICECALLMANAGER_INTERFACE, "CallAdded", this, SLOT(callAdded(QString,QMap<QString,QVariant>)));
where:
OFONO_SERVICE = "org.ofono"
m_modem.path() = /hfp/org/bluez/hci0/dev_xx_xx_x_xx_xx_xx
OFONO_VOICECALLMANAGER_INTERFACE = "org.ofono.VoiceCallManager"
but nothing happens when I make or receive a call. Of course I'm connected and I've enabled and set online the modem.
Perhaps my "translated" signature is wrong?
Related
Peripheral: Nordic nRF52840 chipset with Zephyr
Central: Android smartphone
Bond is created and "pairing_complete" callback is called in peripheral.
But when manually delete the bonding(from Bluetooth > [peripheral device]Unpair), how can the peripheral gets a notification?
BT_CONN_CB_DEFINE(conn_callbacks) = {
.connected = connected,
.disconnected = disconnected,
};
struct bt_conn_auth_cb cb = {
.cancel = cancel,
.oob_data_request = NULL,
.pairing_confirm = NULL,
.passkey_confirm = pass_confirm,
.passkey_display = pass_display,
.passkey_entry = NULL,
};
bt_conn_auth_cb_register(&cb);
struct bt_conn_auth_info_cb info_cb = {
.bond_deleted = bond_deleted, // ------> not getting called when central deletes the pairing
.pairing_complete = pairing_complete,
.pairing_failed = pairing_failed,
};
bt_conn_auth_info_cb_register(&info_cb);
The callbacks are implemented as usual.
My question is, when user deletes the bonding(unpair) from smartphone:
Why the peripheral not getting notification in "bond_deleted' callback?
Is there any other way to get this notification?
Or is this BLE concept?
FYI:
"disconnected" callback is getting called
After disconnection, if I connect from another central, peripheral gets the "bond_deleted" called before bonded
The bond_deleted callback seems only being called when the bond removal is initiated by the local device, as seen here: https://github.com/zephyrproject-rtos/zephyr/pull/26876 where it was introduced. Maybe this callback is called for you when you bond a new central because the oldest one is being removed.
Naturally, the peripheral can't be notified of the bond removal in the central in case the peripheral is disconnected (e.g. out of range) when being unbonded in the central.
If there is a connection ongoing while the central unbonds, then unfortunately it just disconnects without informing the peripheral that the central has removed its bond. The next time it connects (if it ever does so), it will need to perform a new pairing attempt in case it needs to communicate securely.
To solve the issue that the peripheral is not notified of the unbonding attempt, there is a BLE service for that: the Bond Management Service. See https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_bms/README.html for an nRF Connect SDK implementation. I'm not sure if Android implements it though (I would be surprised if it did).
I am using QTcpSocket to connect to given host:
QHostAddress oAddr( u32Addr);
QTcpSocket* poSocket = new QTcpSocket(this);
connect(poSocket, SIGNAL(connected()), this, SLOT(readCheckConnection()));
poSocket->connectToHost( oAddr, 80);
I am not using waitForConnected() because I try to connect many hosts at once, sometimes with quite long time connection so I need to count on connected() signal.
Everything works fine with Windows 10, problem appears with Windows 11. Signal connected() is emitted although there is no host existing. Moreover when socket state is checked it also returns CONNECTED state.
I am working wit QT 5.15.2. What may cause this problem?
I was able to advertise the BLE and setup GATT Services and Characteristics by following the "example_advertisement" and "example-gatt-server" in Bluez Examples. How can I know from DBUS when a BLE client is connected and when it is disconnected, using similar DBUS binding for Python? Which DBUS API do I look into?
There is another example that you can look at: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/test-discovery
When BlueZ/DBus learns of a new remote device, then the InterfacesAdded signal gets sent.
When a remote device goes from disconnected, to connected. Then that is a property change on the device and the PropertiesChanged signal gets sent.
This is why there is the code in the above example they use add_signal_receiver to add callbacks for both signals.
bus.add_signal_receiver(interfaces_added,
dbus_interface = "org.freedesktop.DBus.ObjectManager",
signal_name = "InterfacesAdded")
bus.add_signal_receiver(properties_changed,
dbus_interface = "org.freedesktop.DBus.Properties",
signal_name = "PropertiesChanged",
arg0 = "org.bluez.Device1",
path_keyword = "path")
As a side note, the DBus bindings used in the Buez examples are not the only ones available:
https://www.freedesktop.org/wiki/Software/DBusBindings/
I am having a method and signal. From one process which is developed in Qt Creator 5.2.1, has 1 method and 1 signal.
The method is called using QDbusConnection and QDbusMessage.
The signal is connected with one slot.
A remote application which is to be developed in C should call the method remotely and should emit signal.
I need to know the sequence to remotely run the method and the sequence to emit signal.
Please help me the sequence in C program. No clear picture I found while surfing in internet.
QNetworkConfigurationManager::configurationChanged() signal is not getting called by the system when I am inserting a LAN cable with a valid IP(Ethernet interface).
It is getting called for WLAN and USB interface but not for ETHERNET config changes
Hope to get some pointers on this.