LTE-M Leaf Library
Public Member Functions | List of all members
HL7800Udp Class Reference
Inheritance diagram for HL7800Udp:

Public Member Functions

virtual uint8_t begin (uint16_t)
 
virtual void stop ()
 
virtual int beginPacket (IPAddress ip, uint16_t port)
 
virtual int beginPacket (const char *host, uint16_t port)
 
virtual int endPacket ()
 
virtual size_t write (uint8_t)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual int parsePacket ()
 
virtual int available ()
 
virtual int read ()
 
virtual int read (unsigned char *buffer, size_t len)
 
virtual int read (char *buffer, size_t len)
 
virtual int peek ()
 
virtual void flush ()
 
virtual IPAddress remoteIP ()
 
virtual uint16_t remotePort ()
 

Member Function Documentation

◆ available()

int HL7800Udp::available ( )
virtual

UDP有効データ確認
Get the number of bytes (characters) available for reading from the buffer. This is data that's already arrived
Checks for the presence of a UDP packet, and reports the size. parsePacket() must be called before reading the buffer
受信済みデータのデータサイズを返す

Parameters
なし
Returns
受信済みデータバイト数

◆ begin()

uint8_t HL7800Udp::begin ( uint16_t  port)
virtual

UDPライブラリ初期化
Initializes the UDP library and network settings.

Parameters
port自デバイスのUDPポート番号
Returns
1:成功, 0:失敗

◆ beginPacket() [1/2]

int HL7800Udp::beginPacket ( const char *  host,
uint16_t  port 
)
virtual

UDP送信開始(host名指定)
Starts a connection to write UDP data to the remote connection
ここでは内部変数にパラメータをコピーするのみ、実際の動作はwrite()で開始される

Parameters
host送信相手の
port送信相手のUDPポート番号
Returns
1:成功, 0:失敗

◆ beginPacket() [2/2]

int HL7800Udp::beginPacket ( IPAddress  ip,
uint16_t  port 
)
virtual

UDP送信開始(IPアドレス指定)
Starts a connection to write UDP data to the remote connection
ここでは内部変数にパラメータをコピーするのみ、実際の動作はwrite()で開始される

Parameters
ip送信相手のIP
port送信相手のUDPポート番号
Returns
1:成功, 0:失敗

◆ endPacket()

int HL7800Udp::endPacket ( )
virtual

UDP送信終了
Called after writing UDP data to the remote connection.
UDP送信後の終了処理を行う

Parameters
なし
Returns
1:成功, 0:失敗

◆ flush()

void HL7800Udp::flush ( )
virtual

UDPデータ送信完了待ち
write()で送信完了をチェックしているため、この関数は意味を持たない

Returns
1:成功, 0:失敗

◆ peek()

int HL7800Udp::peek ( )
virtual

UDPデータ廃棄

Returns
1:成功, 0:失敗

◆ read() [1/2]

int HL7800Udp::read ( )
virtual

UDPデータ取得
Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer.
受信済みデータのデータサイズを返す

Parameters
なし
Returns
整数:有効データ, -1:失敗

◆ read() [2/2]

int HL7800Udp::read ( unsigned char *  buffer,
size_t  len 
)
virtual

UDPデータ取得
Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer.
受信済みデータのデータサイズを返す

Parameters
buffer受け取りデータバッファ
len受信したいデータ数
Returns
取得成功したデータバイト数

◆ stop()

void HL7800Udp::stop ( )
virtual

UDPセッションを破棄する
Disconnect from the server. Release any resource being used during the UDP session.

Parameters
なし
Returns
なし

◆ write() [1/2]

size_t HL7800Udp::write ( const uint8_t *  buffer,
size_t  size 
)
virtual

UDP送信データ書き込み
Writes UDP data to the remote connection. Must be wrapped between beginPacket() and endPacket().
beginPacket() initializes the packet of data, it is not sent until endPacket() is called.
指定されたデータ列をUDPで送信する

Parameters
buffer送信データ列
size送信データ数
Returns
1:成功, 0:失敗

◆ write() [2/2]

size_t HL7800Udp::write ( uint8_t  )
virtual

UDP送信データ書き込み
Writes UDP data to the remote connection. Must be wrapped between beginPacket() and endPacket().
beginPacket() initializes the packet of data, it is not sent until endPacket() is called.
HL7800はバイト送信を未サポート

Parameters
data送信データ
Returns
1:成功, 0:失敗

The documentation for this class was generated from the following files: