<?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>Where is the data in throughput example?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27105/where-is-the-data-in-throughput-example</link><description>I am working with the throughput example for the nRF52840 demo board. 
I have found all sorts of control structures which include the counts of bytes sent.
I have not found the actual data sent. I am working with a sniffer and would like to confirm</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Nov 2017 12:40:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27105/where-is-the-data-in-throughput-example" /><item><title>RE: Where is the data in throughput example?</title><link>https://devzone.nordicsemi.com/thread/106629?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 12:40:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bba9fd5-78d8-4256-8764-fcaaf9ce8350</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi greyed,&lt;/p&gt;
&lt;p&gt;When a central/client receives a notification from the peripheral/server, it will get an event &lt;code&gt;BLE_GATTC_EVT_HVX&lt;/code&gt;. In amtc.c in the function &lt;code&gt;nrf_ble_amtc_on_ble_evt()&lt;/code&gt;, we are checking for this event, and when we get the event we call the function &lt;code&gt;on_hvx()&lt;/code&gt;. Here we process the data, and generate an event called &lt;code&gt;NRF_BLE_AMT_C_EVT_NOTIFICATION&lt;/code&gt; that we use to keep track of the amount of data we have received. We pick the information from the &lt;code&gt;BLE_GATTC_EVT_HVX&lt;/code&gt;  event we are interested in, and send this to the &lt;code&gt;amtc_evt_handler()&lt;/code&gt; in main.c, when we call &lt;code&gt;p_ctx-&amp;gt;evt_handler(p_ctx, &amp;amp;amt_c_evt);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In the throughput example, we don’t use the data itself for anything, but we can find the data in &lt;code&gt;p_ble_evt-&amp;gt;evt.gattc_evt.params.hvx.data&lt;/code&gt; when we are in the &lt;code&gt;on_hvx()&lt;/code&gt; function. The length of the data(this we use), is found in &lt;code&gt;p_ble_evt-&amp;gt;evt.gattc_evt.params.hvx.len&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We have examples where we actually use the data itself to something more meaningful, such as the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/ble_sdk_app_nus_c.html?cp=4_0_0_4_2_0_5"&gt;ble_app_uart_c example.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the data in throughput example?</title><link>https://devzone.nordicsemi.com/thread/106630?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 12:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73846bc6-d87c-446e-a515-320581880883</guid><dc:creator>greyed</dc:creator><description>&lt;p&gt;Thanks Sigurd, where is the data &amp;#39;read&amp;#39; when received? I know it isn&amp;#39;t actually read as the content is of no interest, but if I wanted to read it, where would I do that from?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the data in throughput example?</title><link>https://devzone.nordicsemi.com/thread/106628?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2017 11:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:898197e2-ee80-47f0-b9ef-d0c51dede7cf</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The data that is being sent is just random values.  The data is declared in the &lt;code&gt;char_notification_send()&lt;/code&gt; function in the amts.c file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void char_notification_send(nrf_ble_amts_t * p_ctx)
{
    uint8_t            data[256];
    uint16_t           payload_len = p_ctx-&amp;gt;max_payload_len;
    .
    .
    .
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since the data is only declared, and not initialized, the array will contain random values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>