Functions
Functions
BLE Services » Glucose Service Database (GLS_DB)

## Functions
void | gls_db_init (void)
| Initialize the glucose record database.
bool | gls_db_record_add (gls_rec_t *p_rec)
| Add a record at the end of the database. More...
bool | gls_db_record_delete (uint8_t rec_idx)
| Delete a database entry. More...
uint16_t | gls_db_records_num_get (void)
| Get the number of records in the database. More...
uint16_t | gls_db_filter_records_num_get (gls_racp_filter_t *p_filter)
| Get the number of records satisfying the filtering condition. More...
bool | gls_db_record_get (uint8_t rec_idx, gls_rec_t *p_rec)
| Get a record from the database. More...
void | gls_db_record_clear (void)
| Clear database.

## Detailed Description

## Function Documentation

## ◆ gls_db_filter_records_num_get()

uint16_t gls_db_filter_records_num_get | ( | gls_racp_filter_t * | p_filter | ) |

Get the number of records satisfying the filtering condition.

Returns
  Number of records filtered.

## ◆ gls_db_record_add()

bool gls_db_record_add | ( | gls_rec_t * | p_rec | ) |

Add a record at the end of the database.

This call adds a record as the last record in the database.

Parameters

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

Returns
  If add successfully or not.

## ◆ gls_db_record_delete()

bool gls_db_record_delete | ( | uint8_t | rec_idx | ) |

Delete a database entry.

This call deletes a record from the database.

Parameters

  [in] | rec_idx | Index of record to delete.

Returns
  If delete successfully or not.

## ◆ gls_db_record_get()

bool gls_db_record_get | ( | uint8_t | rec_idx,
|  | gls_rec_t * | p_rec
| ) |  |

Get a record from the database.

This call returns a specified record from the database.

Parameters

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

Returns
  If get successfully or not.

## ◆ gls_db_records_num_get()

uint16_t gls_db_records_num_get | ( | void |  | ) |

Get the number of records in the database.

Returns
  Number of records in the database.