3a1da4679f
更新etAndSendFile()逻辑 更新getFilesToSend()函数,改为分次读取,避免一次性读取文件列表占用资源过大 chkAndSendFile()改为开机且始终运行 set_cfgs()增加比较,避免重复写入
47 lines
950 B
C
47 lines
950 B
C
/*
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Change Logs:
|
|
* Date Author Notes
|
|
* 2023-05-30 murmur the first version
|
|
*/
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
//typedef struct
|
|
//{
|
|
// char msg[60];
|
|
// uint8_t index;
|
|
//}FILEINFO_MSG;
|
|
|
|
#define CFGCHANGEED 1
|
|
#define SENDINTERVAL 1<<1
|
|
#define MAXSIZEPERFILE 1<<2
|
|
#define COMPRESSTYPE 1<<3
|
|
#define ENCRYTTYPE 1<<4
|
|
|
|
|
|
#define MAX_KEY_LEN 60
|
|
#define SECTION_TO_SEND "tosend"
|
|
#define SECTION_LST_FILE "lstfile"
|
|
|
|
//typedef struct
|
|
//{
|
|
// char fname[60];
|
|
// uint8_t index;
|
|
//}FILE_INFO;
|
|
|
|
int get_cfg(const char *k);
|
|
//int set_cfg(const char *k, const char*v);
|
|
int set_cfg(const char *k, long v);
|
|
int add_val(const char *k);
|
|
long get_val(const char *k);
|
|
int set_val(const char *k, long v);
|
|
|
|
int setFileToSend(const char *f, int v);
|
|
size_t getFilesToSend(char (*kstr)[MAX_KEY_LEN], int *v);
|
|
int clearFileToSend(const char *k);
|