| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Macros | Functions
Continuous Glucose Monitoring Service database
Continuous Glucose Monitoring Service

Continuous Glucose Monitoring Service database module. More...

## Macros
#define | CGMS_DB_MAX_RECORDS 100

## Functions
ret_code_t | cgms_db_init (void)
| Function for initializing the glucose record database. More...
uint16_t | cgms_db_num_records_get (void)
| Function for getting the number of records in the database. More...
ret_code_t | cgms_db_record_get (uint8_t record_num, ble_cgms_rec_t *p_rec)
| Function for getting a specific record from the database. More...
ret_code_t | cgms_db_record_add (ble_cgms_rec_t *p_rec)
| Function for adding a record at the end of the database. More...
ret_code_t | cgms_db_record_delete (uint8_t record_num)
| Function for deleting a database entry. More...

## Detailed Description

Continuous Glucose Monitoring Service database module.

This module implements a database of stored glucose measurement values. This database is meant as an example of a database that the Continuous Glucose Monitoring Service can use. Replace this module if this implementation does not suit your application. Any replacement implementation should follow the API below to ensure that the qualification of the Continuous Glucose Monitoring Service is not compromised.

## Function Documentation

ret_code_t cgms_db_init | ( | void |  | ) |

Function for initializing the glucose record database.

Return values

  NRF_SUCCESS | If the database was successfully initialized.

uint16_t cgms_db_num_records_get | ( | void |  | ) |

Function for getting the number of records in the database.

Returns
  The number of records in the database.

ret_code_t cgms_db_record_add | ( | ble_cgms_rec_t * | p_rec | ) |

Function for adding a record at the end of the database.

Parameters

  [in] | p_rec | Pointer to the record to add to the database.

Return values

  NRF_SUCCESS | If the record was successfully added to the database.

ret_code_t cgms_db_record_delete | ( | uint8_t | record_num | ) |

Function for deleting a database entry.

This call deletes an record from the database.

Parameters

  [in] | record_num | Index of the record to delete.

Return values

  NRF_SUCCESS | If the record was successfully deleted from the database.

ret_code_t cgms_db_record_get | ( | uint8_t | record_num,
|  | ble_cgms_rec_t * | p_rec
| ) |  |

Function for getting a specific record from the database.

Parameters

  [in] | record_num | Index of the record to retrieve.
  [out] | p_rec | Pointer to the record structure to which the retrieved record is copied.

Return values

  NRF_SUCCESS | If the record was successfully retrieved.