#pragma once

#include "data/config/LegacyConfig.h"

namespace inertia
{

/** StatusConfigVersion */
enum StatusConfigVersion : uint8_t
{
	STATUS_V0 = 0,
	STATUS_V1,
	STATUS_V2,
	STATUS_V3,
	STATUS_V4,
	STATUS_V5,
	STATUS_V6,
	STATUS_V7
};

enum StatusMeasurementID : unsigned
{
	STATUS_ID_BAT_VOLTAGE = 0,
	STATUS_ID_BAT_SOC,
	STATUS_ID_TEMP_INSIDE,
	STATUS_ID_TEMP_AMBIENT,
	STATUS_ID_POWER_INPUT_PRESENT,
	STATUS_ID_POWER_INPUT_VOLTAGE,
	STATUS_ID_POWER_CONSUMPTION,
	STATUS_ID_CHARGE_CURRENT,
	STATUS_ID_LAST,
};

struct INERTIA_API StatusConfig
	: LegacyConfig
{
	bool enableBattery;          // for STATUS_V0, where it will enable bat, temp and extIn
	bool enableTemperature;      // only STATUS_V1
	bool enablePowerInput;       // only STATUS_V1
	bool enablePowerConsumption; // only STATUS_V1

	StatusConfigVersion statusVersion;
	uint8_t samplingChannel;
	uint16_t interval;

	StatusConfig();
	StatusConfig(uint8_t const* in);
	StatusConfig(std::wstring const& argString);

#ifdef WITH_BOOST_PROGRAM_OPTIONS
	static const po::options_description GetOptionDescription();
#endif

	static unsigned GetLength();
	void GetBytes(std::vector<uint8_t>& out) const override;
	ConfigType GetConfigType() const override;
	const std::wstring ToString() const override;
	const std::pair<unsigned, Channel> GetChannel() const;
};

}
