Example #1
0
File: main.c Project: mcanos/nRF51
static void hrm_connect(void * p_context)
{
  uint32_t err_code = NRF_SUCCESS;
  
  err_code = ant_hrm_open(&m_ant_hrm);
  APP_ERROR_CHECK(err_code);
}
Example #2
0
/**
 * @brief Function for HRM profile initialization.
 *
 * @details Initializes the HRM profile and open ANT channel.
 */
static void profile_setup(void)
{
/** @snippet [ANT HRM TX Profile Setup] */
    uint32_t err_code;

    err_code = ant_hrm_init(&m_ant_hrm, &ant_tx_channel_config, &ant_tx_config);
    APP_ERROR_CHECK(err_code);

    m_ant_hrm.page_2.manuf_id     = HRMTX_MFG_ID;
    m_ant_hrm.page_2.serial_num   = HRMTX_SERIAL_NUMBER;
    m_ant_hrm.page_3.hw_version   = HRMTX_HW_VERSION;
    m_ant_hrm.page_3.sw_version   = HRMTX_SW_VERSION;
    m_ant_hrm.page_3.model_num    = HRMTX_MODEL_NUMBER;
    
    err_code = ant_hrm_open(&m_ant_hrm);
    APP_ERROR_CHECK(err_code);
    
    err_code = ant_state_indicator_channel_opened();
    APP_ERROR_CHECK(err_code);
/** @snippet [ANT HRM TX Profile Setup] */
}
Example #3
0
File: main.c Project: mcanos/nRF51
/**@brief Function for HRM profile initialization.
 *
 * @details Initializes the HRM profile and open ANT channel.
 */
static void ant_profile_setup(void)
{
/** @snippet [ANT HRM RX Profile Setup] */
    uint32_t err_code;
        
    err_code = ant_hrm_init(&m_ant_hrm, &ant_rx_channel_config, NULL);
    APP_ERROR_CHECK(err_code);

    err_code = ant_hrm_open(&m_ant_hrm);
    APP_ERROR_CHECK(err_code);

    
    // CAD
    err_code = ant_cad_init(&m_ant_cad, &ant_rx_channel_config2);
    APP_ERROR_CHECK(err_code);

    err_code = ant_cad_open(&m_ant_cad);
    APP_ERROR_CHECK(err_code);

/** @snippet [ANT HRM RX Profile Setup] */
}