88d2f1d0fc
基本完成数据打包(指定文件) TCPclient 连接失败暂未定位
74 lines
1.5 KiB
C
74 lines
1.5 KiB
C
|
|
|
|
#include <rtthread.h>
|
|
#define LOG_TAG "tool"
|
|
#define LOG_LVL LOG_LVL_DBG
|
|
#include <ulog.h>
|
|
//#include <cJSON.h>
|
|
#include <dfs_file.h>
|
|
#include <usrcfg.h>
|
|
|
|
|
|
/**
|
|
* 以HEX显示文件内容
|
|
*/
|
|
void hex()
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* 更新全局参数
|
|
*/
|
|
void updatecfg(void)
|
|
{
|
|
//因为不知原因,采用事件集独立更新配置出错
|
|
//独立响应单个参数更新事件,程序上更复杂也没特别必要
|
|
//现采用事件通知、统一全部重新加载
|
|
|
|
|
|
|
|
}
|
|
|
|
void sDemo()
|
|
{
|
|
// extern struct rt_event sw_check;//软件条件
|
|
// rt_event_send(&sw_check, FILE_IS_OK);
|
|
void upSWflag(void);
|
|
upSWflag();
|
|
}
|
|
|
|
MSH_CMD_EXPORT(sDemo,swTest);
|
|
|
|
static struct rt_thread infoTT_thread;
|
|
void ttinfoInit()
|
|
{
|
|
static CFG cfg;
|
|
memset(&cfg, 0, sizeof(CFG));
|
|
|
|
cfg.s = 1;
|
|
cfg.cnt = 10; //避免通信异常
|
|
extern void getTTinfo_thread_entry(void* parameter);
|
|
// extern void getTTinfo_thread_entry(void* parameter);
|
|
// struct rt_thread infoTT_thread;
|
|
ALIGN(RT_ALIGN_SIZE)
|
|
static char thread2_stack[1024 * 3];
|
|
rt_thread_init(&infoTT_thread, "getTT", getTTinfo_thread_entry, (void *) &cfg, &thread2_stack[0],
|
|
sizeof(thread2_stack), 25, 10);
|
|
// rt_thread_startup(&infoTT_thread);
|
|
}
|
|
|
|
void startTTinfo(void)
|
|
{
|
|
if (&infoTT_thread == RT_NULL) {
|
|
//to Init
|
|
}
|
|
if ((infoTT_thread.stat & RT_THREAD_STAT_MASK) == RT_THREAD_INIT) {
|
|
|
|
}
|
|
rt_thread_startup(&infoTT_thread);
|
|
}
|
|
//MSH_CMD_EXPORT(ttinfoInit,init ttinfo);
|
|
//INIT_COMPONENT_EXPORT(ttinfoInit);
|
|
|