This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do i modify the ble_app_cgms_pca10040 example to send data faster than once a minute

Hi 

We are evaluating the nRF52832 for use in a medical application, I have modified the example ble_app_cgms_pca10040 to drive our evaluation hw. We are using the Nordic Toolbox Android app CGMS to receive data. 

For evaluation purposes we want to change the frequency the data is sent from 1 minute to 10 or 20 seconds. 

I am using SDK - nRF5_SDK_15.2.0_9412b96

Can you help please 

RObin

Parents
  • Hi Robin

    You will have to change the comm_interval in the cgms_evt_handler to the value you want.

    case NRF_BLE_CGMS_EVT_START_SESSION:
                NRF_LOG_INFO("CGM Start Session");
                err_code = app_timer_start(m_glucose_meas_timer_id,
                                           APP_TIMER_TICKS(p_cgms->comm_interval * 60000),
                                           NULL);
                APP_ERROR_CHECK(err_code);
                break;
    
      if (p_cgms->comm_interval != 0)
                {
                    err_code = app_timer_start(m_glucose_meas_timer_id,
                                               APP_TIMER_TICKS(p_cgms->comm_interval * 60000),
                                               NULL);
                    APP_ERROR_CHECK(err_code);
                }
                break;

    Both values of 60000 are stated in ms, so for 10 second updates change them both to 10000, and for 20 second updates to 20000.

    Best regards,

    Simon

Reply
  • Hi Robin

    You will have to change the comm_interval in the cgms_evt_handler to the value you want.

    case NRF_BLE_CGMS_EVT_START_SESSION:
                NRF_LOG_INFO("CGM Start Session");
                err_code = app_timer_start(m_glucose_meas_timer_id,
                                           APP_TIMER_TICKS(p_cgms->comm_interval * 60000),
                                           NULL);
                APP_ERROR_CHECK(err_code);
                break;
    
      if (p_cgms->comm_interval != 0)
                {
                    err_code = app_timer_start(m_glucose_meas_timer_id,
                                               APP_TIMER_TICKS(p_cgms->comm_interval * 60000),
                                               NULL);
                    APP_ERROR_CHECK(err_code);
                }
                break;

    Both values of 60000 are stated in ms, so for 10 second updates change them both to 10000, and for 20 second updates to 20000.

    Best regards,

    Simon

Children
Related