2025-04-18 18:59:53 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @file FluxProtocol.c
|
|
|
|
|
|
* @brief 流量计通讯协议部分
|
|
|
|
|
|
*
|
|
|
|
|
|
* 用于声明便携制氧机参数
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author wang xiang en
|
|
|
|
|
|
* @date 2025-04-18
|
|
|
|
|
|
* @version 版本号
|
|
|
|
|
|
* @copyright 版权声明((C)2025, YUWELL MEDTECH Co.ltd)
|
|
|
|
|
|
*/
|
2025-03-17 13:46:43 +08:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include "FluxProtocol.h"
|
|
|
|
|
|
|
2025-04-23 08:58:26 +08:00
|
|
|
|
#include "esp_log.h"
|
|
|
|
|
|
|
2025-03-17 13:46:43 +08:00
|
|
|
|
/*记录spirits3的没分钟输出的体积*/
|
|
|
|
|
|
float Spirit3_Volume[4] = { 210,420,630,750};
|
|
|
|
|
|
float Spirit6_Volume[6] = { 210,420,630,840,1050,1200};
|
|
|
|
|
|
float YULite8_Volume[6] = { 210,420,630,840,1050,1200};
|
|
|
|
|
|
|
2025-04-23 09:36:19 +08:00
|
|
|
|
/* 应用 event_homePage 中的测试状态显示变量 */
|
|
|
|
|
|
extern bool is_bs_test_ing;
|
|
|
|
|
|
|
2025-04-23 08:58:26 +08:00
|
|
|
|
/*
|
|
|
|
|
|
* @brief 拼接测试过程中用于展示的字符串
|
|
|
|
|
|
* 1.时间设置发送成功 Time setting sent successfully
|
|
|
|
|
|
* 2.开始测试 start testing
|
|
|
|
|
|
* 3.等待测试结束 Waiting for the end of the test
|
|
|
|
|
|
* 4.当前频率测试结束 The current frequency test has ended
|
|
|
|
|
|
* 5.所有频率测试完毕,请记录。 All frequency tests have been completed, please record.
|
|
|
|
|
|
* 6.设备已启动成功,请开始测试。 Device started successfully, please start testing.
|
|
|
|
|
|
*/
|
|
|
|
|
|
char *test_info[] = {"Time setting sent successfully!!",\
|
|
|
|
|
|
"start testing....",\
|
|
|
|
|
|
"Waiting for the end of the test...",\
|
|
|
|
|
|
"The current frequency test has ended!!",\
|
|
|
|
|
|
"All frequency tests have been completed!!",\
|
|
|
|
|
|
"Device started successfully!!!!"
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* 导出协议数据结构体 */
|
2025-03-17 13:46:43 +08:00
|
|
|
|
struct FluxProtocol fluxProtocol;
|
|
|
|
|
|
|
2025-04-23 08:58:26 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @brief 新建用于进行带BS测试的任务函数
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param[in] arg not used
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
void bs_test_task(void* arg)
|
|
|
|
|
|
{
|
|
|
|
|
|
while(1)
|
|
|
|
|
|
{
|
|
|
|
|
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
|
|
|
|
|
|
|
|
|
|
|
ESP_LOGI("bs_test_task", "bs_test_task");
|
|
|
|
|
|
|
|
|
|
|
|
vTaskDelay(4000 / portTICK_PERIOD_MS);
|
|
|
|
|
|
ESP_LOGI("bs_test_task", "bs_test_task end?");
|
|
|
|
|
|
|
|
|
|
|
|
ESP_LOGI("bs_test_timer_func","hahahahhahah............");
|
|
|
|
|
|
|
|
|
|
|
|
/* 显示测试成功 */
|
|
|
|
|
|
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[3]);
|
|
|
|
|
|
|
|
|
|
|
|
vTaskDelay(4000/portTICK_PERIOD_MS);
|
|
|
|
|
|
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[4]);
|
|
|
|
|
|
|
|
|
|
|
|
vTaskDelay(4000/portTICK_PERIOD_MS);
|
|
|
|
|
|
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[5]);
|
|
|
|
|
|
|
|
|
|
|
|
vTaskDelay(4000/portTICK_PERIOD_MS);
|
|
|
|
|
|
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[1]);
|
|
|
|
|
|
|
|
|
|
|
|
vTaskDelay(4000/portTICK_PERIOD_MS);
|
|
|
|
|
|
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[2]);
|
|
|
|
|
|
|
|
|
|
|
|
ESP_LOGI("bs_test_timer_func","bs_test_timer_func end right");
|
|
|
|
|
|
|
2025-04-23 09:36:19 +08:00
|
|
|
|
/* 任务测试完毕 删除任务 */
|
|
|
|
|
|
lv_label_set_text(ui_pageHome_labelStartTest1,"Start Test BS");
|
|
|
|
|
|
is_bs_test_ing = false;
|
2025-04-23 08:58:26 +08:00
|
|
|
|
vTaskDelete(NULL);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-03-17 13:46:43 +08:00
|
|
|
|
|
2025-04-23 09:36:19 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @brief 测试状态显示线程
|
|
|
|
|
|
*
|
|
|
|
|
|
* 设置一个LED小灯,测试的时候bling bling 闪
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param[in] arg not used
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
void bs_test_led_task(void* arg)
|
|
|
|
|
|
{
|
|
|
|
|
|
while(1)
|
|
|
|
|
|
{
|
|
|
|
|
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
|
|
|
|
|
ESP_LOGI("bs_test_led_task", "bs_test_led_task");
|
|
|
|
|
|
|
|
|
|
|
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
|
|
|
|
|
ESP_LOGI("bs_test_led_task", "bs_test_led_task end?");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|