TFTP
Format
This commit is contained in:
@@ -7,10 +7,10 @@
|
|||||||
#ifndef PROJECT_TFTP_H
|
#ifndef PROJECT_TFTP_H
|
||||||
#define PROJECT_TFTP_H
|
#define PROJECT_TFTP_H
|
||||||
#define LOGGER_LEVEL_ALL
|
#define LOGGER_LEVEL_ALL
|
||||||
#include "log.h"
|
|
||||||
#include <tftp_server.h>
|
#include <tftp_server.h>
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
extern struct tftp_context tftpContext_s;
|
extern struct tftp_context tftpContext_s;
|
||||||
|
|
||||||
void tftp_server_init(void);
|
void tftp_server_init(void);
|
||||||
#endif //PROJECT_TFTP_H
|
#endif // PROJECT_TFTP_H
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
static const char* TAG = "tftp_server";
|
static const char* TAG = "tftp_server";
|
||||||
|
|
||||||
void *tftp_open(const char *fname, const char *mode, u8_t write) {
|
void* tftp_open(const char* fname, const char* mode, u8_t write) {
|
||||||
LOG_INFO(TAG, "Opening %s", fname);
|
LOG_INFO(TAG, "Opening %s", fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tftp_close(void *handle) {
|
void tftp_close(void* handle) {
|
||||||
LOG_INFO(TAG, "closing file");
|
LOG_INFO(TAG, "closing file");
|
||||||
}
|
}
|
||||||
int tftp_read(void* handle, void* buf, int bytes) {
|
int tftp_read(void* handle, void* buf, int bytes) {
|
||||||
@@ -23,12 +23,7 @@ int tftp_write(void* handle, struct pbuf* p) {
|
|||||||
LOG_INFO(TAG, "Writing file");
|
LOG_INFO(TAG, "Writing file");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tftp_context tftpContext_s = {
|
struct tftp_context tftpContext_s = {.open = tftp_open, .close = tftp_close, .read = tftp_read, .write = tftp_write};
|
||||||
.open = tftp_open,
|
|
||||||
.close = tftp_close,
|
|
||||||
.read = tftp_read,
|
|
||||||
.write = tftp_write
|
|
||||||
};
|
|
||||||
|
|
||||||
void tftp_server_init(void) {
|
void tftp_server_init(void) {
|
||||||
LOG_INFO(TAG, "Initializing tftp server");
|
LOG_INFO(TAG, "Initializing tftp server");
|
||||||
|
|||||||
Reference in New Issue
Block a user