<?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>Inserting a custom service/characteristic into Central/Peripheral example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14519/inserting-a-custom-service-characteristic-into-central-peripheral-example</link><description>I&amp;#39;ve been playing around with the multi-central central/peripheral examples and I thought I would modify the peripheral to instead use a service I had written for another application, but simply notifies with one byte as the example does. 
 Not really</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jun 2016 08:21:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14519/inserting-a-custom-service-characteristic-into-central-peripheral-example" /><item><title>RE: Inserting a custom service/characteristic into Central/Peripheral example</title><link>https://devzone.nordicsemi.com/thread/55437?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2016 08:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d6527fd-0608-4ec9-8b64-a2201cc5902b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Yes I was going to point out the handle invalid thing however when I checked the function it seemed to say you could use it and it would add to the previous service. Anyway I figured that was the call probably failing.&lt;/p&gt;
&lt;p&gt;3401 - just type &lt;code&gt;0x3401&lt;/code&gt; into the search box at the top.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inserting a custom service/characteristic into Central/Peripheral example</title><link>https://devzone.nordicsemi.com/thread/55436?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2016 08:17:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd42df55-7ca9-4702-85ed-a0d70aca732f</guid><dc:creator>Sensors</dc:creator><description>&lt;p&gt;I totally hadn&amp;#39;t realised I missed that, thanks for pointing it out.&lt;/p&gt;
&lt;p&gt;I realised as I was examining it that it was passing a &lt;code&gt;BLE_GATT_HANDLE_INVALID&lt;/code&gt; rather than the service handle, which seemed strange. I changed it to &lt;code&gt;m_core_service.service_handle&lt;/code&gt; and it seems to work now.&lt;/p&gt;
&lt;p&gt;There seems to be a new issue though with connecting to it via the MCP app, and it&amp;#39;s throwing a 0x00003401 error. I&amp;#39;ve seen the same behaviour when I start the peripheral before the nrf51 central too. I&amp;#39;ll make a new question for that though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inserting a custom service/characteristic into Central/Peripheral example</title><link>https://devzone.nordicsemi.com/thread/55435?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2016 00:08:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4b85653-f2fc-4c41-a50b-b7b5d9b18dcc</guid><dc:creator>RK</dc:creator><description>&lt;pre&gt;&lt;code&gt;err_code = sd_ble_gatts_characteristic_add(BLE_GATT_HANDLE_INVALID,
                                           &amp;amp;char_md,
                                           &amp;amp;attr,
                                           &amp;amp;m_core_service.rh_handles);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;you don&amp;#39;t check the err_code from that call - did it actually succeed, add the characteristic and fill in the handles, because those are the handles you later use in the HVX call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>