<?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>Custom BLE Service Help</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2855/custom-ble-service-help</link><description>Hello, 
 I am really confused on how to get a custom BLE service up and running. I have read through nAN-36, and compared the suggestions in that document to the HRS example provided. It seems like the code in nAN-36 is missing a lot of the code provided</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Jun 2014 06:22:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2855/custom-ble-service-help" /><item><title>RE: Custom BLE Service Help</title><link>https://devzone.nordicsemi.com/thread/10886?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2014 06:22:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e630ad13-6b49-4916-afe8-ad2f859ce309</guid><dc:creator>littedino2112</dc:creator><description>&lt;p&gt;Hi Lucas, totally agree that the instruction in the application note is a little less descriptive. I had to go through it several times to create a custom service of my own.
In order to create a service, basically, u need to have 2 basic structures (one is for init, the other one for storing necessery info about the service itself). Take battery service (ble_bas) as an example. We have ble_bas_s for the service itself and ble_bas_init_t for passing initialization info to the custom service.&lt;/p&gt;
&lt;p&gt;Then you will need to create an init func in which you will add your custom characteristics (look at ble_bas_init function in ble_bas.c). In your case, you will need to add 3 characteristics. In order to to add characteristic, you will need ble_gatts_char_md_t (for characteristic metadata), ble_gatts_attr_t (for characteristic value, UUID, etc...) and ble_gatts_attr_md_t (for setting access permission to characteristic). Additionally, you need to set up and &amp;#39;send&amp;#39; function in your custom service as well. This will take care of sending characteristic data to peripheral device (take a look at ble_hrs_heart_rate_measurement_send in ble_hrs.c for reference).&lt;/p&gt;
&lt;p&gt;Considerting initialization of advdata, the template ble_app_template mentioned in the AN already did the basic initialization. you can play with the config if you want to.&lt;/p&gt;
&lt;p&gt;This will probably take some time to understand all the logics of the code. So be patient :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>