#include <FtpDataStore.h>

Inheritance diagram for FtpDataStore:
[legend]
Collaboration diagram for FtpDataStore:
[legend]

Public Member Functions

 FtpDataStore (FtpServerConnection *connection, const String &fileName)
 
 ~FtpDataStore ()
 
err_t onReceive (pbuf *buf) override
 
err_t onConnected (err_t err) override
 
err_t onSent (uint16_t len) override
 
void finishTransfer ()
 
void response (int code, String text=nullptr)
 
int write (const char *data, int len, uint8_t apiflags=0) override
 Base write operation. More...
 
int write (IDataSourceStream *stream)
 
void onReadyToSendData (TcpConnectionEvent sourceEvent) override
 
virtual void transferData (TcpConnectionEvent sourceEvent)
 
virtual bool connect (const String &server, int port, bool useSsl=false)
 
virtual bool connect (IpAddress addr, uint16_t port, bool useSsl=false)
 
virtual void close ()
 
int writeString (const char *data, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
 
int writeString (const String &data, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
 
uint16_t getAvailableWriteSize ()
 
void flush ()
 
void setTimeOut (uint16_t waitTimeOut)
 
IpAddress getRemoteIp () const
 
uint16_t getRemotePort () const
 
void setDestroyedDelegate (TcpConnectionDestroyedDelegate destroyedDelegate)
 Sets a callback to be called when the object instance is destroyed. More...
 
void setSslInitHandler (Ssl::Session::InitDelegate handler)
 Set the SSL session initialisation callback. More...
 
bool setSslConnection (Ssl::Connection *connection)
 
Ssl::SessiongetSsl ()
 Get a pointer to the current SSL session object. More...
 

Protected Member Functions

void initialize (tcp_pcb *pcb)
 
bool internalConnect (IpAddress addr, uint16_t port)
 
bool sslCreateSession ()
 
virtual void sslInitSession (Ssl::Session &session)
 Override in inherited classes to perform custom session initialisation. More...
 
virtual err_t onPoll ()
 
virtual void onError (err_t err)
 
void trySend (TcpConnectionEvent event)
 
err_t internalOnConnected (err_t err)
 
err_t internalOnReceive (pbuf *p, err_t err)
 
err_t internalOnSent (uint16_t len)
 
err_t internalOnPoll ()
 
void internalOnError (err_t err)
 
void internalOnDnsResponse (const char *name, LWIP_IP_ADDR_T *ipaddr, int port)
 

Protected Attributes

FtpServerConnectionparent = nullptr
 
bool completed = false
 
unsigned written = 0
 
unsigned sent = 0
 
tcp_pcb * tcp = nullptr
 
uint16_t sleep = 0
 
uint16_t timeOut = USHRT_MAX
 By default a TCP connection does not have a time out. More...
 
bool canSend = true
 
bool autoSelfDestruct = true
 
Ssl::Sessionssl = nullptr
 
Ssl::Session::InitDelegate sslInit
 
bool useSsl = false
 

Constructor & Destructor Documentation

◆ FtpDataStore()

FtpDataStore::FtpDataStore ( FtpServerConnection connection,
const String fileName 
)
inline

◆ ~FtpDataStore()

FtpDataStore::~FtpDataStore ( )
inline

Member Function Documentation

◆ close()

virtual void TcpConnection::close ( )
virtualinherited

Reimplemented in TcpClient.

◆ connect() [1/2]

virtual bool TcpConnection::connect ( const String server,
int  port,
bool  useSsl = false 
)
virtualinherited

Reimplemented in TcpClient, and HttpClientConnection.

◆ connect() [2/2]

virtual bool TcpConnection::connect ( IpAddress  addr,
uint16_t  port,
bool  useSsl = false 
)
virtualinherited

Reimplemented in TcpClient.

◆ finishTransfer()

void FtpDataStream::finishTransfer ( )
inlineinherited

◆ flush()

void TcpConnection::flush ( )
inherited

◆ getAvailableWriteSize()

uint16_t TcpConnection::getAvailableWriteSize ( )
inlineinherited

◆ getRemoteIp()

IpAddress TcpConnection::getRemoteIp ( ) const
inlineinherited

◆ getRemotePort()

uint16_t TcpConnection::getRemotePort ( ) const
inlineinherited

◆ getSsl()

Ssl::Session* TcpConnection::getSsl ( )
inlineinherited

Get a pointer to the current SSL session object.

Note that this is typically used so we can query properties of an established session. If you need to change session parameters this must be done via setSslInitHandler.

◆ initialize()

void TcpConnection::initialize ( tcp_pcb *  pcb)
protectedinherited

◆ internalConnect()

bool TcpConnection::internalConnect ( IpAddress  addr,
uint16_t  port 
)
protectedinherited

◆ internalOnConnected()

err_t TcpConnection::internalOnConnected ( err_t  err)
protectedinherited

◆ internalOnDnsResponse()

void TcpConnection::internalOnDnsResponse ( const char *  name,
LWIP_IP_ADDR_T ipaddr,
int  port 
)
protectedinherited

◆ internalOnError()

void TcpConnection::internalOnError ( err_t  err)
protectedinherited

◆ internalOnPoll()

err_t TcpConnection::internalOnPoll ( )
protectedinherited

◆ internalOnReceive()

err_t TcpConnection::internalOnReceive ( pbuf *  p,
err_t  err 
)
protectedinherited

◆ internalOnSent()

err_t TcpConnection::internalOnSent ( uint16_t  len)
protectedinherited

◆ onConnected()

err_t FtpDataStream::onConnected ( err_t  err)
inlineoverridevirtualinherited

Reimplemented from TcpConnection.

◆ onError()

virtual void TcpConnection::onError ( err_t  err)
protectedvirtualinherited

Reimplemented in HttpConnection, and TcpClient.

◆ onPoll()

virtual err_t TcpConnection::onPoll ( )
protectedvirtualinherited

◆ onReadyToSendData()

void FtpDataStream::onReadyToSendData ( TcpConnectionEvent  sourceEvent)
inlineoverridevirtualinherited

Reimplemented from TcpConnection.

◆ onReceive()

err_t FtpDataStore::onReceive ( pbuf *  buf)
inlineoverridevirtual

Reimplemented from TcpConnection.

◆ onSent()

err_t FtpDataStream::onSent ( uint16_t  len)
inlineoverridevirtualinherited

Reimplemented from TcpConnection.

◆ response()

void FtpDataStream::response ( int  code,
String  text = nullptr 
)
inlineinherited

◆ setDestroyedDelegate()

void TcpConnection::setDestroyedDelegate ( TcpConnectionDestroyedDelegate  destroyedDelegate)
inlineinherited

Sets a callback to be called when the object instance is destroyed.

Parameters
destroyedDelegate

◆ setSslConnection()

bool TcpConnection::setSslConnection ( Ssl::Connection connection)
inlineinherited

◆ setSslInitHandler()

void TcpConnection::setSslInitHandler ( Ssl::Session::InitDelegate  handler)
inlineinherited

Set the SSL session initialisation callback.

Parameters
handler

◆ setTimeOut()

void TcpConnection::setTimeOut ( uint16_t  waitTimeOut)
inherited

◆ sslCreateSession()

bool TcpConnection::sslCreateSession ( )
protectedinherited

◆ sslInitSession()

virtual void TcpConnection::sslInitSession ( Ssl::Session session)
inlineprotectedvirtualinherited

Override in inherited classes to perform custom session initialisation.

Called when TCP connection is established before initiating handshake.

Reimplemented in HttpClientConnection.

◆ transferData()

virtual void FtpDataStream::transferData ( TcpConnectionEvent  sourceEvent)
inlinevirtualinherited

Reimplemented in FtpDataRetrieve, and FtpDataFileList.

◆ trySend()

void TcpConnection::trySend ( TcpConnectionEvent  event)
inlineprotectedinherited

◆ write() [1/2]

int FtpDataStream::write ( const char *  data,
int  len,
uint8_t  apiflags = 0 
)
inlineoverridevirtualinherited

Base write operation.

Parameters
data
len
apiflagsTCP_WRITE_FLAG_COPY, TCP_WRITE_FLAG_MORE
Return values
int-1 on error

Reimplemented from TcpConnection.

◆ write() [2/2]

int TcpConnection::write ( IDataSourceStream stream)
inherited

◆ writeString() [1/2]

int TcpConnection::writeString ( const char *  data,
uint8_t  apiflags = TCP_WRITE_FLAG_COPY 
)
inlineinherited

◆ writeString() [2/2]

int TcpConnection::writeString ( const String data,
uint8_t  apiflags = TCP_WRITE_FLAG_COPY 
)
inlineinherited

Member Data Documentation

◆ autoSelfDestruct

bool TcpConnection::autoSelfDestruct = true
protectedinherited

◆ canSend

bool TcpConnection::canSend = true
protectedinherited

◆ completed

bool FtpDataStream::completed = false
protectedinherited

◆ parent

FtpServerConnection* FtpDataStream::parent = nullptr
protectedinherited

◆ sent

unsigned FtpDataStream::sent = 0
protectedinherited

◆ sleep

uint16_t TcpConnection::sleep = 0
protectedinherited

◆ ssl

Ssl::Session* TcpConnection::ssl = nullptr
protectedinherited

◆ sslInit

Ssl::Session::InitDelegate TcpConnection::sslInit
protectedinherited

◆ tcp

tcp_pcb* TcpConnection::tcp = nullptr
protectedinherited

◆ timeOut

uint16_t TcpConnection::timeOut = USHRT_MAX
protectedinherited

By default a TCP connection does not have a time out.

◆ useSsl

bool TcpConnection::useSsl = false
protectedinherited

◆ written

unsigned FtpDataStream::written = 0
protectedinherited

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