From 709f655173023a909ef5a5cdd2d861a2cbf80660 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Sat, 9 Mar 2024 20:35:17 +0800 Subject: [PATCH] stashed --- src/connection.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/connection.cpp b/src/connection.cpp index 4750433..0a069c0 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -781,9 +781,9 @@ qint64 Connection::write(const char *data, qint64 len) else if(m_type == BLE_Central) { if(m_BLERxTxMode == BLE_2S2C) - m_BLETxService->writeCharacteristic(m_BLETxCharacteristic, QByteArray::fromRawData(data, len)); + m_BLETxService->writeCharacteristic(m_BLETxCharacteristic, QByteArray::fromRawData(data, len), QLowEnergyService::WriteWithoutResponse); else - m_BLERxTxService->writeCharacteristic(m_BLETxCharacteristic, QByteArray::fromRawData(data, len)); + m_BLERxTxService->writeCharacteristic(m_BLETxCharacteristic, QByteArray::fromRawData(data, len), QLowEnergyService::WriteWithoutResponse); return len; // no feedback } else if(m_type == TCP_Client) @@ -1248,7 +1248,7 @@ void Connection::BLEC_onServiceDetailDiscovered(QLowEnergyService::ServiceState { for(auto it = chars.cbegin(); it != chars.cend(); ++it) { - if(!m_BLERxCharacteristicValid && it->uuid() == m_currBTArgument.RxCharacteristicUUID && it->properties().testFlag(QLowEnergyCharacteristic::Notify) && it->properties().testFlag(QLowEnergyCharacteristic::Write)) + if(!m_BLERxCharacteristicValid && it->uuid() == m_currBTArgument.RxCharacteristicUUID && it->properties().testFlag(QLowEnergyCharacteristic::Notify) && it->properties().testFlag(QLowEnergyCharacteristic::WriteNoResponse)) { m_BLERxCharacteristicValid = true; m_BLETxCharacteristicValid = true; @@ -1265,7 +1265,7 @@ void Connection::BLEC_onServiceDetailDiscovered(QLowEnergyService::ServiceState m_BLERxCharacteristicValid = true; deleteService = false; } - if(!m_BLETxCharacteristicValid && it->uuid() == m_currBTArgument.TxCharacteristicUUID && it->properties().testFlag(QLowEnergyCharacteristic::Write)) + if(!m_BLETxCharacteristicValid && it->uuid() == m_currBTArgument.TxCharacteristicUUID && it->properties().testFlag(QLowEnergyCharacteristic::WriteNoResponse)) { m_BLETxCharacteristicValid = true; deleteService = false; @@ -1287,7 +1287,7 @@ void Connection::BLEC_onServiceDetailDiscovered(QLowEnergyService::ServiceState { for(auto it = chars.cbegin(); it != chars.cend(); ++it) { - if(!m_BLETxCharacteristicValid && it->uuid() == m_currBTArgument.TxCharacteristicUUID && it->properties().testFlag(QLowEnergyCharacteristic::Write)) + if(!m_BLETxCharacteristicValid && it->uuid() == m_currBTArgument.TxCharacteristicUUID && it->properties().testFlag(QLowEnergyCharacteristic::WriteNoResponse)) { m_BLETxCharacteristicValid = true; deleteService = false;