<?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>nRF52 Button Characteristic Adding</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40095/nrf52-button-characteristic-adding</link><description>Hi Everyone, I am trying to add a characteristic in the BLE_UART project. I&amp;#39;m intending to use that characteristic to transmit the state of a button. I have copy-pasted the button implementation from the BLE_BLINKY project. My buttons_leds_init() function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Nov 2018 13:37:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40095/nrf52-button-characteristic-adding" /><item><title>RE: nRF52 Button Characteristic Adding</title><link>https://devzone.nordicsemi.com/thread/155770?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 13:37:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e097957e-0e9b-4dfd-8cb2-eceb9ca7b487</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]err_code = ble_nus_on_button_change(m_conn_handle, &amp;amp;m_nus, button_action);[/quote]
&lt;p&gt;&amp;nbsp;You need to register a BLE event observer using the NRF_SDH_BLE_OBSERVER macro. Example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ble_lbs_c_t instance;
NRF_SDH_BLE_OBSERVER(anything, BLE_LBS_C_BLE_OBSERVER_PRIO,
                     ble_lbs_c_on_ble_evt, &amp;amp;instance);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Take a look at ble_lbs.h in the ble_app_blinky example. See &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fgroup__ble__lbs.html&amp;amp;cp=4_0_0_6_3_20"&gt;here&lt;/a&gt; for more documentation of the LED Button Service.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>