<?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>What do LEDs 0 and 1 indicate in the ble_proximity sample app?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1037/what-do-leds-0-and-1-indicate-in-the-ble_proximity-sample-app</link><description>Here are some constants from main.c for the other LEDs, but what do LEDs 0 and 1 indicate? 0 seems to be on when advertising. 1 when connected? What about pairing/bonding state? 
 #define ALERT_LEVEL_MILD_LED_PIN_NO NRF6310_LED_2 / &amp;lt; Is on when we are</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Dec 2013 12:39:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1037/what-do-leds-0-and-1-indicate-in-the-ble_proximity-sample-app" /><item><title>RE: What do LEDs 0 and 1 indicate in the ble_proximity sample app?</title><link>https://devzone.nordicsemi.com/thread/4916?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2013 12:39:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab3d2a32-5d0a-48fe-9842-d1e3780a99cb</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Hi Eliot,&lt;/p&gt;
&lt;p&gt;as you say, LED 0 is set when advertising, and LED 1 is set when connected. There is no LED activity that indicates pairing state.&lt;/p&gt;
&lt;p&gt;If you want main.c to handle bond-related events, you should implement the &lt;em&gt;evt_handler&lt;/em&gt; provided in &lt;em&gt;ble_bondmngr_init()&lt;/em&gt;. See &lt;em&gt;bond_manager_init&lt;/em&gt; in main.c.
For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
static void bond_manager_event_handler(ble_bondmngr_evt_t * p_evt)
{
    switch (p_evt-&amp;gt;evt_type)
    {
        case BLE_BONDMNGR_EVT_NEW_BOND:
            break;
        
        case BLE_BONDMNGR_EVT_CONN_TO_BONDED_MASTER:
            break;
        
        case BLE_BONDMNGR_EVT_ENCRYPTED:
            break;
        
        case BLE_BONDMNGR_EVT_AUTH_STATUS_UPDATED:
            break;
        
        case BLE_BONDMNGR_EVT_BOND_FLASH_FULL:
            break;
        
        default:
            // Unexpected event
            APP_ERROR_CHECK_BOOL(false);
            break;
    }
}


/**@brief Function for the Bond Manager initialization.
 */
static void bond_manager_init(void)
{
    uint32_t            err_code;
    ble_bondmngr_init_t bond_init_data;
    bool                bonds_delete;

    // Clear all bonded masters if the Bonds Delete button is pushed
    err_code = app_button_is_pushed(BONDMNGR_DELETE_BUTTON_PIN_NO, &amp;amp;bonds_delete);
    APP_ERROR_CHECK(err_code);
    
    // Initialize the Bond Manager
    bond_init_data.flash_page_num_bond     = FLASH_PAGE_BOND;
    bond_init_data.flash_page_num_sys_attr = FLASH_PAGE_SYS_ATTR;
    bond_init_data.evt_handler             = bond_manager_event_handler; // This wasnt here originally
    bond_init_data.error_handler           = bond_manager_error_handler;
    bond_init_data.bonds_delete            = bonds_delete;
    
    err_code = ble_bondmngr_init(&amp;amp;bond_init_data);
    APP_ERROR_CHECK(err_code);
}

&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>