TFTP
Add logger and checks for initialising
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
#ifndef PROJECT_TFTP_H
|
||||
#define PROJECT_TFTP_H
|
||||
#define LOGGER_LEVEL_ALL
|
||||
#include "log.h"
|
||||
#include <tftp_server.h>
|
||||
|
||||
extern struct tftp_context tftpContext_s;
|
||||
|
||||
@@ -4,34 +4,35 @@
|
||||
|
||||
#include "tftp.h"
|
||||
|
||||
void *tftp_open(const char *fname, const char *mode, u8_t write)
|
||||
{
|
||||
static const char* TAG = "tftp_server";
|
||||
|
||||
void *tftp_open(const char *fname, const char *mode, u8_t write) {
|
||||
|
||||
}
|
||||
|
||||
void tftp_close(void *handle)
|
||||
{
|
||||
void tftp_close(void *handle) {
|
||||
|
||||
}
|
||||
int tftp_read(void* handle, void* buf, int bytes)
|
||||
{
|
||||
int tftp_read(void* handle, void* buf, int bytes) {
|
||||
|
||||
}
|
||||
|
||||
int tftp_write(void* handle, struct pbuf* p)
|
||||
{
|
||||
int tftp_write(void* handle, struct pbuf* p) {
|
||||
|
||||
}
|
||||
|
||||
struct tftp_context tftpContext_s =
|
||||
{
|
||||
struct tftp_context tftpContext_s = {
|
||||
tftp_open,
|
||||
tftp_close,
|
||||
tftp_read,
|
||||
tftp_write
|
||||
};
|
||||
|
||||
void tftp_server_init(void)
|
||||
{
|
||||
tftp_init(&tftpContext_s);
|
||||
void tftp_server_init(void) {
|
||||
LOG_INFO(TAG, "Initializing tftp server");
|
||||
if (tftp_init(&tftpContext_s) != ERR_OK) {
|
||||
LOG_FATAL(TAG, "Could not initialize tftp server");
|
||||
return;
|
||||
}
|
||||
LOG_INFO(TAG, "tftp server initialized successfully");
|
||||
}
|
||||
Reference in New Issue
Block a user