TT12-MCU/applications/demo.c
murmur 88d2f1d0fc 基本完成规则框架
基本完成数据打包(指定文件)
TCPclient 连接失败暂未定位
2023-06-06 15:45:13 +08:00

63 lines
1.7 KiB
C

/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2023-05-18 murmur the first version
*/
#include <rtthread.h>
#define LOG_TAG "demo"
#define LOG_LVL LOG_LVL_DBG
#include <ulog.h>
#include <cJSON.h>
#include <dfs_file.h>
#include <usrcfg.h>
//void getcfg(void)
//{
//// extern struct rt_messagequeue update_cfg;
// extern struct rt_event update_cfg;
// CFG_MSG msg;
// pwTT_thread_entry("1");
// while (1)
// {
//
//
//// rt_memset(&msg, 0, sizeof(msg));
//// /* 从消息队列中读取消息*/
//// rt_err_t result = rt_mq_recv(&update_cfg, &msg, sizeof(msg), RT_WAITING_NO);
//// if (result == RT_EOK)
//// {
//// LOG_I("updatecfg:%10s -->%s", msg.key, msg.value);
//// }
// rt_uint32_t e;
// rt_err_t result = rt_event_recv(&update_cfg, CFGCHANGEED|COMPRESSTYPE, RT_EVENT_FLAG_OR|RT_EVENT_FLAG_CLEAR, RT_WAITING_NO, &e);
// if (result == RT_EOK)
// {
// LOG_I("updatecfg");
// }
// rt_thread_delay(100);
// }
//}
//void mpcfg()
//{
///* 创建线程 */
// rt_thread_t thread = rt_thread_create("getcfg", getcfg, RT_NULL, 1024 * 2, 20, 10);
// /* 创建成功则启动线程 */
// if (thread != RT_NULL)
// {
// rt_thread_startup(thread);
// // rt_kprintf("done");
// }
// else
// {
// LOG_E("thread 'pmsg' create failure.");
// return RT_ERROR;
// }
//}
/* 导出到自动初始化 */
//INIT_COMPONENT_EXPORT(mpcfg);
//MSH_CMD_EXPORT(mpcfg, 线程消息接收测试);