Ignore:
Timestamp:
Mar 30, 2016, 8:40:35 AM (8 years ago)
Author:
ertl-honda
Message:

Thinkgspeakのサポート

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtos_arduino/trunk/arduino_lib/libraries/ESP8266_Arudino_AT/Client_ESP8266.h

    r187 r189  
    2020
    2121#include "ESP8266.h"
     22#include "IPAddress.h"
     23#include "Client.h"
    2224
    2325class ESP8266Client: public Client, public ESP8266 {
     
    3234     */
    3335    int connect(IPAddress ip, uint16_t port) {
     36        if (isConnected()) return 1;
    3437        String ip_str;
    3538        ip_str.concat(ip[0]); ip_str.concat(".");
     
    4144   
    4245    int connect(const char *host, uint16_t port) {
     46        if (isConnected()) return 1;
    4347        String ip_str(host);
    4448        return (createTCP(ip_str, port))? 1 : 0;
     
    5155        return 0;
    5256    };
    53    
     57
    5458    size_t write(const uint8_t *buf, size_t size){
    5559        if(send(buf, size)){
     
    8084   
    8185    void flush(){};
    82     void stop(){releaseTCP();};
     86    void stop(){ if (isConnected()) { releaseTCP(); }}
    8387    uint8_t connected(){return (isConnected())? 1 : 0;};
    8488    operator bool(){return isConnected();};
Note: See TracChangeset for help on using the changeset viewer.