[en] Create a client that can connect to a specific Internet IP address and port.
[ja] 特定のインターネットIPアドレスとポートに接続可能なクライアントを作成します。
More...
#include <LTEClient.h>
Public Member Functions | |
LTEClient () | |
Construct LTEClient instance. | |
~LTEClient () | |
Destruct LTEClient instance. | |
int | connect (IPAddress ip, uint16_t port) |
Connects to a specified IP address and port. More... | |
int | connect (const char *host, uint16_t port) |
Connects to a specified host name and port. More... | |
size_t | write (uint8_t val) |
Send one byte data to the server the client is connected to. More... | |
size_t | write (const uint8_t *buf, size_t size) |
Send series of bytes data to the server the client is connected to. More... | |
int | available () |
Returns the number of bytes available for reading. More... | |
int | read () |
Read the next byte received from the server the client is connected to. More... | |
int | read (uint8_t *buf, size_t size) |
Read series of bytes received from the server the client is connected to. More... | |
int | peek () |
Returns the next byte received from the server without removing it from the buffer. More... | |
void | flush () |
Discards any bytes that have been written to the client. More... | |
void | stop () |
Disconnect from the server. More... | |
uint8_t | connected () |
Whether or not the client is connected. More... | |
operator bool () | |
Assignment operator for bool. More... | |
int | setTimeout (uint32_t milliseconds) |
Set the timeout when the client send or receive. More... | |
[en] Create a client that can connect to a specific Internet IP address and port.
[ja] 特定のインターネットIPアドレスとポートに接続可能なクライアントを作成します。
int LTEClient::connect | ( | IPAddress | ip, |
uint16_t | port | ||
) |
Connects to a specified IP address and port.
[en] Connects to a specified IP address and port.
[ja] 指定されたIPアドレスとポートに接続します。
[in] | ip | [en] Server IP address. [ja] 接続先サーバーのIPアドレス。 |
[in] | port | [en] Server port. [ja] 接続先サーバーのポート番号。 |
int LTEClient::connect | ( | const char * | host, |
uint16_t | port | ||
) |
Connects to a specified host name and port.
[en] Connects to a specified host and port.
[ja] 指定されたホスト名とポートに接続します。
[in] | host | [en] Server host name. [ja] 接続先サーバーのホスト名。 |
[in] | port | [en] Server port. [ja] 接続先サーバーのポート番号。 |
size_t LTEClient::write | ( | uint8_t | val | ) |
Send one byte data to the server the client is connected to.
[en] Send one byte data to the server the client is connected to.
[ja] 接続先のサーバーに1バイトのデータを送信します。
[in] | val | [en] A value to send as a single byte. [ja] 送信する値。 |
size_t LTEClient::write | ( | const uint8_t * | buf, |
size_t | size | ||
) |
Send series of bytes data to the server the client is connected to.
[en] Send series of bytes data to the server the client is connected to.
[ja] 接続先のサーバーに一連のデータを送信します。
[in] | buf | [en] A buffer to send. [ja] 送信バッファー。 |
[in] | size | [en] The length of the buffer. [ja] 送信バッファーの長さ。 |
int LTEClient::available | ( | ) |
Returns the number of bytes available for reading.
[en] Returns the number of bytes available for reading.
[ja] 読み出し可能なバイト数を返します。
int LTEClient::read | ( | ) |
Read the next byte received from the server the client is connected to.
[en] Read the next byte received from the server the client is connected to.
[ja] 接続先のサーバーから受信したデータを読み出します。
int LTEClient::read | ( | uint8_t * | buf, |
size_t | size | ||
) |
Read series of bytes received from the server the client is connected to.
[en] Read series of bytes received from the server the client is connected to.
[ja] 接続先のサーバーから受信した一連のデータを読み出します。
[out] | buf | [en] A buffer to read. [ja] 受信バッファー。 |
[in] | size | [en] The length of the buffer. [ja] 受信バッファーの長さ。 |
int LTEClient::peek | ( | ) |
Returns the next byte received from the server without removing it from the buffer.
[en] Returns the next byte received from the server without removing it from the buffer.
[ja] 接続先のサーバーから受信したデータを、バッファーから削除せずに読み出します。
void LTEClient::flush | ( | ) |
Discards any bytes that have been written to the client.
[en] Discards any bytes that have been written to the client.
[ja] クライアントに書き込まれたデータを破棄します。
void LTEClient::stop | ( | ) |
Disconnect from the server.
[en] Disconnect from the server.
[ja] サーバーから切断します。
uint8_t LTEClient::connected | ( | ) |
Whether or not the client is connected.
[en] Whether or not the client is connected. Note that a client is considered connected if the connection has been closed but there is still unread data.
[ja] クライアントが接続されているかどうかを返します。接続は閉じられているが未読データが残っている場合、クライアントは接続されていると見なされることに注意してください。
|
inline |
Assignment operator for bool.
[en] Whether or not the client is connected.
[ja] クライアントが接続されているかどうかを返します。
int LTEClient::setTimeout | ( | uint32_t | milliseconds | ) |
Set the timeout when the client send or receive.
[en] Set the timeout when the client send or receive. 0 means disabled (no timeout). If this method has not been called, the timeout is 0.
[ja] クライアントが送受信をする際のタイムアウトを設定します。0は無効(タイムアウトしない)を意味します。本メソッドを呼び出さない場合のタイムアウトは0です