<?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>Wake on button press, connect with master and transmit button state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111018/wake-on-button-press-connect-with-master-and-transmit-button-state</link><description>Development Software: Segger Embedded Studio, nRF5_SDK_17.0.2_d674dde 
 Project consists of an nRF52DK-based peripheral (remote control) and a custom nRF52832-based central (carries out the desired operations). These units are separated by a few meters</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Jul 2024 19:23:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111018/wake-on-button-press-connect-with-master-and-transmit-button-state" /><item><title>RE: Wake on button press, connect with master and transmit button state</title><link>https://devzone.nordicsemi.com/thread/492823?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 19:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78286196-bccd-49ca-bd11-f7da206c3a2b</guid><dc:creator>Sigurd</dc:creator><description>[quote user="Roger D"]Why can&amp;#39;t I successfully send data to the Client unless I wait for at least 750msec? Thanks much for your time.[/quote]
&lt;p&gt;The central would potentially need to do a service discovery first, and also if you are sending this as a &lt;span&gt;notification&lt;/span&gt;, the central would need to enable the CCCD for the notification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on button press, connect with master and transmit button state</title><link>https://devzone.nordicsemi.com/thread/491446?ContentTypeID=1</link><pubDate>Sat, 29 Jun 2024 23:33:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aaffae3-bb45-454b-a7c6-4de29cc500cc</guid><dc:creator>Roger D</dc:creator><description>&lt;p&gt;Thanks for your comments. I have successfully implemented pairing and bonding and my connection time is reduced. That&amp;#39;s a good thing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A follow up question:&lt;/p&gt;
&lt;p&gt;I previously asked:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;3. Any suggestions on how to transmit the button press event byte to the central?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You stated:&lt;/p&gt;
&lt;p&gt;Maybe you can use the&amp;nbsp;Queue library for this. Queue the button presses, and when you get the &lt;strong&gt;connected event,&lt;/strong&gt; and/or are ready to send the data, you get the button presses from the queue, and then send the data.&lt;/p&gt;
&lt;p&gt;When I attempt to transmit data to the client in the connected event no data is sent (as per sniffer). When I start a Timer in the Connected Event and load it with a value that gives a 700msec time out and then call&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-size:inherit;"&gt;&lt;span style="color:#993300;"&gt;&lt;span style="color:#008000;"&gt; send_data_to_client(uint32_t cmd)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;within the Timer event handler, no data is sent to the client. When I load the timer with a value that gives a 750msec time out, data is successfully sent to the Client.&lt;/p&gt;
&lt;p&gt;Why can&amp;#39;t I successfully send data to the Client unless I wait for at least 750msec? Thanks much for your time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Connected Event based on ble_peripheral_hrs:&lt;/p&gt;
&lt;p&gt;#define TILT_UP &amp;nbsp; 1&lt;/p&gt;
&lt;pre&gt;&lt;span style="color:#993300;"&gt;    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            printf(&amp;quot;Connected.\n &amp;quot;);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
            APP_ERROR_CHECK(err_code);&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="color:#008000;"&gt;            send_data_to_client(TILT_UP); // this doesn&amp;#39;t work here&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="color:#993300;"&gt;        break;&lt;br /&gt;_______________________________________________________&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#333333;"&gt;Transmit packet to client sub:&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="color:#993300;"&gt;&lt;span style="color:#008000;"&gt;void send_data_to_client(uint32_t cmd)&lt;/span&gt;
{
    ret_code_t      err_code;
    uint16_t        heart_rate;

    heart_rate = (uint16_t)cmd;

    err_code = ble_hrs_heart_rate_measurement_send(&amp;amp;m_hrs, heart_rate);
    if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp;
        (err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
        (err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
        (err_code != NRF_ERROR_BUSY) &amp;amp;&amp;amp;
        (err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)
       )
    {
        APP_ERROR_HANDLER(err_code);
    }
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;sss&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on button press, connect with master and transmit button state</title><link>https://devzone.nordicsemi.com/thread/484917?ContentTypeID=1</link><pubDate>Mon, 20 May 2024 12:59:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5df2c807-b01c-4885-acd4-3cc3722dfd7a</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;I asked a similar question and was directed to an older project , which will probably need updating to use the new SDK 17.0.2.&lt;br /&gt;&lt;a href="https://github.com/NordicPlayground/solar_sensor_beacon/tree/master"&gt;GitHub - NordicPlayground/solar_sensor_beacon&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That said, all new development is going to be in the&amp;nbsp;nRF Connect SDK (I am a little sad about that myself, but ...progress must move forward). The quicker you try to translate this into the newer code, the happier you may be.&lt;br /&gt;A M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on button press, connect with master and transmit button state</title><link>https://devzone.nordicsemi.com/thread/483008?ContentTypeID=1</link><pubDate>Mon, 13 May 2024 11:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e36dc5df-9d58-4e79-9a6c-45ede329cf88</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user=""]1. Is there anyway to get around the negotiation time? Does&amp;nbsp;connecting to a previously paired device cut down on the negotiation time? Current negotiation time is too long to meet my requirements.[/quote]
&lt;p&gt;If you bond to the device, you can skip doing e.g. service discovery each time you connect. Also you control both sides of the BLE link, so any connection interval&amp;nbsp;&lt;span&gt;negotiation, etc., is fully up to you.&lt;/span&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;2. I searched examples, nothing. Do you know of any example code?&lt;/p&gt;
&lt;p&gt;3. Any suggestions on how to transmit the button press event byte to the central?&lt;/p&gt;[/quote]
&lt;p&gt;Maybe you can use the&amp;nbsp;Queue library for this. Queue the button presses, and when you get the connected event, and/or are ready to send the data, you get the button presses from the queue, and then send the data.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_queue.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_queue.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;PS: If this is a new project, I recommend using nRF Connect SDK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK"&gt;https://www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on button press, connect with master and transmit button state</title><link>https://devzone.nordicsemi.com/thread/482802?ContentTypeID=1</link><pubDate>Fri, 10 May 2024 12:46:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e1782ac-73f2-4ade-bcbf-dd6656b92a4a</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;most of the staff is away for vacation, so there will be some delays in response time. Thank you for your patience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>