/*
 * KK_HwDevManager.h
 *
 *  Created on: Nov 29, 2018
 *      Author: sds
 */

#ifndef KK_HWDEVMANAGER_H_
#define KK_HWDEVMANAGER_H_

#include <map>
#include <string>
#include <map>
#include <vector>
#include <set>

#include "json/reader.h"
#include "json/writer.h"
#include "json/value.h"
using namespace std;

//#define DEV_CONFIG_FILE 		"/home/hj/hilink/config/hj_hwdev.json"
//#define PROFILE_CONFIG_FILE 	"/home/hj/hilink/config/hj_hwprofile.json"
#define ROOM_ID_FILE 		    "/home/hj/Roma/config/hj_hwroomid.json"
//#define ScenePaneName_FILE 	"/home/hj/hilink/config/hj_hwscenname.json"
#define CONNECT_STATE_FILE 		"/home/hj/Roma/config/hj_hwconnectstate.json"

#if defined(NOT_X86)
	#define LICENSE_PATH             "/etc/dropbear/accessory/hj/hj_license"
	#define CCUID_PATH               "/etc/dropbear/accessory/hj/hj_ccuid"
//	#define PRODUCTID_PATH           "/etc/dropbear/accessory/hj/hj_productid"
//	#define QRTOKEN_PATH             "/etc/dropbear/accessory/hj/hj_qrtoken"
#else
	#define LICENSE_PATH             "/etc/hj_license"
	#define CCUID_PATH               "/etc/hj_ccuid"
//	#define PRODUCTID_PATH           "/etc/hj_productid"
//	#define QRTOKEN_PATH             "/etc/hj_qrtoken"
#endif


class KK_HwDevManager {

public:
//	class KKDevBindHwTriple {
//		public:
//			//hw dev info
//			string prodId;
//			string sn;
//			//kk dev mac
//			string mac;
//			};
	class KKRoomId {
		public:
			string roonid;
			string name;
			};

//	class KKScenePanelName {//情景面板按钮的名称。
//		public:
//			string nodeID;
//			string devsn;
//			string name1;
//			string name2;
//			string name3;
//			string name4;
//		};
//		class KKConnectState {
//			public:
//				string state;
//				string client_id;
//				string device_name;
//				};
public:
	static KK_HwDevManager* GetInstance();

	//int loadAllSubDev(map<string,KKDevBindHwTriple> &subDevs);
	//int saveAllSubDev(map<string,KKDevBindHwTriple> &subDevs);
//	int  getHwProfileConfig(EH::Json::Value& config);
	int loadroomid(map<string,KKRoomId> &roomid);
	int saveroomid(map<string,KKRoomId> &roomid);
	//int loadScenePanelName(map<string,KKScenePanelName> &subDevs);
	//int saveScenePanelName(map<string,KKScenePanelName> &subDevs);
	string GetRoomId();

	EH::Json::Value loadConnectState();
	int saveConnectState(EH::Json::Value ConnectState);
	string GetConnectState();
	string getCcuId();
	string getCcuKey();

private:
	KK_HwDevManager();

private:
	static KK_HwDevManager* ms_pInstance;

};


#endif /* KK_HWDEVMANAGER_H_ */
