void PCSCDataTransport::serialize(boost::property_tree::ptree& parentNode) { boost::property_tree::ptree node; node.put("<xmlattr>.type", getTransportType()); parentNode.add_child(getDefaultXmlNodeName(), node); }
void HttpBasedTransport::send(QString data) { QString url = _connection->getUrl() + "/send"; url += TransportHelper::getReceiveQueryString(_connection, getTransportType()); QMap<QString, QString> postData; postData.insert("data",data); if(_sending) { SendQueueItem *queueItem = new SendQueueItem(); queueItem->connection = _connection; queueItem->url = url; queueItem->postData = postData; _sendQueue.append(queueItem); } else { _sending = true; connect(_httpClient, SIGNAL(postRequestCompleted(QString,QSharedPointer<SignalException>)), this, SLOT(onSendHttpResponse(QString,QSharedPointer<SignalException>))); _httpClient->post(url, postData); _postTimer.start(); } }
void UdpDataTransport::serialize(boost::property_tree::ptree& parentNode) { boost::property_tree::ptree node; node.put("<xmlattr>.type", getTransportType()); node.put("IpAddress", d_ipAddress); node.put("Port", d_port); parentNode.add_child(getDefaultXmlNodeName(), node); }
void SerialPortDataTransport::serialize(boost::property_tree::ptree& parentNode) { boost::property_tree::ptree node; node.put("<xmlattr>.type", getTransportType()); node.put("PortBaudRate", d_portBaudRate); d_port->serialize(node); parentNode.add_child(getDefaultXmlNodeName(), node); }
bool HttpBasedTransport::abort(int timeoutMs) { _retryTimerTimeout.stop(); disconnect(_httpClient, SIGNAL(postRequestCompleted(QString,QSharedPointer<SignalException>)), this, SLOT(onSendHttpResponse(QString,QSharedPointer<SignalException>))); QString url = _connection->getUrl() + "/abort"; url += TransportHelper::getReceiveQueryString(_connection, getTransportType()); QSharedPointer<SignalException> ex; _httpClient->postSync(url,QMap<QString, QString>(), ex, timeoutMs); _httpClient->abort(); if(ex.isNull()) { return true; } return false; }