@@ -99,9 +99,8 @@ class BluetoothDevice: public QObject {
99
99
Q_PROPERTY (bool batteryAvailable READ batteryAvailable NOTIFY batteryAvailableChanged);
100
100
// / Battery level of the connected device, from `0.0` to `1.0`. Only valid if @@batteryAvailable is true.
101
101
Q_PROPERTY (qreal battery READ default NOTIFY batteryChanged BINDABLE bindableBattery);
102
- // / Received Signal Strength Indicator in dBm. Only valid when device is discoverable/advertising.
103
- // / Typical values range from -30 (very close) to -90 (far away). Values of 0 indicate no signal data.
104
- Q_PROPERTY (qint16 rssi READ rssi NOTIFY rssiChanged BINDABLE bindableRssi);
102
+ // / Signal strength as a normalized score from 0 to 100, where higher is better (stronger signal).
103
+ Q_PROPERTY (qint32 signalStrength READ signalStrength NOTIFY signalStrengthChanged BINDABLE bindableSignalStrength);
105
104
// / The Bluetooth adapter this device belongs to.
106
105
Q_PROPERTY (BluetoothAdapter* adapter READ adapter NOTIFY adapterChanged);
107
106
// / DBus path of the device under the `org.bluez` system service.
@@ -148,7 +147,7 @@ class BluetoothDevice: public QObject {
148
147
[[nodiscard]] bool wakeAllowed () const { return this ->bWakeAllowed ; }
149
148
void setWakeAllowed (bool wakeAllowed);
150
149
151
- [[nodiscard]] qint16 rssi () const { return this -> bRssi ; }
150
+ [[nodiscard]] qint32 signalStrength () const ;
152
151
153
152
[[nodiscard]] bool pairing () const { return this ->bPairing ; }
154
153
@@ -164,7 +163,7 @@ class BluetoothDevice: public QObject {
164
163
[[nodiscard]] QBindable<QString> bindableIcon () { return &this ->bIcon ; }
165
164
[[nodiscard]] QBindable<qreal> bindableBattery () { return &this ->bBattery ; }
166
165
[[nodiscard]] QBindable<BluetoothDeviceState::Enum> bindableState () { return &this ->bState ; }
167
- [[nodiscard]] QBindable<qint16> bindableRssi () { return &this ->bRssi ; }
166
+ [[nodiscard]] QBindable<qint32> bindableSignalStrength () { return &this ->bSignalStrength ; }
168
167
169
168
void addInterface (const QString& interface, const QVariantMap& properties);
170
169
void removeInterface (const QString& interface);
@@ -184,7 +183,7 @@ class BluetoothDevice: public QObject {
184
183
void iconChanged ();
185
184
void batteryAvailableChanged ();
186
185
void batteryChanged ();
187
- void rssiChanged ();
186
+ void signalStrengthChanged ();
188
187
void adapterChanged ();
189
188
190
189
private:
@@ -208,7 +207,8 @@ class BluetoothDevice: public QObject {
208
207
Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, qreal, bBattery, &BluetoothDevice::batteryChanged);
209
208
Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, BluetoothDeviceState::Enum, bState, &BluetoothDevice::stateChanged);
210
209
Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, bool , bPairing, &BluetoothDevice::pairingChanged);
211
- Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, qint16, bRssi, &BluetoothDevice::rssiChanged);
210
+ Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, qint32, bSignalStrength, &BluetoothDevice::signalStrengthChanged);
211
+ Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, qint16, bRssi);
212
212
213
213
QS_DBUS_BINDABLE_PROPERTY_GROUP (BluetoothDevice, properties);
214
214
QS_DBUS_PROPERTY_BINDING (BluetoothDevice, pAddress, bAddress, properties, " Address" );
0 commit comments