#include "clightdriversocket.h"

#include <QReadLocker>

CLightDriverSocket::CLightDriverSocket(const QString &name, int32_t id)
    :CLightDriver(name, id)
{
	m_Variants.add_Variant(VAR_Light_ServerIP_ID,
				QObject::trUtf8("ServerIp"),QString("127.0.0.1"),false,
				Variant::TOXML);
	m_Variants.add_Variant(VAR_Light_ServerPort_ID,
				QObject::trUtf8("ServerPort"),int(5555),false,
				Variant::TOXML);

	//QString ip = m_Variants.get_VData(VAR_Light_ServerIP_ID)->toString();
	//int port = m_Variants.get_VData(VAR_Light_ServerPort_ID)->toInt();
}

CLightDriverSocket::~CLightDriverSocket()
{

}

QDomElement CLightDriverSocket::WriteConfig(QDomDocument &doc, QDomElement &root)
{
    QDomElement elem=CDriverCard::WriteConfig(doc,root);

    return elem;
}

int CLightDriverSocket::ReadConfig(QDomElement &root)
{
    int index = CDriverCard::ReadConfig(root);
    return index;
}

int32_t CLightDriverSocket::init_driver()
{
    return 0;
}

int32_t CLightDriverSocket::exit_driver()
{
	//int ret = CLightDriver::exit_driver();
    return 0;
}

void CLightDriverSocket::Serialize(QDataStream& stream,bool bwrite, int iVersion)
{
	CDriverCard::Serialize(stream, bwrite,iVersion);
}
