Portable interface#
Functions#
Delay ms.
Dump buffer.
FTP get global IP address.
FTP Init.
FTP network is connected.
FTP Close.
TFTP Delay ms.
Define SL_TFTP_DEBUG.
TFTP get global IP address.
TFTP network is connected.
TFTP Close.
Free address.
Get UDP address structure.
TFTP Receive messages on a UDP socket.
TFTP Send a message on a UDP socket.
TFTP udp socket create.
Macros#
FTP debug macro function.
FTP error value.
FTP invalid socket ID.
FTP Localhost string.
TFTP error value (alias)
TFTP invalid socket ID (alias)
TFTP Localhost string (alias)
Function Documentation#
sl_ftp_delay_ms#
void sl_ftp_delay_ms (const uint32_t delay_ms)
Delay ms.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint32_t | N/A | delay_ms | Milliseconds |
Portable function
sl_ftp_dump_buff#
void sl_ftp_dump_buff (const uint8_t *const data_ptr, const uint16_t data_size)
Dump buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t *const | [in] | data_ptr | Data ptr |
const uint16_t | [in] | data_size | Data size |
Util function to dump buffer in hex format
sl_ftp_get_global_addr#
const char * sl_ftp_get_global_addr (void )
FTP get global IP address.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Portable function Returns
Global address string representation
sl_ftp_init#
void sl_ftp_init (void )
FTP Init.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Initialize FTP service
sl_ftp_is_network_connected#
bool sl_ftp_is_network_connected (void )
FTP network is connected.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Portable function Returns
true if network is connected, otherwise false
sl_ftp_socket_close#
int32_t sl_ftp_socket_close (int32_t sockid)
FTP Close.
Type | Direction | Argument Name | Description |
---|---|---|---|
int32_t | N/A | sockid | Socket ID |
Portable function Returns
int32_t Closed socket ID on success, -1 on error
sl_tftp_delay_ms#
__STATIC_INLINE void sl_tftp_delay_ms (const uint32_t delay_ms)
TFTP Delay ms.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint32_t | N/A | delay_ms | Milliseconds |
Alias function
sl_tftp_dump_buff#
__STATIC_INLINE void sl_tftp_dump_buff (const uint8_t *const data_ptr, const uint16_t data_size)
Define SL_TFTP_DEBUG.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t *const | [in] | data_ptr | Data ptr |
const uint16_t | [in] | data_size | Data size |
TFTP Dump buffer
Alias function
sl_tftp_get_global_addr#
__STATIC_INLINE const char * sl_tftp_get_global_addr (void )
TFTP get global IP address.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Portable function Returns
Global address string representation
sl_tftp_is_network_connected#
__STATIC_INLINE bool sl_tftp_is_network_connected (void )
TFTP network is connected.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Alias function Returns
true if network is connected, otherwise false
sl_tftp_socket_close#
__STATIC_INLINE int32_t sl_tftp_socket_close (int32_t sockid)
TFTP Close.
Type | Direction | Argument Name | Description |
---|---|---|---|
int32_t | N/A | sockid | Socket ID |
Alias function Returns
int32_t Closed socket ID on success, -1 on error
sl_tftp_udp_free_addr#
void sl_tftp_udp_free_addr (void * addr)
Free address.
Type | Direction | Argument Name | Description |
---|---|---|---|
void * | [in] | addr | Address structure |
Release the allocated address strcutre
sl_tftp_udp_get_addr#
void * sl_tftp_udp_get_addr (const char * host, uint16_t port)
Get UDP address structure.
Type | Direction | Argument Name | Description |
---|---|---|---|
const char * | [in] | host | Host string |
uint16_t | [in] | port | Port |
Allocate address structue and set host address and port Returns
void * Address structure
sl_tftp_udp_recvfrom#
int32_t sl_tftp_udp_recvfrom (int32_t sockid, void * buff, uint32_t len, void * src_addr)
TFTP Receive messages on a UDP socket.
Type | Direction | Argument Name | Description |
---|---|---|---|
int32_t | [in] | sockid | socket id |
void * | [out] | buff | destination buffer ptr |
uint32_t | [in] | len | length of data to read |
void * | [out] | src_addr | Source address |
Receives data on a socket whether or not it is connection-oriented. Returns
return the number of bytes received, or -1 if an error occurred
sl_tftp_udp_sendto#
int32_t sl_tftp_udp_sendto (int32_t sockid, const void * buff, uint32_t len, const void * dest_addr)
TFTP Send a message on a UDP socket.
Type | Direction | Argument Name | Description |
---|---|---|---|
int32_t | [in] | sockid | socket ID |
const void * | [in] | buff | buffer pointer to send |
uint32_t | [in] | len | length of data to send |
const void * | [in] | dest_addr | destination address ptr, the structure must be prepared for UDP sockets |
Preferred in datagram mode (UDP). Returns
On success, these calls return the number of bytes sent. On error, -1 is returned
sl_tftp_udp_socket_create#
int32_t sl_tftp_udp_socket_create (void )
TFTP udp socket create.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Portable function Returns
int32_t Socket ID