<?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 increase number of characteristics</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9489/how-to-increase-number-of-characteristics</link><description>Hi, 
 Using S130 via mBed, I&amp;#39;d like to have a fairly large number of characteristics (say 30). Unfortunately this seems to be too many, as sd_ble_gatts_characteristic_add() returns an error after I get to maybe 18 characteristics (i.e. 17 works, 18 doesn</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Sep 2015 14:17:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9489/how-to-increase-number-of-characteristics" /><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35039?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 14:17:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d52da594-de8f-49d9-be5c-b3feef8fa8a4</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;You are right, BT SIG don&amp;#39;t mandate grouping 128-bit UUIDs by any base for Service and its Characteristics, it&amp;#39;s just the routine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35038?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 12:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b4147cd-16a6-4fb0-b1ce-7966d826a14c</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;I&amp;#39;ve not read that anywhere - and actually it worked with every service and characteristic having totally different base UUIDs (up to the limit of 8). However in my code I now use the same base UUID for everything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35035?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 11:39:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2df0d875-b8e9-4b89-8a58-57efc16c34b8</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;And btw. if you start to care really about security (which I hope all the people involved in IoT will soon!) then you encounter problems such as anonymity through tracking of MAC addresses (Adv. Address in case of BLE GAP Peripheral role). This is already problem with classic BT and Wifi and some manufactures (e.g. iOS) already started to randomize these things (at least a bit - e.g. with long rotation period but but better then nothing). Now if you project this into BLE I believe you see where it is going (and why it is again more interesting to use &amp;quot;minimal&amp;quot; part of BLE stack as &amp;quot;tube&amp;quot; and do clever things on applicative layer - unless you design really largely interoperable schemes such as new GAP profile which should work on various devices from multiple vendors or you are designing new IoT protocol which should be widely adopted and coexist with current GAP profiles).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35034?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 11:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e81f7a54-ca03-48b9-8574-93615fb29a6b</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Re discovery procedure: you are right, if stack on peripheral side is static (+ does not provide &amp;quot;Service Changed Characteristic&amp;quot;) it&amp;#39;s good chance that central stack will cache it (link it to Adv. Address). However this is not perfect because also central stack is some sort of embedded device so it cannot log all the addresses, it is also usually out of your control (e.g. in the mobile phone or similar rich OS platform) so you never know if and how well it does this caching (it can decide to delete &amp;quot;old&amp;quot; records randomly or based on time or just during OS upgrade...) So in general there are catches and if you claim that in your special case it will work (which I&amp;#39;m perfectly fine and in-line) then it leads back to my original remark: why to make it so &amp;quot;general&amp;quot; and complex when in the end it will be just your proprietary protocol between one &amp;quot;peripheral&amp;quot; and dedicated &amp;quot;central app&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35033?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 11:26:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cba59e1b-b1f6-4242-9375-8ba42a6fe99b</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Re Security: there is actually only one mode which is really secure in BT SIG 4.0&amp;amp;4.1 defined for LE: OOB (Out-Of-Bend). There you distribute the keys yourself (e.g. derive from static master key known to all parts or transported by other media such as keyboard or NFC). With fix in spec 4.2 which brings asymmetric bootstrapping with ECC it makes some sense to use &amp;quot;native&amp;quot; security layer provided by LE stack but it isn&amp;#39;t really adopted yet. In addition to the scaling: most of the implementations (e.g. all SoftDevices from Nordic) are limiting number of devices (logically - it&amp;#39;s deeply embedded system not server with &amp;quot;unlimited&amp;quot; space for large DB) - number is 8 I guess. So you cannot really deploy system where devices on both sides &amp;quot;randomly&amp;quot; meet and communicate securely (unless you do it on applicative layer which is what all the guys such Apple HomeKit or Google Weave).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35032?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 11:03:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a027166c-4766-40e1-bd8e-6c582acc2596</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Re update: Interesting, can you explain why the BLE security mechanism doesn&amp;#39;t scale? Also is it necessary to do a full service discovery when connecting? If I already know all the GUIDs (because I designed the device) surely I don&amp;#39;t need to?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35037?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 10:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f4ec1d8-6f3e-4d63-b1f0-cc4c15b14e5b</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;My answer to this exceeds 900-word limit so I amend my answer above;)&lt;/p&gt;
&lt;p&gt;(Btw. I hope you&amp;#39;ve tricked your mBed drivers/SDK to accept more UUIDs under one 128-bit base because all Characteristics should share the UUID base of their ancestor Primary Service, don&amp;#39;t they?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35036?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 09:53:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:212aafdf-3366-43ab-9929-f368b161eaf1</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Jan&amp;#39;s answer is great, but actually my problem turned out to be not due to the ATTR_TAB_SIZE. It was because I was using distinct UUIDs for all my characteristics. I totally forgot you are supposed to use a very small number of &amp;quot;base&amp;quot; UUIDs, and then just change the third and forth bytes.&lt;/p&gt;
&lt;p&gt;custom_helper.cpp in mBed restricts the number of distinct base UUIDs to 8:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static const unsigned UUID_TABLE_MAX_ENTRIES = 8; /* This is the maximum number of 128-bit UUIDs with distinct bases that
                                                   * we expect to be in use; increase this limit if needed. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I changed my UUIDs so that the bases match and now it is fine (I also had to increase the hard limit of 20 in nRF5xGattServer.h, but I didn&amp;#39;t have to change the ATTR_TAB_SIZE from its default (0x600).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35031?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 06:53:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26999997-a41b-4a64-86be-67c76ad4c36b</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Perfect thanks! Yeah I could just use a single characteristic and write to/notify from it as if it were a pipe. But that&amp;#39;s less discoverable and doesn&amp;#39;t really seem like it&amp;#39;s in the spirit of BLE!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase number of characteristics</title><link>https://devzone.nordicsemi.com/thread/35030?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2015 21:34:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f57aea0-14cc-4246-b582-9e0c54eccf5b</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi Tim,&lt;/p&gt;
&lt;p&gt;BLE ATT (Attribute) layer which is base of GATT client/server layers in BLE Stack is configurable in latest Nordic SoftDevices. This is done during SoftDevice init by function &lt;code&gt;sd_ble_enable(...)&lt;/code&gt;. See API documentation in Nordic infocenter &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v1.0.0%2Fgroup___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=2_7_2_1_0_2_0_1_3_0&amp;amp;anchor=ga0f632bec36100e4d2d74672ccbb4218b"&gt;here&lt;/a&gt; and also read &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v1.0.0%2Fgroup___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=2_7_2_1_0_2_0_1_3_0&amp;amp;anchor=ga0f632bec36100e4d2d74672ccbb4218b"&gt;chapter 13.1&lt;/a&gt; of S130 SoftDevice Specification (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.pdf.sds/S130_SDS_v1.0.pdf"&gt;link to PDF version&lt;/a&gt; if you prefer). Note that changing Attribute Table Size has consequences on memory layout during linking of final firmware binary, see chapter &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v1.0.0%2Fgroup___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=2_7_2_1_0_2_0_1_3_0&amp;amp;anchor=ga0f632bec36100e4d2d74672ccbb4218b"&gt;13.2.1&lt;/a&gt; and other references in SDS.&lt;/p&gt;
&lt;p&gt;Cannot leave the reply without this comment: what about redesigning your usage of Bluetooth LE ATT/GATT layer because most of the job could be done over single Service and Characteristic handles (actually 1 for the Service and 3 for the Char)? Or is it so that your device will really potentially offer so many characteristics to different applications? (e.g. if you have just one dedicated app then merge all features to applicative protocol running over one bi-directional characteristic which will safe resources as well as time during service discovery and I believe overhead will hardly harm your throughput unless you have very specific use case of many fast-changing but short and completely asynchronous values...)&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;
&lt;h2&gt;Update on September 30, 2015:&lt;/h2&gt;
&lt;p&gt;Hi Tim,&lt;/p&gt;
&lt;p&gt;This is exactly what I&amp;#39;ve tried to point out: while GATT client/server architecture looks like &amp;quot;in the spirit of BLE&amp;quot; it doesn&amp;#39;t scale. I assume that if your 30 &amp;quot;properties&amp;quot; (whatever it is) are really independent and there should be &amp;quot;general&amp;quot; applications which can discover full (or partial) list and pick just few they should be rather grouped on Primary Service level, don&amp;#39;t they? In every case you will have huge penalty (it can take even couple of seconds when you increase the GATT table usage) during each connection (if full service discovery will be done by central side) plus you will have troubles once you would like to secure the link (because BT Smart security mechanism doesn&amp;#39;t scale in practice) so the whole concept of &amp;quot;general&amp;quot; properties in the practice collapses into &amp;quot;one bonded/paired central device with my application&amp;quot;. And thus simple stupid &amp;quot;pipe&amp;quot; would do all the job more efficiently. In the system where server (peripheral) can accept only one connection at the time the principle of applicative fragmentation already on GATT layer somehow loses the charm. And when new devices supporting more complex server-client topologies arrive (compliant to BT SIG specs 4.2/5.0) - which will take couple of years - there will still be majority of the devices living in this old &amp;quot;low energy&amp;quot; (and resources) design. (And sweet secret: &amp;quot;one pipe for all things and applicative discovery mechanism on top of it&amp;quot; will work efficiently even on these &amp;quot;rich topologies&amp;quot;;)&lt;/p&gt;
&lt;p&gt;Just an opinion after my 2-year experience with BT Smart...&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>