#pragma once

#include "data/InertiaService.h"

namespace inertia
{

/** @brief Device Connection
 *
 *  The type of connection used by the device.
 */
enum class DeviceConnection
{
	UNKNOWN,
	USB,
	RADIO,
	BLUETOOTH,
	BLUETOOTH_LE,
	EHTERNET,
	REPLAY,
	EXTERNAL
};


/** @brief Device Info
 *
 *  Class containing device information.
 */
struct INERTIA_API DeviceInfo
	: ServiceResponseGetVersion
	, ServiceResponseGetSerialNr
{
private:
	unsigned addressingID;
	DeviceConnection deviceConnection;

public:
	DeviceInfo(uint64_t const& serialNumber = 0);
	DeviceInfo(unsigned const addrID, DeviceConnection const connType, ServiceResponseGetVersion const& devInfo, ServiceResponseGetSerialNr const& serialInfo);

	unsigned GetAddressingID() const;
	DeviceConnection GetConnectionType() const;

	bool IsGateway(bool includeGwFw = true) const;
	unsigned GetNodeID() const;

	bool IsProMoveMini() const;
	bool IsProMoveV() const;
	bool IsBluetooth() const;

	static ServiceHardwareTypeID ToHardwareID(uint64_t const& serialNr);
	static uint64_t ToSerialNr(ServiceHardwareTypeID const& hardwareType, unsigned const& nodeID);
};

}
