Files
JBao_Heat_Pad_FW/apps/usr_app/app_th_scan.h
T

46 lines
1.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/******************************************************************************
* @file app_th_scan.h
* @brief CBR1 断连温湿度扫描(规格书第 8 章):500ms 重连广播 ↔ 500ms 扫描
* @author cyWu <1917507415@qq.com>
* @date 2026.09.07
* @version V1.1.6
* @history
* - V1.1.6, 2026.09.07, cyWu, 扫描上报只留 GAP 0xE2(杰理包装后的 adv_report_t
* - V1.0.0, 2026.09.04, cyWu, P2 完整实现
*
* @note 只在「断连 + 已配对 + 非配对/OTA 流程 + 联动配置有效(缸体≠0)」
* 时进入 500ms 交替:偶拍重连广播 / 奇拍扫描。匹配规则(8.1):
* 名字 == "JBao-"+本机 DP8 缸体号(uint16 十进制)+ 配置版本相等
* → temp_x10 = int8℃×10;湿度只打日志不参与开停。
* 名字/版本不对或解析失败 → 当没收到,保持上一温度与上一加热态。
******************************************************************************/
#ifndef __APP_TH_SCAN_H__
#define __APP_TH_SCAN_H__
#include <stdint.h>
/**
* @brief 初始化扫描模块
* @return 无
*/
void app_th_scan_init(void);
/**
* @brief 500ms 任务上下文:满足条件时重连广播/扫描各占一拍交替
* @return 无
*/
void app_th_scan_tick(void);
/**
* @brief GAP 扫描上报(栈线程)
* @note 杰理把扫描结果包成 GAP_EVENT_ADVERTISING_REPORT(0xE2)
* packet[2] 起为 adv_report_t。与 wireless_mic 中央示例同一布局。
* @param packet HCI 事件包
* @param size 事件包长度
* @return 无
*/
void app_th_scan_report_event(uint8_t *packet, uint16_t size);
#endif /* __APP_TH_SCAN_H__ */