Index: sources/bluetooth/BluetoothInterface.cpp =================================================================== diff -u -r3e64d98e243484505a44d99b13826097cb6b01eb -r093155324dda47cba65693b72a2d1b0290d0c29a --- sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision 3e64d98e243484505a44d99b13826097cb6b01eb) +++ sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision 093155324dda47cba65693b72a2d1b0290d0c29a) @@ -77,13 +77,14 @@ void BluetoothInterface::quit() { if ( ! _isValid ) return; - // coco begin validated: Application termination is not correctly done in coco!!! - // it has been tested and works perfectly fine in normal run. - quitThread(); // validated if ( _local ) _local ->deleteLater(); if ( _agent ) _agent ->deleteLater(); quitDevice(); + + // coco begin validated: Application termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. + quitThread(); // validated } // coco end @@ -675,11 +676,6 @@ if ( ! sender() ) return; QLowEnergyService *service = reinterpret_cast(sender()); switch (vState) { - case QLowEnergyService::InvalidService : - // After disconnection the services are invalidated by Qt. - // NOTIFY_DETAILS_ERROR - break; - case QLowEnergyService::ServiceDiscovered : { NOTIFY_SERVICE_DETAILS_DONE switch( service->serviceUuid().toUInt32() ) { @@ -705,9 +701,16 @@ break; } // DEBUG: printCharacteristics(service); + break; } + + case QLowEnergyService::InvalidService : + // After disconnection the services are invalidated by Qt. + // NOTIFY_DETAILS_ERROR + break; + default: - break; + break; } } @@ -907,7 +910,7 @@ switch(_device->state()) { case QLowEnergyController::ConnectingState : SKIPPER_TRY; - Q_FALLTHROUGH(); + // FALLTHROUGH case QLowEnergyController::DiscoveredState : // - For QLowEnergyController::DiscoveredState : @@ -1092,6 +1095,34 @@ } /*! + * \brief BluetoothInterface::notifyBloodPressure + * \details The main notifier of the Vital measurement. + * \param vModel - The Blood pressure model of type MUIBloodPressure + */ +void BluetoothInterface::notifyBloodPressure(const MUIBloodPressure &vModel) +{ + UIBloodPressureData data = vModel.data(); + emit didActionReceive(data); + LOG_EVENT(vModel.toString()); +} + +/*! + * \brief BluetoothInterface::mimic + * \details A mimic function to simulate the vital measured values. + * \param vSystolic - Systolic Viral value + * \param vDiastolic - Diastolic Viral value + * \param vPulseRate - Pulse Rate Viral value + */ +void BluetoothInterface::mimic(quint16 vSystolic , + quint16 vDiastolic , + quint16 vPulseRate ) { + MUIBloodPressure model(vSystolic , + vDiastolic , + vPulseRate ); + notifyBloodPressure(model); +} + +/*! * \brief BluetoothInterface::interpretBloodPressure * \details Interpreting the blood pressure message QByteArray vData and extracting the values of Systolic, Diastolic, HeartRate. * \param vData - the received QByteArray of data. @@ -1100,10 +1131,7 @@ { MUIBloodPressure model; model.fromByteArray(vData); - UIBloodPressureData data = model.data(); - qDebug() << "==========" << data.mSystolic << data.mDiastolic << data.mPulseRate; - emit didActionReceive(data); - LOG_EVENT(model.toString()); + notifyBloodPressure(model); } /*!