#ifndef CLIGHTDRIVER_OPT_H
#define CLIGHTDRIVER_OPT_H

#include "clightdriver.h"

#include "OPTController.h"
class CMSerialPort;
class CLightDriver_OPT : public CLightDriver
{
public:
    enum msg_id
    {
        LIGHTDRIVER_OPT_MSG_ID=MAX_LIGHTDRIVER_MSG_ID,
        MAX_LIGHTDRIVER_OPT_MSG_ID,
    };
    CLightDriver_OPT(const QString& name,int32_t id);
    ~CLightDriver_OPT();

    int32_t setlight(int32_t iChid, int32_t ibright);
    int32_t freshlight(int32_t iChid);
    int32_t setmultiplier(int32_t iChid, int32_t imultiplier);
    int32_t init_driver();
    int32_t exit_driver();
    const char *getErrorString(int iErrID);

	bool openAllChannel(bool bOpen);
	bool setTriggerLevel(unsigned char val);
	bool setLight(unsigned char channelNum, unsigned short val);
	bool getLight(unsigned char channelNum, unsigned short& val);
	bool reset();
	bool checkResponse(unsigned char *pRecvBuf, unsigned char *pResponse, int nLen);
	void checkoutSum(unsigned char* pBuf, int nLen, unsigned char& cValue);
private:
    OPTController_Handle controllerHandle;

};

#endif // CLIGHTDRIVER_OPT_H
