Body Temperature
Sets listener of temperature measurement results
Sets the monitoring of body temperature measurement results to return the corresponding data of body temperature.
_blePlugin.tempChangeEveStm.listen(
(TempChangeBean event) {
setState(() {
/// Do something with new state,for example:
switch (event.type) {
case TempChangeType.continueState:
_enable = event.enable!;
break;
case TempChangeType.measureTemp:
_temp = event.temp!;
break;
case TempChangeType.measureState:
_state = event.state!;
break;
case TempChangeType.continueTemp:
_tempInfo = event.tempInfo;
_tempTimeType = _tempInfo!.tempTimeType!;
_startTime = _tempInfo!.startTime!;
_tempList = _tempInfo!.tempList!;
break;
default:
break;
}
});
});
Callback Description(event):
TempChangeBean:
callback value | callback value type | callback value description |
---|---|---|
type | int | Get the corresponding return value according to type, where type is the value corresponding to TempChangeType |
enable | bool | whether to continue measuring true:enable false:disable |
temp | double | real-time body temperature |
state | bool | temperature measurement status true:measuring false:end of measurement |
tempInfo | TempInfo | Body temperature information |
TempChangeType:
type | value | value description |
---|---|---|
continueState | 1 | Continue to measure body temperature |
measureTemp | 2 | Start measuring the temperature obtained by taking the temperature |
measureState | 3 | measure body temperature |
continueTemp | 4 | The temperature value obtained by continuing to measure the body temperature |
TempInfo
callback value | callback value type | callback value description |
---|---|---|
type | TempTimeType | Body temperature timing measurement status. |
startTime | long | Temperature measurement start time |
tempList | List< Float > | Temperature record sheet |
measureInterval | int | Measurement interval (unit: minute, default 30 minutes) |
TempTimeType:
type | value type | value |
---|---|---|
today | String | "TODAY" |
yesterday | String | "YESTERDAY" |
Start measuring once temperature
Start taking temperature.
When starting a temperature measurement. The query result will be obtained through the tempChangeEveStm monitoring stream, the return type is TempChangeBean, and the real-time body temperature and measurement status are TempChangeBean.temp and TempChangeBean.state,type ismeasureTemp and type is measureState Respectively.
_blePlugin.startMeasureTemp;
Stop measuring once temperature
_blePlugin.stopMeasureTemp;
Enable timing temperature measurement
When the chronograph measurement is turned on, the watch automatically measures the temperature every half an hour.
_blePlugin.enableTimingMeasureTemp;
Disable timing temperature measurement
_blePlugin.disableTimingMeasureTemp;
Gets the timing of temperature measurement status
Get the temperature measurement status. The query result will be obtained through the tempChangeEveStm monitoring stream, the type is measureState, and the measurement state is TempChangeBean.state.
String timingTempState = await _blePlugin.queryTimingMeasureTempState;
Gets the result of timing temperature measurement
The measurement state is obtained through tempChangeEveStm, and the result is stored in TempChangeBean.continueTemp.
_blePlugin.queryTimingMeasureTemp(TempTimeType);