<?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>How to make custom characteristic with Indication?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9100/how-to-make-custom-characteristic-with-indication</link><description>Based on Battery Service I have made my own Service and Characteristics but I have problem with setting Indication. This is how my characteristic add function looks like: 
 static uint32_t xyz_response_char_add(ble_bws_t * p_bws, 
 const ble_bws_init_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Sep 2015 13:36:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9100/how-to-make-custom-characteristic-with-indication" /><item><title>RE: How to make custom characteristic with Indication?</title><link>https://devzone.nordicsemi.com/thread/33510?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2015 13:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d1ac8d4-b603-4f9b-ba2f-905711fc9eec</guid><dc:creator>Al Bundy</dc:creator><description>&lt;p&gt;It works now, thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make custom characteristic with Indication?</title><link>https://devzone.nordicsemi.com/thread/33509?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2015 14:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4f06a01-63e7-41ba-8367-ad728bab5656</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Try to use &lt;code&gt;sd_ble_gatts_hvx()&lt;/code&gt;. &amp;quot;hvx&amp;quot; stands for Handle Value x, where x can be Indication or Notification. &lt;a href="https://devzone.nordicsemi.com/question/310/notificationindication-difference/"&gt;Notification/Indication Difference&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is how the heart rate example ble_app_hrs example in SDK 9 sends a notification:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t ble_hrs_heart_rate_measurement_send(ble_hrs_t * p_hrs, uint16_t heart_rate)
{
    uint32_t err_code;

    // Send value if connected and notifying
    if (p_hrs-&amp;gt;conn_handle != BLE_CONN_HANDLE_INVALID)
    {
        uint8_t                encoded_hrm[MAX_HRM_LEN];
        uint16_t               len;
        uint16_t               hvx_len;
        ble_gatts_hvx_params_t hvx_params;

        len     = hrm_encode(p_hrs, heart_rate, encoded_hrm);
        hvx_len = len;

        memset(&amp;amp;hvx_params, 0, sizeof(hvx_params));

        hvx_params.handle = p_hrs-&amp;gt;hrm_handles.value_handle;
        hvx_params.type   = BLE_GATT_HVX_NOTIFICATION;
        hvx_params.offset = 0;
        hvx_params.p_len  = &amp;amp;hvx_len;
        hvx_params.p_data = encoded_hrm;

        err_code = sd_ble_gatts_hvx(p_hrs-&amp;gt;conn_handle, &amp;amp;hvx_params);
        if ((err_code == NRF_SUCCESS) &amp;amp;&amp;amp; (hvx_len != len))
        {
            err_code = NRF_ERROR_DATA_SIZE;
        }
    }
    else
    {
        err_code = NRF_ERROR_INVALID_STATE;
    }

    return err_code;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>