56 #include "ble_srv_common.h"
57 #include "app_util_platform.h"
61 #define BLE_UUID_TES_SERVICE 0x0200
62 #define BLE_TES_MAX_DATA_LEN (GATT_MTU_SIZE_DEFAULT - 3)
69 #define PACKED(TYPE) TYPE __attribute__ ((packed))
72 typedef PACKED(
struct
76 }) ble_tes_temperature_t;
78 typedef PACKED(
struct
82 }) ble_tes_pressure_t;
84 typedef uint8_t ble_tes_humidity_t;
86 typedef PACKED(
struct
92 typedef PACKED(
struct
106 } ble_tes_gas_mode_t;
108 typedef PACKED(
struct
113 }) ble_tes_color_config_t;
115 typedef PACKED(
struct
117 uint16_t temperature_interval_ms;
118 uint16_t pressure_interval_ms;
119 uint16_t humidity_interval_ms;
120 uint16_t color_interval_ms;
121 uint8_t gas_interval_mode;
122 ble_tes_color_config_t color_config;
125 #define BLE_TES_CONFIG_TEMPERATURE_INT_MIN 100
126 #define BLE_TES_CONFIG_TEMPERATURE_INT_MAX 5000
127 #define BLE_TES_CONFIG_PRESSURE_INT_MIN 50
128 #define BLE_TES_CONFIG_PRESSURE_INT_MAX 5000
129 #define BLE_TES_CONFIG_HUMIDITY_INT_MIN 100
130 #define BLE_TES_CONFIG_HUMIDITY_INT_MAX 5000
131 #define BLE_TES_CONFIG_COLOR_INT_MIN 200
132 #define BLE_TES_CONFIG_COLOR_INT_MAX 5000
133 #define BLE_TES_CONFIG_GAS_MODE_MIN 1
134 #define BLE_TES_CONFIG_GAS_MODE_MAX 3
138 BLE_TES_EVT_NOTIF_TEMPERATURE,
139 BLE_TES_EVT_NOTIF_PRESSURE,
140 BLE_TES_EVT_NOTIF_HUMIDITY,
141 BLE_TES_EVT_NOTIF_GAS,
142 BLE_TES_EVT_NOTIF_COLOR,
143 BLE_TES_EVT_CONFIG_RECEIVED
151 ble_tes_evt_type_t evt_type,
162 ble_tes_temperature_t * p_init_temperature;
163 ble_tes_pressure_t * p_init_pressure;
164 ble_tes_humidity_t * p_init_humidity;
165 ble_tes_gas_t * p_init_gas;
166 ble_tes_color_t * p_init_color;
167 ble_tes_config_t * p_init_config;
274 #endif // BLE_TES_H__