예제 #1
0
ClientGUI::ClientGUI(QWidget *parent) :
QMainWindow(parent)
{
	qDebug("Client UI setup");
	setupUi(this);
	move(100,22);
	
	m_tcpSocket = new QTcpSocket(this);
		
	// network widgets
	connect(pushButtonConnect, SIGNAL(clicked()), this, SLOT(hostAction()));
	connect(pushButtonSend, SIGNAL(clicked()), this, SLOT(sendToHost()));
	connect(lineEditCommand, SIGNAL(returnPressed()), this, SLOT(sendToHost()));
	
	connect(m_tcpSocket, SIGNAL(readyRead()), this, SLOT(readFromHost()));
	connect(m_tcpSocket, SIGNAL(disconnected()), this, SLOT(hostDisconnect()));
	connect(m_tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
             this, SLOT(hostError(QAbstractSocket::SocketError)));

	pushButtonSend->setEnabled(false);
	pushButtonConnect->setText("Connect");
	
	ipAddress = "NULL";
	lineEditAddress->setText(QHostAddress(QHostAddress::LocalHost).toString());
	lineEditPort->setText(QString::number(50657));
	lineEditPort->setFocus();
}
예제 #2
0
void processUsbSendQueue(UsbDevice* usbDevice) {
    USB_USBTask();

    if(usbDevice->configured && (USB_DeviceState != DEVICE_STATE_Configured
                || !vbusDetected() || !usbHostDetected())) {
        EVENT_USB_Device_Disconnect();
    } else {
        sendToHost(usbDevice);
    }
}
예제 #3
0
bool RFduinoGZLLClass::sendToHost(String &data)
{
  char buf[32];
  data.toCharArray(buf, sizeof(buf));
  return sendToHost(buf);
}
예제 #4
0
bool RFduinoGZLLClass::sendToHost(const char *data)
{
  return sendToHost(data, strlen(data));
}