<?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>Custom Service Structure</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26513/custom-service-structure</link><description>I need to create a service on the nRF52832 that can send large amounts of a few different data types to the central device. For instance 
 
 ADC1 sampling (~256 bytes/s) 
 ADC2 sampling (~256 bytes/s) 
 IMU orientation (32 bytes/s) 
 
 And I also</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Nov 2017 22:05:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26513/custom-service-structure" /><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104322?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 22:05:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02f98b18-78c2-4646-bc65-bb09f860a0d0</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;No, once you use SD API call to create Characteristic with Notification or Indication GATT method capability the stack will take care to create CCCD handle automatically for you. All you need to do is store handles&amp;#39; references returned in &lt;code&gt;p_handles&lt;/code&gt; structure supplied to &lt;code&gt;sd_ble_gatts_characteristic_add&lt;/code&gt; call for future use because there you have both your Characteristic Value handle and CCCD handle (so once there is Write event you can check to which one, look into data and interpret them correctly).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104316?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 17:00:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a15b6ac-f127-4efb-9ee4-f2f8503abb42</guid><dc:creator>phipi</dc:creator><description>&lt;p&gt;And finally, I need to create a separate notify enable flag for each characteristic, correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104320?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 16:36:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4ab9100-5113-4246-8e6d-e335e2bf5406</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Yes, NUS is exactly such multipurpose &amp;quot;tube&amp;quot; example and that&amp;#39;s also the reason why it is so popular;) From GATT Server side you have basically 3 options (pull method through Read and push methods Notification and Identification) from which Notify method is the most effective (only simple command no round-trip needed).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104319?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 16:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e04cd88-c043-4b76-aef3-b65d6956082e</guid><dc:creator>phipi</dc:creator><description>&lt;p&gt;Thanks, that makes a lot of sense. For sending the ADC data is the proper way still to use notification from the device? Also, is it possible to use a single global notify enable? I&amp;#39;m working from the NUS sample which seems like it&amp;#39;s close to what I&amp;#39;m looking to do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104317?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 15:06:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a81a37b-31f3-44c5-a121-ae60470efc97</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;(2/2)&lt;/p&gt;
&lt;p&gt;However if you don&amp;#39;t care about 1-3 seconds of delay between actual connection on link layer and start of data transfer on application layer then you want to at least separate Tx and Rx &amp;quot;tubes&amp;quot; into two characteristics (because it seems that this can help with bandwidth during full-duplex transfers if you have them in your use case) or go and separate each &amp;quot;function&amp;quot; to separate characteristics (one for reporting of sensor data type X1, second for reporting of sensor data X2, third for sending management commands to sensor gateway etc.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104318?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 15:03:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:042198a9-18e6-4548-b102-bef31fa8c81e</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Yes, there are downsides of using ANY number of GATT objects (Services/Characteristics/Descriptors...): general GATT Clients (as implemented in Android/iOS/Windows BLE stacks) tend to do firstly so-called &amp;quot;full GATT Service discovery&amp;quot; which can cost you 1-4 connection intervals per such object. In other words if you use Android phone with default 48.75ms interval it will take 50-200ms more per each new Characteristic added to your profile. Therefore people who are interested into minimal latency between connection and actual data transfer on application layer use &amp;quot;one service + one characteristic&amp;quot; rule and have everything wrapped on top of GATT in their own application protocol (typically some headers are saying &amp;quot;this is command for management, this is data transfer of type X, this is transfer of type Y etc.&amp;quot;) Simply build a tube on top of GATT to speed that layer discovery.&lt;/p&gt;
&lt;p&gt;(1/2)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104321?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 14:11:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b288b6f4-fd3a-4545-9f59-cf70f06a9f8e</guid><dc:creator>phipi</dc:creator><description>&lt;p&gt;The device is not always connected but the central will command the device to start sampling and sending data so essentially it will be connected the whole time it&amp;#39;s sampling. Are there downsides for using a separate characteristic for ADC1, ADC2, IMU and Commands other than discovery overhead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Structure</title><link>https://devzone.nordicsemi.com/thread/104315?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2017 22:36:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca5ff54f-4469-403e-92af-d2488b5c9b97</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Depend on what is your major criteria;) Is it speed hence minimal overhead during GATT service discovery right after connection is established or you don&amp;#39;t care about that (e.g. because your use case is rather &amp;quot;all the time connected&amp;quot; or &amp;quot;devices will be always bonded and GATT Server stack will be static hence Client will use cache all the time&amp;quot;) and you rather prefer having it &amp;quot;nice&amp;quot;? I guess answering this question will give you also immediately answer to your original one;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>