CGM Simulator
0.1.3
A CGM simulator to demonstrate the BLE CGM profile v1.1
|
This file contains the CGM sensor simulator glucose data generation function. More...
#include "cgmsimdata.h"
Macros | |
#define | CGM_SIM_DATA_RECORD_NUMBER 145 |
The number of records in the simulation glucose value array. More... | |
#define | CGM_SIM_DATA_OFFSET 80 |
An offset added to the retrieved glucose value to obtain the abosolute glucose value. In this way, a glucose value of 320 (2 bytes) can be stored with a 1-byte variable as 320-80=240(1 byte). More... | |
Functions | |
void | cgmSimDataReset (void) |
Reset the simulator data return. More... | |
unsigned short | cgmGetNextData (void) |
Retrieve the next glucose simulation data from the data array cgmData. More... | |
Variables | |
static unsigned char | index |
A pointer indicaing next glucose value to return. More... | |
const unsigned char | cgmData [CGM_SIM_DATA_RECORD_NUMBER] |
A constant array loaded with real glucose values from a person, in the unit of mg/dL. Each measurement was taken at 10 mins interval. More... | |
This file contains the CGM sensor simulator glucose data generation function.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define CGM_SIM_DATA_OFFSET 80 |
An offset added to the retrieved glucose value to obtain the abosolute glucose value. In this way, a glucose value of 320 (2 bytes) can be stored with a 1-byte variable as 320-80=240(1 byte).
#define CGM_SIM_DATA_RECORD_NUMBER 145 |
The number of records in the simulation glucose value array.
unsigned short cgmGetNextData | ( | void | ) |
Retrieve the next glucose simulation data from the data array cgmData.
void cgmSimDataReset | ( | void | ) |
Reset the simulator data return.
Basically, it rewinds the index variable back to 0.
const unsigned char cgmData[CGM_SIM_DATA_RECORD_NUMBER] |
A constant array loaded with real glucose values from a person, in the unit of mg/dL. Each measurement was taken at 10 mins interval.
|
static |
A pointer indicaing next glucose value to return.