V3 Menstrual Historical Data Delivery
Function: setHistoryMenstrual 【supportSetHistoricalMenstruationUseVersion2】
Flutter Example:
/// Menstrual historical data delivery event number
getHistoricalMenstruation(
evtBase: _VBusEvtBase.base_app_set,
evtType: _VBusEvtType.func_v3_get_historical_menstruation
);
/// Menstrual historical data delivery
libManager.send(
evt: CmdEvtType.getHistoricalMenstruation,
json: jsonEncode(json)
);
JSON Fields Sent by the App:
Field Name | Field Type | Field Description |
---|---|---|
version | int | Protocol library version number |
avg_menstrual_day | int | Average length of menstrual cycle Uint:day |
avg_cycle_day | int | Average length of menstrual cycle Uint:day |
items_len | int | Number of menstrual history details items,max len value 5 |
items | list | Details of menstrual historical data Collection of year , month , day , menstrual_day , cycle_day ovulation_interval_day , ovulation_before_day , and ovulation_after_day are effective when the Function supportSetHistoricalMenstruationUseVersion2 is enabled. |
Field Name | Field Type | Field Description |
---|---|---|
year | int | Year when menstruation starts |
mon | int | Month when menstruation starts |
day | int | Day when menstruation starts |
menstrual_day | int | Length of menstrual cycle (days) |
cycle_day | int | Length of cycle (days) |
ovulation_interval_day | int | The interval from the start of the next menstrual period to the ovulation day is usually 14 days when the Function supportSetHistoricalMenstruationUseVersion2 is enabled. |
ovulation_before_day | int | The number of days of fertility before the ovulation day is usually 5 when the Function supportSetHistoricalMenstruationUseVersion2 is enabled. |
ovulation_after_day | int | The number of days of fertility after the ovulation day is usually 5 when the Function supportSetHistoricalMenstruationUseVersion2 is enabled. |
Example:
{
"version": 2,
"avg_menstrual_day": 7,
"avg_cycle_day": 29,
"items_len": 1,
"items": [
{
"year": 2023,
"mon": 8,
"day": 1,
"menstrual_day": 7,
"cycle_day":30,
"ovulation_interval_day":14,
"ovulation_before_day":5,
"ovulation_after_day":5,
},
{
"year": 2023,
"mon": 8,
"day": 31,
"menstrual_day": 7,
"cycle_day":28,
"ovulation_interval_day":14,
"ovulation_before_day":5,
"ovulation_after_day":5,
}
]
}
JSON Fields Received by the App:
Field Name | Field Type | Field Description |
---|---|---|
err_code | int | Error code: 0 for success, non-zero for failure |
Example:
{
"err_code": 0
}