<?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>NRF52840 Automatically send a message</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45346/nrf52840-automatically-send-a-message</link><description>I have two of the nrf52840 boards and want one to implement a cascade reconciliation between them. That is device A and B have similar secret keys but need to make them match. To do this they repeatedly send each other the parity bits of different segments</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Mar 2019 14:46:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45346/nrf52840-automatically-send-a-message" /><item><title>RE: NRF52840 Automatically send a message</title><link>https://devzone.nordicsemi.com/thread/178732?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 14:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66a6fcbc-3f4d-4633-947b-d6cca27f8baa</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The other device will get the payload from your ble_nus_data_send() in an event. Then you can do some calculations, and use ble_nus_c_string_send() to send the response back.&lt;/p&gt;
&lt;p&gt;The events that you get when the other device sends data is:&lt;/p&gt;
&lt;p&gt;ble_nus_c_evt_handler() -&amp;gt; switch-case BLE_NUS_C_EVT_NUS_TX_EVT on the&amp;nbsp;central&lt;/p&gt;
&lt;p&gt;and&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nus_data_handler() -&amp;gt; switch-case BLE_NUS_EVT_RX_DATA on the peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Automatically send a message</title><link>https://devzone.nordicsemi.com/thread/178622?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 10:57:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e194cb28-b9c0-4a5c-ac08-21ad969282ff</guid><dc:creator>Kebab</dc:creator><description>&lt;p&gt;Hi Edvin, thanks for your reply.&lt;/p&gt;
&lt;p&gt;I am trying to send over BLE but am working in the Uart example. I am also working on a project to develop some novel encryption scheme so cannot use the inbuilt methods.&lt;/p&gt;
&lt;p&gt;I see what you are talking about and it makes sense. When one device has calculated the data it must send I can simply call&amp;nbsp;&lt;span&gt;ble_nus_data_send(). How can I then get the other device to then perform a calculation and send a response upon receiving this data?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Automatically send a message</title><link>https://devzone.nordicsemi.com/thread/178610?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 10:15:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:843848fc-5e5e-4d64-b183-3fd13a3a92a3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;We are talking about sending over Bluetooth Low Energy here? Or do you mean UART?&lt;/p&gt;
&lt;p&gt;Why don&amp;#39;t you just use pairing and bonding (BLE encryption), which is part of the BLE specification? Are you sure that you want to implement your own encryption implementation?&lt;/p&gt;
&lt;p&gt;If your question is really, how do I send a message from the peripheral to the central and from the central to the peripheral, then I suggest that you check out the ble_app_uart&amp;#39;s function&amp;nbsp;ble_nus_data_send() which is called from main.c (in the uart_event_handle() function). You can call this from wherever you like.&lt;/p&gt;
&lt;p&gt;On the central side, you can look at the function&amp;nbsp;ble_nus_c_string_send(), which is almost identical (the central equivalent of ble_nus_data_send()).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>