<?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>sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5870/sd_ble_gatts_hvx-return-error-0x3401</link><description>Hi all, 
 I am trying to send data(rssi+MAC address) from GATT server to GATT client using sd_ble_gatts_hvx(). I added the service and the characteristic into the ATT table. I want to send data just when the client establish a connection. So in the BLE_EVT_CONNECTED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Mar 2015 12:36:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5870/sd_ble_gatts_hvx-return-error-0x3401" /><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20484?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2015 12:36:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74dcc9df-e332-432a-b143-3f78ea52e2b5</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/4/testing-and-using-a-simple-ble-application/"&gt;This tutorial&lt;/a&gt; goes through the procedure in Master Control Panel in order to receive notifications from a server.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20485?ContentTypeID=1</link><pubDate>Mon, 16 Mar 2015 09:24:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e41777e5-a460-4c21-a16f-9114409ce40f</guid><dc:creator>Michael Theurl</dc:creator><description>&lt;p&gt;Hy,&lt;/p&gt;
&lt;p&gt;Can you show me an example i have the same issue, on the lbs example code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20483?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 15:55:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51563266-fdfc-436b-999f-99af6a2b29da</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;The system attributes consist of the CCCD values, i.e. the &amp;quot;preferences&amp;quot; for a peer. You are required to save these peer-specific values between connections if you are bonded, and the example Device Manager shows you how this can be done. Please refer to the GATTS documentation or header files for sd_ble_gatts_sys_attr_set(), *_get() and sd_ble_gatts_hvx() for lots of information on how these affect your program. In short, you have to detect that these are written to when WRITE events come, and only allow hvx() calls after they are enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20482?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 15:49:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2081f17d-1de5-4432-b9a9-ad0792ce6b3b</guid><dc:creator>mohBOSS</dc:creator><description>&lt;p&gt;Hi Ulrich, please what are the system attributes ? Who get the access to them ?And how can I be awre if the GATT client has enabled the notification/indication ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20481?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 15:42:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da5d851f-dc83-4cf0-9e88-ec03e474c65e</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;If you look at the other examples, they change an internal state when the CCCD of the characteristic you want to indicate/notify is written to. Before restoring system attributes (sys_attr_get/set) or a write to the CCCD, all CCCD values are unknown. Attempting to call hvx() on a characteristic value where the CCCD is in an unknown state will return an error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20480?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 15:39:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aa508d4-7311-4574-8e9f-f92c54595cdc</guid><dc:creator>mohBOSS</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;the problem is solved (Thank you God). In fact, the peripheral should enable the notification, and since I am testing with MCP as a peripheral, I have had to click on the &amp;quot; Enable Services&amp;quot; button. The BLE_EVT_TX_COMPLETE event was generated after calling sd_ble_gatts_hvx().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20476?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 15:36:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7f4114e-e31a-40c9-8b21-edce1846ef35</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;What SoftDevice version is this? There are different error codes that could fit, depending on your version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20479?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 13:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7208fdb-a888-4c38-8fbc-b1d287a9c4ac</guid><dc:creator>mohBOSS</dc:creator><description>&lt;p&gt;Hi Dan, in fact the GATT server (peripheral)needs to send rssi+MAC to a GATT client(central).When testing, I use the Dongle as a GATT client(with MCP).I dont know if the dongle is configured to accept async messages. The new problem is, as I edited in the question is the 0x3001 error.It is a BLE_ERROR_INVALID_CONN_HANDLE .I am using s130 in the GATT server.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20478?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 13:38:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14cd6155-7847-4bf6-bc48-b5c4e9d03f39</guid><dc:creator>Dan Danknick</dc:creator><description>&lt;p&gt;This code looks just like mine that works on multiple products. I would only point out that your Central may need to be configured to accept async messages (indications, notifications) though you haven&amp;#39;t told us what that program is.&lt;/p&gt;
&lt;p&gt;Also, you do mean to send 4 bytes back, right? Because that is what this bit of code compiles to when data_to_send is a pointer:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; uint16_t len = sizeof(data_to_send); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best,
Dan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20477?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 07:08:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d855b61-5845-4452-8fe3-b6d4c189e5af</guid><dc:creator>mohBOSS</dc:creator><description>&lt;p&gt;All configurations that I did are in the attachement, I followed many similar examples. I don&amp;#39;t know what I missed. Did you mean the GATT client, by saying Central ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_hvx() return error :0x3401</title><link>https://devzone.nordicsemi.com/thread/20475?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2015 03:59:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb110b38-99e2-4433-9f59-43f3d41b83c1</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;Are you sure the Characteristic you have setup for this data transfer has Notifications?  Is the Central enabling the Notifications?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>