- Timestamp:
- Mar 30, 2016, 8:40:35 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rtos_arduino/trunk/arduino_lib/libraries/ESP8266_Arudino_AT/Client_ESP8266.h
r187 r189 20 20 21 21 #include "ESP8266.h" 22 #include "IPAddress.h" 23 #include "Client.h" 22 24 23 25 class ESP8266Client: public Client, public ESP8266 { … … 32 34 */ 33 35 int connect(IPAddress ip, uint16_t port) { 36 if (isConnected()) return 1; 34 37 String ip_str; 35 38 ip_str.concat(ip[0]); ip_str.concat("."); … … 41 44 42 45 int connect(const char *host, uint16_t port) { 46 if (isConnected()) return 1; 43 47 String ip_str(host); 44 48 return (createTCP(ip_str, port))? 1 : 0; … … 51 55 return 0; 52 56 }; 53 57 54 58 size_t write(const uint8_t *buf, size_t size){ 55 59 if(send(buf, size)){ … … 80 84 81 85 void flush(){}; 82 void stop(){ releaseTCP();};86 void stop(){ if (isConnected()) { releaseTCP(); }} 83 87 uint8_t connected(){return (isConnected())? 1 : 0;}; 84 88 operator bool(){return isConnected();};
Note:
See TracChangeset
for help on using the changeset viewer.