健康温度计服务

[English]

健康温度计服务公开与用于医疗保健应用程序的温度计相关的温度和其他数据。

示例

bluetooth/ble_services/ble_hts.

API 参考

Header File

Functions

esp_err_t esp_ble_hts_get_temp_type(uint8_t *temp_type)

Get the current temperature type value of the device.

参数

temp_type[in] The pointer to store the current temperature type value

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong temperature type

esp_err_t esp_ble_hts_set_temp_type(uint8_t temp_type)

Set the current temperature type value of the device.

参数

temp_type[in] The current temperature type value

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong temperature type

esp_err_t esp_ble_hts_get_measurement_temp(esp_ble_hts_temp_t *temp_val)

Get the value of the temperature measurement of the device.

参数

temp_val[in] The pointer to store the value of the temperature measurement

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong temperature measurement

esp_err_t esp_ble_hts_set_measurement_temp(esp_ble_hts_temp_t *temp_val)

Set the value of the temperature measurement of the device.

参数

temp_val[in] The pointer to store the value of the temperature measurement

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong temperature measurement

esp_err_t esp_ble_hts_get_intermediate_temp(esp_ble_hts_temp_t *temp_val)

Get the value of the intermediate temperature of the device.

参数

temp_val[in] The pointer to store the value of the intermediate temperature

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong intermediate temperature

esp_err_t esp_ble_hts_set_intermediate_temp(esp_ble_hts_temp_t *temp_val)

Set the value of the intermediate temperature of the device.

参数

temp_val[in] The pointer to store the value of the intermediate temperature

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong intermediate temperature

esp_err_t esp_ble_hts_get_measurement_interval(uint16_t *interval_val)

Get the measurement interval value of the device.

参数

interval_val[in] The pointer to store the measurement interval value

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong measurement interval

esp_err_t esp_ble_hts_set_measurement_interval(uint16_t interval_val)

Set the measurement interval value of the device.

参数

interval_val[in] The measurement interval value

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong measurement interval

esp_err_t esp_ble_hts_init(void)

Initialization Health Thermometer Service.

返回

  • ESP_OK on successful

  • ESP_ERR_INVALID_ARG on wrong initialization

  • ESP_FAIL on error

Structures

struct esp_ble_hts_temp_t

Temperature Measurement and Intermediate Temperature Characteristic.

Public Members

uint8_t temperature_unit

Temperature units flag

uint8_t time_stamp

Time stamp flag

uint8_t temperature_type

Temperature type flag

uint8_t reserved

Reserved for future use

struct esp_ble_hts_temp_t::[anonymous] flags

Flags of temperature

uint32_t celsius

Celsius unit

uint32_t fahrenheit

Fahrenheit unit

union esp_ble_hts_temp_t::[anonymous] temperature

Temperature value

uint16_t year

Year as defined by the Gregorian calendar, Valid range 1582 to 9999

uint8_t month

Month of the year as defined by the Gregorian calendar, Valid range 1 (January) to 12 (December)

uint8_t day

Day of the month as defined by the Gregorian calendar, Valid range 1 to 31

uint8_t hours

Number of hours past midnight, Valid range 0 to 23

uint8_t minutes

Number of minutes since the start of the hour. Valid range 0 to 59

uint8_t seconds

Number of seconds since the start of the minute. Valid range 0 to 59

struct esp_ble_hts_temp_t::[anonymous] timestamp

The date and time

uint8_t location

The location of a temperature measurement

Macros

BLE_HTS_UUID16
BLE_HTS_CHR_UUID16_TEMPERATURE_MEASUREMENT
BLE_HTS_CHR_UUID16_TEMPERATURE_TYPE
BLE_HTS_CHR_UUID16_INTERMEDIATE_TEMPERATURE
BLE_HTS_CHR_UUID16_MEASUREMENT_INTERVAL
BLE_HTS_CHR_TEMPERATURE_UNITS_CELSIUS
BLE_HTS_CHR_TEMPERATURE_UNITS_FAHRENHEIT
BLE_HTS_CHR_TEMPERATURE_FLAGS_NOT
BLE_HTS_CHR_TEMPERATURE_FLAGS_SET
BLE_HTS_CHR_TEMPERATURE_TYPE_RFU
BLE_HTS_CHR_TEMPERATURE_TYPE_ARMPIT
BLE_HTS_CHR_TEMPERATURE_TYPE_BODY
BLE_HTS_CHR_TEMPERATURE_TYPE_EAR
BLE_HTS_CHR_TEMPERATURE_TYPE_FINGER
BLE_HTS_CHR_TEMPERATURE_TYPE_GAST_TRACT
BLE_HTS_CHR_TEMPERATURE_TYPE_MOUTH
BLE_HTS_CHR_TEMPERATURE_TYPE_RECTUM
BLE_HTS_CHR_TEMPERATURE_TYPE_TOE
BLE_HTS_CHR_TEMPERATURE_TYPE_TYMPANUM
BLE_HTS_CHR_TEMPERATURE_TYPE_MAX