<?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>Control a function by button and/or BLE (e.g. iOS App)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1794/control-a-function-by-button-and-or-ble-e-g-ios-app</link><description>Hi, 
 i started writing a BLE application with the nRF51822 but i seam to have some trouble understanding BLE/S110. My application will consist of a button and an actor connected to the nRF51822 and a smartphone app. I would like to create a characteristic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Apr 2015 17:27:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1794/control-a-function-by-button-and-or-ble-e-g-ios-app" /><item><title>RE: Control a function by button and/or BLE (e.g. iOS App)</title><link>https://devzone.nordicsemi.com/thread/7830?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 17:27:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c05d25aa-bcab-4ab1-8e0f-fbb17934a445</guid><dc:creator>zainab_daoud</dc:creator><description>&lt;p&gt;I use nRF51822 and i want to change a characteristic value(major_value) in the function button_handler? Is there any example ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Control a function by button and/or BLE (e.g. iOS App)</title><link>https://devzone.nordicsemi.com/thread/7829?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2014 09:33:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d51dea3d-9fd6-4f56-abfa-8a66b417a1db</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;m not quite sure I understand why you absolutely want to combine them, and it sounds as if what you want is more or less exactly what&amp;#39;s covered by nAN-36 and the code &lt;a href="https://github.com/NordicSemiconductor/nrf51-ble-app-lbs"&gt;here&lt;/a&gt;. There isn&amp;#39;t really any problems with notifying the phone about a button press, but also using it to trigger something locally on your device. It should also be pretty easy to extens the LED state to instead write a number or something, and then using that number to control whatever action you want to happen on your device (i.e. with 0 being off, some other value being fully on, and whatever value in between being a percentage or similar).&lt;/p&gt;
&lt;p&gt;If it is so that the local button directly controls the value, and you want to know the value also on the phone, I&amp;#39;d recommend to instead just remove the button characteristic, and just notify the value when it changes.&lt;/p&gt;
&lt;p&gt;Also, for completeness, there isn&amp;#39;t really anything stopping you from having a characteristic that&amp;#39;s both readable, writeable and notifiable. You can do this by just setting all the needed properties in the ble_gatts_char_md_t struct when initializing the characteristic. You can then both do notifications with sd_ble_gatts_hvx(), set the value to be read with sd_ble_gatts_value_set() or receive writes over-the-air.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>