Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Data Structures | |
struct | tftp_data_param |
Parameters for data event. More... | |
struct | tftp_error_param |
Parameters for error event. More... | |
union | tftp_evt_param |
Defines event parameters notified along with asynchronous events to the application. More... | |
struct | tftp_evt |
Defines TFTP asynchronous event notified to the application. More... | |
struct | tftpc |
TFTP client definition to maintain information relevant to the client. More... | |
Macros | |
#define | TFTP_BLOCK_SIZE 512 |
RFC1350: the file is sent in fixed length blocks of 512 bytes. | |
#define | TFTP_HEADER_SIZE 4 |
RFC1350: For non-request TFTP message, the header contains 2-byte operation code plus 2-byte block number or error code. | |
#define | TFTPC_MAX_BUF_SIZE (TFTP_BLOCK_SIZE + TFTP_HEADER_SIZE) |
Maximum amount of data that can be sent or received. | |
Typedefs | |
typedef void(* | tftp_callback_t) (const struct tftp_evt *evt) |
TFTP event notification callback registered by the application. | |
Enumerations | |
enum | tftp_evt_type { TFTP_EVT_DATA , TFTP_EVT_ERROR } |
TFTP Asynchronous Events notified to the application from the module through the callback registered by the application. More... | |
Functions | |
int | tftp_get (struct tftpc *client, const char *remote_file, const char *mode) |
This function gets data from a "file" on the remote server. | |
int | tftp_put (struct tftpc *client, const char *remote_file, const char *mode, const uint8_t *user_buf, uint32_t user_buf_size) |
This function puts data to a "file" on the remote server. | |
TFTP client error codes. | |
#define | TFTPC_SUCCESS 0 |
Success. | |
#define | TFTPC_DUPLICATE_DATA -1 |
Duplicate data received. | |
#define | TFTPC_BUFFER_OVERFLOW -2 |
User buffer is too small. | |
#define | TFTPC_UNKNOWN_FAILURE -3 |
Unknown failure. | |
#define | TFTPC_REMOTE_ERROR -4 |
Remote server error. | |
#define | TFTPC_RETRIES_EXHAUSTED -5 |
Retries exhausted. | |
#define TFTP_BLOCK_SIZE 512 |
#include <zephyr/net/tftp.h>
RFC1350: the file is sent in fixed length blocks of 512 bytes.
Each data packet contains one block of data, and must be acknowledged by an acknowledgment packet before the next packet can be sent. A data packet of less than 512 bytes signals termination of a transfer.
#define TFTP_HEADER_SIZE 4 |
#include <zephyr/net/tftp.h>
RFC1350: For non-request TFTP message, the header contains 2-byte operation code plus 2-byte block number or error code.
#define TFTPC_BUFFER_OVERFLOW -2 |
#include <zephyr/net/tftp.h>
User buffer is too small.
#define TFTPC_DUPLICATE_DATA -1 |
#include <zephyr/net/tftp.h>
Duplicate data received.
#define TFTPC_MAX_BUF_SIZE (TFTP_BLOCK_SIZE + TFTP_HEADER_SIZE) |
#include <zephyr/net/tftp.h>
Maximum amount of data that can be sent or received.
#define TFTPC_REMOTE_ERROR -4 |
#include <zephyr/net/tftp.h>
Remote server error.
#define TFTPC_RETRIES_EXHAUSTED -5 |
#include <zephyr/net/tftp.h>
Retries exhausted.
#define TFTPC_SUCCESS 0 |
#include <zephyr/net/tftp.h>
Success.
#define TFTPC_UNKNOWN_FAILURE -3 |
#include <zephyr/net/tftp.h>
Unknown failure.
typedef void(* tftp_callback_t) (const struct tftp_evt *evt) |
#include <zephyr/net/tftp.h>
TFTP event notification callback registered by the application.
[in] | evt | Event description along with result and associated parameters (if any). |
enum tftp_evt_type |
#include <zephyr/net/tftp.h>
TFTP Asynchronous Events notified to the application from the module through the callback registered by the application.
int tftp_get | ( | struct tftpc * | client, |
const char * | remote_file, | ||
const char * | mode ) |
#include <zephyr/net/tftp.h>
This function gets data from a "file" on the remote server.
client | Client information of type tftpc. |
remote_file | Name of the remote file to get. |
mode | TFTP Client "mode" setting. |
The | size of data being received if the operation completed successfully. |
TFTPC_BUFFER_OVERFLOW | if the file is larger than the user buffer. |
TFTPC_REMOTE_ERROR | if the server failed to process our request. |
TFTPC_RETRIES_EXHAUSTED | if the client timed out waiting for server. |
-EINVAL | if client is NULL. |
client
structure must be ensured until the function returns. int tftp_put | ( | struct tftpc * | client, |
const char * | remote_file, | ||
const char * | mode, | ||
const uint8_t * | user_buf, | ||
uint32_t | user_buf_size ) |
#include <zephyr/net/tftp.h>
This function puts data to a "file" on the remote server.
client | Client information of type tftpc. |
remote_file | Name of the remote file to put. |
mode | TFTP Client "mode" setting. |
user_buf | Data buffer containing the data to put. |
user_buf_size | Length of the data to put. |
The | size of data being sent if the operation completed successfully. |
TFTPC_REMOTE_ERROR | if the server failed to process our request. |
TFTPC_RETRIES_EXHAUSTED | if the client timed out waiting for server. |
-EINVAL | if client or user_buf is NULL or if user_buf_size is zero. |
client
structure must be ensured until the function returns.