Embedded TCP/IP stack
4.7.0
|
typedef fnet_int32_t(* fnet_tftp_srv_data_handler_t) (fnet_tftp_request_t request, fnet_uint8_t *data, fnet_size_t data_size, fnet_tftp_error_t *error_code, fnet_char_t **error_message, void *handler_param) |
Prototype of the TFTP-server callback function prototype that is called when the TFTP server has received a new data packet (request_type
equals to FNET_TFTP_REQUEST_WRITE). This callback function is also called when the TFTP server is ready to send a new data packet to the TFTP client (request_type
equals to FNET_TFTP_REQUEST_READ).
request_type | Request type (read or write) defined by fnet_tftp_request_t. |
data | Pointer to the data buffer which content defined by request_type:
|
data_size | Size of the buffer pointed by the data parameter, in bytes.
|
error_code | Pointer to the error code that will be sent to the remote TFTP client. Changing of this parameter is optional, by default the error code is set to FNET_TFTP_ERROR_NOT_DEFINED. This parameter is used only when this callback function returns FNET_ERR. |
error_message | Pointer to a null-terminated error message string. Changing of this parameter is optional, by default the error string is set to "Not defined". This parameter is used only when this callback function returns FNET_ERR. |
handler_param | User-application specific parameter. It's set during the TFTP-server service initialization as part of fnet_tftp_srv_params_t. |
request_type
equals to FNET_TFTP_REQUEST_WRITE,request_type
equals to FNET_TFTP_REQUEST_READ, data
. If this number is less than FNET_TFTP_DATA_SIZE_MAX, it will mean that this data packet is the last one.Definition at line 145 of file fnet_tftp_srv.h.