<?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 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72003/nrf52840-ble-peripheral-connection-for-data-transfer-managing</link><description>Hello Nordic 
 
 I am using nrf52840, SDK 16.0, 
 I wish to implement Ble peripheral that advertise a connection request (if no response from central after x seconds then I go to sleep and try few minutes later). After connection has established I need</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Mar 2021 11:02:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72003/nrf52840-ble-peripheral-connection-for-data-transfer-managing" /><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/297751?ContentTypeID=1</link><pubDate>Thu, 04 Mar 2021 11:02:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f77726e-40ef-47a3-94f4-d50b75f80685</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t suggest that you have to modify the ble_app_uart to make it high throughput. What I wanted to suggest is to start with simple example and get to understand how things work.&amp;nbsp;&lt;br /&gt;The ble_app_att_mtu is a bit more complex because the server is located on the central device. So the tester is both the central and the one who send data via notification.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The ATT table (both client and server) is setup automatically on both device, and when you press the button you only&amp;nbsp;select the application activity, not the GATT attribute table.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you need peripheral + server, this example could be a better option:&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nrf52-ble-image-transfer-demo"&gt;https://github.com/NordicPlayground/nrf52-ble-image-transfer-demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It also comes with an Android/iOS app to test, but you need to have an Adruino camera module, or you need to modify the application to send dummy data instead.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/297220?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 13:59:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80644604-726a-47b5-b02c-0ddeb1213e1a</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/72003/nrf52840-ble-peripheral-connection-for-data-transfer-managing/297185#297185"]If you want to test with the ATT_MTU, I would suggest to start with &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_att_mtu.html?cp=7_1_4_2_1_0"&gt;the documentation.&amp;nbsp;&lt;/a&gt;[/quote]
&lt;p&gt;i have seen this link .. could not understand everything yet&lt;/p&gt;
&lt;p&gt;i understand it is a bit more easy to start with the Uart_ble example but i will eventually need to use the large throughput that is the ATT_MTU example and since i was not given so much time i must try to understand the ATT_MTU instead of writing the uart_ble and then change to the ATT_MTU&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i am trying to understand how to configure only peripheral for start. in the ATT_MTU example when pressing the button to get the &amp;quot;dummy&amp;quot;(responder) which to my understanding is the peripheral, there is a start&amp;nbsp;advertising and start scan, if the central (tester) button is pressed there is a user choosing .. but the initiation of all the GAP GATT&amp;nbsp;and so are done before all this decisions, i guess it is somehow fits to both roles,&amp;nbsp; but what configs and inits should be for peripheral configuration only and which for the central ? how can i organize&amp;nbsp;that ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/297185?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 13:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:addcda51-cd7b-422c-9c4f-5ecc41a9eafd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to test with the ATT_MTU, I would suggest to start with &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_att_mtu.html?cp=7_1_4_2_1_0"&gt;the documentation.&amp;nbsp;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But I would strongly suggest to start with the ble_app_uart. You need to study the code and get to understand how things work in the code before moving to more advanced application.&amp;nbsp;&lt;br /&gt;ble_app_blinky would also a good start.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/296927?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 15:18:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e1fd068-5591-454c-8f28-8ba57d39f802</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&amp;nbsp;&lt;/p&gt;
&lt;p&gt;sorry but it seems like you did not see all my questions ..&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i have seen those tutorials, didn&amp;#39;t go over them thoroughly, but in any way i did not see any of them relate to a simple way to transmit data, not by nus function or hrs, etc. specific function but just data transfer&lt;/p&gt;
&lt;p&gt;tried to&amp;nbsp;go over&amp;nbsp;the ATT_MTU example cause i will need to transfer a large amount of data with high throughput but could not really find or understood how it knows if it is peripheral or central and in general how to work with it.. any help or explanation on that will be most welcome&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/296918?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 14:52:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76a996f7-df38-4d74-9650-987b3e538530</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ble_app_uart and ble_app_uart_c should be a good place to start for you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please also get familiar to how to debug the application. You would need to compile the application without optimization in order to have debug information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;peer&amp;quot; in &amp;quot;peer_manager&amp;quot; means the&amp;nbsp;peripheral or central&amp;nbsp;that connect to the device.&amp;nbsp;&lt;br /&gt;When a connection is established you will receive event:&amp;nbsp;BLE_GAP_EVT_CONNECTED, please have a look at the&amp;nbsp;ble_evt_handler() function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We have some tutorials about BLE that you may want to have a look:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy"&gt;devzone.nordicsemi.com/.../bluetooth-low-energy&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/296701?ContentTypeID=1</link><pubDate>Sun, 28 Feb 2021 09:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c607c7bf-e066-4ac9-addf-fb289b694f32</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;sorry for verifying and un verifying, just clicked the wrong place.. anyway&lt;/p&gt;
&lt;p&gt;beside the previouse reply i wonder, after looking intosome examples including the ble_uart_app, i am looking for a way to send data from my application, without using nus, there is no need for uart implementation in my peripheralm also looked at other examples it seems each service has it&amp;#39;s own send function type, i am looking for general byte array kindof, data transfre.. is there some function like that or an example that demonstrate data transmit over ble from a peripheral ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. in the app_ble_uart example, i tryied to change the filtering to a device name .. like so :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/// ziv start
static char const m_target_periph_name[] = &amp;quot;Audio_sensor&amp;quot;;
//// ziv end
/**@brief Function for initializing the scanning and setting the filters.
 */
static void scan_init(void)
{
    ret_code_t          err_code;
    nrf_ble_scan_init_t init_scan;

    memset(&amp;amp;init_scan, 0, sizeof(init_scan));

    init_scan.connect_if_match = true;
    init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;

    err_code = nrf_ble_scan_init(&amp;amp;m_scan, &amp;amp;init_scan, scan_evt_handler);
    APP_ERROR_CHECK(err_code);
/// ziv start
//    err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan, SCAN_UUID_FILTER, &amp;amp;m_nus_uuid);
//    APP_ERROR_CHECK(err_code);
//
//    err_code = nrf_ble_scan_filters_enable(&amp;amp;m_scan, NRF_BLE_SCAN_UUID_FILTER, false);
//    APP_ERROR_CHECK(err_code);
/// ziv start
    err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan, SCAN_NAME_FILTER, m_target_periph_name); // TBD - what to do with the m_nus_uuid, what should replace it 
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filters_enable(&amp;amp;m_scan, NRF_BLE_SCAN_NAME_FILTER, false);
    APP_ERROR_CHECK(err_code);
//// ziv end
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and it fails, for some reason i can&amp;#39;t get a read of the err type on the &amp;quot;&amp;nbsp;err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan, SCAN_NAME_FILTER, m_target_periph_name); &amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;any ideas ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/296689?ContentTypeID=1</link><pubDate>Sat, 27 Feb 2021 18:44:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1007fdd-0190-4557-b820-a612fd4b3492</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/72003/nrf52840-ble-peripheral-connection-for-data-transfer-managing/296340#296340"]When you change&amp;nbsp;APP_ADV_DURATION to 30 it will advertise in only 300ms.[/quote]
&lt;p&gt;i also tried with 3000 instead of 30 cause i thought there might be an issue there, it also did not work&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/72003/nrf52840-ble-peripheral-connection-for-data-transfer-managing/296340#296340"]In the example we show cased how you can handle a BLE connection without using peer_manager library.[/quote]
&lt;p&gt;when reading the explanation for that example it is written &amp;quot;peer&amp;quot; all the time so i don&amp;#39;t really understand,&lt;/p&gt;
&lt;p&gt;also there is something more basic that i don&amp;#39;t get from the example:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;to my understanding,&amp;nbsp;&lt;/span&gt;if i am the peripheral, then first i broadcast myself, then the central can respond to my broadcast and we initiate a connection.&lt;/p&gt;
&lt;p&gt;in which function i get indication that a connection was established, is the broadcast timeout includes the time it takes to establish the connection, or there is a different timeout for that ?&lt;/p&gt;
&lt;p&gt;who enables the Notifications which to my understanding enables data transfer, is it the central or the peripheral ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if the central is the one who enables the notification, how do i know that the notification is enabled, and what happens if i try to send data via &amp;quot;&lt;span&gt;ble_nus_data_send(...)&amp;quot; (if this is indeed the right function to use?) when the notifications is not enabled ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;hope to read from you soon&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ziv&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 BLE peripheral connection for data transfer managing</title><link>https://devzone.nordicsemi.com/thread/296340?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 15:15:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a128701-50a7-431b-9bbf-ba61955eb8af</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. I would suggest to have a look at the ble_app_uart example. In the example we show cased how you can handle a BLE connection without using peer_manager library. However I would strongly suggest you to use peer_manager in your application. You can choose not to support pairing with peer_manager if you want.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Base your application on ble_app_uart would be the best option for you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. When you change&amp;nbsp;APP_ADV_DURATION to 30 it will advertise in only 300ms. The&amp;nbsp;&amp;nbsp; adv_params.duration&amp;nbsp; unit is 10ms not 1s as in the comment (please have a look at the ble_gap_adv_params_t struct in ble_gap.h) . I have reported this bug earlier but we haven&amp;#39;t got it fixed yet.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>