Class PvTftpClient
Client used to transfer files over TFTP to and from Pleora devices.
Implements
Inherited Members
Namespace: eBUSDotNet
Assembly: eBUSDotNet.dll
Syntax
public class PvTftpClient : IDisposable
Constructors
View SourcePvTftpClient()
Constructor.
Declaration
public PvTftpClient()
Fields
View SourceswigCMemOwn
Determines who is responsible for deleting the underlying C++ object.
Declaration
protected bool swigCMemOwn
Field Value
| Type | Description |
|---|---|
| bool |
Properties
View SourceTransferResult
Gets the result of the most recent TFTP transfer.
Declaration
public PvResult TransferResult { get; }
Property Value
| Type | Description |
|---|---|
| PvResult |
Methods
View SourceAbort()
Aborts the current TFTP transfer operation.
Declaration
public PvResult Abort()
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, or an error code on failure. |
Dispose()
Dispose.
Declaration
public void Dispose()
Dispose(bool)
Dispose
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
~PvTftpClient()
Destructor.
Declaration
protected ~PvTftpClient()
GetData(SWIGTYPE_p_unsigned_char, uint, out uint)
Gets data from a device file using TFTP.
Declaration
public PvResult GetData(SWIGTYPE_p_unsigned_char aBuffer, uint aBufferLength, out uint aBytesRead)
Parameters
| Type | Name | Description |
|---|---|---|
| SWIGTYPE_p_unsigned_char | aBuffer | Pointer to the buffer where the data is written. |
| uint | aBufferLength | The size of the buffer in bytes. |
| uint | aBytesRead | Output, the number of bytes read from the device file into aBuffer in bytes. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes: - #PvResult::Code::OK - #PvResult::Code::INVALID_PARAMETER if the buffer parameters are invalid - #PvResult::Code::STATE_ERROR if a transfer is already in progress - #PvResult::Code::NOT_INITIALIZED if Init has not been called |
GetFile()
Retrieves a file from the device using TFTP.
Declaration
public PvResult GetFile()
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, or an error code on failure. |
GetFile(string)
Retrieves a file from the device and saves it to the specified path.
Declaration
public PvResult GetFile(string aHostFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aHostFilename | The path where the file will be saved on the host. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, or an error code on failure. |
GetProgress(out long, out long)
Gets the progress of the current TFTP transfer.
Declaration
public PvResult GetProgress(out long aCompleted, out long aTotal)
Parameters
| Type | Name | Description |
|---|---|---|
| long | aCompleted | Output parameter to receive bytes completed. |
| long | aTotal | Output parameter to receive total bytes. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, or an error code on failure. |
GetWarning(out string)
Gets any warning message from the last TFTP operation.
Declaration
public PvResult GetWarning(out string aWarning)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aWarning | Output parameter to receive the warning message. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK if there is a warning, error code otherwise. |
Init(string, string)
Initializes the TFTP client with device connection parameters.
Declaration
public PvResult Init(string aDeviceIPAddress, string aDeviceFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDeviceIPAddress | The IP address of the device. |
| string | aDeviceFilename | The filename on the device. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, or an error code on failure. |
SendData(SWIGTYPE_p_unsigned_char, uint)
Sends data to a device file using TFTP.
Declaration
public PvResult SendData(SWIGTYPE_p_unsigned_char aBuffer, uint aBufferLength)
Parameters
| Type | Name | Description |
|---|---|---|
| SWIGTYPE_p_unsigned_char | aBuffer | Pointer to the buffer containing the data to send. |
| uint | aBufferLength | The size of the buffer in bytes. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes: - #PvResult::Code::OK - #PvResult::Code::INVALID_PARAMETER if the buffer and buffer length are invalid - #PvResult::Code::STATE_ERROR if a transfer is already in progress - #PvResult::Code::NOT_INITIALIZED if Init has not been called |
SendFile()
Sends a file to the device using TFTP.
Declaration
public PvResult SendFile()
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, or an error code on failure. |
SendFile(string)
Sends a file from the specified host path to the device.
Declaration
public PvResult SendFile(string aHostFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aHostFilename | The path of the file to send from the host. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, or an error code on failure. |