Skip to content

Commit

Permalink
Fixed bug in Heart rate and Health thermometer
Browse files Browse the repository at this point in the history
Removed is_freshest_sample
  • Loading branch information
Skjerve committed May 15, 2014
1 parent 5e5a608 commit f1cf270
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
12 changes: 6 additions & 6 deletions libraries/BLE/examples/ble_heart_rate_template/heart_rate.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,30 +111,30 @@ bool heart_rate_send_hr_16bits(uint16_t meas_hr);
* @param expended_energy Measured expended energy.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_expended_energy(uint8_t meas_hr, uint16_t expended_energy, bool is_freshest_sample);
bool heart_rate_send_hr_expended_energy(uint8_t meas_hr, uint16_t expended_energy);

/** @brief Function to send a heart rate measurement (16 bits) with expended energy.
* @param meas_hr Measured heart_rate to send.
* @param expended_energy Measured expended energy.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_expended_energy(uint16_t meas_hr, uint16_t expended_energy, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_expended_energy(uint16_t meas_hr, uint16_t expended_energy);

/** @brief Function to send a heart rate measurement (8 bits) with rr_intervals
* @param meas_hr Measured heart_rate to send.
* @param p_rr_intervals Pointer to rr_intervals values.
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_rr_interval(uint8_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_rr_interval(uint8_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (16 bits) with rr_intervals
* @param meas_hr Measured heart_rate to send.
* @param p_rr_intervals Pointer to rr_intervals values.
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (8 bits) with expended energy with rr_intervals
* @param meas_hr Measured heart_rate to send.
Expand All @@ -143,7 +143,7 @@ bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_inte
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (16 bits) with expended energy with rr_intervals
* @param meas_hr measured heart_rate to send.
Expand All @@ -152,7 +152,7 @@ bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t ex
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_expended_energy_rr_interval(uint16_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_expended_energy_rr_interval(uint16_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to check received data
* @details Call this function each time data is received (on @c ACI_EVT_DATA_RECEIVED on the control point pipe ).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,30 +137,30 @@ bool heart_rate_send_hr_16bits(uint16_t meas_hr);
* @param expended_energy Measured expended energy.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_expended_energy(uint8_t meas_hr, uint16_t expended_energy, bool is_freshest_sample);
bool heart_rate_send_hr_expended_energy(uint8_t meas_hr, uint16_t expended_energy);

/** @brief Function to send a heart rate measurement (16 bits) with expended energy.
* @param meas_hr Measured heart_rate to send.
* @param expended_energy Measured expended energy.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_expended_energy(uint16_t meas_hr, uint16_t expended_energy, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_expended_energy(uint16_t meas_hr, uint16_t expended_energy);

/** @brief Function to send a heart rate measurement (8 bits) with rr_intervals
* @param meas_hr Measured heart_rate to send.
* @param p_rr_intervals Pointer to rr_intervals values.
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_rr_interval(uint8_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_rr_interval(uint8_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (16 bits) with rr_intervals
* @param meas_hr Measured heart_rate to send.
* @param p_rr_intervals Pointer to rr_intervals values.
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (8 bits) with expended energy with rr_intervals
* @param meas_hr Measured heart_rate to send.
Expand All @@ -169,7 +169,7 @@ bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_inte
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (16 bits) with expended energy with rr_intervals
* @param meas_hr measured heart_rate to send.
Expand All @@ -178,7 +178,7 @@ bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t ex
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_expended_energy_rr_interval(uint16_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_expended_energy_rr_interval(uint16_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to check received data
* @details Call this function each time data is received (on @c ACI_EVT_DATA_RECEIVED on the control point pipe ).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,30 +111,30 @@ bool heart_rate_send_hr_16bits(uint16_t meas_hr);
* @param expended_energy Measured expended energy.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_expended_energy(uint8_t meas_hr, uint16_t expended_energy, bool is_freshest_sample);
bool heart_rate_send_hr_expended_energy(uint8_t meas_hr, uint16_t expended_energy);

/** @brief Function to send a heart rate measurement (16 bits) with expended energy.
* @param meas_hr Measured heart_rate to send.
* @param expended_energy Measured expended energy.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_expended_energy(uint16_t meas_hr, uint16_t expended_energy, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_expended_energy(uint16_t meas_hr, uint16_t expended_energy);

/** @brief Function to send a heart rate measurement (8 bits) with rr_intervals
* @param meas_hr Measured heart_rate to send.
* @param p_rr_intervals Pointer to rr_intervals values.
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_rr_interval(uint8_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_rr_interval(uint8_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (16 bits) with rr_intervals
* @param meas_hr Measured heart_rate to send.
* @param p_rr_intervals Pointer to rr_intervals values.
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (8 bits) with expended energy with rr_intervals
* @param meas_hr Measured heart_rate to send.
Expand All @@ -143,7 +143,7 @@ bool heart_rate_send_hr_16bits_rr_interval(uint16_t meas_hr, uint16_t *p_rr_inte
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to send a heart rate measurement (16 bits) with expended energy with rr_intervals
* @param meas_hr measured heart_rate to send.
Expand All @@ -152,7 +152,7 @@ bool heart_rate_send_hr_expended_energy_rr_interval(uint8_t meas_hr, uint16_t ex
* @param nb_intervals Number of rr_intervals.
* @return : True when the ACI command is successfully placed in the ACI command queue
*/
bool heart_rate_send_hr_16bits_expended_energy_rr_interval(uint16_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals, bool is_freshest_sample);
bool heart_rate_send_hr_16bits_expended_energy_rr_interval(uint16_t meas_hr, uint16_t expended_energy, uint16_t *p_rr_intervals, uint8_t nb_intervals);

/** @brief Function to check received data
* @details Call this function each time data is received (on @c ACI_EVT_DATA_RECEIVED on the control point pipe ).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool health_thermometer_send_measure(uint32_t meas_temp)
return lib_aci_send_data(PIPE_HEALTH_THERMOMETER_TEMPERATURE_MEASUREMENT_TX_ACK, (uint8_t *)&h_temperature, measurement_size);
}

bool health_thermometer_send_measure_with_t_stamp(uint32_t meas_temp, time_stamp_t *t_stamp, bool is_freshest_sample)
bool health_thermometer_send_measure_with_t_stamp(uint32_t meas_temp, time_stamp_t *t_stamp)
{
uint8_t measurement_size = 12;
uint8_t *p_in_val = (uint8_t *)&meas_temp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,13 @@ void health_thermometer_set_unit_f();
/** @brief Function to send a temperature measurement without time_stamp.
* @details Call this function to send (indicate) a new temperature measurement.
* @param meas_temp Measured temperature to send.
* @param is_freshest_sample Set it to true if you want to overwrite an eventual pending transaction on this pipe.
* @return : True if is_freshest_sample true. Otherwise return false if a transaction on this pipe is already pending, true otherwise.
*/
bool health_thermometer_send_measure(uint32_t meas_temp);

/** @brief Function to send a temperature measurement with time_stamp.
* @details Call this function to send (indicate) a new temperature measurement with a time_stamp.
* @param meas_temp Measured temperature to send.
* @param t_stamp Time stamp.
* @param is_freshest_sample Set it to true if you want to overwrite an eventual pending transaction on this pipe.
* @return : True if is_freshest_sample true. Otherwise return false if a transaction on this pipe is already pending, true otherwise.
*/
bool health_thermometer_send_measure_with_t_stamp(uint32_t meas_temp, time_stamp_t *t_stamp);

Expand Down

0 comments on commit f1cf270

Please sign in to comment.