8#include <esp_gattc_api.h>
18namespace airthings_wave_base {
22static const uint8_t ACCESS_CONTROL_POINT_COMMAND = 0x6d;
23static const auto CLIENT_CHARACTERISTIC_CONFIGURATION_DESCRIPTOR_UUID = espbt::ESPBTUUID::from_uint16(0x2902);
32 esp_ble_gattc_cb_param_t *param)
override;
48 virtual void read_sensors(uint8_t *raw_value, uint16_t value_len) = 0;
This class simplifies creating components that periodically check a state.
void set_pressure(sensor::Sensor *pressure)
espbt::ESPBTUUID service_uuid_
void set_tvoc(sensor::Sensor *tvoc)
void read_battery_(uint8_t *raw_value, uint16_t value_len)
void response_received_()
uint8_t responses_pending_
void set_battery_update_interval(uint32_t interval)
bool is_valid_voc_value_(uint16_t voc)
void set_humidity(sensor::Sensor *humidity)
bool request_read_values_()
void set_battery_voltage(sensor::Sensor *voltage)
void set_temperature(sensor::Sensor *temperature)
sensor::Sensor * pressure_sensor_
espbt::ESPBTUUID sensors_data_characteristic_uuid_
AirthingsWaveBase()=default
void set_response_timeout_()
uint32_t battery_update_interval_
sensor::Sensor * temperature_sensor_
espbt::ESPBTUUID access_control_point_characteristic_uuid_
virtual void read_sensors(uint8_t *raw_value, uint16_t value_len)=0
bool read_battery_next_update_
sensor::Sensor * tvoc_sensor_
sensor::Sensor * humidity_sensor_
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
sensor::Sensor * battery_voltage_
Base-class for all sensors.
Providing packet encoding functions for exchanging data with a remote host.