<?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>Adding a second characteristic to a custom service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19856/adding-a-second-characteristic-to-a-custom-service</link><description>nrf52DK - SDK12.2 
 This is probably a simple thing I am missing but I can&amp;#39;t seem to find the answer. 
 I have been following the tutorial for BLE Characteristics ( here ) 
 I was able to follow through the whole thing and make changes needed - it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Feb 2017 14:28:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19856/adding-a-second-characteristic-to-a-custom-service" /><item><title>RE: Adding a second characteristic to a custom service</title><link>https://devzone.nordicsemi.com/thread/77233?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 14:28:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:220c2920-7760-4cb0-84b5-375a97f3417f</guid><dc:creator>Bryan H</dc:creator><description>&lt;p&gt;Jørgen,
Thank you so much! I feel really stupid for not figuring that out myself.
I also had to change my code for updating the photocell reading as below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (p_our_service-&amp;gt;conn_handle != BLE_CONN_HANDLE_INVALID)
{
    uint16_t               len = 2;
    ble_gatts_hvx_params_t hvx_params;
    memset(&amp;amp;hvx_params, 0, sizeof(hvx_params));
    hvx_params.handle = p_our_service-&amp;gt;char_b_handles.value_handle;
    hvx_params.type   = BLE_GATT_HVX_NOTIFICATION;
    hvx_params.offset = 0;
    hvx_params.p_len  = &amp;amp;len;
    hvx_params.p_data = (uint8_t*)photoReading_value;
    sd_ble_gatts_hvx(p_our_service-&amp;gt;conn_handle, &amp;amp;hvx_params);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thank you again - big help!
Bryan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second characteristic to a custom service</title><link>https://devzone.nordicsemi.com/thread/77232?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 09:47:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fd57579-cdd2-4de7-ae25-64c92ae48020</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi Bryan,&lt;/p&gt;
&lt;p&gt;You need to add a new variable holding the handles for the second characteristics. In step 2.D of the tutorial, you are asked to add the member &lt;code&gt;ble_gatts_char_handles_t char_handles;&lt;/code&gt; to the struct &lt;code&gt;ble_os_t&lt;/code&gt;. You need to add a second member of type &lt;code&gt;ble_gatts_char_handles_t&lt;/code&gt; to this struct, holding the handles of your second charactersitics. Your struct can look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;typedef struct
{
    uint16_t                    conn_handle; 
    uint16_t                    service_handle;        
    ble_gatts_char_handles_t    char_a_handles;
    ble_gatts_char_handles_t    char_b_handles;
} ble_os_t;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the next step, you will use the new handle holder when adding the new characteristics to the GATT table:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = sd_ble_gatts_characteristic_add(p_our_service-&amp;gt;service_handle,
                                           &amp;amp;char_md,
                                           &amp;amp;attr_char_value,
                                           &amp;amp;p_our_service-&amp;gt;char_b_handles);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>