![]() |
Network Component
Version 7.1
MDK Middleware for IPv4 and IPv6 Networking
|
Functions to work with the TFTP server. More...
Functions | |
netStatus | netTFTPs_Start (void) |
Start the TFTP server. [thread-safe]. | |
netStatus | netTFTPs_Stop (void) |
Stop the TFTP server. [thread-safe]. | |
bool | netTFTPs_Running (void) |
Check if the TFTP server is running. [thread-safe]. | |
uint16_t | netTFTPs_GetPort (void) |
Get port number of the TFTP server. [thread-safe]. | |
netStatus | netTFTPs_SetPort (uint16_t port) |
Set port number of the TFTP server. [thread-safe]. | |
Functions to work with the TFTP server.
Like all services, the TFTP server is normally started automatically if NET_START_SERVICE
is set to 1 in the Net_Config.c configuration file. If it is disabled, the TFTP server needs to be started manually in the user application using netTFTPs_Start. At runtime, it is always possible to stop the TFTP server using the function netTFTPs_Stop. The user application can check for a running server using the netTFTPs_Running function.
To change the port of the TFTP server at runtime, first call netTFTPs_Stop (if the server is running) and then use the netTFTPs_SetPort function. Afterwards, the TFTP server needs to be (re-)started by the application calling netTFTPs_Start.
Code Example
uint16_t netTFTPs_GetPort | ( | void | ) |
Get port number of the TFTP server. [thread-safe].
The function netTFTPs_GetPort returns the port that is used for the TFTP server.
Code Example
bool netTFTPs_Running | ( | void | ) |
Check if the TFTP server is running. [thread-safe].
The function netTFTPs_Running checks whether the TFTP server is running. It returns true if the server is up and running.
Code Example (see netTFTPs_SetPort)
netStatus netTFTPs_SetPort | ( | uint16_t | port | ) |
Set port number of the TFTP server. [thread-safe].
[in] | port | port number. |
The function netTFTPs_SetPort sets the port that is to be used for the TFTP server. The TFTP server must not run while setting the port. If required, stop it first using netTFTPs_Stop.
The argument port specifies the port number to be used.
Code Example
netStatus netTFTPs_Start | ( | void | ) |
Start the TFTP server. [thread-safe].
The function netTFTPs_Start starts the TFTP server at runtime. It can be stopped again using netTFTPs_Stop.
NET_START_SERVICE
to 1 in Net_Config.c, all selected services will be started automatically. Thus, you only need to call this function, if you have either stopped the TFTP server previously using netTFTPs_Stop or have set NET_START_SERVICE
to 0.Code Example (see netTFTPs_SetPort)
netStatus netTFTPs_Stop | ( | void | ) |
Stop the TFTP server. [thread-safe].
The function netTFTPs_Stop stops the TFTP server at runtime. It can be restarted using netTFTPs_Start.
Code Example (see netTFTPs_SetPort)