76 lines
2.0 KiB
C
76 lines
2.0 KiB
C
/******************************************************************************
|
||
* @file usr_le_api.h
|
||
* @brief usr_le_code 静态库对外应用 API(配网 / 配对 / OTA)
|
||
* @author cyWu <1917507415@qq.com>
|
||
* @date 2026.08.03
|
||
* @version V1.0.1
|
||
* @history
|
||
* - V1.0.0, 2026.08.03, cyWu, 首次发布
|
||
* - V1.0.1, 2026.08.19, cyWu, 收敛公开 API,移除 BLE 栈钩子声明
|
||
*
|
||
* @note usr_ble_adv_init / usr_le_data_recieve 为 BLE/RCSP 协议栈链接钩子,
|
||
* 由库内部实现并导出符号,不作为应用层公开接口。
|
||
******************************************************************************/
|
||
|
||
#ifndef __USR_LE_API_H__
|
||
#define __USR_LE_API_H__
|
||
|
||
#include <stdint.h>
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
/**
|
||
* @brief 进入配对/配网模式
|
||
* @note 断开当前连接、清除配对信息(不复位),重新发绑定广播
|
||
*/
|
||
void usr_goto_pair_mode(void);
|
||
|
||
/**
|
||
* @brief 清除配对信息但不复位
|
||
*/
|
||
void usr_clear_pair_info_noreset(void);
|
||
|
||
/**
|
||
* @brief 清除配对信息并延时复位
|
||
*/
|
||
void usr_clear_pair_info(void);
|
||
|
||
/**
|
||
* @brief 获取当前是否已配对
|
||
* @return 1=已配对,0=未配对
|
||
*/
|
||
uint8_t usr_get_pair_flag(void);
|
||
|
||
/**
|
||
* @brief 查询 BLE 是否已连接
|
||
* @return 1=已连接,0=未连接
|
||
*/
|
||
uint8_t usr_ble_is_connected(void);
|
||
|
||
/**
|
||
* @brief 启动应用侧 OTA 流程
|
||
* @note 置位 usr_goto_updata,并创建 1s 周期定时器驱动断连与 OTA 广播切换
|
||
*/
|
||
void usr_app_ota_init(void);
|
||
|
||
/**
|
||
* @brief 暂停/恢复广播发送(扫描分时射频仲裁,见 app_th_scan)
|
||
* @note 仅门控发送,不断开连接;恢复后按注册数据续发,无需重新编码
|
||
* @param pause 1=暂停(扫描期让出射频),0=恢复
|
||
*/
|
||
void usr_le_set_adv_pause(uint8_t pause);
|
||
|
||
/**
|
||
* @brief 查询广播是否处于暂停态
|
||
* @return 1=暂停中(扫描期),0=正常广播
|
||
*/
|
||
uint8_t usr_le_adv_is_paused(void);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
|
||
#endif /* __USR_LE_API_H__ */
|