<?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 received data from peripheral?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67230/how-to-received-data-from-peripheral</link><description>Hi, I&amp;#39;m using nRF52832 Software Development Kit, PCA10040, S132. 
 
 I am trying to test ble_app_blinky_c. 
 I have problem with received data from peripheral which is my own BLE device. 
 
 First of all, I tested blinky central and peripheral with two</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Oct 2020 08:47:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67230/how-to-received-data-from-peripheral" /><item><title>RE: how to received data from peripheral?</title><link>https://devzone.nordicsemi.com/thread/275286?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 08:47:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:563f184c-4b37-4e78-948a-7ecc5f2b91c5</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="lyrics"]Thank you very much for your quick reply.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="lyrics"]&lt;span&gt;I understood the basics.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;And I will study again with &amp;#39;ble_app_uart_c&amp;#39;.&lt;/span&gt;[/quote]
&lt;p&gt;Great, just let me know if you should have any further questions on this!&lt;/p&gt;
[quote user="lyrics"]Does the example ble_app_blinky_c handler only the events caused by the button?[/quote]
&lt;p&gt;The button LED notification service is made to send a notification if a button is pressed in order to set a LED, as such, the connected device will only receive button and LED information through this service - since it is its only contents.&lt;br /&gt;I am not sure if this is what you were asking about. As you can see from the ble_app_blinky_c lbs event handler, it handles all &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fgroup__ble__sdk__srv__lbs__c.html&amp;amp;anchor=ga092ee3cf2c153bf92d025d45e0133076"&gt;( both ) of the available LBS events&lt;/a&gt;.&lt;/p&gt;
[quote user="lyrics"]In addition, can&amp;#39;t we use &amp;#39;BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP&amp;#39; to bring the charterical values?[/quote]
&lt;p&gt;That depends, which data exactly are you interested in seeing?&lt;br /&gt;If you would like to see the contents of a received notification, you should use the contents of the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/structble__gattc__evt__hvx__t.html"&gt;BLE_GATTC_EVT_HVX event instead&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to received data from peripheral?</title><link>https://devzone.nordicsemi.com/thread/275225?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 00:17:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7ac41a7-9491-4774-a257-27d51854d625</guid><dc:creator>lyrics</dc:creator><description>&lt;p&gt;&lt;span&gt;Thank you very much for your quick reply.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;I understood the basics.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;And I will study again with &amp;#39;ble_app_uart_c&amp;#39;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Few more questions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Does the example ble_app_blinky_c handler only the events caused by the button?&lt;br /&gt;In addition, can&amp;#39;t we use &amp;#39;BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP&amp;#39; to bring the charterical values?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to received data from peripheral?</title><link>https://devzone.nordicsemi.com/thread/275014?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 09:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db16819e-575e-4bfa-b79d-accd2992986a</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Lyrics,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;First of all, I tested blinky central and peripheral with two nordic borad.&lt;/p&gt;
&lt;p&gt;When I pressed peripheral button 1, breakpoint stop at &amp;quot;case BLE_GATTC_EVT_HVX:&amp;quot;&lt;/p&gt;[/quote]
&lt;p&gt;Yes, the BLE Blinky application uses notifications to alert the connected device that the button has been pressed.&lt;br /&gt;The &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s110.api.v8.0.0%2Fstructble__gattc__evt__hvx__t.html"&gt;BLE_GATTC_EVT_HVX event is generated when a notification is received, which contains all the events information&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;span style="font-size:150%;"&gt;All I want to do is just read the data from the bl device and record it on the terminal.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;To do this, can I use BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP?&lt;/span&gt;[/quote][quote user=""]or...&amp;nbsp;&lt;span&gt;Should&amp;nbsp;I create a new&amp;nbsp;function&amp;nbsp;in main()?&lt;/span&gt;[/quote]
&lt;p&gt;I would not recommend that you make changes in the drivers directly - since this may break the drivers, or place it in an invalid state.&lt;br /&gt;In this particular case, the button-led-central module does this information processing for you, and then sends an event to the applications lbs_c_evt_handler, which handles the button led information in the BLE_LBS_C_EVT_BUTTON_NOTIFICATION case of the handler. From there, you could write out any of the contents of the BLE_LBS_C_EVT_BUTTON_NOTIFICATION, if you would like.&lt;br /&gt;&lt;br /&gt;If you instead are looking for the general method to receive data transferred over BLE in your application, you could instead take a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_nus_eval.html"&gt;ble_app_uart example&lt;/a&gt;, which does exactly this - with very little other things going on.&lt;/p&gt;
[quote user=""]I think it might be difficult to understand the intent of my question because I didn&amp;#39;t fully understand the example code.[/quote]
&lt;p&gt;I might not have understood your intentions correctly - so if my reply above does not answer your questions, please do not hesitate to let me know!&lt;br /&gt;In that case, please elaborate exactly what you would like to see happening in your application / what functionality you would like to extract from the example.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>