<?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>To properly set up a ble peripheral app, how many CBs do I have to register?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28544/to-properly-set-up-a-ble-peripheral-app-how-many-cbs-do-i-have-to-register</link><description>Hello, I&amp;#39;m trying to migrate an Atmel project to nrf51822 chip. 
 Now, in the original project there were 2 CB arrays registered, one dealing iwth GATT one with GAP: 
 a little sneak-peak: 
 ble_mgr_events_callback_handler(REGISTER_CALL_BACK, 
 BLE_GAP_EVENT_TYPE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Dec 2017 14:42:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28544/to-properly-set-up-a-ble-peripheral-app-how-many-cbs-do-i-have-to-register" /><item><title>RE: To properly set up a ble peripheral app, how many CBs do I have to register?</title><link>https://devzone.nordicsemi.com/thread/113067?ContentTypeID=1</link><pubDate>Fri, 15 Dec 2017 14:42:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cf2be11-c00c-4dad-9bb3-87fb3ff99f46</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;It appears all the callbacks for Atmel are softdevice level callbacks/events and not at the SDK level. Can you provide more information on this. You can also use the one on one support portal , &lt;a href="http://www.nordicsemi.com/eng/Support/Contact-Support-Team"&gt;www.nordicsemi.com/.../Contact-Support-Team&lt;/a&gt; to provide other information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To properly set up a ble peripheral app, how many CBs do I have to register?</title><link>https://devzone.nordicsemi.com/thread/113068?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 13:47:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:905db73c-22de-4182-bef3-bf2eb04226ac</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mitch,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;There isn&amp;#39;t a split between GAP and GATT callbacks/event. They are all can be handled inside ble_evt_dispatch(). If you use our library (device manager for example), you don&amp;#39;t need to register any more handler.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I assume you are talking about ble_hrs_on_ble_evt() (for example) as &amp;quot;sub-callback&amp;quot;  ? They are event handler of a service. Any service can subscribe to the events dispatch and handle events that it&amp;#39;s interested in. It&amp;#39;s completely up to the application what to do with the event.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The question is what do you want to do with your application, for example if you want to handle an event. For example if there is a write request to a characteristic , then turn on an LED. Then you need to write that handler to catch the write event then turn on the LED.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;dm_ble_evt_handler() for example , is belong to the device manager library ,and you can leave it untouch.
Other handler, is the service handler, if you don&amp;#39;t plan to use it you can skip it. Or if you want to include it hrs for example, you just leave it as it is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>