Arduino  1.8.10
WiFiStream クラスabstract

#include <WiFiStream.h>

WiFiStream の継承関係図
Stream Print WiFiClientStream WiFiServerStream

公開メンバ関数

 WiFiStream (uint16_t server_port)
 
 WiFiStream (IPAddress server_ip, uint16_t server_port)
 
void attach (hostConnectionCallbackFunction newFunction)
 
void config (IPAddress local_ip)
 
void config (IPAddress local_ip, IPAddress gateway, IPAddress subnet)
 
IPAddress getLocalIP ()
 
virtual bool maintain ()=0
 
virtual void stop ()=0
 
int begin (char *ssid)
 
int begin (char *ssid, uint8_t key_idx, const char *key)
 
int begin (char *ssid, const char *passphrase)
 
int available ()
 
void flush ()
 
int peek ()
 
int read ()
 
size_t write (uint8_t byte)
 
- 基底クラス Stream に属する継承公開メンバ関数
 Stream ()
 
void setTimeout (unsigned long timeout)
 
unsigned long getTimeout (void)
 
bool find (char *target)
 
bool find (uint8_t *target)
 
bool find (char *target, size_t length)
 
bool find (uint8_t *target, size_t length)
 
bool find (char target)
 
bool findUntil (char *target, char *terminator)
 
bool findUntil (uint8_t *target, char *terminator)
 
bool findUntil (char *target, size_t targetLen, char *terminate, size_t termLen)
 
bool findUntil (uint8_t *target, size_t targetLen, char *terminate, size_t termLen)
 
long parseInt (LookaheadMode lookahead=SKIP_ALL, char ignore=NO_IGNORE_CHAR)
 
float parseFloat (LookaheadMode lookahead=SKIP_ALL, char ignore=NO_IGNORE_CHAR)
 
size_t readBytes (char *buffer, size_t length)
 
size_t readBytes (uint8_t *buffer, size_t length)
 
size_t readBytesUntil (char terminator, char *buffer, size_t length)
 
size_t readBytesUntil (char terminator, uint8_t *buffer, size_t length)
 
String readString ()
 
String readStringUntil (char terminator)
 
- 基底クラス Print に属する継承公開メンバ関数
 Print ()
 
int getWriteError ()
 
void clearWriteError ()
 
size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
size_t write (const char *buffer, size_t size)
 
virtual int availableForWrite ()
 
size_t print (const __FlashStringHelper *)
 
size_t print (const String &)
 
size_t print (const char[])
 
size_t print (char)
 
size_t print (unsigned char, int=DEC)
 
size_t print (int, int=DEC)
 
size_t print (unsigned int, int=DEC)
 
size_t print (long, int=DEC)
 
size_t print (unsigned long, int=DEC)
 
size_t print (double, int=2)
 
size_t print (const Printable &)
 
size_t println (const __FlashStringHelper *)
 
size_t println (const String &s)
 
size_t println (const char[])
 
size_t println (char)
 
size_t println (unsigned char, int=DEC)
 
size_t println (int, int=DEC)
 
size_t println (unsigned int, int=DEC)
 
size_t println (long, int=DEC)
 
size_t println (unsigned long, int=DEC)
 
size_t println (double, int=2)
 
size_t println (const Printable &)
 
size_t println (void)
 

限定公開メンバ関数

virtual bool connect_client ()=0
 
- 基底クラス Stream に属する継承限定公開メンバ関数
int timedRead ()
 
int timedPeek ()
 
int peekNextDigit (LookaheadMode lookahead, bool detectDecimal)
 
long parseInt (char ignore)
 
float parseFloat (char ignore)
 
int findMulti (struct MultiTarget *targets, int tCount)
 
- 基底クラス Print に属する継承限定公開メンバ関数
void setWriteError (int err=1)
 

限定公開変数類

WiFiClient _client
 
bool _connected = false
 
hostConnectionCallbackFunction _currentHostConnectionCallback
 
IPAddress _local_ip
 
IPAddress _subnet
 
IPAddress _gateway
 
IPAddress _remote_ip
 
uint16_t _port
 
uint8_t _key_idx
 
const char * _key = nullptr
 
const char * _passphrase = nullptr
 
char * _ssid = nullptr
 
- 基底クラス Stream に属する継承限定公開変数類
unsigned long _timeout
 
unsigned long _startMillis
 

詳解

WiFiStream.h35 行目に定義があります。

構築子と解体子

◆ WiFiStream() [1/2]

WiFiStream::WiFiStream ( uint16_t  server_port)
inline

constructor for TCP server

WiFiStream.h61 行目に定義があります。

61 : _port(server_port) {}
uint16_t _port
Definition: WiFiStream.h:47

◆ WiFiStream() [2/2]

WiFiStream::WiFiStream ( IPAddress  server_ip,
uint16_t  server_port 
)
inline

constructor for TCP client

WiFiStream.h64 行目に定義があります。

64 : _remote_ip(server_ip), _port(server_port) {}
uint16_t _port
Definition: WiFiStream.h:47
IPAddress _remote_ip
Definition: WiFiStream.h:46

関数詳解

◆ attach()

void WiFiStream::attach ( hostConnectionCallbackFunction  newFunction)
inline

WiFiStream.h66 行目に定義があります。

66 { _currentHostConnectionCallback = newFunction; }
hostConnectionCallbackFunction _currentHostConnectionCallback
Definition: WiFiStream.h:40

◆ available()

int WiFiStream::available ( void  )
inlinevirtual

Streamを実装しています。

WiFiStream.h199 行目に定義があります。

200  {
201  return connect_client() ? _client.available() : 0;
202  }
virtual bool connect_client()=0
virtual int available()
Definition: WiFiClient.cpp:105
WiFiClient _client
Definition: WiFiStream.h:38

◆ begin() [1/3]

int WiFiStream::begin ( char *  ssid)
inline

initialize WiFi without security (open) and initiate client connection if WiFi connection is already established

戻り値
WL_CONNECTED if WiFi connection is established

WiFiStream.h154 行目に定義があります。

155  {
156  _ssid = ssid;
157 
158  WiFi.begin(ssid);
159  int result = WiFi.status();
160  return WiFi.status();
161  }
int begin(char *ssid)
Definition: WiFi.cpp:59
uint8_t status()
Definition: WiFi.cpp:238
int result
Definition: ard_spi.c:174
char ssid[]
Definition: wifiConfig.h:119
WiFiClass WiFi
Definition: WiFi.cpp:248
char * _ssid
Definition: WiFiStream.h:51

◆ begin() [2/3]

int WiFiStream::begin ( char *  ssid,
uint8_t  key_idx,
const char *  key 
)
inline

initialize WiFi with WEP security and initiate client connection if WiFi connection is already established

戻り値
WL_CONNECTED if WiFi connection is established

WiFiStream.h169 行目に定義があります。

170  {
171  _ssid = ssid;
172  _key_idx = key_idx;
173  _key = key;
174 
175  WiFi.begin( ssid, key_idx, key );
176  return WiFi.status();
177  }
int begin(char *ssid)
Definition: WiFi.cpp:59
uint8_t status()
Definition: WiFi.cpp:238
char ssid[]
Definition: wifiConfig.h:119
WiFiClass WiFi
Definition: WiFi.cpp:248
char * _ssid
Definition: WiFiStream.h:51
uint8_t _key_idx
Definition: WiFiStream.h:48
const char * _key
Definition: WiFiStream.h:49

◆ begin() [3/3]

int WiFiStream::begin ( char *  ssid,
const char *  passphrase 
)
inline

initialize WiFi with WPA-PSK security and initiate client connection if WiFi connection is already established

戻り値
WL_CONNECTED if WiFi connection is established

WiFiStream.h185 行目に定義があります。

186  {
187  _ssid = ssid;
188  _passphrase = passphrase;
189 
190  WiFi.begin(ssid, passphrase);
191  return WiFi.status();
192  }
const char * _passphrase
Definition: WiFiStream.h:50
int begin(char *ssid)
Definition: WiFi.cpp:59
uint8_t status()
Definition: WiFi.cpp:238
char ssid[]
Definition: wifiConfig.h:119
WiFiClass WiFi
Definition: WiFi.cpp:248
char * _ssid
Definition: WiFiStream.h:51

◆ config() [1/2]

void WiFiStream::config ( IPAddress  local_ip)
inline

configure a static local IP address without defining the local network DHCP will be used as long as local IP address is not defined

WiFiStream.h77 行目に定義があります。

78  {
80  WiFi.config( local_ip );
81  }
void config(IPAddress local_ip)
Definition: WiFi.cpp:118
#define local_ip
WiFiClass WiFi
Definition: WiFi.cpp:248
IPAddress _local_ip
Definition: WiFiStream.h:43

◆ config() [2/2]

void WiFiStream::config ( IPAddress  local_ip,
IPAddress  gateway,
IPAddress  subnet 
)
inline

configure a static local IP address DHCP will be used as long as local IP address is not defined

WiFiStream.h88 行目に定義があります。

89  {
91  _subnet = subnet;
92  _gateway = gateway;
93 #ifndef ESP8266
94  WiFi.config( local_ip, IPAddress(0, 0, 0, 0), gateway, subnet );
95 #else
96  WiFi.config( local_ip, gateway, subnet );
97 #endif
98  }
IPAddress _subnet
Definition: WiFiStream.h:44
void config(IPAddress local_ip)
Definition: WiFi.cpp:118
#define local_ip
WiFiClass WiFi
Definition: WiFi.cpp:248
IPAddress _gateway
Definition: WiFiStream.h:45
IPAddress _local_ip
Definition: WiFiStream.h:43

◆ connect_client()

virtual bool WiFiStream::connect_client ( )
protectedpure virtual

check if TCP client is connected

戻り値
true if connected

WiFiClientStream, WiFiServerStreamで実装されています。

◆ flush()

void WiFiStream::flush ( void  )
inlinevirtual

Printを再実装しています。

WiFiStream.h204 行目に定義があります。

205  {
206  if( _client ) _client.flush();
207  }
virtual void flush()
Definition: WiFiClient.cpp:142
WiFiClient _client
Definition: WiFiStream.h:38

◆ getLocalIP()

IPAddress WiFiStream::getLocalIP ( )
inline
戻り値
local IP address

WiFiStream.h103 行目に定義があります。

104  {
105  return WiFi.localIP();
106  }
IPAddress localIP()
Definition: WiFi.cpp:163
WiFiClass WiFi
Definition: WiFi.cpp:248

◆ maintain()

virtual bool WiFiStream::maintain ( )
pure virtual

maintain WiFi and TCP connection

戻り値
true if WiFi and TCP connection are established

WiFiClientStream, WiFiServerStreamで実装されています。

◆ peek()

int WiFiStream::peek ( void  )
inlinevirtual

Streamを実装しています。

WiFiStream.h209 行目に定義があります。

210  {
211  return connect_client() ? _client.peek(): 0;
212  }
virtual bool connect_client()=0
virtual int peek()
Definition: WiFiClient.cpp:133
WiFiClient _client
Definition: WiFiStream.h:38

◆ read()

int WiFiStream::read ( void  )
inlinevirtual

Streamを実装しています。

WiFiStream.h214 行目に定義があります。

215  {
216  return connect_client() ? _client.read() : -1;
217  }
virtual int read()
Definition: WiFiClient.cpp:114
virtual bool connect_client()=0
WiFiClient _client
Definition: WiFiStream.h:38

◆ stop()

virtual void WiFiStream::stop ( )
pure virtual

close TCP client connection

WiFiServerStream, WiFiClientStreamで実装されています。

◆ write()

size_t WiFiStream::write ( uint8_t  byte)
inlinevirtual

Printを実装しています。

WiFiStream.h219 行目に定義があります。

220  {
221  return connect_client() ? _client.write( byte ) : 0;
222  }
virtual bool connect_client()=0
virtual size_t write(uint8_t)
Definition: WiFiClient.cpp:74
WiFiClient _client
Definition: WiFiStream.h:38

メンバ詳解

◆ _client

WiFiClient WiFiStream::_client
protected

WiFiStream.h38 行目に定義があります。

◆ _connected

bool WiFiStream::_connected = false
protected

WiFiStream.h39 行目に定義があります。

◆ _currentHostConnectionCallback

hostConnectionCallbackFunction WiFiStream::_currentHostConnectionCallback
protected

WiFiStream.h40 行目に定義があります。

◆ _gateway

IPAddress WiFiStream::_gateway
protected

WiFiStream.h45 行目に定義があります。

◆ _key

const char* WiFiStream::_key = nullptr
protected

WiFiStream.h49 行目に定義があります。

◆ _key_idx

uint8_t WiFiStream::_key_idx
protected

WiFiStream.h48 行目に定義があります。

◆ _local_ip

IPAddress WiFiStream::_local_ip
protected

WiFiStream.h43 行目に定義があります。

◆ _passphrase

const char* WiFiStream::_passphrase = nullptr
protected

WiFiStream.h50 行目に定義があります。

◆ _port

uint16_t WiFiStream::_port
protected

WiFiStream.h47 行目に定義があります。

◆ _remote_ip

IPAddress WiFiStream::_remote_ip
protected

WiFiStream.h46 行目に定義があります。

◆ _ssid

char* WiFiStream::_ssid = nullptr
protected

WiFiStream.h51 行目に定義があります。

◆ _subnet

IPAddress WiFiStream::_subnet
protected

WiFiStream.h44 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: