Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvTftpClient Class Reference

Sends or receives files from a GigE Vision video interface using the TFTP protocol. More...

Public Member Functions

 PvTftpClient ()
 Constructor.
 
 ~PvTftpClient ()
 Destructor.
 
PvResult Init (const PvString &aDeviceIPAddress, const PvString &aDeviceFilename)
 Initializes the client for file transfer. More...
 
PvResult SendFile (const PvString &aHostFilename="")
 Sends a local file to the device using TFTP. More...
 
PvResult SendData (const uint8_t *aBuffer, uint32_t aBufferLength)
 Sends data to a device file using TFTP. More...
 
PvResult GetFile (const PvString &aHostFilename="")
 Reads a file from the device using TFTP. More...
 
PvResult GetData (uint8_t *aBuffer, uint32_t aBufferLength, uint32_t *aBytesRead)
 Gets data from a device file using TFTP. More...
 
PvResult Abort ()
 Aborts the current transfer. More...
 
PvResult GetWarning (PvString &aWarning)
 Pops the oldest transfer warning and returns it in aStatus. More...
 
PvResult GetTransferResult () const
 Returns the last error message. More...
 
PvResult GetProgress (int64_t &aCompleted, int64_t &aTotal)
 Returns the transfer progress. More...
 

Detailed Description

Sends or receives files from a GigE Vision video interface using the TFTP protocol.

Init must first be called in order to specify the device IP address and file.

SendFile/SendData are used to send a host file or memory buffer to the device file. ReceiveFile/ReceiveData are used to transfer a device file to a host file or memory buffer.

SendFile and ReceiveFile are blocking calls. Another thread can poll GetWarning, GetTransferResult and GetProgress to provide the user with status updates.

Calling Abort from another thread aborts the current transfer.

Member Function Documentation

PvResult PvTftpClient::Abort ( )

Aborts the current transfer.

As the send and receive methods are blocking, this one needs to be called from a different thread.

Returns
Includes:
PvResult PvTftpClient::GetData ( uint8_t *  aBuffer,
uint32_t  aBufferLength,
uint32_t *  aBytesRead 
)

Gets data from a device file using TFTP.

Parameters
[in]aBufferpointer to the buffer where the data is written.
[in]aBufferLengththe size of the buffer in bytes.
[in]aBytesReadoutput, the number of bytes read from the device file into aBuffer in bytes.
Returns
Includes:
PvResult PvTftpClient::GetFile ( const PvString aHostFilename = "")

Reads a file from the device using TFTP.

Parameters
[in]aHostFilenameif provided, the file read from the device is written to that location. If not provided, the file is written to aDeviceFilename (from Init) in the current working directory.
Returns
Includes:
PvResult PvTftpClient::GetProgress ( int64_t &  aCompleted,
int64_t &  aTotal 
)

Returns the transfer progress.

Parameters
[out]aCompletedhow many bytes have been transferred.
[out]aTotalsize of the transfer in bytes.
Returns
Includes:
PvResult PvTftpClient::GetTransferResult ( ) const

Returns the last error message.

Returns
Includes:
PvResult PvTftpClient::GetWarning ( PvString aWarning)

Pops the oldest transfer warning and returns it in aStatus.

Parameters
[in]aWarningthe last warning.
Returns
Includes:
PvResult PvTftpClient::Init ( const PvString aDeviceIPAddress,
const PvString aDeviceFilename 
)

Initializes the client for file transfer.

Parameters
[in]aDeviceIPAddressthe IP address of the device to transfer to/from.
[in]aDeviceFilenamethe name device-side filename written to or read from the device.
Returns
Includes:
PvResult PvTftpClient::SendData ( const uint8_t *  aBuffer,
uint32_t  aBufferLength 
)

Sends data to a device file using TFTP.

Parameters
[in]aBufferpointer to the buffer containing the data to send.
[in]aBufferLengththe size of the buffer, in bytes.
Returns
Includes:
PvResult PvTftpClient::SendFile ( const PvString aHostFilename = "")

Sends a local file to the device using TFTP.

Parameters
[in]aHostFilenameif provided, the name of the local file to write to the device. If not provided, the aDeviceFilename (from Init) from the current working directory is sent to the device.
Returns
Includes:

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

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com