<?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>Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59611/problem-in-data-transfer-in-bluetooth-at-10ms</link><description>Hi, 
 We are using NRF52840 Dk board to transfer the data at 10ms through Bluetooth which is central and peripheral as other cc250moda controller Bluetooth. Our objective is to send the data of 8 bytes at 10ms from the NRF52840 Bluetooth to other Bluetooth</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 May 2020 13:52:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59611/problem-in-data-transfer-in-bluetooth-at-10ms" /><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/251517?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 13:52:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f345bf1f-293a-48d4-ba4a-777b00fb4fb4</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="sharmelaraju"]I have tried&amp;nbsp; cc2564moda Bluetooth(central) with&amp;nbsp; cc2564moda Bluetooth(peripheral) .With this communication it is working fine.[/quote]
&lt;p&gt;That is very strange to hear. Are you saying that the cc2564moda peripheral behaves differently with a cc2564moda, without any changes to the peripheral code? Could you detail how it is different - do you not see the occasional double or triple message appear on the debug terminal of the peripheral?&lt;br /&gt;I do not think this is likely.&lt;br /&gt;&lt;br /&gt;From the logs you sent, it is evident that the nRF sends all the data as expected when configured as the central. 10 ms connection intervals delivering your custom data to the peripheral.&lt;br /&gt;&lt;br /&gt;Do I have it correctly that you in your cc2564moda peripheral code use a 10 ms timer to trigger reading of the BLE RX buffer?&lt;br /&gt;In the case that I was correct:&lt;br /&gt;Did you attempt what I suggested in my last comment - switching the cc2564moda peripheral code to instead react to &lt;strong&gt;radio RX events&lt;/strong&gt; rather than a 10 ms timer? I think this would solve your problem, as the central is sending everything it is supposed to, when it is supposed to, according to the logs.&lt;br /&gt;It would also free up resources on your peripheral advice, and conform more to best-practice principles of embedded development.&lt;br /&gt;&lt;br /&gt;Looking forward to hearing from you,&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/251391?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 07:32:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19b252e9-3c94-40b0-b1eb-13ca2f4ad281</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;I have tried&amp;nbsp; cc2564moda Bluetooth(central) with&amp;nbsp; cc2564moda Bluetooth(peripheral) .With this communication it is working fine.But not with the nrf52840&amp;nbsp; controller. can you please give me some solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/250987?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 12:52:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96c7f3fb-f4ea-4975-bc7e-9e825fb9b896</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;br /&gt;&lt;br /&gt;I was under the impression from your earlier comments that you currently were using the nRF as the peripheral device?&lt;br /&gt;The code you have shared in your last reply seem to be for your CC250MODA device - which I am not familiar with. If there is a problem with this device, then I rather recommend that you contact Texas Instrument regarding this.&lt;br /&gt;&lt;br /&gt;Nevertheless, giving the code a quick look, it looks to me like you are indeed scheduling a single read every 10 ms. Instead of setting up a scheduler to do a reading every 10 ms - when you already know that you will be receiving a packet every 10 ms - I suggest making use of the generated BLE Radio events (RX complete events) to start the processing of your data. I am not sure how this is implemented on the CC250MODA device, but I am sure they will generate an interrupt or event upon the completion of a BLE transfer.&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue,&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/250915?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 10:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74096cfd-f963-4f6d-a965-942898d86994</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I am hereby attaching the code of the peripheral which reads the data every 10ms.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/per_5F00_code.txt"&gt;devzone.nordicsemi.com/.../per_5F00_code.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/250802?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 16:29:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e553419-65a7-4e91-9cbe-2e8f5c3a4796</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="sharmelaraju"]In the peripheral side the there is an scheduler function which reads the data at every 10ms. I am using termite application to log the data from the controller.[/quote]
&lt;p&gt;Could you share some code or elaborate more on the scheduler function you use to read data ever 10 ms? It could be that this scheduler does not work as intended.&lt;/p&gt;
[quote user="sharmelaraju"]But in the captured_log1data i have noticed that one point of time the master has not connected to slave&amp;nbsp; but the data is sending.I am here by attaching the log file .[/quote]
&lt;p&gt;The first highlighted section might be caused by the peripheral not acknowledging the reception of the packet sent from the central device. This causes the central to resend the packet.&amp;nbsp;&lt;br /&gt;It might also be due to that the sniffer might receive packets that is lost or corrupted to the central/peripheral device - and vice verse. The first highlighted section of the screenshot you have shared might be showing this. That the sniffer lost a packet that the central/peripheral might still have received.&lt;br /&gt;The frequency of loss and packet corruption depends heavily on the environment in which the devices are working.&lt;br /&gt;&lt;br /&gt;What is interesting is the transmission starting on packet number 1209... I must have missed this exchange when reading the log earlier. What might be happening is that the central attempts to start a transfer, that is not acknowledged by the slave. This causes the central to have to wait until the next connection interval to re-transmit the non-acknowledged packet. Since your program schedules new data to be sent every 10 ms, a new packet will be placed in the TX buffer before the previous is retransmitted. This leads to the transmission exchanges we are seeing at packet 1209 - the master suddenly has more than one packet to transmitt at once, since the previous one was never acknowledged.&lt;br /&gt;The re-transmission feature also ensures that no data is lost, even though it will arrive in the next connection interval. Note also how all the extra data is fitted into the next connection interval, without causing any sort of delay.&lt;br /&gt; So, In essence; you are ensured that all the data will be transmitted over the BLE connection, but some data might arrive in the next connection interval, if the first transmission attempt is never acknowledged by the peripheral.&lt;br /&gt;&lt;strong&gt;This is probably the cause of the logger &amp;quot;stutter&amp;quot; you&amp;#39;ve seen in your log. :)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;As for the Empty PDU in the second highlighted section, it is probably caused by the central TX buffer being empty when the connection interval is up, causing the central to send an empty packet just to maintain the connection to the peripheral. &lt;br /&gt;You can double click the packet in question&amp;nbsp; to see its contents.&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/250684?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 11:39:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5be984c3-cf6f-4f29-b0d5-8b0c1d8b6f00</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;In the peripheral side the there is an scheduler function which reads the data at every 10ms. I am using termite application to log the data from the controller.&lt;/p&gt;
&lt;p&gt;But in the captured_log1data i have noticed that one point of time the master has not connected to slave&amp;nbsp; but the data is sending.I am here by attaching the log file .&lt;/p&gt;
&lt;p&gt;please give me the solution.&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3323.capture2.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/250489?ContentTypeID=1</link><pubDate>Mon, 18 May 2020 14:42:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3584ee99-5965-4e6c-aaf3-1937338ded4f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;br /&gt;&lt;br /&gt;Those logs were much better, thank you.&lt;br /&gt;&lt;br /&gt;When viewing the logs, this seems exactly as it should be to me.&lt;br /&gt;The delta time for each transmission is ~10 ms for each transmission. From this, we can now be sure that you are in fact completing your data transmission (the 0x11, 0x12, 0x15 .. data) every 10 ms.&lt;br /&gt;If you take a look at packet number 531 particularly, that is when the central initiates the connection - with 8 as connection interval, which translates to 10 ms (8 * 1.25 ms).&lt;br /&gt;&lt;br /&gt;Seeing this, in combination with the printed UART log you shared earlier(where the data is not being processed right away after being received. So, that leads us to examining what the peripheral spends its time doing.&lt;br /&gt;&lt;br /&gt;When does the data handling happen? Could it be that your device is over encumbered, and thus not always finish its processing of the received data in time, before a new packet is received?&lt;br /&gt;It could also be that the UART logging itself is what pushes the peripheral to miss its processing windows - are you using deferred logging?&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/250338?ContentTypeID=1</link><pubDate>Mon, 18 May 2020 05:27:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fad988fd-3a2f-4751-bf92-27d7b8bd5c03</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Plz give me the solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/250337?ContentTypeID=1</link><pubDate>Mon, 18 May 2020 05:27:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a7c4e38-7f97-474a-a894-1a70578df63e</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;I am&amp;nbsp; here by attaching the captured sniff data between the central and peripheral.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/captured_5F00_logdata.pcapng"&gt;devzone.nordicsemi.com/.../captured_5F00_logdata.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/captured_5F00_log1data.pcapng"&gt;devzone.nordicsemi.com/.../captured_5F00_log1data.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/249644?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 09:55:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e16f1cd-c33a-4186-8e4e-286726fad2ab</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="sharmelaraju"]Sorry for the delayed response.[/quote]
&lt;p&gt;&amp;nbsp;No problem at all.&lt;/p&gt;
[quote user="sharmelaraju"]Still i am getting the same thing while logging the data in the ble sniffer.[/quote]
&lt;p&gt;Did you take a look at the sniffer trace I attached in my last reply?&lt;br /&gt;Are you unable to see the master-slave communication happening as shown in the trace?&amp;nbsp;&lt;br /&gt;If so, could you verify that the two modules manage to connect to each other? If you are not seeing the master-slave communication, and not receiving the data, then it is possible that the two devices are not connecting to each other.&lt;br /&gt;&lt;br /&gt;The master-slave communication should show up in the sniffer as soon as the connection is established.&lt;br /&gt;&lt;br /&gt;Could you verify if this is the case, and get back to me?&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/249591?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 05:25:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:420b145a-e521-4866-b3f7-162a238f870c</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Sorry for the delayed response.&lt;/p&gt;
&lt;p&gt;Still i am getting the same thing while logging the data in the ble sniffer.&lt;/p&gt;
&lt;p&gt;I have even tried nrf52840 as (peripheral) and cc2564 moda Bluetooth as central.Still i am not able receive&amp;nbsp; the data at every 10ms .&lt;/p&gt;
&lt;p&gt;please help me with the soluion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/248218?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 14:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8d2e8c3-6f0d-4d6e-9c1d-2ea15a9fe9f6</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="sharmelaraju"]Thanks for the reply.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;br /&gt;&lt;br /&gt;Looking at the new log you have provided, I again only see advertising - no connections is happening. The advertising follows the same pattern as I saw in the previous logs.&lt;/p&gt;
[quote user="sharmelaraju"]I have observed that while logging the data the source address kept on changing every time&amp;nbsp; whenever&amp;nbsp; i have closed the wire shark application and opened the application and logging.[/quote]
&lt;p&gt;That sounds strange. Do you make any changes to the code running on the central device?&lt;/p&gt;
[quote user="sharmelaraju"]one more doubt is the peripheral Bluetooth is&amp;nbsp; other&amp;nbsp; controller Bluetooth(CC2564MODA bluetooth) so while logging&amp;nbsp; in nrf sniffer&amp;nbsp; will it be able to capture the data of other controller Bluetooth because i am not using the same controller Bluetooth on&amp;nbsp; central and peripheral.[/quote]
&lt;p&gt;Yes, the Sniffer tool will see all BLE traffic happening around it - it does not differentiate between different chip-sets or vendors.&lt;br /&gt;&lt;br /&gt;Please have a look at the Wireshark sniffer trace I have attached to this comment.&lt;br /&gt;The log illustrates how the connection should look between the central(master) and the peripheral(slave).&lt;br /&gt;Notice that the peripheral only advertises its presence for the first 4-5 seconds, before the central comes online and establishes a connection.&lt;br /&gt;The central in the log I have supplies is using the code I provided you earlier - notice that it is sending your custom message as a write command to the peripheral every 10 ms.&lt;br /&gt;Since this is working as intended on my end, I am having a hard time replicating and debugging your error - and this is strengthening my suspicion that your peripheral might be at fault here.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-761a43b28c6f423097fbbaea92cd1f90/master_5F00_slave_5F00_communication.pcapng"&gt;devzone.nordicsemi.com/.../master_5F00_slave_5F00_communication.pcapng&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Could you attempt to capture a sniffer trace like the one I sent you now, with the connection between central and peripheral?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/248064?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 07:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfe4394f-3c2a-4952-a2e6-72090ca71bee</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;The log data which i have sent is sniffer data between the central and peripheral device.I have placed the development board(NRF51422) which runs the NRF sniffer&amp;nbsp; between the central (NRF52840 ) device and peripheral (cc2564 moda other controller bluetooth) .I have opened the&amp;nbsp; wire shark application and log the data.&lt;/p&gt;
&lt;p&gt;I have observed that while logging the data the source address kept on changing every time&amp;nbsp; whenever&amp;nbsp; i have closed the wire shark application and opened the application and logging.&lt;/p&gt;
&lt;p&gt;one more doubt is the peripheral Bluetooth is&amp;nbsp; other&amp;nbsp; controller Bluetooth(CC2564MODA bluetooth) so while logging&amp;nbsp; in nrf sniffer&amp;nbsp; will it be able to capture the data of other controller Bluetooth because i am not using the same controller Bluetooth on&amp;nbsp; central and peripheral.&lt;/p&gt;
&lt;p&gt;please you give me the&amp;nbsp; solution.&lt;/p&gt;
&lt;p&gt;I am here by attaching the log of the snif&amp;nbsp; data&amp;nbsp; between central and peripheral device.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/IBP_5F00_LOG_5F00_DATA.pcapng"&gt;devzone.nordicsemi.com/.../IBP_5F00_LOG_5F00_DATA.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/247999?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 17:28:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2d03dc4-8f5b-4193-a094-d1d584b32963</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="sharmelaraju"]sorry for the delayed response.[/quote]
&lt;p&gt;It is no problem at all - I fully understand these days being hectic. We resume whenever you are able to reply back.&lt;/p&gt;
[quote user="sharmelaraju"]I am here by attaching the&amp;nbsp; sniffer log&amp;nbsp; central(NRF52840) and peripheral( CC2564MODA Bluetooth).[/quote]
&lt;p&gt;What do you mean by this?&lt;br /&gt;Preferably the sniffer trace is taken while the transfer from the central to the peripheral is taking place.&lt;br /&gt;What I would like to see in the sniffer trace is what is happening at the same time as your peripheral reads an abnormal amount of bytes(24, 16, 0).&lt;br /&gt;Could you ensure that the sniffer traces contain these exchanges?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Looking at LOG12 and&amp;nbsp;LOG22(assuming the 24:5c is the correct device):&lt;br /&gt;- There is &lt;strong&gt;no connection&lt;/strong&gt; happening in these logs: only a single device advertising its presence and manufacturer specific data.&lt;br /&gt;- It is advertising very frequently for the first 500ms, with intervals as low as ~2-3 ms.&lt;br /&gt;- After 500 ms it advertises roughly every 100 ms.&lt;br /&gt;&lt;br /&gt;The device address is the same in both these logs, and their behavior is also similar: Could you verify that these were the logs you meant to send?&lt;br /&gt;If this in fact was the logs you meant to send, could you tell me what process what going on when these logs were captured?&lt;br /&gt;Please verify that the transfer over BLE is happening while the sniffer trace is captured.&lt;br /&gt;&lt;br /&gt;I still suspect that the issue is on the peripheral end of things.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/247897?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 13:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fca3cc6-ee5b-4d22-9c69-be0fcd3ddb29</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;sorry for the delayed response.&lt;/p&gt;
&lt;p&gt;I am here by attaching the&amp;nbsp; sniffer log&amp;nbsp; central(NRF52840) and peripheral( CC2564MODA Bluetooth).&lt;/p&gt;
&lt;p&gt;Plz give me the solution.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/LOG12.pcapng"&gt;devzone.nordicsemi.com/.../LOG12.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/LOG22.pcapng"&gt;devzone.nordicsemi.com/.../LOG22.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/247006?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2020 08:56:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3579d972-ed87-4860-acc1-04f40f78704c</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;No problem at all, I am happy to help!&lt;br /&gt;&lt;br /&gt;I see.&lt;br /&gt;Could you provide me with a sniffer trace of the BLE traffic you are seeing?&lt;br /&gt;On my end, the central is communicating as expected, and I am not seeing these deviations.&lt;br /&gt;With a sniffer trace, I would be able to pinpoint if the issue is with your central, peripheral or the BLE link.&lt;br /&gt;&lt;br /&gt;What else, other than receiving BLE communication, is the peripheral doing?&lt;br /&gt;Could you ensure that the peripheral always has enough time to process the received data?&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue,&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/246877?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 13:25:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00f4b850-6c3d-43f4-bb4c-8b73a648af3d</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks for the support.&lt;/p&gt;
&lt;p&gt;I have tried your it is working....I am receiving the 8 bytes of data at every 10 ms .But sometimes the receiver Bluetooth reads 24 bytes,16 bytes,0 bytes. Can you please tell me how to resolve this issue.&lt;/p&gt;
&lt;p&gt;I am here by attaching the log of the received data.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/MAIN_5F00_IBP_5F00_DONGLE.txt"&gt;devzone.nordicsemi.com/.../MAIN_5F00_IBP_5F00_DONGLE.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/246312?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 15:04:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e76038a-26e8-4341-b9cd-4af0e1de31de</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="sharmelaraju"]Thanks for the support.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="sharmelaraju"]In our application&amp;nbsp; we need to achieve at every 10ms.&amp;nbsp;[/quote]
&lt;p&gt;Yes, that much is understood.&lt;br /&gt;I took a closer look at the code you provided, and made some discoveries.&lt;br /&gt;First of all, the reason why you have not been able to set the connection interval properly: It seems that there is a bug in the ble_central/blinky source code, where it in fact does not make use of the parameters MIN_CONNECTION_INTERVAL and MAX_CONNECTION_INTERVAL as specified in main.c - but instead uses the default NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL from the sdk_config.h file.&lt;br /&gt;I have created an internal ticket on these misleading lines, for our SDK team to take a closer look at. I am sorry for any confusion this has caused you in your development.&lt;br /&gt;&lt;br /&gt;Having found this, I changed the NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL and NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL to 10, which resulted in the expected 10 ms connection interval between the central device and an arbitrary peripheral device I set up.&lt;br /&gt;&lt;br /&gt;Then, I used a Sniffer tool to capture the BLE traffic from the central, and noticed that it was only sending the data every other connection interval, instead of every 10 ms.&lt;br /&gt;Taking a closer look at you code, I see that you have merged the Led Button service with the Nordic UART example service, and discovered that your data is scheduled to be sent every 20 ms by your &amp;quot;&lt;em&gt;battery_level_meas_timeour_handler()&amp;quot;&lt;/em&gt; function. I changed the BATTERY_LEVEL_MEAS_INTERVAL from 20 ms to 10 ms, and observed that the changes were reflected in the BLE traffic captured using the Sniffer. I have attached the sniffer log here, for you to take a look at.&lt;br /&gt;&lt;br /&gt;For future reference, I strongly recommend changing variable- and function-names so that they match their actual function, for significantly increased readability.&lt;br /&gt;&lt;br /&gt;You can find the changes I made to your project code by looking at the lines preceded by &amp;quot;CHANGE START&amp;quot; and ending with &amp;quot;CHANGE END&amp;quot;&lt;br /&gt;I recommend that you take a look at the changes I have made, but input them into your project yourself - rather than continuing to develop using the code I have sent.&lt;br /&gt;This will ensure that you have full control and understanding of the changes made.&lt;br /&gt;&lt;br /&gt;Please let me know if you should encounter any other questions or issues in the future.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-761a43b28c6f423097fbbaea92cd1f90/sharmelaraju.pcapng"&gt;devzone.nordicsemi.com/.../sharmelaraju.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-761a43b28c6f423097fbbaea92cd1f90/IBP_5F00_DONGLE.zip"&gt;devzone.nordicsemi.com/.../IBP_5F00_DONGLE.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/246160?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 07:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ea9a4ab-2a67-4120-a5ee-3f94b45072e5</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks for the support.&lt;/p&gt;
&lt;p&gt;In our application&amp;nbsp; we need to achieve at every 10ms.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/246118?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2020 20:00:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f66c2222-fe02-48b7-962d-49ec14aafbd9</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hi again,&lt;br /&gt;&lt;br /&gt;I have been able to replicate your minimal 20 ms connection interval with the code you provided.&lt;br /&gt;I have also successfully created a modified version of the Blinky examples, that communicate with 10 ms connection intervals - since this is the basis of your application.&lt;br /&gt;&lt;br /&gt;Tomorrow I will pursue the reason for your application only achieving to send every 20 ms.&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/245860?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 13:41:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dbff274-fb62-424f-ace3-a169d05942bd</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Thank you for you patience.&lt;br /&gt;I have allocated time to review your code tomorrow.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ll get back to you once I have looked over the code.&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/245451?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 08:41:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc3d0d3e-d8e1-435e-b316-81083293d146</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;I am here by sharing the entire project&amp;nbsp; in the folder IBP_DONGLE( NRF52840), Soft device s 140,&amp;nbsp; &amp;nbsp;SDK VERSION 15.3, EXAMPLE -ble_app_blinky.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/IBP_5F00_DONGLE.rar"&gt;devzone.nordicsemi.com/.../IBP_5F00_DONGLE.rar&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/245433?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 07:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:006d81ab-d457-41e5-9a9a-6aed482773dc</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;br /&gt;&lt;br /&gt;This is just the contents of your main.c source code file - if I am to be able to run your code on my end, I will need the entire project directory, complete with the project and configuration files as well. If you would like to send me this, please compress the project folder to a .zip or .7z file, and post it here, so I may take a look.&lt;br /&gt;Before you do this, please make sure that the project you are sending is the correct version, exhibiting the behavior you have detailed earlier.&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: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/245343?ContentTypeID=1</link><pubDate>Sat, 18 Apr 2020 11:38:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc255068-ec28-4812-8a98-adbc3e54d129</guid><dc:creator>sharmelaraju</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am here by attaching the code.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2014 - 2019, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/**
 * @brief BLE LED Button Service central and client application main file.
 *
 * This file contains the source code for a sample client application using the LED Button service.
 */

#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf_sdh.h&amp;quot;
#include &amp;quot;nrf_sdh_ble.h&amp;quot;
#include &amp;quot;nrf_sdh_soc.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;bsp_btn_ble.h&amp;quot;
#include &amp;quot;ble.h&amp;quot;
#include &amp;quot;ble_hci.h&amp;quot;
#include &amp;quot;ble_advertising.h&amp;quot;
#include &amp;quot;ble_conn_params.h&amp;quot;
#include &amp;quot;ble_db_discovery.h&amp;quot;
#include &amp;quot;ble_lbs_c.h&amp;quot;
#include &amp;quot;nrf_ble_gatt.h&amp;quot;
#include &amp;quot;nrf_ble_scan.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;



typedef unsigned char Byte_t;                   /* Generic 8 bit Container.   */



#define CENTRAL_SCANNING_LED            BSP_BOARD_LED_0                     /**&amp;lt; Scanning LED will be on when the device is scanning. */
#define CENTRAL_CONNECTED_LED           BSP_BOARD_LED_1                     /**&amp;lt; Connected LED will be on when the device is connected. */
#define LEDBUTTON_LED                   BSP_BOARD_LED_2                     /**&amp;lt; LED to indicate a change of state of the the Button characteristic on the peer. */

#define SCAN_INTERVAL                   0x0030                              /**&amp;lt; Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW                     0x0030                              /**&amp;lt; Determines scan window in units of 0.625 millisecond. */
#define SCAN_DURATION                   0x0000                              /**&amp;lt; Timout when scanning. 0x0000 disables timeout. */

#define MIN_CONNECTION_INTERVAL         MSEC_TO_UNITS(20, UNIT_1_25_MS)    /**&amp;lt; Determines minimum connection interval in milliseconds. */
#define MAX_CONNECTION_INTERVAL         MSEC_TO_UNITS(20, UNIT_1_25_MS)     /**&amp;lt; Determines maximum connection interval in milliseconds. */
#define SLAVE_LATENCY                   0                                   /**&amp;lt; Determines slave latency in terms of connection events. */
#define SUPERVISION_TIMEOUT             MSEC_TO_UNITS(4000, UNIT_10_MS)     /**&amp;lt; Determines supervision time-out in units of 10 milliseconds. */

#define LEDBUTTON_BUTTON_PIN            BSP_BUTTON_0                        /**&amp;lt; Button that will write to the LED characteristic of the peer */
#define BUTTON_DETECTION_DELAY          APP_TIMER_TICKS(50)                 /**&amp;lt; Delay from a GPIOTE event until a button is reported as pushed (in number of timer ticks). */

#define APP_BLE_CONN_CFG_TAG            1                                   /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */
#define APP_BLE_OBSERVER_PRIO           3                                   /**&amp;lt; Application&amp;#39;s BLE observer priority. You shouldn&amp;#39;t need to modify this value. */

NRF_BLE_SCAN_DEF(m_scan);                                       /**&amp;lt; Scanning module instance. */
BLE_LBS_C_DEF(m_ble_lbs_c);                                     /**&amp;lt; Main structure used by the LBS client module. */
NRF_BLE_GATT_DEF(m_gatt);                                       /**&amp;lt; GATT module instance. */
BLE_DB_DISCOVERY_DEF(m_db_disc);                                /**&amp;lt; DB discovery module instance. */
#define BLE_NUS_MAX_DATA_LEN            8

//static char const m_target_periph_name[] = &amp;quot;Nordic_Blinky&amp;quot;;     /**&amp;lt; Name of the device we try to connect to. This name is searched in the scan report data*/

static char const m_target_periph_name[] = &amp;quot;DEVICE&amp;quot;;     /**&amp;lt; Name of the device we try to connect to. This name is searched in the scan report data*/

#define BATTERY_LEVEL_MEAS_INTERVAL         APP_TIMER_TICKS(20)                   /**&amp;lt; Battery level measurement interval (ticks). */

APP_TIMER_DEF(m_battery_timer_id);  

/**@brief Function to handle asserts in the SoftDevice.
 *
 * @details This function will be called in case of an assert in the SoftDevice.
 *
 * @warning This handler is an example only and does not fit a final product. You need to analyze
 *          how your product is supposed to react in case of Assert.
 * @warning On assert from the SoftDevice, the system can only recover on reset.
 *
 * @param[in] line_num     Line number of the failing ASSERT call.
 * @param[in] p_file_name  File name of the failing ASSERT call.
 */
void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
{
    app_error_handler(0xDEADBEEF, line_num, p_file_name);
}


/**@brief Function for the LEDs initialization.
 *
 * @details Initializes all LEDs used by the application.
 */
static void leds_init(void)
{
    bsp_board_init(BSP_INIT_LEDS);
}


/**@brief Function to start scanning.
 */
static void scan_start(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_scan_start(&amp;amp;m_scan);
    APP_ERROR_CHECK(err_code);

    bsp_board_led_off(CENTRAL_CONNECTED_LED);
    bsp_board_led_on(CENTRAL_SCANNING_LED);
}


/**@brief Handles events coming from the LED Button central module.
 */
static void lbs_c_evt_handler(ble_lbs_c_t * p_lbs_c, ble_lbs_c_evt_t * p_lbs_c_evt)
{
    switch (p_lbs_c_evt-&amp;gt;evt_type)
    {
        case BLE_LBS_C_EVT_DISCOVERY_COMPLETE:
        {
            ret_code_t err_code;

            err_code = ble_lbs_c_handles_assign(&amp;amp;m_ble_lbs_c,
                                                p_lbs_c_evt-&amp;gt;conn_handle,
                                                &amp;amp;p_lbs_c_evt-&amp;gt;params.peer_db);
            NRF_LOG_INFO(&amp;quot;LED Button service discovered on conn_handle 0x%x.&amp;quot;, p_lbs_c_evt-&amp;gt;conn_handle);

            err_code = app_button_enable();
            APP_ERROR_CHECK(err_code);

            // LED Button service discovered. Enable notification of Button.
            err_code = ble_lbs_c_button_notif_enable(p_lbs_c);
            APP_ERROR_CHECK(err_code);
        } break; // BLE_LBS_C_EVT_DISCOVERY_COMPLETE

       /* case BLE_LBS_C_EVT_BUTTON_NOTIFICATION:
        {
            NRF_LOG_INFO(&amp;quot;Button state changed on peer to 0x%x.&amp;quot;, p_lbs_c_evt-&amp;gt;params.button.button_state);
            if (p_lbs_c_evt-&amp;gt;params.button.button_state)
            {
                bsp_board_led_on(LEDBUTTON_LED);
            }
            else
            {
                bsp_board_led_off(LEDBUTTON_LED);
            }
        } break; // BLE_LBS_C_EVT_BUTTON_NOTIFICATION*/

        default:
            // No implementation needed.
            break;
    }
}

void send_ble_data(uint8_t * p_data, uint16_t length)
{
	uint32_t  err_code;
static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
memcpy(data_array, p_data, length);
ble_nus_c_string_send(&amp;amp;m_ble_lbs_c, data_array, length);
}
	
/**@brief Function for handling the Battery measurement timer timeout.
 *
 * @details This function will be called each time the battery level measurement timer expires.
 *
 * @param[in] p_context  Pointer used for passing some arbitrary information (context) from the
 *                       app_start_timer() call to the timeout handler.
 */
static void battery_level_meas_timeout_handler()
{
   // UNUSED_PARAMETER(p_context);
    //battery_level_update();
	
uint8_t dummyData[8] ;

int i=0;	

//nrf_gpio_pin_toggle(24);
	
dummyData[0]=0X11;
	
dummyData[1]=0X12;

dummyData[2]=0X23;
	
dummyData[3]=0X34;

dummyData[4]=0X55;
	
dummyData[5]=0X66;

dummyData[6]=0X57;
	
dummyData[7]=0x58;
send_ble_data(dummyData, sizeof(dummyData));
	
}


/**@brief Function for handling BLE events.
 *
 * @param[in]   p_ble_evt   Bluetooth stack event.
 * @param[in]   p_context   Unused.
 */
static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    ret_code_t err_code;

    // For readability.
    ble_gap_evt_t const * p_gap_evt = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        // Upon connection, check which peripheral has connected (HR or RSC), initiate DB
        // discovery, update LEDs status and resume scanning if necessary. */
        case BLE_GAP_EVT_CONNECTED:
        {
            NRF_LOG_INFO(&amp;quot;Connected.\r\n&amp;quot;);
					   nrf_ble_scan_stop();
        
            err_code = ble_lbs_c_handles_assign(&amp;amp;m_ble_lbs_c, p_gap_evt-&amp;gt;conn_handle, NULL);
            APP_ERROR_CHECK(err_code);

            err_code = ble_db_discovery_start(&amp;amp;m_db_disc, p_gap_evt-&amp;gt;conn_handle);
            APP_ERROR_CHECK(err_code);
					  if(err_code==NRF_SUCCESS)
						{
							NRF_LOG_INFO(&amp;quot;DISCOVERY COMPLETED\r\n&amp;quot;);
            
						}

            // Update LEDs status, and check if we should be looking for more
            // peripherals to connect to.
            bsp_board_led_on(CENTRAL_CONNECTED_LED);
            bsp_board_led_off(CENTRAL_SCANNING_LED);
						} break;

        // Upon disconnection, reset the connection handle of the peer which disconnected, update
        // the LEDs status and start scanning again.
        case BLE_GAP_EVT_DISCONNECTED:
        {
            NRF_LOG_INFO(&amp;quot;Disconnected.&amp;quot;);
            scan_start();
        } break;

        case BLE_GAP_EVT_TIMEOUT:
        {
            // We have not specified a timeout for scanning, so only connection attemps can timeout.
            if (p_gap_evt-&amp;gt;params.timeout.src == BLE_GAP_TIMEOUT_SRC_CONN)
            {
                NRF_LOG_INFO(&amp;quot;Connection request timed out.&amp;quot;);
            }
        } break;

        case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST:
        {
            // Accept parameters requested by peer.
            err_code = sd_ble_gap_conn_param_update(p_gap_evt-&amp;gt;conn_handle,
                                        &amp;amp;p_gap_evt-&amp;gt;params.conn_param_update_request.conn_params);
            APP_ERROR_CHECK(err_code);
        } break;

        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_INFO(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;

        case BLE_GATTC_EVT_TIMEOUT:
        {
            // Disconnect on GATT Client timeout event.
            NRF_LOG_INFO(&amp;quot;GATT Client Timeout.&amp;quot;);
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
        } break;

        case BLE_GATTS_EVT_TIMEOUT:
        {
            // Disconnect on GATT Server timeout event.
            NRF_LOG_INFO(&amp;quot;GATT Server Timeout.&amp;quot;);
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
        } break;
				
				
				
         case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            // No system attributes have been stored.
            err_code = sd_ble_gatts_sys_attr_set(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle, NULL, 0, 0);
            APP_ERROR_CHECK(err_code);
        default:
            // No implementation needed.
            break;
				
    }
}

/**@brief Function for starting application timers.
 */
static void application_timers_start(void)
{
    ret_code_t err_code;

    // Start application timers.
    err_code = app_timer_start(m_battery_timer_id, BATTERY_LEVEL_MEAS_INTERVAL, NULL);
    APP_ERROR_CHECK(err_code);
}

/**@brief LED Button client initialization.
 */
static void lbs_c_init(void)
{
    ret_code_t       err_code;
    ble_lbs_c_init_t lbs_c_init_obj;

    lbs_c_init_obj.evt_handler = lbs_c_evt_handler;

    err_code = ble_lbs_c_init(&amp;amp;m_ble_lbs_c, &amp;amp;lbs_c_init_obj);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing the BLE stack.
 *
 * @details Initializes the SoftDevice and the BLE event interrupts.
 */
static void ble_stack_init(void)
{
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
}


/**@brief Function for handling events from the button handler module.
 *
 * @param[in] pin_no        The pin that the event applies to.
 * @param[in] button_action The button action (press/release).
 */
/*static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
    ret_code_t err_code;

    switch (pin_no)
    {
        case LEDBUTTON_BUTTON_PIN:
            err_code = ble_lbs_led_status_send(&amp;amp;m_ble_lbs_c, button_action);
            if (err_code != NRF_SUCCESS &amp;amp;&amp;amp;
                err_code != BLE_ERROR_INVALID_CONN_HANDLE &amp;amp;&amp;amp;
                err_code != NRF_ERROR_INVALID_STATE)
            {
                APP_ERROR_CHECK(err_code);
            }
            if (err_code == NRF_SUCCESS)
            {
                NRF_LOG_INFO(&amp;quot;LBS write LED state %d&amp;quot;, button_action);
            }
            break;

        default:
            APP_ERROR_HANDLER(pin_no);
            break;
    }
}
*/

/**@brief Function for handling Scaning events.
 *
 * @param[in]   p_scan_evt   Scanning event.
 */
static void scan_evt_handler(scan_evt_t const * p_scan_evt)
{
    ret_code_t err_code;

    switch(p_scan_evt-&amp;gt;scan_evt_id)
    {
        case NRF_BLE_SCAN_EVT_CONNECTING_ERROR:
            err_code = p_scan_evt-&amp;gt;params.connecting_err.err_code;
            APP_ERROR_CHECK(err_code);
            break;
        default:
          break;
    }
}



/**@brief Function for initializing the button handler module.
 */
/*static void buttons_init(void)
{
    ret_code_t err_code;

    //The array must be static because a pointer to it will be saved in the button handler module.
    static app_button_cfg_t buttons[] =
    {
        {LEDBUTTON_BUTTON_PIN, false, BUTTON_PULL, button_event_handler}
    };

    err_code = app_button_init(buttons, ARRAY_SIZE(buttons),
                               BUTTON_DETECTION_DELAY);
    APP_ERROR_CHECK(err_code);
}
*/

/**@brief Function for handling database discovery events.
 *
 * @details This function is callback function to handle events from the database discovery module.
 *          Depending on the UUIDs that are discovered, this function should forward the events
 *          to their respective services.
 *
 * @param[in] p_event  Pointer to the database discovery event.
 */
static void db_disc_handler(ble_db_discovery_evt_t * p_evt)
{
    ble_lbs_on_db_disc_evt(&amp;amp;m_ble_lbs_c, p_evt);
}


/**@brief Database discovery initialization.
 */
static void db_discovery_init(void)
{
    ret_code_t err_code = ble_db_discovery_init(db_disc_handler);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing the log.
 */
static void log_init(void)
{
    ret_code_t err_code = NRF_LOG_INIT(get_rtc_counter);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();
}
uint32_t  get_rtc_counter(void)
{
	return NRF_RTC1-&amp;gt;COUNTER;
}


/**@brief Function for initializing the timer.
 */
static void timer_init(void)
{
    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);
	 err_code = app_timer_create(&amp;amp;m_battery_timer_id,
                                APP_TIMER_MODE_REPEATED,
                                battery_level_meas_timeout_handler);
    APP_ERROR_CHECK(err_code);

}


/**@brief Function for initializing the Power manager. */
static void power_management_init(void)
{
    ret_code_t err_code;
    err_code = nrf_pwr_mgmt_init();
    APP_ERROR_CHECK(err_code);
}


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);

    // Setting filters for scanning.
    err_code = nrf_ble_scan_filters_enable(&amp;amp;m_scan, NRF_BLE_SCAN_NAME_FILTER, false);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan, SCAN_NAME_FILTER, m_target_periph_name);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing the GATT module.
 */
static void gatt_init(void)
{
    ret_code_t err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, NULL);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for handling the idle state (main loop).
 *
 * @details Handle any pending log operation(s), then sleep until the next event occurs.
 */
static void idle_state_handle(void)
{
    NRF_LOG_FLUSH();
    nrf_pwr_mgmt_run();
}



int main(void)
{
    // Initialize.
    log_init();
    timer_init();
    leds_init();
   // buttons_init();
    power_management_init();
    ble_stack_init();
    scan_init();
    gatt_init();
    db_discovery_init();
    lbs_c_init();

    // Start execution.
    NRF_LOG_INFO(&amp;quot;Blinky CENTRAL example started.&amp;quot;);
    scan_start();

    // Turn on the LED to signal scanning.
    bsp_board_led_on(CENTRAL_SCANNING_LED);
	  application_timers_start();

    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please give me the solution&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in data transfer in Bluetooth at  10ms</title><link>https://devzone.nordicsemi.com/thread/245252?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 13:34:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:566846d0-9144-4bb3-bb8b-faf37f1be2a9</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="sharmelaraju"]I am&amp;nbsp; here by attaching the code.[/quote]
&lt;p&gt;I am not sure I understand what you have shared with me in the previous snippet. It seems to be an incomplete snippet of the ble event handler?&lt;br /&gt;Also, the defines you have stuck at the end of the snippet&amp;nbsp; The defines should be located at the top of your source code file. I do not know if your placement of them inside the event handler is intentional. In short, the code snippet you included in the last comment does not provide me with anything to work with.&lt;br /&gt;&lt;br /&gt;Could you instead share the entire project with me?&lt;br /&gt;That way, I can attempt to replicate your error at my end, to see if I may find a solution to this issue.&lt;br /&gt;&lt;br /&gt;If you would like, I can make the ticket private before you share your code - so that it is only viewable to you and the support staff here at Nordic Semiconductor.&lt;br /&gt;Let me know if you could like me to do that.&lt;br /&gt;&lt;br /&gt;Looking forward to hearing back from you,&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>