<?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>BLE-UART vs dedicated service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100160/ble-uart-vs-dedicated-service</link><description>Hi team, 
 I need a way to control nrf52 via a phone with a distance less than 2 meters. So I plan to use Nordic CLI over ble-uart connection for this. I also need to transfer a continuous data stream from nrf52 to the phone with a bandwidth about 1Kbyte</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 28 May 2023 12:23:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100160/ble-uart-vs-dedicated-service" /><item><title>RE: BLE-UART vs dedicated service</title><link>https://devzone.nordicsemi.com/thread/427937?ContentTypeID=1</link><pubDate>Sun, 28 May 2023 12:23:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aafeb7dc-1714-4c3c-9223-b62f641f5ce0</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Hello,&lt;/p&gt;
[quote user=""]With a short distance like 2 meters (max), would BLE-UART be a reliable connection? Should I include CRC and packet sequence etc? Is the lower level layer of BLE already handle all of this already?[/quote]
&lt;p&gt;Yes, unless you are operating in an extremely noisy 2.4 GHz environment BLE will be very reliable in this range.&lt;br /&gt;You will also not need to worry about adding CRC or packet sequence numbers yourself - this is all innate features of the BLE protocol :)&amp;nbsp;&lt;br /&gt;The BLE protocol is lossless, which means that no data can be lost in the link - either all the data makes it across and is acknowledged by the peer, or the connection will be terminated.&lt;/p&gt;
[quote user=""]For a continuous data stream from the NRF52 to the phone, should I use another instance of BLE-UART&amp;nbsp; (with different TX,RX address) or should I use a dedicated service characteristics with read/notification?[/quote]
&lt;p&gt;All data is sent as packets in BLE, so it is not strictly &amp;#39;continuous&amp;#39;, but you can have a connection interval of as low as 7.5 ms (meaning that a packet transfer will be initiated every 7.5 ms), and you can also send multiple packets per connection interval (which essentially lets you send packets continuously, if need be), but it will still be divided into separate packets for sending, as opposed to a &amp;#39;continuous stream&amp;#39; of data.&lt;br /&gt;I dont think this should be any issue for your application since this is more an issue of &amp;#39;semantics&amp;#39;, but I thought I should mention it anyways to highlight how the BLE protocol works.&lt;br /&gt;&lt;br /&gt;Over to your question: the use of different services and characteristics in BLE lets you separate all different &amp;#39;data streams&amp;#39; into different containers, so that they are easily managed. In essence, a single characteristic holds a single value, and you can bundle multiple characteristics into a single service. So you should use different characteristics and services for your different &amp;#39;data streams&amp;#39; or values. In essence, you use a separate characteristic for each sensor measurement (one for heart rate, one for temperature, one for humidity, and so on.), as an example.&lt;br /&gt;In the &amp;#39;Nordic UART over BLE service/characteristics&amp;#39; case we have made a custom service - the NUS service - which emulates a hardware UART connection though holding a byte value, so that you can feed through whatever data you would like so long as you parse it correctly on the receiving end.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to ask if anything should be unclear, or if you should have any follow-up questions! :)&amp;nbsp;&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>