⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bluetooth.h

📁 AMLOGIC DPF source code
💻 H
字号:
#ifndef __BLUETOOTH_H
#define __BLUETOOTH_H

#if ((!defined __ROM_) || (defined __ROM_ && defined __ROMDBG_))
	//#define BT_DEBUG
	//#define BT_ERROR_DEADLOOP
	
	//#define HCI_DEBUG
	//#define HCI_ACL_DEBUG
	//#define L2CAP_DEBUG
	//#define SDP_DEBUG
	//#define RFCOMM_DEBUG
	//#define OBEX_DEBUG
	//#define FTP_DEBUG
	//#define OPP_DEBUG
	//#define SPP_DEBUG
#endif

#include "misc/bt_types.h"
#include "misc/bt_system.h"
#include "misc/link_buff.h"

/* BD Address */
typedef struct bdaddr
{
	__u8 b[6];
} bdaddr_t;
#define HCI_BD_ADDRESS_SIZE				6

extern bdaddr_t bdaddr_any;
extern bdaddr_t bdaddr_local;
#define BDADDR_ANY   (&bdaddr_any)
#define BDADDR_LOCAL (&bdaddr_local)
//#define BDADDR_ANY   (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
//#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})

/* Copy, swap, convert BD Address */
int bacmp(bdaddr_t *ba1, bdaddr_t *ba2);
void bacpy(bdaddr_t *dst, bdaddr_t *src);
void baswap(bdaddr_t *dst, bdaddr_t *src);
char *batostr(bdaddr_t *ba);
bdaddr_t *strtoba(char *str);
int ba2str(bdaddr_t *ba, char *str);
int str2ba(char *str, bdaddr_t *ba);


#define	BT_NO_ERROR						0
#define BT_ERROR_NO_MEMORY				1
#define BT_ERROR_NO_DATA				2
#define BT_ERROR_INVALID				3
#define BT_ERROR_NO_DEVICE				4
#define BT_ERROR_ALREADY				5
#define BT_ERROR_NO_EXIST				6
#define BT_ERROR_NOT_READY				7
#define BT_ERROR_FRAME_TYPE				8
#define BT_ERROR_TIMEOUT				9
#define BT_ERROR_NOT_SUPPORTED			10
#define BT_ERROR_HOST_UNREACH			11
#define BT_ERROR_CONN_RESET				12
#define BT_ERROR_BAD_ADDRESS			13
#define BT_ERROR_NOT_CONNECTED			14
#define BT_ERROR_REMOTE_HOST			15
#define BT_ERROR_PROTOCOL				16
#define BT_ERROR_IO						17
#define BT_ERROR_BUSY					18
#define BT_ERROR_TOO_BIG				19

#if 1
	#define BT_TASK_RUNNING_SIGNAL
#else
	#define BT_TASK_SLEEP_TIME			10
#endif

#define BT_OBEX_MTU						(1024*20)

#ifdef BT_DEBUG
void bt_error_print(char *str, char* file, unsigned line);
#endif

#endif // __BLUETOOTH_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -