Index: sources/bluetooth/BluetoothInterface.cpp =================================================================== diff -u -r7bb28b34d5337c6fe8669ee797e0312639c0e02f -rd1c6d835c562ff192b6b89cf9962b2f994dacaec --- sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision 7bb28b34d5337c6fe8669ee797e0312639c0e02f) +++ sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision d1c6d835c562ff192b6b89cf9962b2f994dacaec) @@ -1231,9 +1231,20 @@ */ void BluetoothInterface::interpretInformation() { + QString vendorName; + QString modelNumberString; for ( auto const &detail: _serviceDeviceInformation->characteristics()) { + switch(detail.uuid().toUInt32()) + { + case QBluetoothUuid::ManufacturerNameString : vendorName = detail.value(); break; + case QBluetoothUuid::ModelNumberString : modelNumberString = detail.value(); break; + default: + break; + } + qDebug() << " ~~~~~ " << detail.name() << detail.uuid() << detail.value(); } + emit didDeviceInfoUpdated(vendorName, modelNumberString); } /*! Index: sources/bluetooth/BluetoothInterface.h =================================================================== diff -u -r7bb28b34d5337c6fe8669ee797e0312639c0e02f -rd1c6d835c562ff192b6b89cf9962b2f994dacaec --- sources/bluetooth/BluetoothInterface.h (.../BluetoothInterface.h) (revision 7bb28b34d5337c6fe8669ee797e0312639c0e02f) +++ sources/bluetooth/BluetoothInterface.h (.../BluetoothInterface.h) (revision d1c6d835c562ff192b6b89cf9962b2f994dacaec) @@ -175,6 +175,7 @@ void didActionReceive (const UIBloodPressureData &vData); void didDeviceChange (const BluetoothDeviceData &vDevice); void didDeviceSelect (const BluetoothDeviceData &vDevice); + void didDeviceInfoUpdated (const QString &vVendorName, const QString &vModelName); SAFE_CALL(doStart) // start the bluetooth adapter. SAFE_CALL(doScan ) // scan for devices. Index: sources/gui/qml/BluetoothStatusIndicator.qml =================================================================== diff -u -r070977fbf934ea7ff458bdadc6c1e0b7e7efd3bf -rd1c6d835c562ff192b6b89cf9962b2f994dacaec --- sources/gui/qml/BluetoothStatusIndicator.qml (.../BluetoothStatusIndicator.qml) (revision 070977fbf934ea7ff458bdadc6c1e0b7e7efd3bf) +++ sources/gui/qml/BluetoothStatusIndicator.qml (.../BluetoothStatusIndicator.qml) (revision d1c6d835c562ff192b6b89cf9962b2f994dacaec) @@ -61,42 +61,35 @@ source : _btStatusRoot.isConnected ? "qrc:/images/BtLogoConnected" : "qrc:/images/BtLogoNotConnected" } - // TODO: Update this to use the updatable RSSI of the bluetooth remote, - // which is not available until Qt 6.5+ : - // https://bugreports.qt.io/browse/QTBUG-69747 - - Text { id: _rssiValue - visible : true //TODO _btStatusRoot.isConnected - anchors.top: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - color : Colors.white - text : "Bt" // TODO vBluetooth.pairedRssi - font.pixelSize: 12 - font.bold: true - } - onClicked: if(displayInformation) _btInfoDialog.open() Item { // To allow better positioning control, wrapping ModalDialog in Item - anchors.right : _btStatusRoot.right - anchors.top : _btStatusRoot.bottom + anchors { + top : _btStatusRoot.bottom + topMargin : Variables.dialogSpaceFromIcon + right : _btStatusRoot.right + } width : _btInfoDialog.width height: _btInfoDialog.height StatusDialog{ id: _btInfoDialog dialogTitleText : qsTr("Bluetooth Info") infoLabels : [ - "Device name" , - "Mac Addr" , - "Battery Level" , + vBluetooth.pairedVendorName , + qsTr("Mac Addr" ), + qsTr("Battery Level" ), ] statusInfo : [ - vBluetooth.pairedName, - vBluetooth.pairedAddr, - vBluetooth.pairedBatt + "%" + vBluetooth.pairedModelName || vBluetooth.pairedName, + vBluetooth.pairedAddr , + vBluetooth.pairedBatt + "%" , + vBluetooth.notification || vDevice.status ] + // TODO: Update this to add the updatable RSSI of the bluetooth remote, + // which is not available until Qt 6.5+ : + // https://bugreports.qt.io/browse/QTBUG-69747 } } } Index: sources/gui/qml/dialogs/StatusDialog.qml =================================================================== diff -u -r06152733946baf8da998803721e9013f48078f48 -rd1c6d835c562ff192b6b89cf9962b2f994dacaec --- sources/gui/qml/dialogs/StatusDialog.qml (.../StatusDialog.qml) (revision 06152733946baf8da998803721e9013f48078f48) +++ sources/gui/qml/dialogs/StatusDialog.qml (.../StatusDialog.qml) (revision d1c6d835c562ff192b6b89cf9962b2f994dacaec) @@ -66,10 +66,11 @@ model: [] Row { + spacing : 5 width: _root.width - _closeButton.width Text { id: _text objectName : _root.textObjectName + index - width : parent.width/2 + width : text == "" ? 0 : parent.width/2 // set width to 0 to have only one line of text text : (index < _root.infoLabels.length) ? _root.infoLabels[index] : "" color : Colors.textMain font.pixelSize : fontPixelSizeText @@ -78,11 +79,11 @@ } Text { objectName : _root.textObjectName + "L" + index - width : parent.width/2 - text : " " + modelData + width : text === "" ? 0 : parent.width/2 // set width to 0 to have only one line of text + text : modelData color : Colors.textMain font.pixelSize : fontPixelSizeText - font.family: Fonts.fontFamilyFixed + font.family : Fonts.fontFamilyFixed horizontalAlignment: Text.AlignLeft } } Index: sources/view/settings/VBluetooth.cpp =================================================================== diff -u -rd1a4fe257de0cc4fe51f241075f429d22d83eebe -rd1c6d835c562ff192b6b89cf9962b2f994dacaec --- sources/view/settings/VBluetooth.cpp (.../VBluetooth.cpp) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe) +++ sources/view/settings/VBluetooth.cpp (.../VBluetooth.cpp) (revision d1c6d835c562ff192b6b89cf9962b2f994dacaec) @@ -38,8 +38,11 @@ this , SLOT( onStateChange (BluetoothData ))); connect(&_BluetoothInterface, SIGNAL(didDeviceChange(BluetoothDeviceData)), this , SLOT( onDeviceChange(BluetoothDeviceData))); + connect(&_BluetoothInterface, SIGNAL(didDeviceInfoUpdated(QString, QString )), + this , SLOT( onDeviceInfoUpdated(QString, QString ))); connect(this , SIGNAL(didDeviceSelect(QString, QString )), this , SLOT( onDeviceSelect(QString, QString ))); + } /*! @@ -310,6 +313,18 @@ } /*! + * \brief View::VBluetooth::onDeviceInfoUpdated + * \details Sets the vendor name and model name properties + * \param vVendorName - the vendor name associated with the remote device + * \param vModelName - the model string of the remote device + */ +void View::VBluetooth::onDeviceInfoUpdated(const QString &vVendorName, const QString &vModelName) +{ + pairedVendorName(vVendorName); + pairedModelName (vModelName ); +} + +/*! * \brief View::VBluetooth::doScan * \details calls the Bluetooth Interface scan to start discovering the Bluetooth devices. */ Index: sources/view/settings/VBluetooth.h =================================================================== diff -u -rd1a4fe257de0cc4fe51f241075f429d22d83eebe -rd1c6d835c562ff192b6b89cf9962b2f994dacaec --- sources/view/settings/VBluetooth.h (.../VBluetooth.h) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe) +++ sources/view/settings/VBluetooth.h (.../VBluetooth.h) (revision d1c6d835c562ff192b6b89cf9962b2f994dacaec) @@ -16,6 +16,7 @@ // Qt #include +#include // Project #include "main.h" // Doxygen : do not remove @@ -52,6 +53,8 @@ PROPERTY(QString , pairedAddr , "" ) PROPERTY(QString , pairedName , "" ) PROPERTY(quint8 , pairedBatt , 0 ) + PROPERTY(QString , pairedVendorName , "" ) + PROPERTY(QString , pairedModelName , "" ) // List Model public: @@ -84,6 +87,8 @@ QString toText (Model::MBluetooth::InterfaceStates vState) const; void notify (Model::MBluetooth::InterfaceStates vState); + void onDeviceInfoUpdated(const QString &vVendorName, const QString &vModelName); + public slots: void doScan (); };