示例#1
0
文件: main.c 项目: JulianYG/WNR
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    bool     erase_bonds;

    // Initialize
    timers_init();
    nrf_log_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    device_manager_init(erase_bonds);
    db_discovery_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();

    // Start execution
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    NRF_LOG("\r\nCTS Start!\r\n");
    
    // Enter main loop
    for (;;)
    {
        app_sched_execute();
        power_manage();
    }
}
示例#2
0
int main(void)
{
    bool erase_bonds;

    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, NULL);
    buttons_leds_init(&erase_bonds);
    nrf_log_init();
    APPL_LOG("Heart rate collector example\r\n");
    ble_stack_init();
    device_manager_init(erase_bonds);
    db_discovery_init();
    hrs_c_init();
    bas_c_init();

    // Start scanning for peripherals and initiate connection
    // with devices that advertise Heart Rate UUID.
    scan_start();

    for (;; )
    {
        power_manage();
    }
}