42 #ifndef BATTERY_SOC_SENSOR_HPP 43 #define BATTERY_SOC_SENSOR_HPP 51 #include "../sensor_impl.hpp" 59 static const std::vector<unsigned char> IDENTIFIERS;
61 static const std::vector<std::string> SERVICE_UUIDS;
63 static const std::vector<std::string> DATA_CHAR_UUIDS;
65 static const unsigned char MANUFACTURER_DATA_TYPE;
69 static const std::string NAME;
71 static const std::string VENDOR;
73 static const std::string STRING_TYPE;
75 static const float MAX_RANGE;
77 static const float RESOLUTION;
79 static const float POWER;
81 static const std::chrono::microseconds MIN_DELAY;
83 static const std::chrono::microseconds MAX_DELAY;
93 BatterySocSensor(std::string name, std::string address, std::string vendor,
unsigned int version,
SensorType type, std::string string_type,
94 ReportingMode reporting_mode,
unsigned int identifier,
float max_range,
float resolution,
float power, std::chrono::microseconds min_delay,
140 void onNotification(std::string address, std::string service_uuid, std::string characteristic_uuid,
const std::vector<unsigned char>& values);
164 static bool isAvailable(
unsigned int identifier,
const std::map<uint16_t, std::vector<uint8_t> >& manufacturer_data);
184 static std::vector<std::unique_ptr<SensorImpl> >
build(std::string address,
util::Executor& event_dispatcher,
186 const std::map<uint16_t, std::vector<uint8_t> >& manufacturer_data);
192 #endif // BATTERY_SOC_HPP
void onNotification(std::string address, std::string service_uuid, std::string characteristic_uuid, const std::vector< unsigned char > &values)
Definition: bluetooth_adapter.hpp:52
Class that encapsulates a result.
Definition: kallisto_error.hpp:81
static bool isAvailable(unsigned int identifier, const std::map< uint16_t, std::vector< uint8_t > > &manufacturer_data)
SensorType
Definition: sensor.hpp:60
Definition: bluetooth_dispatcher.hpp:57
Definition: bluetooth_dispatcher.hpp:81
error::KallistoDetailedResult update(std::map< std::string, const void *> parameters)
Definition: battery_soc_sensor.hpp:55
void operator=(BatterySocSensor const &)=delete
Definition: executor.hpp:71
BatterySocSensor(std::string name, std::string address, std::string vendor, unsigned int version, SensorType type, std::string string_type, ReportingMode reporting_mode, unsigned int identifier, float max_range, float resolution, float power, std::chrono::microseconds min_delay, std::chrono::microseconds max_delay, util::Executor &event_dispatcher, bluetooth::BluetoothDispatcher &bluetooth_dispatcher)
static std::vector< std::unique_ptr< SensorImpl > > build(std::string address, util::Executor &event_dispatcher, bluetooth::BluetoothDispatcher &bluetooth_dispatcher, const std::map< uint16_t, std::vector< uint8_t > > &manufacturer_data)
error::KallistoDetailedResult stop(bool link_loss)
error::KallistoDetailedResult start(std::map< std::string, const void *> parameters, InternalSensorEventListener internal_listener)
std::map< std::string, const void * > getParameters()
std::function< void(SensorEvent &event)> InternalSensorEventListener
Definition: sensor_impl.hpp:65
Definition: sensor_impl.hpp:70
ReportingMode
Definition: sensor.hpp:126