@@ -99,9 +99,8 @@ class BluetoothDevice: public QObject {
9999 Q_PROPERTY (bool batteryAvailable READ batteryAvailable NOTIFY batteryAvailableChanged);
100100 // / Battery level of the connected device, from `0.0` to `1.0`. Only valid if @@batteryAvailable is true.
101101 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);
105104 // / The Bluetooth adapter this device belongs to.
106105 Q_PROPERTY (BluetoothAdapter* adapter READ adapter NOTIFY adapterChanged);
107106 // / DBus path of the device under the `org.bluez` system service.
@@ -148,7 +147,7 @@ class BluetoothDevice: public QObject {
148147 [[nodiscard]] bool wakeAllowed () const { return this ->bWakeAllowed ; }
149148 void setWakeAllowed (bool wakeAllowed);
150149
151- [[nodiscard]] qint16 rssi () const { return this -> bRssi ; }
150+ [[nodiscard]] qint32 signalStrength () const ;
152151
153152 [[nodiscard]] bool pairing () const { return this ->bPairing ; }
154153
@@ -164,7 +163,7 @@ class BluetoothDevice: public QObject {
164163 [[nodiscard]] QBindable<QString> bindableIcon () { return &this ->bIcon ; }
165164 [[nodiscard]] QBindable<qreal> bindableBattery () { return &this ->bBattery ; }
166165 [[nodiscard]] QBindable<BluetoothDeviceState::Enum> bindableState () { return &this ->bState ; }
167- [[nodiscard]] QBindable<qint16> bindableRssi () { return &this ->bRssi ; }
166+ [[nodiscard]] QBindable<qint32> bindableSignalStrength () { return &this ->bSignalStrength ; }
168167
169168 void addInterface (const QString& interface, const QVariantMap& properties);
170169 void removeInterface (const QString& interface);
@@ -184,7 +183,7 @@ class BluetoothDevice: public QObject {
184183 void iconChanged ();
185184 void batteryAvailableChanged ();
186185 void batteryChanged ();
187- void rssiChanged ();
186+ void signalStrengthChanged ();
188187 void adapterChanged ();
189188
190189private:
@@ -208,7 +207,8 @@ class BluetoothDevice: public QObject {
208207 Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, qreal, bBattery, &BluetoothDevice::batteryChanged);
209208 Q_OBJECT_BINDABLE_PROPERTY (BluetoothDevice, BluetoothDeviceState::Enum, bState, &BluetoothDevice::stateChanged);
210209 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);
212212
213213 QS_DBUS_BINDABLE_PROPERTY_GROUP (BluetoothDevice, properties);
214214 QS_DBUS_PROPERTY_BINDING (BluetoothDevice, pAddress, bAddress, properties, " Address" );
0 commit comments