Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Links2004 committed Nov 25, 2015
1 parent 75fb6e2 commit 9089448
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <ESP8266httpClient.h>

#define USE_SERIAL Serial1
#define USE_SERIAL Serial

ESP8266WiFiMulti WiFiMulti;

Expand Down Expand Up @@ -59,7 +59,7 @@ void loop() {
USE_SERIAL.println(payload);
}
} else {
USE_SERIAL.print("[HTTP] GET... faild, no connection or no HTTP server\n");
USE_SERIAL.print("[HTTP] GET... failed, no connection or no HTTP server\n");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void loop() {

}
} else {
USE_SERIAL.print("[HTTP] GET... faild, no connection or no HTTP server\n");
USE_SERIAL.print("[HTTP] GET... failed, no connection or no HTTP server\n");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <ESP8266httpClient.h>

#define USE_SERIAL Serial1
#define USE_SERIAL Serial

ESP8266WiFiMulti WiFiMulti;

Expand Down Expand Up @@ -54,7 +54,7 @@ void loop() {
http.writeToStream(&USE_SERIAL);
}
} else {
USE_SERIAL.print("[HTTP] GET... faild, no connection or no HTTP server\n");
USE_SERIAL.print("[HTTP] GET... failed, no connection or no HTTP server\n");
}
}

Expand Down
19 changes: 10 additions & 9 deletions libraries/ESP8266httpClient/src/ESP8266httpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void httpClient::begin(String host, uint16_t port, String url, bool https, Strin

/**
* end
* called after the payload is handeld
* called after the payload is handled
*/
void httpClient::end(void) {
if(connected()) {
Expand Down Expand Up @@ -176,13 +176,13 @@ int httpClient::sendRequest(const char * type, uint8_t * payload, size_t size) {

// send Header
if(!sendHeader(type)) {
return HTTPC_ERROR_SEND_HEADER_FAILD;
return HTTPC_ERROR_SEND_HEADER_FAILED;
}

// send Payload if needed
if(payload && size > 0) {
if(_tcp->write(&payload[0], size) != size) {
return HTTPC_ERROR_SEND_PAYLOAD_FAILD;
return HTTPC_ERROR_SEND_PAYLOAD_FAILED;
}
}

Expand All @@ -200,7 +200,7 @@ int httpClient::getSize(void) {

/**
* deprecated Note: this is not working with https!
* returns the stram of the tcp connection
* returns the stream of the tcp connection
* @return WiFiClient
*/
WiFiClient & httpClient::getStream(void) {
Expand All @@ -214,7 +214,7 @@ WiFiClient & httpClient::getStream(void) {
}

/**
* returns the stram of the tcp connection
* returns the stream of the tcp connection
* @return WiFiClient *
*/
WiFiClient * httpClient::getStreamPtr(void) {
Expand Down Expand Up @@ -242,7 +242,7 @@ int httpClient::writeToStream(Stream * stream) {
return HTTPC_ERROR_NOT_CONNECTED;
}

// get lenght of document (is -1 when Server sends no Content-Length header)
// get length of document (is -1 when Server sends no Content-Length header)
int len = _size;
int bytesWritten = 0;

Expand Down Expand Up @@ -282,7 +282,7 @@ int httpClient::writeToStream(Stream * stream) {
}

/**
* return all payload as String (may need lot of ram or trigger out of memmory!)
* return all payload as String (may need lot of ram or trigger out of memory!)
* @return String
*/
String httpClient::getString(void) {
Expand All @@ -300,8 +300,9 @@ String httpClient::getString(void) {
return sstring;
}


/**
* adds Headder to the request
* adds Header to the request
* @param name
* @param value
* @param first
Expand Down Expand Up @@ -443,7 +444,7 @@ bool httpClient::sendHeader(const char * type) {
}

/**
* reads the respone from the server
* reads the response from the server
* @return int http code
*/
int httpClient::handleHeaderResponse() {
Expand Down
4 changes: 2 additions & 2 deletions libraries/ESP8266httpClient/src/ESP8266httpClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

/// HTTP client errors
#define HTTPC_ERROR_CONNECTION_REFUSED (-1)
#define HTTPC_ERROR_SEND_HEADER_FAILD (-2)
#define HTTPC_ERROR_SEND_PAYLOAD_FAILD (-3)
#define HTTPC_ERROR_SEND_HEADER_FAILED (-2)
#define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)
#define HTTPC_ERROR_NOT_CONNECTED (-4)
#define HTTPC_ERROR_CONNECTION_LOST (-5)
#define HTTPC_ERROR_NO_STREAM (-6)
Expand Down

0 comments on commit 9089448

Please sign in to comment.