Exemplo n.º 1
0
LeweiTcpClient::LeweiTcpClient(const char *userKey,const char *gatewayNo):
	server(EthernetServer(80)),
	tcpServer("tcp.lewei50.com")
{
	_userKey = (char*)malloc( strlen(userKey)+1 );
	strcpy( _userKey,userKey );
	
	_gatewayNo = (char*)malloc( strlen(gatewayNo)+1 );
	strcpy( _gatewayNo,gatewayNo );
	
	setupDefaultValue();
	
	//Ethernet.begin(_mac);
	byte _mac[] = {0x74, 0x69, 0x69, 0x2D, 0x30, 0x31};
	if (Ethernet.begin(_mac) == 0) {
    Serial.println("fail");
    // no point in carrying on, so do nothing forevermore:
    for (;;)
      ;
  }
	Serial.println(Ethernet.localIP());
	//Ethernet.begin(mac, ip);
	delay(1000);
	String clientStr="";
	keepOnline();
}
Exemplo n.º 2
0
LeweiTcpClient::LeweiTcpClient(const char *userKey,const char *gatewayNo)
{
	_userKey = userKey;
	_gatewayNo = gatewayNo;
	setupDefaultValue();
	
	keepOnline();
}
Exemplo n.º 3
0
LeweiTcpClient::LeweiTcpClient( const char *userKey,const char *gatewayNo,byte mac[],IPAddress ip,IPAddress dns,IPAddress gw,IPAddress subnet)
{
	_userKey = userKey;
	_gatewayNo = gatewayNo;
	setupDefaultValue();
	Ethernet.begin(mac,ip,dns,gw,subnet);
	Serial.println(Ethernet.localIP());
	delay(1000);
	String clientStr="";
	keepOnline();
}
Exemplo n.º 4
0
LeweiTcpClient::LeweiTcpClient(const char *userKey,const char *gatewayNo,byte mac[])
{
	_userKey = userKey;
	_gatewayNo = gatewayNo;
	setupDefaultValue();
	
	Ethernet.begin(mac);
	Serial.println(Ethernet.localIP());
	delay(1000);
	
	String clientStr="";
	keepOnline();
}
Exemplo n.º 5
0
VSCCameraAdd::VSCCameraAdd(DeviceParam &Param, QWidget *parent)
    : QWidget(parent)
{
	ui.setupUi(this);
	m_Param = Param;

	BOOL bHWAccel;
	BOOL bMining;

	m_nId = m_Param.m_Conf.data.conf.nId;
	if (m_nId == 0)
	{
		gFactory->GetDefaultHWAccel(bHWAccel);
		if (bHWAccel == TRUE)
		{
			VDC_DEBUG( "%s  Enable default the HWAccel\n",__FUNCTION__);
			m_Param.m_Conf.data.conf.HWAccel = 1;
		}

		gFactory->GetDefaultMining(bMining);
		if (bMining == TRUE)
		{
			VDC_DEBUG( "%s  Enable default the Mining\n",__FUNCTION__);
			m_Param.m_Conf.data.conf.Mining = 1;
		}
	}
	
#if 0
    m_pFloating = new QAction(QIcon(tr("images/open.ico")), tr("Floating"), this);
    //m_pUnFloating = new QAction(QIcon(tr("images/open.ico")), tr("UnFloating"), this);
    connect(m_pFloating, SIGNAL(triggered()), this, SLOT(floatingAction()));
    //connect(m_pUnFloating, SIGNAL(triggered()), this, SLOT(unFloatingAction()));
    createContentMenu();
#endif
    //connect(ui.lineFilePath, SIGNAL(triggered()), this, SLOT(floatingAction()));
    //ui.radioButtonFile->setChecked(true);
    setupDefaultValue();
    radioButtonClicked();
    m_pVideo = new VSCVWidget(m_nId, this);

    QVBoxLayout* layout = new QVBoxLayout();

    layout->addWidget(m_pVideo);
    layout->setMargin(0);

    ui.widget->setLayout(layout);

    PreView();

    SetupConnections();
}
Exemplo n.º 6
0
LeweiTcpClient::LeweiTcpClient( const char *userKey,const char *gatewayNo,byte mac[],IPAddress ip,IPAddress dns,IPAddress gw,IPAddress subnet):
	server(EthernetServer(80)),
	tcpServer("tcp.lewei50.com")
{
	_userKey = (char*)malloc( strlen(userKey)+1 );
	strcpy( _userKey,userKey );
	
	_gatewayNo = (char*)malloc( strlen(gatewayNo)+1 );
	strcpy( _gatewayNo,gatewayNo );
	
	setupDefaultValue();
	Ethernet.begin(mac,ip,dns,gw,subnet);
	Serial.println(Ethernet.localIP());
	delay(1000);
	String clientStr="";
	keepOnline();
}
Exemplo n.º 7
0
LeweiTcpClient::LeweiTcpClient(const char *userKey,const char *gatewayNo)
{
	_userKey = userKey;
	_gatewayNo = gatewayNo;
	setupDefaultValue();
	//IPAddress tcpServer(42,121,128,216); //tcp.lewei50.com's ip
	//IPAddress uploadServer(42,121,128,216);// "open.lewei50.com";
	
	Ethernet.begin(_mac);
	Serial.println(Ethernet.localIP());
	//Ethernet.begin(mac, ip);
	delay(1000);
	String clientStr="";
	//_postInterval = 5000;
	//_starttime = millis();
	keepOnline();
}