<?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>how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14635/how-to-enable-bidirectional-comunication-on-my-nrf51822</link><description>Hi, 
 I&amp;#39;m using the nrf51822 and I want to merge Server and Client roles in one Peripheral device. I am already able to send a history of temperature and humidity measurements to my phone, but I don&amp;#39;t have possibility to set measurement period in my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Nov 2017 17:05:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14635/how-to-enable-bidirectional-comunication-on-my-nrf51822" /><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55858?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 17:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19a8ac84-9bf8-4fc5-9ee0-f0fdeed85b18</guid><dc:creator>Michael Mangeng</dc:creator><description>&lt;p&gt;unfortunately, the example referencd in the link is not available anymore:
&lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/tree/master/examples"&gt;github.com/.../examples&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;but as Michal Andrzejewski pointed out, you do not need to use this type anymore.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55857?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 15:01:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37e31c16-d4ac-476b-aa90-bbccc8e517c7</guid><dc:creator>sjc</dc:creator><description>&lt;p&gt;Dear Michael Mangeng, the githu link seems to be broken. Could you update it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55856?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2016 08:25:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fec312f1-419b-48ca-9832-31b1c334bbed</guid><dc:creator>Michal Andrzejewski</dc:creator><description>&lt;p&gt;That&amp;#39;s work :). In newest SDK 11 it is unnecessary to define variable of ble_gatts_evt_write_t type because sd_ble_gatts_value_get function does everything for us, like in this example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    static void on_ble_write(ble_os_t * p_our_service, ble_evt_t * p_ble_evt) 
    {
            uint32_t data_buffer;
            ble_gatts_value_t rx_data;
            rx_data.len = sizeof(int16_t);
            rx_data.offset = 0;
            rx_data.p_value = (uint8_t*)&amp;amp;data_buffer;
            
            if(p_ble_evt-&amp;gt;evt.gatts_evt.params.write.handle ==  p_our_service-&amp;gt;RH_char_handles.value_handle)
            {
                sd_ble_gatts_value_get(p_our_service-&amp;gt;conn_handle, p_ble_evt-&amp;gt;evt.gatts_evt.params.write.handle, &amp;amp;rx_data);
        	    received_variable=*rx_data.p_value;
            }
     }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55855?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 19:36:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03fa3cc6-1ed1-4d50-a72d-88e2d539a523</guid><dc:creator>Michal Andrzejewski</dc:creator><description>&lt;p&gt;Thank&amp;#39;s a lot!!!  I&amp;#39;ll let you know tommorow if it works properly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55854?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 15:13:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05c27d45-26bb-4bb3-88b5-fca66dc1bca1</guid><dc:creator>Michael Mangeng</dc:creator><description>&lt;p&gt;you will receive a BLE_GATTS_EVT_WRITE event from which you can read the written data.
see: &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/driver/examples/heart_rate_relay/main.c"&gt;github.com/.../main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55853?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 10:19:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2096eb70-62be-40bc-bf59-760d05f8ce1b</guid><dc:creator>Michal Andrzejewski</dc:creator><description>&lt;p&gt;I&amp;#39;m interested in the first option that you mentioned :). Do you know how can I read the information written by central (smartphone) on peripheral (nrf51)? Could you provide some example how should I receive that command on nrf51?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55852?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 09:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0201a276-30a8-457b-8c8a-6fb594593a94</guid><dc:creator>Michael Mangeng</dc:creator><description>&lt;p&gt;Hmm i&amp;#39;m not sure i understand you fully. &lt;strong&gt;During a connection&lt;/strong&gt; the central can write data to peripheral anytime using write command/request. The peripheral can write data to the central if the central registered itself for HandleValue Notifications/indications.&lt;/p&gt;
&lt;p&gt;If you want to Disconnect - and after some time - create a connection from the former peripheral to the smartphone... then you need to do what i sad in my response. Act as both central &amp;amp; peripheral at the same time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55851?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 09:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96782c1f-76dd-4757-b76f-d92f3f22da4e</guid><dc:creator>Michal Andrzejewski</dc:creator><description>&lt;p&gt;Every connection event consists of data package sending from central to peripheral and other package  sending after T_IFS period from peripheral to central. The peripheral doesn&amp;#39;t hold a monologue so it  is definitely possible to receiving some data from central, and GATT roles (Server and Client) are not fixed to GAP roles (Central and Peripheral). I just don&amp;#39;t know how to make use of this knowledge in practice&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55850?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 09:36:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a84086b0-c97b-47c9-b22f-ea03bbf6aa28</guid><dc:creator>Michal Andrzejewski</dc:creator><description>&lt;p&gt;That isn&amp;#39;t exactly what I want to do. In my application, nrf51 should be peripheral all the time, and smartphone should be central, because smartphone oughts to start the connection. But during the connection I want to enable ability of reading data sending from smartphone by my nrf51. Talking more conventionally, I don&amp;#39;t want to change GAP roles in my application, I want to nrf51 can smoothly swap its GATT role from Server to Client and vice-versa or rather simply play both roles simultaneously.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable bidirectional comunication on my nrf51822</title><link>https://devzone.nordicsemi.com/thread/55849?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 08:53:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65fcf4c6-1615-4aca-b573-3007bf59e40b</guid><dc:creator>Michael Mangeng</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;we also use S130 to act as peripheral and central at the same time.&lt;/p&gt;
&lt;p&gt;You have to start scanning as well as setup advertising. Stack will automatically listen for connects  8=&amp;gt;on_connected event) and you can perform your own connects when you receive an advertising event.&lt;/p&gt;
&lt;p&gt;When you receive a CONNECTED event, you can check your role - e.g.:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(p_ble_evt-&amp;gt;evt.gap_evt.params.connected.role == BLE_GAP_ROLE_PERIPH) {
// we are peripheral
} else {
// we are central
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;greetings,
Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>