<?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 Battery Service: Extra Characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50904/ble-battery-service-extra-characteristic</link><description>Hi all, 
 I am looking for some advice on how to implement a couple of extra characteristics(Related with battery) with the Battery Service apart from the usual Battery Level Characteristic. 
 What is the best practice to handle such a case? Should I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 Aug 2019 09:08:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50904/ble-battery-service-extra-characteristic" /><item><title>RE: BLE Battery Service: Extra Characteristic</title><link>https://devzone.nordicsemi.com/thread/203766?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 09:08:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8150143a-e6b3-4b8c-b7d5-f8f5199fad88</guid><dc:creator>cbd</dc:creator><description>&lt;p&gt;A custom service is definitely he way to go.&lt;/p&gt;
&lt;p&gt;Although the Bluetooth SIG conformance testing and specification documentation for the Battery Service doesn&amp;#39;t specifically state that conformance to the specification excludes the inclusion of extra characteristics the fact that the specification states&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;em&gt;&lt;span style="background-color:#ffffff;"&gt;If a device claims conformance to this service, all capabilities indicated as mandatory for this service shall be supported in the specified manner (process-mandatory).&lt;/span&gt;&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;and that it specifically lists &lt;strong&gt;only&lt;/strong&gt; the Battery Level characteristic (and as mandatory), along with the fact that GATT specification states on services&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;em&gt;&lt;span style="background-color:#ffffff;"&gt;To maintain backward compatibility with earlier clients, later versions of a service definition can only add new included services or optional characteristics. Later versions of a service definition are forbidden from changing behaviors from previous versions of the service definition.&lt;/span&gt;&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;it could be argued that the inclusion of extra characteristics is changing the service behaviour which would make your code non-conformant if in future an optional characteristic was added to the Battery Service and ratified by the Bluetooth SIG.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Battery Service: Extra Characteristic</title><link>https://devzone.nordicsemi.com/thread/203732?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 07:03:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d7248be-8d12-45e3-826f-9f0155bf2e10</guid><dc:creator>dev_000</dc:creator><description>&lt;p&gt;Thanks.&lt;br /&gt;I couldnt find information on the spec on whether this will be a violation. Hence thought of asking. &lt;br /&gt;Will go ahead with the extra service. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Battery Service: Extra Characteristic</title><link>https://devzone.nordicsemi.com/thread/203728?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 06:54:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90e8d154-01d8-4af0-a2e9-aa069a8fecd9</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Our &lt;a href="https://github.com/bjornspockeli/custom_ble_service_example"&gt;custom BLE service&amp;nbsp;example&lt;/a&gt; shows you how to add and implement custom characteristics/services. You could also look at the linked beginner tutorials for more details on either services, characteristics or advertising in that example.&lt;/p&gt;
&lt;p&gt;I would recommend adding a new service instead of adding characteristics to the Battery Service, as it&amp;#39;s &amp;quot;cleaner&amp;quot; to have custom characteristics within custom services, and not mixing them with already existing services.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think this would violate the Bluetooth spec. but I&amp;#39;m not 100% sure, so you should check the Bluetooth specification just in case if you decide to go with this solution.&lt;/p&gt;
&lt;p&gt;In any case, we do not recommend editing the files within our SDK libraries/drivers, as it makes future support harder if we have to consider multiple files to be the source of errors instead of just edits within main.c, sdk_config.h, and custom files. So please go for new .c and .h files for this approach.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>