Files
BLV_C1F_Module/BasicCode/Drive/BLE/include/multiCentral.h
caocong 95916b9995 fix:修改UDP通讯中,取电变化上报机制
1、问题点:当RCU网络状态异常的情况下,网络还处于协商状态下,还未进入正常通讯环节时,取电变化不会进行判断。这会导致取电变化上报与实际产生取电状态时间点对不上。
2、将BLV_C1F_Module代码上传至Gitea,之前代码修改记录请查看 .\BasicCode\Readme.txt
2026-01-23 09:23:12 +08:00

98 lines
3.3 KiB
C

/********************************** (C) COPYRIGHT *******************************
* File Name : multiCentral.h
* Author : WCH
* Version : V1.0
* Date : 2018/11/12
* Description :
*******************************************************************************/
#ifndef MULTICENTRAL_H
#define MULTICENTRAL_H
#include "gattprofile.h"
#ifdef __cplusplus
extern "C"
{
#endif
/*********************************************************************
* INCLUDES
*/
#define PERIPHERAL_DEVICE_MAX_NUM 30
/*********************************************************************
* CONSTANTS
*/
// Simple BLE Observer Task Events
#define START_DEVICE_EVT 0x0001
#define START_DISCOVERY_EVT 0x0002
#define START_SCAN_EVT 0x0004
#define START_SVC_DISCOVERY_EVT 0x0008
#define START_PARAM_UPDATE_EVT 0x0010
#define START_READ_OR_WRITE_EVT 0x0020
#define START_READ_RSSI_EVT 0x0040
#define ESTABLISH_LINK_TIMEOUT_EVT 0x0080
#define CONNECT0_ITEM 0
#define CONNECT1_ITEM 1
#define CONNECT2_ITEM 2
/*********************************************************************
* MACROS
*/
#define CENTRAL_CONNECTING 1 //主机正在连接
#define CENTRAL_IDLE 0 //主机空闲
typedef struct
{
uint8 taskID; // Task ID for internal task/event processing
uint16 connHandle; // Connection handle of current connection
uint8 state; // Application state
//uint8 connecting; //正在连接标志
uint8 peerAddr[B_ADDR_LEN];
uint8 discState; // Discovery state
uint8 procedureInProgress; // GATT read/write procedure state
uint16 svcStartHdl; // Discovered service start handle
uint16 svcEndHdl; // Discovered service end handle
uint16 charHdl; // Discovered characteristic handle
} centralConnItem_t;
typedef struct
{
uint8 peerAddr[B_ADDR_LEN];
} peerAddrDefItem_t;
extern BLE_DEVICE_CONFIG* Ble_Device_Head;
/*********************************************************************
* FUNCTIONS
*/
/*
* Task Initialization for the BLE Application
*/
extern void Central_Init( void );
/*
* Task Event Processor for the BLE Application
*/
extern uint16 Central_ProcessEvent( uint8 task_id, uint16 events );
void Clear_Connecting_flg(u8* addr);
void Set_Connecting_flg(u8* addr);
void BLE_Send_Task(void);
void Device_Add_List(BLE_DEVICE_CONFIG* Device_node); //将设备添加进链表
uint8 IS_Empty_Connection(u8 device_type, u8 device_addr); //查询指定设备是否已连接
uint8 Connect_Peripheral_Device(u8 device_type, u8 device_addr); //连接指定设备
uint8 Disconnect_Peripheral_Device(u8 device_type, u8 device_addr); //断开指定设备
void Peripheral_Notify_Control(u8 device_type, u8 device_addr, u8 notify_id, u8 state); //打开或关闭指定从机设备的通知
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* MULTICENTRAL_H */