MT7697 API Reference  LinkIt SDK v4

Overview

Macros

#define BT_HANDLE_INVALID   0xFFFF
 Bluetooth connection handle. More...
 
#define BT_KEY_SIZE   16
 Bluetooth SM key size, please refer to the Bluetooth core specification version 4.2 [VOL 3, part H] Section 2.3.4.
 
#define BT_ROLE_MASTER   0x00
 Bluetooth GAP role, please refer to the Bluetooth core specification version 4.2 [VOL 6, part B] Section 4.5. More...
 
#define BT_ROLE_SLAVE   0x01
 Slave or Peripheral. More...
 
#define BT_MODULE_OFFSET   26
 Module range: 0x00 ~ 0x3F. More...
 
#define BT_MODULE_MASK   0x03FFFFFFU
 Mask for Bluetooth module. More...
 
#define BT_MODULE_GENERAL   (0x00U<<BT_MODULE_OFFSET)
 Prefix of the general module. More...
 
#define BT_MODULE_TIMER   (0x01U<<BT_MODULE_OFFSET)
 Prefix of the timer module. More...
 
#define BT_MODULE_MM   (0x02U<<BT_MODULE_OFFSET)
 Prefix of the Memory Management module. More...
 
#define BT_MODULE_HCI   (0x03U<<BT_MODULE_OFFSET)
 Prefix of the HCI module. More...
 
#define BT_MODULE_GAP   (0x04U<<BT_MODULE_OFFSET)
 Prefix of the GAP module. More...
 
#define BT_MODULE_L2CAP   (0x05U<<BT_MODULE_OFFSET)
 Prefix of the L2CAP module. More...
 
#define BT_MODULE_SM   (0x06U<<BT_MODULE_OFFSET)
 Prefix of the SM module. More...
 
#define BT_MODULE_ATT   (0x07U<<BT_MODULE_OFFSET)
 Prefix of the ATT module. More...
 
#define BT_MODULE_GATT   (0x08U<<BT_MODULE_OFFSET)
 Prefix of the GATT module. More...
 
#define BT_MODULE_SYSTEM   (0x09U<<BT_MODULE_OFFSET)
 Prefix of the System module. More...
 
#define BT_MODULE_SDP   (0x0AU<<BT_MODULE_OFFSET)
 Prefix of the SDP module. More...
 
#define BT_MODULE_RFCOMM   (0x0BU<<BT_MODULE_OFFSET)
 Prefix of the RFCOMM module. More...
 
#define BT_MODULE_HFP   (0x0CU<<BT_MODULE_OFFSET)
 Prefix of the HFP module. More...
 
#define BT_MODULE_SPP   (0x0DU<<BT_MODULE_OFFSET)
 Prefix of the SPP module. More...
 
#define BT_MODULE_AVRCP   (0x0EU<<BT_MODULE_OFFSET)
 Prefix of the SPP module. More...
 
#define BT_MODULE_A2DP   (0x0FU<<BT_MODULE_OFFSET)
 Prefix of the A2DP module. More...
 
#define BT_MODULE_GOEP   (0x10U<<BT_MODULE_OFFSET)
 Prefix of the GOEP module. More...
 
#define BT_MODULE_PBAPC   (0x11U<<BT_MODULE_OFFSET)
 Prefix of the PBAPC module. More...
 
#define BT_MODULE_AWS   (0x12U<<BT_MODULE_OFFSET)
 Prefix of the AWS module. More...
 
#define BT_MODULE_GENERAL_ERROR   (0x3FU<<BT_MODULE_OFFSET)
 Prefix of the general error module. More...
 
#define BT_MODULE_NUM   BT_MODULE_GENERAL_ERROR
 The maximum prefix value of the module. More...
 
#define BT_STATUS_SUCCESS   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x00))
 Bluetooth status definitions. More...
 
#define BT_STATUS_PENDING   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x01))
 General pending. More...
 
#define BT_STATUS_BUSY   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x02))
 General busy, please re-try the operation later. More...
 
#define BT_STATUS_TIMER_FULL   (BT_MODULE_TIMER|(BT_MODULE_MASK&0x1))
 The timer is out-of-memory. More...
 
#define BT_STATUS_TIMER_NOT_FOUND   (BT_MODULE_TIMER|(BT_MODULE_MASK&0x2))
 Timer not found in the timer manager. More...
 
#define BT_STATUS_FAIL   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF1))
 General failed. More...
 
#define BT_STATUS_OUT_OF_MEMORY   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF2))
 General Out-of-memory. More...
 
#define BT_STATUS_TIMEOUT   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF3))
 General Timeout. More...
 
#define BT_STATUS_BUFFER_USED   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF4))
 General Buffer-used. More...
 
#define BT_STATUS_UNSUPPORTED   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF5))
 General Unsupported. More...
 
#define BT_STATUS_CONNECTION_IN_USE   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF6))
 General Connection-in-use. More...
 
#define BT_STATUS_LINK_IS_DISCONNECTING   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF7))
 General Link-is-disconnecting. More...
 
#define BT_STATUS_LINK_SECURITY_BLCOK   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF8))
 General Link-security-block. More...
 
#define BT_STATUS_HCI_FLOW_CONTROLLED   (BT_MODULE_HCI|0x01)
 The packet is flow-controlled. More...
 
#define BT_STATUS_RX_PENDING   (BT_MODULE_HCI|0x02)
 Internal use of the HCI. More...
 
#define BT_STATUS_DIRECTED_ADVERTISING_TIMEOUT   (BT_MODULE_GAP|0x03)
 Directed Advertising Timeout defined in the specification. More...
 
#define BT_STATUS_CONNECTION_NOT_FOUND   (BT_MODULE_GAP|0x04)
 Unable to find the specified connection. More...
 
#define BT_STATUS_L2CAP_REQUEST_TIMEOUT   (BT_MODULE_L2CAP|0x01)
 A L2CAP request time out. More...
 
#define BT_STATUS_L2CAP_LOCAL_SECURITY_BLOCKED   (BT_MODULE_L2CAP|0x02)
 The local security manager refuses the connection attempt. More...
 
#define BT_STATUS_L2CAP_LOCAL_PSM_UNSUPPORTED   (BT_MODULE_L2CAP|0x03)
 The local device does not support the protocol service (PSM). More...
 
#define BT_STATUS_L2CAP_USER_REQUEST_DISCONNECT   (BT_MODULE_L2CAP|0x04)
 The local or remote device requests the disconnection. More...
 
#define BT_STATUS_L2CAP_UNEXPECTED_SIGNAL_RECEIVED   (BT_MODULE_L2CAP|0x05)
 Received an unexpected signal from the remote device. More...
 
#define BT_STATUS_L2CAP_LOCAL_REJECTED_NO_RESOURCES   (BT_MODULE_L2CAP|0x06)
 The local device is rejected due to the lack of resources. More...
 
#define BT_STATUS_L2CAP_REMOTE_PSM_UNSUPPORTED   (BT_MODULE_L2CAP|0x42)
 The remote device does not support the requested protocol service (PSM). More...
 
#define BT_STATUS_L2CAP_REMOTE_SECURITY_BLOCKED   (BT_MODULE_L2CAP|0x43)
 The remote device's security architecture denies the connection. More...
 
#define BT_STATUS_L2CAP_REMOTE_NO_RESOURCES   (BT_MODULE_L2CAP|0x44)
 The remote device is out of resources. More...
 
#define BT_STATUS_L2CAP_CONFIG_UNACCEPTED   (BT_MODULE_L2CAP|0x81)
 Configuration failed due to unacceptable parameters. More...
 
#define BT_STATUS_L2CAP_CONFIG_REJECTED   (BT_MODULE_L2CAP|0x82)
 Configuration is rejected (unknown reason). More...
 
#define BT_STATUS_L2CAP_CONFIG_OPTIONS_UNKNOWN   (BT_MODULE_L2CAP|0x83)
 Configuration failed due to an unrecognized configuration option. More...
 
#define BT_STATUS_L2CAP_CHANNEL_EXISTED   (BT_MODULE_L2CAP|0xA0)
 User should return it to L2CAP if the L2CAP channel already exists when L2CAP requests the user to allocate channel. More...
 
#define BT_BD_ADDR_LEN   6
 Bluetooth Device Address Length defined in the specification. More...
 
#define BT_ADDR_PUBLIC   0x00
 Address type, defined in Bluetooth core specification version 4.2. More...
 
#define BT_ADDR_RANDOM   0x01
 Random address type. More...
 
#define BT_ADDR_PUBLIC_IDENTITY   0x02
 Public identity address type. More...
 
#define BT_ADDR_RANDOM_IDENTITY   0x03
 Random identity address type. More...
 
#define BT_NULL   0
 NULL.
 

Typedefs

typedef uint16_t bt_handle_t
 Define the connection handle type. More...
 
typedef uint8_t bt_key_t[16]
 Define the SM key type. More...
 
typedef uint8_t bt_role_t
 Define the role type. More...
 
typedef uint32_t bt_msg_type_t
 Define the message type. More...
 
typedef int32_t bt_status_t
 Define the status type, returned from the APIs, and defined as BT_STATUS_XXX. More...
 
typedef uint8_t bt_bd_addr_t[6]
 Address type, defined in Bluetooth core specification version 4.2. More...
 
typedef uint8_t const * bt_bd_addr_ptr_t
 A pointer to the bt_bd_addr_t. More...
 
typedef uint8_t bt_addr_type_t
 Define the address type. More...
 
typedef uint8_t bt_data_t[1]
 Variable length data type.
 

Macro Definition Documentation

#define BT_ADDR_PUBLIC   0x00

Address type, defined in Bluetooth core specification version 4.2.

Public address type.

#define BT_ADDR_PUBLIC_IDENTITY   0x02

Public identity address type.

#define BT_ADDR_RANDOM   0x01

Random address type.

#define BT_ADDR_RANDOM_IDENTITY   0x03

Random identity address type.

#define BT_BD_ADDR_LEN   6

Bluetooth Device Address Length defined in the specification.

#define BT_HANDLE_INVALID   0xFFFF

Bluetooth connection handle.

Invalid connection handle.

#define BT_MODULE_A2DP   (0x0FU<<BT_MODULE_OFFSET)

Prefix of the A2DP module.

#define BT_MODULE_ATT   (0x07U<<BT_MODULE_OFFSET)

Prefix of the ATT module.

#define BT_MODULE_AVRCP   (0x0EU<<BT_MODULE_OFFSET)

Prefix of the SPP module.

#define BT_MODULE_AWS   (0x12U<<BT_MODULE_OFFSET)

Prefix of the AWS module.

#define BT_MODULE_GAP   (0x04U<<BT_MODULE_OFFSET)

Prefix of the GAP module.

#define BT_MODULE_GATT   (0x08U<<BT_MODULE_OFFSET)

Prefix of the GATT module.

#define BT_MODULE_GENERAL   (0x00U<<BT_MODULE_OFFSET)

Prefix of the general module.

#define BT_MODULE_GENERAL_ERROR   (0x3FU<<BT_MODULE_OFFSET)

Prefix of the general error module.

#define BT_MODULE_GOEP   (0x10U<<BT_MODULE_OFFSET)

Prefix of the GOEP module.

#define BT_MODULE_HCI   (0x03U<<BT_MODULE_OFFSET)

Prefix of the HCI module.

#define BT_MODULE_HFP   (0x0CU<<BT_MODULE_OFFSET)

Prefix of the HFP module.

#define BT_MODULE_L2CAP   (0x05U<<BT_MODULE_OFFSET)

Prefix of the L2CAP module.

#define BT_MODULE_MASK   0x03FFFFFFU

Mask for Bluetooth module.

#define BT_MODULE_MM   (0x02U<<BT_MODULE_OFFSET)

Prefix of the Memory Management module.

#define BT_MODULE_NUM   BT_MODULE_GENERAL_ERROR

The maximum prefix value of the module.

#define BT_MODULE_OFFSET   26

Module range: 0x00 ~ 0x3F.

The maximum number of modules: 64.

#define BT_MODULE_PBAPC   (0x11U<<BT_MODULE_OFFSET)

Prefix of the PBAPC module.

#define BT_MODULE_RFCOMM   (0x0BU<<BT_MODULE_OFFSET)

Prefix of the RFCOMM module.

#define BT_MODULE_SDP   (0x0AU<<BT_MODULE_OFFSET)

Prefix of the SDP module.

#define BT_MODULE_SM   (0x06U<<BT_MODULE_OFFSET)

Prefix of the SM module.

#define BT_MODULE_SPP   (0x0DU<<BT_MODULE_OFFSET)

Prefix of the SPP module.

#define BT_MODULE_SYSTEM   (0x09U<<BT_MODULE_OFFSET)

Prefix of the System module.

#define BT_MODULE_TIMER   (0x01U<<BT_MODULE_OFFSET)

Prefix of the timer module.

#define BT_ROLE_MASTER   0x00

Bluetooth GAP role, please refer to the Bluetooth core specification version 4.2 [VOL 6, part B] Section 4.5.

Master or Central.

#define BT_ROLE_SLAVE   0x01

Slave or Peripheral.

#define BT_STATUS_BUFFER_USED   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF4))

General Buffer-used.

#define BT_STATUS_BUSY   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x02))

General busy, please re-try the operation later.

#define BT_STATUS_CONNECTION_IN_USE   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF6))

General Connection-in-use.

#define BT_STATUS_CONNECTION_NOT_FOUND   (BT_MODULE_GAP|0x04)

Unable to find the specified connection.

#define BT_STATUS_DIRECTED_ADVERTISING_TIMEOUT   (BT_MODULE_GAP|0x03)

Directed Advertising Timeout defined in the specification.

#define BT_STATUS_FAIL   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF1))

General failed.

#define BT_STATUS_HCI_FLOW_CONTROLLED   (BT_MODULE_HCI|0x01)

The packet is flow-controlled.

#define BT_STATUS_L2CAP_CHANNEL_EXISTED   (BT_MODULE_L2CAP|0xA0)

User should return it to L2CAP if the L2CAP channel already exists when L2CAP requests the user to allocate channel.

#define BT_STATUS_L2CAP_CONFIG_OPTIONS_UNKNOWN   (BT_MODULE_L2CAP|0x83)

Configuration failed due to an unrecognized configuration option.

#define BT_STATUS_L2CAP_CONFIG_REJECTED   (BT_MODULE_L2CAP|0x82)

Configuration is rejected (unknown reason).

#define BT_STATUS_L2CAP_CONFIG_UNACCEPTED   (BT_MODULE_L2CAP|0x81)

Configuration failed due to unacceptable parameters.

#define BT_STATUS_L2CAP_LOCAL_PSM_UNSUPPORTED   (BT_MODULE_L2CAP|0x03)

The local device does not support the protocol service (PSM).

#define BT_STATUS_L2CAP_LOCAL_REJECTED_NO_RESOURCES   (BT_MODULE_L2CAP|0x06)

The local device is rejected due to the lack of resources.

#define BT_STATUS_L2CAP_LOCAL_SECURITY_BLOCKED   (BT_MODULE_L2CAP|0x02)

The local security manager refuses the connection attempt.

#define BT_STATUS_L2CAP_REMOTE_NO_RESOURCES   (BT_MODULE_L2CAP|0x44)

The remote device is out of resources.

#define BT_STATUS_L2CAP_REMOTE_PSM_UNSUPPORTED   (BT_MODULE_L2CAP|0x42)

The remote device does not support the requested protocol service (PSM).

#define BT_STATUS_L2CAP_REMOTE_SECURITY_BLOCKED   (BT_MODULE_L2CAP|0x43)

The remote device's security architecture denies the connection.

#define BT_STATUS_L2CAP_REQUEST_TIMEOUT   (BT_MODULE_L2CAP|0x01)

A L2CAP request time out.

#define BT_STATUS_L2CAP_UNEXPECTED_SIGNAL_RECEIVED   (BT_MODULE_L2CAP|0x05)

Received an unexpected signal from the remote device.

#define BT_STATUS_L2CAP_USER_REQUEST_DISCONNECT   (BT_MODULE_L2CAP|0x04)

The local or remote device requests the disconnection.

#define BT_STATUS_LINK_IS_DISCONNECTING   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF7))

General Link-is-disconnecting.

#define BT_STATUS_LINK_SECURITY_BLCOK   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF8))

General Link-security-block.

#define BT_STATUS_OUT_OF_MEMORY   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF2))

General Out-of-memory.

#define BT_STATUS_PENDING   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x01))

General pending.

#define BT_STATUS_RX_PENDING   (BT_MODULE_HCI|0x02)

Internal use of the HCI.

#define BT_STATUS_SUCCESS   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x00))

Bluetooth status definitions.

For the ATT or HCI error codes, please refer to GATT HCI .General Success.

#define BT_STATUS_TIMEOUT   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF3))

General Timeout.

#define BT_STATUS_TIMER_FULL   (BT_MODULE_TIMER|(BT_MODULE_MASK&0x1))

The timer is out-of-memory.

#define BT_STATUS_TIMER_NOT_FOUND   (BT_MODULE_TIMER|(BT_MODULE_MASK&0x2))

Timer not found in the timer manager.

#define BT_STATUS_UNSUPPORTED   (BT_MODULE_GENERAL|(BT_MODULE_MASK&0x03FFFFF5))

General Unsupported.

Typedef Documentation

typedef uint8_t bt_addr_type_t

Define the address type.

typedef uint8_t const* bt_bd_addr_ptr_t

A pointer to the bt_bd_addr_t.

typedef uint8_t bt_bd_addr_t[6 ]

Address type, defined in Bluetooth core specification version 4.2.

Bluetooth Device Address defined in the specification.

typedef uint16_t bt_handle_t

Define the connection handle type.

typedef uint8_t bt_key_t[16]

Define the SM key type.

typedef uint32_t bt_msg_type_t

Define the message type.

typedef uint8_t bt_role_t

Define the role type.

typedef int32_t bt_status_t

Define the status type, returned from the APIs, and defined as BT_STATUS_XXX.