0
私は温度を測定する簡単なソフトウェアを行っています。 XMLを外部のブラウザやその他のソフトウェアに送信することは私にはできません。私がブラウザとArduinoに接続すると、私はこの写真を得る(下記)。何I'am間違っているの?:ArduinoイーサネットソケットでXMLを送信
XMLを送信するコードは次のとおりです。エラーが検出されました
EthernetClient client = server.available();
if (client) {
Serial.println("new client");
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
if (c == '\n' && currentLineIsBlank) {
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/xml;charset=UTF-8");
client.println("Connection: close"); // the connection will be closed after completion of the response
client.println();
client.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
client.println("<TEMP>");
client.print(calcTemp(cnt1), 3);
client.println("<TEMP/>");
break;
}
if (c == '\n') {
// you're starting a new line
currentLineIsBlank = true;
} else if (c != '\r') {
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
client.stop();
Arrgg ..ありがとう:)私の間違い...それは今働いています.. – Ferguson