BLE_API v2.1.3

BLE Bonding Definitions
BLE Bonding

#define | CMD_FB_GET_NEXT_PID 0x01
#define | CMD_FB_INIT_INFO_FLASHBOND 0x02
#define | CMD_FB_INIT_DATA_FLASHBOND 0x03
#define | CMD_FB_CHK_IF_FLASH_INITED 0x04
#define | CMD_FB_GET_EXIST_PID_BY_HOST_ID 0x05
#define | CMD_FB_GET_KEY_FLASHBOND_PARA_BOND 0x06
#define | CMD_FB_GET_DATA_FLASHBOND_EXIST_HOSTID_DBLK_START 0x07
#define | CMD_FB_GET_DATA_FLASHBOND_NXT_PID_DBLK_START 0x08
#define | CMD_FB_PSH_DATA_FLASHBOND_EXIST_HOSTID_DBLK 0x09
#define | CMD_FB_CHK_IF_FLASHBOND_NEED_TO_ERASE_PAGE 0x0A
#define | CMD_FB_PSH_BACKUP_KEY_FLASH_PARA_BOND 0x0B
#define | CMD_FB_PSH_BACKUP_DATA_FLASH_PARA_BOND 0x0C
#define | CMD_FB_GET_DATA_VALUE_BY_HANDLE 0x0D
#define | CMD_FB_GET_INFO_FLASHBOND_WATER_LEVEL 0x0E
#define | FLH_BND_ERR_CODE_NO_ERR 0x00
#define | FLH_BND_ERR_CODE_FLASH_NOT_INI 0x01
#define | FLH_BND_ERR_CODE_IN_PROCESS 0x02
#define | FLH_BND_ERR_CODE_NO_FREE_PID 0x03
#define | FLH_BND_ERR_CODE_NO_EXIST_HOST_ID 0x04
#define | FLH_BND_ERR_CODE_HOST_ID_DNT_MATCH 0x05
#define | ERR_CODE_FLH_BND_NO_ENOUGH_REST_SPACE 0x06
#define | ERR_BND_ERR_CODE_NOT_EXIST_HANDLE 0x07
#define | FLH_BND_ERR_CODE_WATER_LEVEL_EXCEEDS 0x08
#define | ERR_CODE_FLH_BND_SYS_ERROR 0xFF
#define | TAB_INFO_FLASHBOND_PID 0
#define | TAB_INFO_FLASHBOND_HOSTID 2
#define | TAB_INFO_FLASHBOND_INI_ADDR 4
#define | TAB_INFO_FLASHBOND_SMP_PARA_BOND (TAB_INFO_FLASHBOND_INI_ADDR+SIZE_BLE_ADDR)
#define | TAB_PARA_DATA_ERROR_CODE 0
#define | TAB_PARA_DATA_PID_H 1
#define | TAB_PARA_DATA_PID_L 2
#define | TAB_PARA_DATA_HOSTID 3
#define | TAB_PARA_DATA_INI_ADDR 4
#define | TAB_PARA_DATA_BOND_ROLE 11
#define | TAB_PARA_DATA_OWN_RAND 71
#define | TAB_PARA_DATA_OWN_EDIV 79
#define | TAB_PARA_DATA_DAT_START_H 4
#define | TAB_PARA_DATA_DAT_START_L 5
#define | TAB_PARA_DATA_DAT_HDL_H (TAB_PARA_DATA_DAT_START_L+1)
#define | TAB_PARA_DATA_DAT_HDL_L (TAB_PARA_DATA_DAT_START_L+2)
#define | TAB_PARA_DATA_GATT_ROLE (TAB_PARA_DATA_DAT_START_L+3)
#define | TAB_PARA_DATA_DAT_SIZE (TAB_PARA_DATA_DAT_START_L+4)
#define | TAB_PARA_DATA_DAT (TAB_PARA_DATA_DAT_START_L+5)
#define | BOND_PEER_ADDR_TYPE 0
#define | BOND_PEER_ADDR 1
#define | BOND_ROLE 7
#define | BOND_STK_GEN_METHOD 8
#define | BOND_MAX_ENC_KEY_SIZE 9
#define | BOND_KEY_TYPE 10
#define | BOND_PEER_RAND 11
#define | BOND_PEER_EDIV 19
#define | BOND_PEER_LTK 21
#define | BOND_PEER_IRK 37
#define | BOND_PEER_ID_ADDR_TYPE 53
#define | BOND_PEER_ID_ADDR 54
#define | BOND_OWN_ADDR_TYPE 60
#define | BOND_OWN_ADDR 61
#define | BOND_OWN_RAND 67
#define | BOND_OWN_EDIV 75
#define | BOND_OWN_LTK 77
#define | SMP_PARA_BOND_SIZE (BOND_OWN_LTK+16)

## Detailed Description

Here shows the BLE bonding related definition.

## Macro Definition Documentation

## ◆ BOND_KEY_TYPE

#define BOND_KEY_TYPE 10

The starting position of BLE key type in the information bonding data.

## ◆ BOND_MAX_ENC_KEY_SIZE

#define BOND_MAX_ENC_KEY_SIZE 9

The starting position of BLE KEY Size in the information bonding data.

## ◆ BOND_OWN_ADDR

#define BOND_OWN_ADDR 61

The starting position of BLE Own ADDR in the information bonding data.

## ◆ BOND_OWN_ADDR_TYPE

#define BOND_OWN_ADDR_TYPE 60

The starting position of BLE Own ADDR Type in the information bonding data.

## ◆ BOND_OWN_EDIV

#define BOND_OWN_EDIV 75

The starting position of BLE Own EDIV in the information bonding data.

## ◆ BOND_OWN_LTK

#define BOND_OWN_LTK 77

The starting position of BLE Own LTK in the information bonding data.

## ◆ BOND_OWN_RAND

#define BOND_OWN_RAND 67

The starting position of BLE Own RAND in the information bonding data.

## ◆ BOND_PEER_ADDR

#define BOND_PEER_ADDR 1

The starting position of PEER_ADDR in the information bonding data.

## ◆ BOND_PEER_ADDR_TYPE

#define BOND_PEER_ADDR_TYPE 0

BLE Bonding the Starting Position Related Definition The starting position of PEER_ADDR type in the information bonding data.

## ◆ BOND_PEER_EDIV

#define BOND_PEER_EDIV 19

The starting position of BLE PEER EDIV in the information bonding data.

## ◆ BOND_PEER_ID_ADDR

#define BOND_PEER_ID_ADDR 54

The starting position of BLE PEER ID ADDR in the information bonding data.

## ◆ BOND_PEER_ID_ADDR_TYPE

#define BOND_PEER_ID_ADDR_TYPE 53

The starting position of BLE PEER ID ADDR Type in the information bonding data.

## ◆ BOND_PEER_IRK

#define BOND_PEER_IRK 37

The starting position of BLE PEER IRK in the information bonding data.

## ◆ BOND_PEER_LTK

#define BOND_PEER_LTK 21

The starting position of BLE PEER LTK in the information bonding data.

## ◆ BOND_PEER_RAND

#define BOND_PEER_RAND 11

The starting position of BLE PEER_RAND in the information bonding data.

## ◆ BOND_ROLE

#define BOND_ROLE 7

The starting position of BLE connection role in the information bonding data.

## ◆ BOND_STK_GEN_METHOD

#define BOND_STK_GEN_METHOD 8

The starting position of BLE key gen method in the information bonding data.

## ◆ CMD_FB_CHK_IF_FLASH_INITED

#define CMD_FB_CHK_IF_FLASH_INITED 0x04

Bonding operation command : Check if bonding space has been initialized.

## ◆ CMD_FB_CHK_IF_FLASHBOND_NEED_TO_ERASE_PAGE

#define CMD_FB_CHK_IF_FLASHBOND_NEED_TO_ERASE_PAGE 0x0A

Bonding operation command : Check if bonding space need to be erase or not.

## ◆ CMD_FB_GET_DATA_FLASHBOND_EXIST_HOSTID_DBLK_START

#define CMD_FB_GET_DATA_FLASHBOND_EXIST_HOSTID_DBLK_START 0x07

Bonding operation command : Get starting position of the exist data bonding space.

## ◆ CMD_FB_GET_DATA_FLASHBOND_NXT_PID_DBLK_START

#define CMD_FB_GET_DATA_FLASHBOND_NXT_PID_DBLK_START 0x08

Bonding operation command : Get starting position of next data bonding space.

## ◆ CMD_FB_GET_DATA_VALUE_BY_HANDLE

#define CMD_FB_GET_DATA_VALUE_BY_HANDLE 0x0D

Bonding operation command : Get the backup data by valid handle & host id.

## ◆ CMD_FB_GET_EXIST_PID_BY_HOST_ID

#define CMD_FB_GET_EXIST_PID_BY_HOST_ID 0x05

Bonding operation command : Get exist PID number.

## ◆ CMD_FB_GET_INFO_FLASHBOND_WATER_LEVEL

#define CMD_FB_GET_INFO_FLASHBOND_WATER_LEVEL 0x0E

Bonding operation command : Get the water level of the bonding flash.

## ◆ CMD_FB_GET_KEY_FLASHBOND_PARA_BOND

#define CMD_FB_GET_KEY_FLASHBOND_PARA_BOND 0x06

Bonding operation command : Get Bonding key information data.

## ◆ CMD_FB_GET_NEXT_PID

#define CMD_FB_GET_NEXT_PID 0x01

BLE Bonding Operation Command Definition Bonding operation command : Get next PID number.

## ◆ CMD_FB_INIT_DATA_FLASHBOND

#define CMD_FB_INIT_DATA_FLASHBOND 0x03

Bonding operation command : Initial Data Bonding space.

## ◆ CMD_FB_INIT_INFO_FLASHBOND

#define CMD_FB_INIT_INFO_FLASHBOND 0x02

Bonding operation command : Initial Information Bonding space.

## ◆ CMD_FB_PSH_BACKUP_DATA_FLASH_PARA_BOND

#define CMD_FB_PSH_BACKUP_DATA_FLASH_PARA_BOND 0x0C

Bonding operation command : Push (Program) the backup data to new bonding space.

## ◆ CMD_FB_PSH_BACKUP_KEY_FLASH_PARA_BOND

#define CMD_FB_PSH_BACKUP_KEY_FLASH_PARA_BOND 0x0B

Bonding operation command : Push (Program) the backup key information to new bonding space.

## ◆ CMD_FB_PSH_DATA_FLASHBOND_EXIST_HOSTID_DBLK

#define CMD_FB_PSH_DATA_FLASHBOND_EXIST_HOSTID_DBLK 0x09

Bonding operation command : Push (Program) bonding data to exist bonding space.

## ◆ ERR_BND_ERR_CODE_NOT_EXIST_HANDLE

#define ERR_BND_ERR_CODE_NOT_EXIST_HANDLE 0x07

Bonding operation error code : NOT found the exist handle number.

## ◆ ERR_CODE_FLH_BND_NO_ENOUGH_REST_SPACE

#define ERR_CODE_FLH_BND_NO_ENOUGH_REST_SPACE 0x06

Bonding operation error code : Not enough program space.

## ◆ ERR_CODE_FLH_BND_SYS_ERROR

#define ERR_CODE_FLH_BND_SYS_ERROR 0xFF

Bonding operation error code : System Error.

## ◆ FLH_BND_ERR_CODE_FLASH_NOT_INI

#define FLH_BND_ERR_CODE_FLASH_NOT_INI 0x01

Bonding operation error code : Flash space is not initialized.

## ◆ FLH_BND_ERR_CODE_HOST_ID_DNT_MATCH

#define FLH_BND_ERR_CODE_HOST_ID_DNT_MATCH 0x05

Bonding operation error code : Host id not match.

## ◆ FLH_BND_ERR_CODE_IN_PROCESS

#define FLH_BND_ERR_CODE_IN_PROCESS 0x02

Bonding operation error code : Processing.

## ◆ FLH_BND_ERR_CODE_NO_ERR

#define FLH_BND_ERR_CODE_NO_ERR 0x00

BLE Bonding Operation Error Code Definition Bonding operation error code : No Error.

## ◆ FLH_BND_ERR_CODE_NO_EXIST_HOST_ID

#define FLH_BND_ERR_CODE_NO_EXIST_HOST_ID 0x04

Bonding operation error code : NOT found the exist host id number.

## ◆ FLH_BND_ERR_CODE_NO_FREE_PID

#define FLH_BND_ERR_CODE_NO_FREE_PID 0x03

Bonding operation error code : No free adea in bonding space.

## ◆ FLH_BND_ERR_CODE_WATER_LEVEL_EXCEEDS

#define FLH_BND_ERR_CODE_WATER_LEVEL_EXCEEDS 0x08

Bonding operation error code : Water level exceeds threshold.

## ◆ SMP_PARA_BOND_SIZE

#define SMP_PARA_BOND_SIZE (BOND_OWN_LTK+16)

The total size of the information bonding data.

## ◆ TAB_INFO_FLASHBOND_HOSTID

#define TAB_INFO_FLASHBOND_HOSTID 2

The tag number of the host ID in the information bonding space.

## ◆ TAB_INFO_FLASHBOND_INI_ADDR

#define TAB_INFO_FLASHBOND_INI_ADDR 4

The tag number of BLE INI_ADDR in the information bonding space.

## ◆ TAB_INFO_FLASHBOND_PID

#define TAB_INFO_FLASHBOND_PID 0

BLE Bonding Tag Number Related Definition The tag number of the PID in the information bonding space.

## ◆ TAB_INFO_FLASHBOND_SMP_PARA_BOND

#define TAB_INFO_FLASHBOND_SMP_PARA_BOND (TAB_INFO_FLASHBOND_INI_ADDR+SIZE_BLE_ADDR)

The tag number of BLE SMP data in the information bonding space.

## ◆ TAB_PARA_DATA_BOND_ROLE

#define TAB_PARA_DATA_BOND_ROLE 11

The tag number of BLE connection role value.

## ◆ TAB_PARA_DATA_DAT

#define TAB_PARA_DATA_DAT (TAB_PARA_DATA_DAT_START_L+5)

The tag number of data location.

## ◆ TAB_PARA_DATA_DAT_HDL_H

#define TAB_PARA_DATA_DAT_HDL_H (TAB_PARA_DATA_DAT_START_L+1)

The tag number of data handle location. (High Byte)

## ◆ TAB_PARA_DATA_DAT_HDL_L

#define TAB_PARA_DATA_DAT_HDL_L (TAB_PARA_DATA_DAT_START_L+2)

The tag number of data handle location. (Low Byte)

## ◆ TAB_PARA_DATA_DAT_SIZE

#define TAB_PARA_DATA_DAT_SIZE (TAB_PARA_DATA_DAT_START_L+4)

The tag number of data size location.

## ◆ TAB_PARA_DATA_DAT_START_H

#define TAB_PARA_DATA_DAT_START_H 4

The tag number of the starting position. (High Byte)

## ◆ TAB_PARA_DATA_DAT_START_L

#define TAB_PARA_DATA_DAT_START_L 5

The tag number of the starting position. (Low Byte)

## ◆ TAB_PARA_DATA_ERROR_CODE

#define TAB_PARA_DATA_ERROR_CODE 0

The tag number of error code.

## ◆ TAB_PARA_DATA_GATT_ROLE

#define TAB_PARA_DATA_GATT_ROLE (TAB_PARA_DATA_DAT_START_L+3)

The tag number of the GATT data role.

## ◆ TAB_PARA_DATA_HOSTID

#define TAB_PARA_DATA_HOSTID 3

The tag number of host id in data space.

## ◆ TAB_PARA_DATA_INI_ADDR

#define TAB_PARA_DATA_INI_ADDR 4

The tag number of INI_ADDR .

## ◆ TAB_PARA_DATA_OWN_EDIV

#define TAB_PARA_DATA_OWN_EDIV 79

The tag number of own EDIV value.

## ◆ TAB_PARA_DATA_OWN_RAND

#define TAB_PARA_DATA_OWN_RAND 71

The tag number of own RAND value.

## ◆ TAB_PARA_DATA_PID_H

#define TAB_PARA_DATA_PID_H 1

The tag number of PID in data space. (High Byte)

## ◆ TAB_PARA_DATA_PID_L

#define TAB_PARA_DATA_PID_L 2

The tag number of PID in data space. (Low Byte)