TcpClient Object.
More...
#include <tcp_client.h>
|
static err_t | connected (void *arg, struct tcp_pcb *tpcb, err_t err) |
| Function called when TCP connection established. More...
|
|
static err_t | recv (void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err) |
| tcp_receiv callback More...
|
|
static void | send (struct tcp_pcb *tpcb, struct client *es) |
| function used to send data More...
|
|
static err_t | poll (void *arg, struct tcp_pcb *tpcb) |
| This function implements the tcp_poll callback function. More...
|
|
static err_t | sent (void *arg, struct tcp_pcb *tpcb, u16_t len) |
| This function implements the tcp_sent LwIP callback (called when ACK is received from remote host for sent data) More...
|
|
◆ TcpClient()
TcpClient::TcpClient |
( |
Mp3Player * |
mp3, |
|
|
struct netif * |
connection |
|
) |
| |
|
inline |
Construct a new Tcp Client object.
- Parameters
-
◆ adjustBuffer()
void TcpClient::adjustBuffer |
( |
| ) |
|
- Adjust speed of danger of buffer overfill: consume items slower
- Adjust speed if danger of buffer underrun: consume items faster
◆ analysisOfMetaInfo()
void TcpClient::analysisOfMetaInfo |
( |
void |
| ) |
|
Analyse and display metainfo, if present.
◆ clearAudioBuffer()
void TcpClient::clearAudioBuffer |
( |
void |
| ) |
|
|
inlineprivate |
◆ clearFileReadBuffer()
void TcpClient::clearFileReadBuffer |
( |
void |
| ) |
|
|
inlineprivate |
◆ connect()
void TcpClient::connect |
( |
ip_addr_t |
DestIPaddr, |
|
|
uint16_t |
DEST_PORT |
|
) |
| |
Tcp Client object and Connects to the TCP server.
- Parameters
-
◆ connected()
static err_t TcpClient::connected |
( |
void * |
arg, |
|
|
struct tcp_pcb * |
tpcb, |
|
|
err_t |
err |
|
) |
| |
|
inlinestaticprivate |
◆ connectionClose()
void TcpClient::connectionClose |
( |
struct tcp_pcb * |
tpcb, |
|
|
struct client * |
es |
|
) |
| |
This function is used to close the tcp connection with server.
- Parameters
-
tpcb | tcp connection control block |
es | pointer on client structure |
- Return values
-
◆ disconnect()
disconnects the TCP server
◆ gateActivities()
Gate for all activites that are admitted every 1s.
◆ poll()
static err_t TcpClient::poll |
( |
void * |
arg, |
|
|
struct tcp_pcb * |
tpcb |
|
) |
| |
|
inlinestaticprivate |
This function implements the tcp_poll callback function.
- Parameters
-
arg | pointer on argument passed to callback |
tpcb | tcp connection control block |
- Return values
-
References es, ES_CLOSING, client::p_tx, and client::state.
◆ process()
◆ recv()
static err_t TcpClient::recv |
( |
void * |
arg, |
|
|
struct tcp_pcb * |
tpcb, |
|
|
struct pbuf * |
p, |
|
|
err_t |
err |
|
) |
| |
|
inlinestaticprivate |
tcp_receiv callback
- Parameters
-
arg | argument to be passed to receive callback |
tpcb | tcp connection control block |
err | receive error code |
- Return values
-
References curr_len, data_with_metainfo, err, es, ES_CLOSING, ES_CONNECTED, initial_pipe, inserted_len, insertion_point, insertion_point_maximum, items, lencounter, message_count, meta_info_len, meta_start_index, meta_string, metainfo_present, metaint, metainterval, metnum, msg_len_max, p, client::p_tx, payloadtemp, ptr2, sent_len, startnameptr, client::state, stationname, strptr, TCPBUFF_MAXITEMS, and totaldatacount.
◆ send()
static void TcpClient::send |
( |
struct tcp_pcb * |
tpcb, |
|
|
struct client * |
es |
|
) |
| |
|
inlinestaticprivate |
function used to send data
- Parameters
-
tpcb | tcp control block |
es | pointer on structure of type client containing info on data to be sent |
- Return values
-
References es, and client::p_tx.
◆ sent()
static err_t TcpClient::sent |
( |
void * |
arg, |
|
|
struct tcp_pcb * |
tpcb, |
|
|
u16_t |
len |
|
) |
| |
|
inlinestaticprivate |
This function implements the tcp_sent LwIP callback (called when ACK is received from remote host for sent data)
- Parameters
-
arg | pointer on argument passed to callback |
tcp_pcb | tcp connection control block |
len | length of data sent |
- Return values
-
References es, and client::p_tx.
◆ updateStation()
On station change disconnect and delete all buffers, then reconnect with new station.
◆ es
allocate structure es to maintain tcp connection informations
◆ gnetif
struct netif* TcpClient::gnetif |
◆ m_mp3
◆ server
◆ stations
The documentation for this class was generated from the following file: