<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[need help to  used  window10 qt version 5.14.2 qbleutooth   characteristicChanged Slot is not running，]]></title><description><![CDATA[<p dir="auto">hi guys,i copy this example to my project,write  m_service-&gt;writeDescriptor(m_notificationDesc, QByteArray::fromHex("0100"));  is ok,<br />
devices can received.but device notify data is not can  trigger characteristicChanged Slot,  Hope that the big guys help to answer.Thank you</p>
<p dir="auto">In some cases the peripheral generates value updates which the central is interested in receiving. In order for a characteristic to support such notifications it must have the QLowEnergyCharacteristic::Notify or QLowEnergyCharacteristic::Indicate property and a descriptor of type QBluetoothUuid::ClientCharacteristicConfiguration. Provided those conditions are fulfilled notifications can be enabled as shown in the following code segment:</p>
<pre><code>  //PreCondition: service details already discovered
  QLowEnergyCharacteristic batteryLevel = service-&gt;characteristic(
              QBluetoothUuid::BatteryLevel);
  if (!batteryLevel.isValid())
      return;

  QLowEnergyDescriptor notification = batteryLevel.descriptor(
              QBluetoothUuid::ClientCharacteristicConfiguration);
  if (!notification.isValid())
      return;

  // establish hook into notifications
  connect(service, SIGNAL(characteristicChanged(QLowEnergyCharacteristic,QByteArray)),
          this, SLOT(characteristicChanged(QLowEnergyCharacteristic,QByteArray)));

  // enable notification
  service-&gt;writeDescriptor(notification, QByteArray::fromHex("0100"));

  // disable notification
  //service-&gt;writeDescriptor(notification, QByteArray::fromHex("0000"));

  // wait until descriptorWritten() signal is emitted
  // to confirm successful write
</code></pre>
<p dir="auto">The example shows a battery level characteristic which updates the central on every value change. The notifications are provided via the characteristicChanged() signal. More details about this mechanism are provided by the Bluetooth Specification.</p>
]]></description><link>https://forum.qt.io/topic/139417/need-help-to-used-window10-qt-version-5-14-2-qbleutooth-characteristicchanged-slot-is-not-running</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 08:31:58 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139417.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Sep 2022 09:41:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to need help to  used  window10 qt version 5.14.2 qbleutooth   characteristicChanged Slot is not running， on Sun, 25 Sep 2022 03:06:27 GMT]]></title><description><![CDATA[<p dir="auto">hi it connected ble5.0 micro chip.thanks you very much! i used QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true")); can privide some information to find bug. now it can be used。<br />
but i find new problem used void QLowEnergyController::connectionUpdated(const QLowEnergyConnectionParameters &amp;newParameters) it can not running slot，seem not find information can solution.  can you please some advice? thanks</p>
]]></description><link>https://forum.qt.io/post/730067</link><guid isPermaLink="true">https://forum.qt.io/post/730067</guid><dc:creator><![CDATA[qixin]]></dc:creator><pubDate>Sun, 25 Sep 2022 03:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to need help to  used  window10 qt version 5.14.2 qbleutooth   characteristicChanged Slot is not running， on Mon, 19 Sep 2022 10:30:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/qixin">@<bdi>qixin</bdi></a>, your code looks right to me, assuming the device you're talking to does indeed support BLE Notify for that characteristic.</p>
<p dir="auto">Two things I would try.  First, update your <code>connect</code> to use the <a href="https://wiki.qt.io/New_Signal_Slot_Syntax" target="_blank" rel="noopener noreferrer nofollow ugc">newer syntax</a>, like:</p>
<pre><code>    connect(service, &amp;QLowEnergyService::characteristicChanged,
            this, &amp;YourClassName::characteristicChanged);
</code></pre>
<p dir="auto">This will just allow the compiler to catch any argument errors you might have there (though Qt should be logging an warning at runtime, if that was the problem).</p>
<p dir="auto">(BTW, you can make that connection as soon as <code>service</code> is constructed if you like, so you don't miss the first <code>characteristicChanged</code> event ;)</p>
<p dir="auto">Then, enable the <a href="https://doc.qt.io/qt-6/qtbluetooth-index.html#logging-categories" target="_blank" rel="noopener noreferrer nofollow ugc">QtBluetooth Logging Categories</a>; something like this:</p>
<pre><code>QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
</code></pre>
<p dir="auto">That might give you some hints to why its not working.</p>
<p dir="auto">Cheers.</p>
<p dir="auto">PS. Are you able / willing to tell us what device you're talking to? It might be helpful.</p>
]]></description><link>https://forum.qt.io/post/729274</link><guid isPermaLink="true">https://forum.qt.io/post/729274</guid><dc:creator><![CDATA[Paul Colby]]></dc:creator><pubDate>Mon, 19 Sep 2022 10:30:49 GMT</pubDate></item></channel></rss>