hts.h File Reference

Health Thermometer Service API. More...

#include "gr_includes.h"
#include "custom_config.h"
#include "ble_prf_utils.h"
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Classes

struct  hts_evt_t
 Health Thermometer Service event. More...
 
struct  ieee_float32_t
 SFLOAT format (IEEE-11073 32-bit FLOAT, defined as a 32-bit vlue with 24-bit mantissa and 8-bit exponent. More...
 
struct  hts_meas_val_t
 Health Theromometer Measurement Character value structure. More...
 
struct  hts_init_t
 Health Thermometer Service init stucture. This contains all option and data needed for initialization of the service. More...
 

Macros

#define HTS_CONNECTION_MAX   10
 
#define HTS_TEM_MEAS_MAX_LEN   20
 
#define HTS_TEM_TYPE_MAX_LEN   1
 
#define HTS_INTM_TEM_MAX_LEN   20
 
#define HTS_MEAS_INTERVAL_MAX_LEN   2
 
#define HTS_MEAS_INTV_DFLT_MIN   2
 
#define HTS_MEAS_INTV_DFLT_MAX   10
 
#define HTS_CHAR_MANDATORY   0x000f
 
#define HTS_CHAR_TEM_TYPE_SUP   0x003f
 
#define HTS_CHAR_INTM_TEM_SUP   0x01c0
 
#define HTS_CHAR_MEAS_INTERVAL_SUP   0x1e00
 
#define HTS_CHAR_FULL   0x1fff
 

Typedefs

typedef void(* hts_evt_handler_t) (hts_evt_t *p_evt)
 Health Thermometer Service event handler type. More...
 
typedef prf_date_time_t hts_date_time_t
 Health Thermometer Service date time type. More...
 

Enumerations

enum  hts_evt_type_t {
  HTS_EVT_INVALID,
  HTS_EVT_TEM_MEAS_INDICATION_ENABLE,
  HTS_EVT_TEM_MEAS_INDICATION_DISABLE,
  HTS_EVT_INTM_TEM_NOTIFICATION_ENABLE,
  HTS_EVT_INTM_TEM_NOTIFICATION_DISABLE,
  HTS_EVT_MEAS_INTREVAL_INDICATION_ENABLE,
  HTS_EVT_MEAS_INTERVAL_INDICATION_DISABLE,
  HTS_EVT_MEAS_INTERVAL_UPDATE,
  HTS_EVT_READ_CHARACTERISTIC
}
 Health Thermometer Service event type. More...
 
enum  hts_temp_unit_t {
  HTS_TEMPERATURE_CELCIUS,
  HTS_TEMPERATURE_FAHRENHEIT
}
 Health Thermometer temperature unit,. More...
 
enum  hts_temp_meas_type_t {
  HTS_TEMPERATURE_STABLE,
  HTS_TEMPERATURE_INTERMEDIATE
}
 Health Thermometer temperature measurement type. More...
 
enum  hts_flag_bit_t {
  HTS_MEAS_FLAG_TEM_UINTS_BIT = (0x01<<0),
  HTS_MEAS_FLAG_TIME_STAMP_BIT = (0x01<<1),
  HTS_MEAS_FLAG_TEM_TYPE_BIT = (0x01<<2)
}
 Health Thermometer Measurement flag bits. More...
 
enum  hts_temp_meas_loc_t {
  HTS_TEMP_TYPE_ARMPIT = 0x01,
  HTS_TEMP_TYPE_BODY,
  HTS_TEMP_TYPE_EAR,
  HTS_TEMP_TYPE_FINGER,
  HTS_TEMP_TYPE_GI_TRACT,
  HTS_TEMP_TYPE_MOUTH,
  HTS_TEMP_TYPE_RECTUM,
  HTS_TEMP_TYPE_TOE,
  HTS_TEMP_TYPE_EAR_DRUM
}
 Temperature Type measurement locations. More...
 
enum  hts_read_characteristic_t {
  HTS_READ_CHAR_TEMP_TYPE,
  HTS_READ_CHAR_MEAS_INTL
}
 The parameters for HTS_EVT_READ_CHARACTERISTIC. More...
 

Functions

sdk_err_t hts_service_init (hts_init_t *p_hts_init)
 Initialize a Health Thermometer Service instance and add in the DB. More...
 
sdk_err_t hts_measurement_send (uint8_t conn_idx, hts_meas_val_t *p_meas)
 Send temperature measurement if indication or notification has been enabled. More...
 
sdk_err_t hts_measurement_interval_send (uint8_t conn_idx)
 Send temperature measurement interval if indication has been enabled. More...
 

Detailed Description

Health Thermometer Service API.

Attention
#####Copyright (c) 2019 GOODIX All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hts.h.