Big Data
Service: de5bf728-d711-4e47-af26-65e3012a5dc7
Write Characteristic (Requests): de5bf72a-d711-4e47-af26-65e3012a5dc7
Notify Characteristic (Responses): de5bf729-d711-4e47-af26-65e3012a5dc7
This is a newer protocol compared to Commands.
These will contain the following structure:
struct BigDataResponse {
uint8_t bigDataMagic = 188;
uint8_t dataId;
uint16_t dataLen;
uint16_t crc16;
// Variable data length
}
For requests, the variable data will be empty, so set dataLen
to 0 and crc16
to UINT16_MAX.
struct BigDataRequest {
uint8_t bigDataMagic = 188;
uint8_t dataId;
uint16_t dataLen = 0;
uint16_t crc16 = 0xFFFF;
}
TODO: There's more Big Data types
Sleep
ID: 39
struct SleepData {
uint8_t bigDataMagic = 188;
uint8_t sleepId = 39;
uint16_t dataLen;
uint16_t crc16;
uint8_t sleepDays;
SleepDay days[];
}
struct SleepDay {
uint8_t daysAgo;
uint8_t curDayBytes;
int16_t sleepStart; // Minutes after midnight
int16_t sleepEnd; // Minutes after midnight
SleepPeriod sleepPeriods[];
}
struct SleepPeriod {
SleepType type;
uint8_t minutes;
}
enum SleepType : uint8_t {
NODATA = 0,
ERROR = 1,
LIGHT = 2,
DEEP = 3,
AWAKE = 5,
}
Blood Oxygen
ID: 42
struct BloodOxygenData {
uint8_t bigDataMagic = 188;
uint8_t sleepId = 42;
uint16_t dataLen;
uint16_t crc16;
uint8_t unk;
uint8_t daysAgo;
BloodOxygenSample samples[];
}
struct BloodOxygenSample {
uint8_t min;
uint8_t max;
}