#ifndef __hal_BLE_Host__
#define __hal_BLE_Host__
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "sdk_common.h"
#include "SEGGER_RTT.h"
#include "usr_config.h"
#include "hal_ble_common.h"

#ifdef __cplusplus  
extern "C" {  
#endif  

	
#ifdef __cplusplus
} 
#endif

typedef void (*BLE_Host_Callback)(void*);

typedef void (*BLE_Host_Callback_cb)(uint8_t*pdat ,uint8_t len);

typedef struct _BLE_Host_Rx{
	uint8_t  cmd;
	uint8_t*  pDat;
	uint8_t  datLen; 
	BLE_Host_Callback cb;
}BLE_Host_Rx_t;

typedef struct _BLE_Host_Tx{
	uint8_t  n;
	uint32_t t;
	uint8_t  ncnt;
	uint32_t tcnt;
	BLE_CMD_n  cmd;
	uint8_t* pDat;
	uint8_t  datLen;
	uint8_t  holdon;
	BLE_Host_Callback cb;
	struct _BLE_Host_Tx *next;	//µ¥ÏòÁ´±í
}BLE_Host_Tx_t;

void BLE_Host_Initialize(void);
void BLE_Host_Send(BLE_CMD_n cmd,unsigned char *pDat,unsigned char datLen);
int BLE_Host_Rx_Regist(BLE_CMD_n cmd,BLE_Host_Callback cb);
void BLE_Host_Tx_Send(BLE_Host_Tx_t* handle,BLE_CMD_n cmd,unsigned char *pDat,unsigned char datLen);
void BLE_Host_Tx_Clear(BLE_Host_Tx_t* handle);
void BLE_Host_Push(unsigned char* p,int len);
int BLE_Host_Rx_Regist_Game(BLE_Host_Callback_cb cb);

#endif

