//-----------------------------------------------------------------------------
#ifndef DeviceHandlerBlueDeviceH
#define DeviceHandlerBlueDeviceH DeviceHandlerBlueDeviceH
//-----------------------------------------------------------------------------
#include "DeviceHandler.h"
#include "PackageDescriptionParser.h"

//-----------------------------------------------------------------------------
class DeviceHandlerBlueDevice : public DeviceHandler
//-----------------------------------------------------------------------------
{
	enum TProductGroup
	{
		pgUnknown,
		pgBlueCOUGAR_P,
		pgBlueCOUGAR_S,
		pgBlueCOUGAR_X,
		pgBlueLYNX_M7,
	};
	TProductGroup product_;
	wxString productStringForFirmwareUpdateCheck_;
	wxString firmwareUpdateFileName_;
	wxString firmwareUpdateFolder_;
	bool ExtractFileVersion( const wxString& fileName, Version& fileVersion ) const;
	bool GetFileFromArchive( const wxString& firmwareFileAndPath, const char* pArchive, size_t archiveSize, const wxString& filename, auto_array_ptr<char>& data );
	bool IsBlueCOUGAR_X( mvIMPACT::acquire::Device* pDev );
	int UpdateCOUGAR_SDevice( bool boSilentMode );
	int UpdateCOUGAR_XDevice( bool boSilentMode );
	int UpdateLYNXAndCOUGAR_PDevice( const wxString& updateFileName, const wxString& fileExtension, bool boSilentMode );
	int UploadFile( const wxString& fullPath, const wxString& descriptionFile );
public:
	DeviceHandlerBlueDevice( mvIMPACT::acquire::Device* pDev );
	static DeviceHandler* Create( mvIMPACT::acquire::Device* pDev ) { return new DeviceHandlerBlueDevice(pDev); }
	virtual bool GetIDFromUser( long& newID, const long minValue, const long maxValue );
	virtual bool SupportsFirmwareUpdate( void ) const;
	virtual int UpdateFirmware( bool boSilentMode );
};

#endif // DeviceHandlerBlueDeviceH
