fix:修改UDP通讯中,取电变化上报机制
1、问题点:当RCU网络状态异常的情况下,网络还处于协商状态下,还未进入正常通讯环节时,取电变化不会进行判断。这会导致取电变化上报与实际产生取电状态时间点对不上。 2、将BLV_C1F_Module代码上传至Gitea,之前代码修改记录请查看 .\BasicCode\Readme.txt
This commit is contained in:
97
BasicCode/Drive/BLE/include/multiCentral.h
Normal file
97
BasicCode/Drive/BLE/include/multiCentral.h
Normal file
@@ -0,0 +1,97 @@
|
||||
/********************************** (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 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define CENTRAL_IDLE 0 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8 taskID; // Task ID for internal task/event processing
|
||||
uint16 connHandle; // Connection handle of current connection
|
||||
uint8 state; // Application state
|
||||
//uint8 connecting; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>־
|
||||
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); //<2F><><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD>
|
||||
uint8 IS_Empty_Connection(u8 device_type, u8 device_addr); //<2F><>ѯָ<D1AF><D6B8><EFBFBD>豸<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
uint8 Connect_Peripheral_Device(u8 device_type, u8 device_addr); //<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>豸
|
||||
uint8 Disconnect_Peripheral_Device(u8 device_type, u8 device_addr); //<2F>Ͽ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>豸
|
||||
void Peripheral_Notify_Control(u8 device_type, u8 device_addr, u8 notify_id, u8 state); //<2F><EFBFBD><F2BFAABB>ر<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ӻ<EFBFBD><D3BB>豸<EFBFBD><E8B1B8>֪ͨ
|
||||
/*********************************************************************
|
||||
*********************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MULTICENTRAL_H */
|
||||
Reference in New Issue
Block a user