<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>What’s BLE handle mean?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44316/what-s-ble-handle-mean</link><description>Hey, 
 previously working with BLE devices I had manage them reading/writing its characteristic. To control my new device I have to write the value into its handle ( i. e. 0x1892) 
 
 what at does it mean? And how can I solve it with nrf51 and s130? </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Mar 2019 08:01:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44316/what-s-ble-handle-mean" /><item><title>RE: What’s BLE handle mean?</title><link>https://devzone.nordicsemi.com/thread/173874?ContentTypeID=1</link><pubDate>Mon, 04 Mar 2019 08:01:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f736dcf8-ec3b-44a0-b0a3-843d2d514136</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;quot;handle&amp;quot; is not a BLE concept. It is a common software concept, used by the libraries you are using.&amp;nbsp; See for instance &lt;a href="https://en.wikipedia.org/wiki/Handle_(computing)"&gt;Handle (computing)&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What’s BLE handle mean?</title><link>https://devzone.nordicsemi.com/thread/173825?ContentTypeID=1</link><pubDate>Sat, 02 Mar 2019 19:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c46a85dc-6c01-4ba5-bf6c-9462e16304e5</guid><dc:creator>IlyaM</dc:creator><description>&lt;p&gt;Hi, I&amp;#39;m gonna communicate with my smart kettle Redmond rk-g201s (&lt;a href="https://redmond.company/ge/products/sky-kitchen/kettle-redmond-rk-g200s/?popup_shown=Y" rel="noopener noreferrer" target="_blank"&gt;the link&lt;/a&gt; on the similar model)&lt;/p&gt;
&lt;p&gt;I successfully done it with gatttool (bluez) wrapped with pygatt, the code below shows how I&amp;#39;ve done it&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;def write_handle(self, device, handle, value, increment=True):
    val = bytearray(val)
    device.char_write_handle(handle, val, True)
...
adapter.start()
device = adapter.connect(YOUR_DEVICE_ADDRESS, address_type=ADDRESS_TYPE)
self.write_handle(device, 0x000e, [0xFF, 0xDF, 0x24, 0x0E, 0xC6, 0x94, 0xD1, 0x97, 0x43], False)
self.write_handle(device, 0x000c, [0x01, 0x00])
self.write_handle(device, 0x000e, [0x01])
self.write_handle(device, 0x000e, [0x05, 0x00, 0x00, int(hex(100), 16), 0x00])
self.write_handle(device, 0x000e, [0x03])
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;pygatt&amp;#39;s GitHub says&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Writes a value to a given characteristic handle. This can be used to
write to the characteristic config handle for a primary characteristic.
hande -- the handle to write to.
value -- a bytearray to write to the characteristic.
wait_for_response -- wait for response after writing.

def char_write_handle(self, handle, value, wait_for_response=False,
                      timeout=1):
    &amp;quot;&amp;quot;&amp;quot;
    Writes a value to a given characteristic handle.
    :param handle:
    :param value:
    :param wait_for_response:
    &amp;quot;&amp;quot;&amp;quot;
    cmd = &amp;#39;char-write-{0} 0x{1:02x} {2}&amp;#39;.format(
        &amp;#39;req&amp;#39; if wait_for_response else &amp;#39;cmd&amp;#39;,
        handle,
        &amp;#39;&amp;#39;.join(&amp;quot;{0:02x}&amp;quot;.format(byte) for byte in value),
    )

    log.debug(&amp;#39;Sending cmd=%s&amp;#39;, cmd)
    if wait_for_response:
        try:
            with self._receiver.event(&amp;quot;char_written&amp;quot;, timeout=timeout):
                self.sendline(cmd)
        except NotificationTimeout:
            log.error(&amp;quot;No response received&amp;quot;, exc_info=True)
            raise
    else:
        self.sendline(cmd)

    log.info(&amp;#39;Sent cmd=%s&amp;#39;, cmd)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What’s BLE handle mean?</title><link>https://devzone.nordicsemi.com/thread/173820?ContentTypeID=1</link><pubDate>Sat, 02 Mar 2019 14:39:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7423813b-e605-4c85-bfcd-13fa84a04985</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;What device are your talking about?&lt;/p&gt;
&lt;p&gt;Post a link to where it talks about this &amp;quot;handle&amp;quot; - so that people can see it in context.&lt;/p&gt;
&lt;p&gt;A &amp;quot;handle&amp;quot; is usually a software abstraction - so not specifically a BLE thing ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>