<?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 detect peripheral connect but not enable notify yet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20253/how-to-detect-peripheral-connect-but-not-enable-notify-yet</link><description>Hi, 
 I do test my project one central connect to 4 peripheral(HR and CSC).
and I put the memset(&amp;amp;m_ble_db_discovery,0,sizeof(m_ble_db_discovery)); err_code = ble_db_discovery_start(&amp;amp;m_ble_db_discovery[p_gap_evt-&amp;gt;conn_handle], p_gap_evt-&amp;gt;conn_handle</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Mar 2017 06:52:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20253/how-to-detect-peripheral-connect-but-not-enable-notify-yet" /><item><title>RE: how to detect peripheral connect but not enable notify yet</title><link>https://devzone.nordicsemi.com/thread/78894?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 06:52:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:599f71a1-b949-47e9-91fe-eeb0c372fe3f</guid><dc:creator>Vincent</dc:creator><description>&lt;p&gt;Finally I realize how to got the notify does enable or not&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Assign the service handle into service_init
for example in  csc device:&lt;/p&gt;
&lt;p&gt;void m_ble_cscs_evt_handler_t (ble_cscs_t * p_cscs, ble_cscs_evt_t * p_evt)
{
if( p_evt-&amp;gt;evt_type ==  BLE_CSCS_EVT_NOTIFICATION_ENABLED )
{
NRF_LOG_INFO(&amp;quot;BLE_CSCS_EVT_NOTIFICATION_ENABLED\r\n&amp;quot;);
}
else if( p_evt-&amp;gt;evt_type ==  BLE_CSCS_EVT_NOTIFICATION_DISABLED )
{
NRF_LOG_INFO(&amp;quot;BLE_CSCS_EVT_NOTIFICATION_DISABLED\r\n&amp;quot;);
}
}&lt;/p&gt;
&lt;p&gt;static void services_init(void)
{
uint32_t              err_code;
ble_cscs_init_t       cscs_init;
ble_bas_init_t        bas_init;
ble_dis_init_t        dis_init;
ble_sensor_location_t sensor_location;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; // Initialize Cycling Speed and Cadence Service.
memset(&amp;amp;cscs_init, 0, sizeof(cscs_init));

cscs_init.evt_handler = m_ble_cscs_evt_handler_t;//NULL;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;then we can got the notify does enable or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>