<?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>Writable values on services</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66135/writable-values-on-services</link><description>Hi , 
 Just one question. 
 I am trying to create services using hrs examples and its useful. 
 Currently one question I have that , 
 the battery indicator is only notifiable but instead could that service can be made writable as well. 
 
 Thanks,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Sep 2020 13:36:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66135/writable-values-on-services" /><item><title>RE: Writable values on services</title><link>https://devzone.nordicsemi.com/thread/270622?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 13:36:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6da762c7-361e-4706-a469-afab868fbb9f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Then I suggest you look into the ble_app_uart example.&lt;/p&gt;
&lt;p&gt;You can read the test description &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_nus_eval.html?cp=7_1_4_2_2_25_2#project_uart_nus_eval_test"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writable values on services</title><link>https://devzone.nordicsemi.com/thread/270568?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 11:51:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3f31487-01a3-4429-bb53-3a9c7a4dd381</guid><dc:creator>Zero.cool</dc:creator><description>&lt;p&gt;Yes&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;re right.&lt;br /&gt;Actually I will try to explain here, &lt;br /&gt;In project we have IOS app, which is hiding mac of device + generic attributes, and only exposing services. &lt;br /&gt;So I just wanted to check If I can make one service with writable such that data sending from IOS can be tried.&lt;/p&gt;
&lt;p&gt;your suggestions are most welcome here :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writable values on services</title><link>https://devzone.nordicsemi.com/thread/270550?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 10:59:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:314cd5d7-7e6c-42ab-b2bd-c7143b92050a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You can try to make the battery service writable, just for testing.&lt;/p&gt;
&lt;p&gt;It would be adding something like:&lt;/p&gt;
&lt;p&gt;add_char_params.char_props.write&amp;nbsp; &amp;nbsp;= 1;&lt;/p&gt;
&lt;p&gt;after&amp;nbsp;&lt;/p&gt;
&lt;p&gt;add_char_params.char_props.read&amp;nbsp; &amp;nbsp;= 1;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And then you would have to implement something to handle the write events in the on_write() function in ble_bas.c.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, the heart rate characteristic is only one byte by default, so you would have to change that if you want to send more data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    add_char_params.max_len           = sizeof(uint8_t);
    add_char_params.init_len          = sizeof(uint8_t);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To be honest, it may be easier for you to add the nus service from the ble_app_uart example. Look at how it is implemented in that example. Using that service, you are free to send more data, and you can send this custom data both ways.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writable values on services</title><link>https://devzone.nordicsemi.com/thread/270536?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 10:07:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:884c1038-b11c-4a0e-a0b9-1478ab2ebd3b</guid><dc:creator>Zero.cool</dc:creator><description>&lt;p&gt;Ok,&lt;/p&gt;
&lt;p&gt;So, Is there any service I can make it as Writable in heart rate example just to quickly check for one experiment. &lt;br /&gt;or I need to create one service to make it writable. ?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writable values on services</title><link>https://devzone.nordicsemi.com/thread/270504?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 08:55:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8b53acc-963d-4df5-bb69-3dd2a06116ee</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;According to the Battery Service specification, which you can find &lt;a href="https://www.bluetooth.com/specifications/gatt/" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;&amp;nbsp;(click on the 1.0-link next to &amp;quot;Battery Service&amp;quot;), the battery level characteristic can not be written to:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-430c6f8229e343ea9acd73dd978a0fee/pastedimage1600678501498v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So while it probably is possible to implement it, you will not be able to certify the product with Bluetooth if that is possible.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>