Please note this project is neither created nor backed by Dexcom, Inc. This software is not intended for use in therapy.
Update node version. Please see wiki page for instructions https://github.com/xdrip-js/xdrip-js/wiki
See Lookout or Logger for two examples of applications built using this library.
cd ~/src
git clone https://github.com/xdrip-js/xdrip-js.git
cd xdrip-js
sudo npm install
npm test
sudo node example <######>
where <######>
is the 6-character serial number of the transmitter.
To see verbose output, use sudo DEBUG=* node example <######>
, or replace the *
with a comma separated list of the modules you would like to debug. E.g. sudo DEBUG=smp,transmitter,bluetooth-manager node example <######>
.
See Node.js EventEmitter docs for more info on the event API.
glucose = {
inSession: <bool>,
glucoseMessage: {
status: <0: "ok" | 0x81: "lowBattery" | 0x83: "bricked">,
sequence: <int>, // increments for each glucose value read
timestamp: <int>, // in seconds since transmitter start
glucoseIsDisplayOnly: <bool>,
glucose: <int>, // in mg/dl
state: <int>, // calibration state
trend: <int>
},
timeMessage: {
status: <0: "ok" | 0x81: "lowBattery" | 0x83: "bricked">,
currentTime: <int>, // in seconds since transmitter start
sessionStartTime: <int> // in seconds since transmitter start
},
status: <0: "ok" | 0x81: "lowBattery" | 0x83: "bricked">,
state: <int>, // calibration state
transmitterStartDate: <int>, // epoch time
sessionStartDate: <int>, // epoch time
readDate: <int>, // epoch time
isDisplayOnly: <bool>,
filtered: <float>, // mg/dl
unfiltered: <float>, // mg/dl
glucose: <int>, // mg/dl
trend: <int>,
canBeCalibrated: <bool>
}
transmitter.on('glucose', callback(glucose));
details = {
time: <int> // epoch time
}
transmitter.on('messageProcessed', callback(details));
calibrationData = {
date: <int>, // epoch time
glucose: <int> //mg/dl
};
transmitter.on('calibrationData', callback(calibrationData));
transmitter.on('disconnect', callback);