TuyaOS
成员变量
tftp_context结构体 参考

#include <tftp_server.h>

成员变量

void(* close )(void *handle)
 
void *(* open )(const char *fname, const char *mode, u8_t write)
 
int(* read )(void *handle, void *buf, int bytes)
 
int(* write )(void *handle, struct pbuf *p)
 

详细描述

TFTP context containing callback functions for TFTP transfers

结构体成员变量说明

◆ close

void(* tftp_context::close) (void *handle)

Close file handle

参数
handleFile handle returned by open()

◆ open

void *(* tftp_context::open) (const char *fname, const char *mode, u8_t write)

Open file for read/write.

参数
fnameFilename
modeMode string from TFTP RFC 1350 (netascii, octet, mail)
writeFlag indicating read (0) or write (!= 0) access
返回
File handle supplied to other functions

◆ read

int(* tftp_context::read) (void *handle, void *buf, int bytes)

Read from file

参数
handleFile handle returned by open()
bufTarget buffer to copy read data to
bytesNumber of bytes to copy to buf
返回
>= 0: Success; < 0: Error

◆ write

int(* tftp_context::write) (void *handle, struct pbuf *p)

Write to file

参数
handleFile handle returned by open()
pbufPBUF adjusted such that payload pointer points to the beginning of write data. In other words, TFTP headers are stripped off.
返回
>= 0: Success; < 0: Error

该结构体的文档由以下文件生成: