Callisto4Bootloader: include/c4_tftp.h File Reference

Callisto4Bootloader

Functions
c4_tftp.h File Reference

Functions to connect to an TFTP server and download application files and configurations. More...

`#include "c4_error_codes.h"`
`#include <stdint.h>`

Go to the source code of this file.

## Functions

exit_code_t | c4_tftpDownloadText (const uint8_t server[4], const char *name, char *file, uint32_t max_file)
| Use TFTP to download the configuration file. More...
exit_code_t | c4_stack_init (const uint8_t au8MACAddress[6], const uint8_t au8StaticIPAddress[4], const uint8_t au8StaticNetMask[4], const uint8_t au8StaticGateway[4])
| Initialise the IP stack. More...

## Detailed Description

Functions to connect to an TFTP server and download application files and configurations.

Copyright
  2020 Remsdaq Ltd.

Date
  10 Sep 2020

Author
  Dan Smithers dwhs@.nosp@m.rems.nosp@m.daq.c.nosp@m.om

Definition in file c4_tftp.h.

## Function Documentation

## ◆ c4_stack_init()

exit_code_t c4_stack_init | ( | const uint8_t | au8MACAddress[6],
|  | const uint8_t | au8StaticIPAddress[4],
|  | const uint8_t | au8StaticNetMask[4],
|  | const uint8_t | au8StaticGateway[4]
| ) |  |

Initialise the IP stack.

Starts LWIP, TCPIP, IGMP, etc

Definition at line 377 of file c4_tftp.c.

## ◆ c4_tftpDownloadText()

exit_code_t c4_tftpDownloadText | ( | const uint8_t | server[4],
|  | const char * | name,
|  | char * | file,
|  | uint32_t | max_file
| ) |  |

Use TFTP to download the configuration file.

Parameters

  [in] | server | IP Address of TFTP server
  [in] | name | File name
  [out] | file | Character array to receive config file
  [in] | max_file | Maximum length of file allocated.

Returns
  Exit code

Return values

  ERR_OK | Success

The download function determines whether the file is a location in RAM or on QSPI flash.

If the location is in RAM, then the TFTP transfer will be made directly into the memory starting at `file` and `max_file` is the length already allocated at that address. Data will overwrite anything that is already stored in this location.

If the location is in QSPI flash, then `file` specifies the location to receive the data and `max_file` is the extent available. In this case, the region specified by these two parameters will be erased and the data received written block-by-block.

Definition at line 266 of file c4_tftp.c.