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(); }
void processUsbSendQueue(UsbDevice* usbDevice) { USB_USBTask(); if(usbDevice->configured && (USB_DeviceState != DEVICE_STATE_Configured || !vbusDetected() || !usbHostDetected())) { EVENT_USB_Device_Disconnect(); } else { sendToHost(usbDevice); } }
bool RFduinoGZLLClass::sendToHost(String &data) { char buf[32]; data.toCharArray(buf, sizeof(buf)); return sendToHost(buf); }
bool RFduinoGZLLClass::sendToHost(const char *data) { return sendToHost(data, strlen(data)); }