2023-05-30 08:53:31 +00:00
|
|
|
/*
|
|
|
|
* 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>
|
2023-06-06 07:45:13 +00:00
|
|
|
|
|
|
|
|
2023-08-27 04:31:54 +00:00
|
|
|
#define LJW_CFG_FILE_NAME "/cfg.ini"
|
|
|
|
#define FILE_TO_SEND "/sd/tosend.ini"//避免读写出错造成系统配置文件丢失
|
2023-05-30 08:53:31 +00:00
|
|
|
|
2023-06-01 02:23:08 +00:00
|
|
|
#define CFGCHANGEED 1
|
|
|
|
#define SENDINTERVAL 1<<1
|
|
|
|
#define MAXSIZEPERFILE 1<<2
|
|
|
|
#define COMPRESSTYPE 1<<3
|
|
|
|
#define ENCRYTTYPE 1<<4
|
|
|
|
|
2023-06-01 09:10:00 +00:00
|
|
|
|
2023-07-29 08:08:15 +00:00
|
|
|
#define MAX_KEY_LEN 60
|
2023-08-23 03:02:26 +00:00
|
|
|
#define SECTION_TO_SEND "tosend"//待发送文件清单列表
|
|
|
|
#define SECTION_LST_FILE "lstfile"//最后缓存的文件名称
|
2023-06-01 09:10:00 +00:00
|
|
|
|
2023-08-01 08:27:21 +00:00
|
|
|
//typedef struct
|
|
|
|
//{
|
|
|
|
// char fname[60];
|
|
|
|
// uint8_t index;
|
|
|
|
//}FILE_INFO;
|
2023-06-01 09:10:00 +00:00
|
|
|
|
2023-05-30 08:53:31 +00:00
|
|
|
int get_cfg(const char *k);
|
2023-08-03 03:04:50 +00:00
|
|
|
//int set_cfg(const char *k, const char*v);
|
|
|
|
int set_cfg(const char *k, long v);
|
2023-06-01 02:23:08 +00:00
|
|
|
int add_val(const char *k);
|
2023-06-02 02:23:26 +00:00
|
|
|
long get_val(const char *k);
|
|
|
|
int set_val(const char *k, long v);
|
2023-06-01 09:10:00 +00:00
|
|
|
|
2023-08-24 03:06:44 +00:00
|
|
|
//int setFileToSend(const char *f, int v);
|
2023-08-08 06:31:16 +00:00
|
|
|
size_t getFilesToSend(char (*kstr)[MAX_KEY_LEN], int *v);
|
2023-06-01 09:10:00 +00:00
|
|
|
int clearFileToSend(const char *k);
|