<?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>Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11803/little-problem-with-send-data-to-ble</link><description>Good afternoon. 
 I&amp;#180;m using nrf51-dk with SDK 9.0.0, s110 softdevice and uart nordic app on mobile. I have a program in my nrf51-dk that it sends and receives data between nrf51-dk and mobile device. 
 I want to send a data when mobile device establishes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Feb 2016 12:30:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11803/little-problem-with-send-data-to-ble" /><item><title>RE: Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/thread/44627?ContentTypeID=1</link><pubDate>Mon, 29 Feb 2016 12:30:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6320a729-d001-4df2-b9a4-8a7ca06350d8</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Doing it as shown in the SDK example would be a good start.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/thread/44626?ContentTypeID=1</link><pubDate>Mon, 29 Feb 2016 11:15:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a36a55b-0a6a-46ce-9b8f-d083b8b4d56b</guid><dc:creator>Javier</dc:creator><description>&lt;p&gt;what would be the best way to implement it or how do u recommend it me do it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/thread/44625?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2016 08:51:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41c063f4-4ae2-4d97-9e0f-6effd6b43340</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Yes, in on_write you can see that we check if notifications has been enabled (on_hrm_cccd_write). Once they are you can start sending notifications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/thread/44624?ContentTypeID=1</link><pubDate>Thu, 18 Feb 2016 12:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d2c9413-740f-4b4b-9886-c7aa1c89aefa</guid><dc:creator>Javier</dc:creator><description>&lt;p&gt;you mean to (in ble_hrs.c):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/**@brief Function for handling the Write event.
*
* @param[in]   p_hrs       Heart Rate Service structure.
* @param[in]   p_ble_evt   Event received from the BLE stack.
*/
static void on_write(ble_hrs_t * p_hrs, ble_evt_t * p_ble_evt)
{
ble_gatts_evt_write_t * p_evt_write = &amp;amp;p_ble_evt-&amp;gt;evt.gatts_evt.params.write;

if (p_evt_write-&amp;gt;handle == p_hrs-&amp;gt;hrm_handles.cccd_handle)
{
    on_hrm_cccd_write(p_hrs, p_evt_write);
}
}

void ble_hrs_on_ble_evt(ble_hrs_t * p_hrs, ble_evt_t * p_ble_evt)
{
  switch (p_ble_evt-&amp;gt;header.evt_id)
  {
 ......
}
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/thread/44623?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 09:46:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47230aad-a859-4c3f-80c9-1a04f7526926</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;You should not send data on the connect event, (unless you are already bonded and HVX is enabled) as the peer hasn&amp;#39;t had the chance to subscribe to your indications/notifications by writing to the CCCD. Instead you should wait for HVX to be enabled. Look at e.g. the HRS example. There you can see that HRs has it&amp;#39;s own handler that calls on_write when a ble_gatts_evt_write is received. In on write there is a check to see if the cccd was written to, and if it is it&amp;#39;s starts to send notifications. If you try to send a notification or indication when it&amp;#39;s not enabled sd_ble_gatts_hvx will return NRF_ERROR_INVALID_STATE.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/thread/44622?ContentTypeID=1</link><pubDate>Wed, 10 Feb 2016 09:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba7e2a5e-e05a-44e6-88cf-eff5a291aef9</guid><dc:creator>Javier</dc:creator><description>&lt;p&gt;I have checked err_code when I send the first time, data &amp;quot;Pulse c para calibra&amp;quot;, and I receive &amp;quot;&lt;strong&gt;error 8&lt;/strong&gt;&amp;quot;, so i will try you comment me.&lt;/p&gt;
&lt;p&gt;I have changed a bit the code. My program has some steps in wich it waits the client sends &amp;quot;c&amp;quot; to calibrate it and then go to the next step, in case the client loses the connection, when he connects again, he has to receive a data that says in what step he was when he lost the connection. &lt;strong&gt;So I only can send it when he connect&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Javier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Little problem with send data to BLE</title><link>https://devzone.nordicsemi.com/thread/44621?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2016 13:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f84bce4b-2931-42d8-8dcc-0546e8bd1034</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;The information, whether an indication is send to a GATT client (your phone) or not, is stored on the GATT server (nrf51-dk) and is usually edited by the GATT client (subscription). So in your case, you send an indication to the GATT client, before the GATT client subscribed to the characteristic.&lt;/p&gt;
&lt;p&gt;You could see, if you find a way to subscribe the client on the server side (I don’t know the Nordic API). But if this works, you must make sure, that on the client side is some kind of callback that actually receives the (unexpected) data.&lt;/p&gt;
&lt;p&gt;Or you simply change your client to read the instrucciones text without indication.&lt;/p&gt;
&lt;p&gt;The same goes for your attempt to indicate the client, when the connection was just closed. There will be no connection, where the indication could be transported on.&lt;/p&gt;
&lt;p&gt;Maybe you could just finder better times to send the indications.&lt;/p&gt;
&lt;p&gt;Cheers,
Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>