This commit is contained in:
lmx
2025-12-10 17:40:26 +08:00
parent 23b14f0142
commit 141b538bf5
9 changed files with 51 additions and 17 deletions

View File

@ -93,18 +93,19 @@ void rc_rfid_callback_handler(void *priv)
// memset(current_board_mac, uid, sizeof(current_board_mac));
// TODO发送指令让主板断开经典蓝牙连接
// TODO: 切断BLE
// g_ble_connect_new_device(current_board_mac); //连接新主板
// 重新启动扫描,以连接到新的主板
// EARPHONE_STATE_SET_PAGE_SCAN_ENABLE();
break;
case RFID_DEVICE_TYPE_REMOTE_CONTROL:
case RFID_DEVICE_TYPE_REMOTE_CONTROL: //扫的是遥控器
rc_log("Device is another Remote Control.\n");
if(g_rc_context.team != TEAM_YES){
nvs_clear_info(); //清楚nfc数据
return; //非组队状态
}
if (g_ble_get_state() == BLE_ST_NOTIFY_IDICATE) {
rc_log("Sending teaming request to main board...\n");
//TODO:
@ -249,6 +250,8 @@ void rc_app_main_init(void)
// 1. 初始化全局上下文
memset(&g_rc_context, 0, sizeof(RC_Context_t));
g_rc_context.state = RC_STATE_DISCONNECTED; // 初始状态为未连接
g_rc_context.team = TEAM_NO;
FM176XX_HardInit();
// 2. 检查并启动RFID处理定时器
if (g_rfid_timer_id == 0) {
@ -268,16 +271,18 @@ void rc_app_main_init(void)
//test
#define TEST_FUNCTION 1
void test_task(void){
#if TEST_FUNCTION == 1
FM176XX_HardInit();
while(1){
u8 uid[UID_LENGTH] = {0};
//读id卡
TYPE_V_EVENT((char *)uid);
// TYPE_A_EVENT((char *)uid);
os_time_dly(10);
os_time_dly(100);
}
#endif
}
void test_func_main(void){