nRF5 IoT SDK  v0.9.0
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
TFTP Application Interface for Nordic's IPv6 stack

Trivial File Transfer Protocol module provides implementation of TFTP Client. More...

Data Structures

struct  iot_tftp_evt_err_t
 TFTP error event structure. More...
 
struct  iot_tftp_evt_param_t
 TFTP event structure. More...
 
struct  iot_tftp_evt_t
 Asynchronous event type. More...
 
struct  iot_tftp_trans_params_t
 TFTP Transmission initialization structure (both GET and PUT). More...
 
struct  iot_tftp_init_t
 TFTP initialization structure. More...
 

Typedefs

typedef uint32_t iot_tftp_t
 TFTP global instance number.
 
typedef void(* iot_tftp_callback_t )(iot_tftp_t *p_tftp, iot_tftp_evt_t *p_evt)
 User callback from TFTP module. More...
 

Enumerations

enum  iot_tftp_evt_id_t {
  IOT_TFTP_EVT_ERROR,
  IOT_TFTP_EVT_TRANSFER_GET_COMPLETE,
  IOT_TFTP_EVT_TRANSFER_PUT_COMPLETE
}
 TFTP module Events. More...
 

Functions

uint32_t iot_tftp_init (iot_tftp_t *p_tftp, iot_tftp_init_t *p_init_params)
 Initializes TFTP client. More...
 
uint32_t iot_tftp_set_params (iot_tftp_t *p_tftp, iot_tftp_trans_params_t *p_params)
 Function used in order to change initial connection parameters. More...
 
uint32_t iot_tftp_get (iot_tftp_t *p_tftp, iot_file_t *p_file)
 Retrieves file from remote server into p_file. More...
 
uint32_t iot_tftp_put (iot_tftp_t *p_tftp, iot_file_t *p_file)
 Sends local file p_file to a remote server. More...
 
uint32_t iot_tftp_hold (iot_tftp_t *p_tftp)
 Holds transmission of ACK (use in order to slow transmission). More...
 
uint32_t iot_tftp_resume (iot_tftp_t *p_tftp)
 Resumes transmission. More...
 
uint32_t iot_tftp_abort (iot_tftp_t *p_tftp)
 Resets TFTP client instance, so it is possible to make another request after error. More...
 
uint32_t iot_tftp_uninit (iot_tftp_t *p_tftp)
 Frees assigned sockets. More...
 
void iot_tftp_timeout_process (iot_timer_time_in_ms_t wall_clock_value)
 Function for performing retransmissions of TFTP acknowledgements. More...
 

Detailed Description

Trivial File Transfer Protocol module provides implementation of TFTP Client.

Typedef Documentation

typedef void(* iot_tftp_callback_t)(iot_tftp_t *p_tftp, iot_tftp_evt_t *p_evt)

User callback from TFTP module.

Note
TFTP module user callback will be invoked even if user asks TFTP to abort (TFTP error event).
Parameters
[in]p_tftpPointer to the TFTP instance.
[in]p_evtPointer to the TFTP event structure, describing reason.
Return values
None.

Enumeration Type Documentation

TFTP module Events.

Enumerator
IOT_TFTP_EVT_ERROR 

Event code indicating that en error occurred.

IOT_TFTP_EVT_TRANSFER_GET_COMPLETE 

Event code indicating that transfer read was completed.

IOT_TFTP_EVT_TRANSFER_PUT_COMPLETE 

Event code indicating that transfer write was completed.

Function Documentation

uint32_t iot_tftp_abort ( iot_tftp_t p_tftp)

Resets TFTP client instance, so it is possible to make another request after error.

Parameters
[in]p_tftpPointer to the TFTP instance.
Return values
NRF_SUCCESSon successful execution of procedure, else an error code indicating reason for failure.
uint32_t iot_tftp_get ( iot_tftp_t p_tftp,
iot_file_t p_file 
)

Retrieves file from remote server into p_file.

Parameters
[in]p_tftpPointer to the TFTP instance.
[in]p_fileReference to the file from which data should be read. Should not be NULL.
Return values
NRF_SUCCESSon successful execution of procedure, else an error code indicating reason for failure.
uint32_t iot_tftp_hold ( iot_tftp_t p_tftp)

Holds transmission of ACK (use in order to slow transmission).

Parameters
[in]p_tftpPointer to the TFTP instance.
Return values
NRF_SUCCESSon successful execution of procedure, else an error code indicating reason for failure.
uint32_t iot_tftp_init ( iot_tftp_t p_tftp,
iot_tftp_init_t p_init_params 
)

Initializes TFTP client.

Parameters
[in]p_tftpPointer to the TFTP instance. Should not be NULL.
[in]p_init_paramsInitialization structure for TFTP client. Should not be NULL.
Return values
NRF_SUCCESSon successful execution of procedure, else an error code indicating reason for failure.
uint32_t iot_tftp_put ( iot_tftp_t p_tftp,
iot_file_t p_file 
)

Sends local file p_file to a remote server.

Parameters
[in]p_tftpPointer to the TFTP instance.
[in]p_fileReference to the file to which data should be stored. Should not be NULL.
Return values
NRF_SUCCESSon successful execution of procedure, else an error code indicating reason for failure.
uint32_t iot_tftp_resume ( iot_tftp_t p_tftp)

Resumes transmission.

Parameters
[in]p_tftpPointer to the TFTP instance.
Return values
NRF_SUCCESSon successful execution of procedure, else an error code indicating reason for failure.
uint32_t iot_tftp_set_params ( iot_tftp_t p_tftp,
iot_tftp_trans_params_t p_params 
)

Function used in order to change initial connection parameters.

Parameters
[in]p_tftpReference to the TFTP instance.
[in]p_paramsPointer to transmission parameters structure. Should not be NULL.
Return values
NRF_SUCCESSif parameters successfully set, else an error code indicating reason for failure.
void iot_tftp_timeout_process ( iot_timer_time_in_ms_t  wall_clock_value)

Function for performing retransmissions of TFTP acknowledgements.

Note
TFTP module implements the retransmission mechanism by invoking this function periodically. So that method has to be added to IoT Timer client list and has to be called with minimum of TFTP_RETRANSMISSION_INTERVAL resolution.
Parameters
[in]wall_clock_valueThe value of the wall clock that triggered the callback.
Return values
None.
uint32_t iot_tftp_uninit ( iot_tftp_t p_tftp)

Frees assigned sockets.

Parameters
[in]p_tftpPointer to the TFTP instance.
Return values
NRF_SUCCESSon successful execution of procedure, else an error code indicating reason for failure.