diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/AMB25 (RTL8720DF).fzpz b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/AMB25 (RTL8720DF).fzpz new file mode 100644 index 00000000..0747fe9f Binary files /dev/null and b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/AMB25 (RTL8720DF).fzpz differ diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) Schematic 2022-01-03.svg b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) Schematic 2022-01-03.svg new file mode 100644 index 00000000..8f7ac9a7 --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) Schematic 2022-01-03.svg @@ -0,0 +1,588 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) bottom 2022-12-29.png b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) bottom 2022-12-29.png new file mode 100644 index 00000000..baa9d909 Binary files /dev/null and b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) bottom 2022-12-29.png differ diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) bottom 2022-12-29.svg b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) bottom 2022-12-29.svg new file mode 100644 index 00000000..cf94c9a2 --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) bottom 2022-12-29.svg @@ -0,0 +1,1343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GND + GND + VDD33 + CHIP_EN + LOG_RXD + LOG_TXD + PB23 + PB22 + PB19 + PB18 + PB21 + PB20 + VDD33 + VDD5V + GND + + + GND + VDD5V + PB1 + PB2 + PB3 + PA27 + PA25 + PA26 + PA28 + PA30 + PA12 + PA13 + PA14 + PA15 + GND + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pcb 2022-12-29.svg b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pcb 2022-12-29.svg new file mode 100644 index 00000000..964ba963 --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pcb 2022-12-29.svg @@ -0,0 +1,535 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pinmap 2022-12-29.png b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pinmap 2022-12-29.png new file mode 100644 index 00000000..1da8747e Binary files /dev/null and b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pinmap 2022-12-29.png differ diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pinmap 2022-12-29.svg b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pinmap 2022-12-29.svg new file mode 100644 index 00000000..7ea0184c --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) pinmap 2022-12-29.svg @@ -0,0 +1,6550 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + GPIO interrupt pin + + + + + GND + + + + Power + + + + GPIO pin name + + + + Analog ADC pin + + + + PWM pin + + + + UART pin + + + + SPI pin + + + + I2C pin + + + + SWD debug pin + + + + IR pin + + + + + BACK + FRONT + AMB25(RTL8720DF) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GND + GND + VDD33 + CHIP_EN + LOG_TXD + LOG_RXD + PB23 + PB22 + PB19 + PB18 + PB21 + PB20 + VDD33 + VDD5V + GND + + GND + VDD5V + PB1 + PB2 + PB3 + PA27 + PA25 + PA26 + PA28 + PA30 + PA12 + PA13 + PA14 + PA15 + GND + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BURN + RST + + + + + + + + + + + + + 5V + + + + + + + + + + 3V3 + + + + + + + + + GND + + + + + + GND + + + + + + + + + + + 3V3 + + + + + + + + + + + PB20 + + + + INT + + + + + PWM + + + + + + + SPI_SCLK(b) + + + + SPI0_SCLK + + + + + + + + + + PB21 + + + + INT + + + + + PWM + + + + + + + SPI_SCLK(b) + + + + SPI0_SS + + + + + + + + PA18 + + + + INT + + + + + + SPI_SCLK(b) + + + + SPI0_MOSI + + + + + PWM + + + + + + SERIAL1_RX + + + + + + + + + PB19 + + + + INT + + + + + + SPI_SCLK(b) + + + + SPI0_MISO + + + + + PWM + + + + + + SERIAL1_TX + + + + + + + + IR_RX (b) + + + + + PWM + + + + + + PB22 + + + + INT + + + + + + + IR_TX (b) + + + + + PB23 + + + + INT + + + + + PWM + + + + + + + + + + PA8 + + + + + + LOG_RX + + + + + INT + + + + + + + + + PA7 + + + + + + LOG_TX + + + + + INT + + + + + + + + + + CHIP_EN + + + + + + + + GND + + + + + + + + + GND + + + + + + + + GND + + + + + + + + + + 5V + + + + + + + + + + + A4 + + + + + + PB1 + + + + INT + + + + + + + + + + A5 + + + + + + PB2 + + + + INT + + + + + + + + PB3 + + + + INT + + + + + + A6 + + + + + + + SWD_CLK + + + + + + + + PA27 + + + + INT + + + + + SWD_DATA + + + + + + + + + PA28 + + + + INT + + + + + PWM + + + + + + + + + PA30 + + + + INT + + + + + PWM + + + + + + + + + + PA12 + + + + INT + + + + + PWM + + + + + + SERIAL2_TX + + + + + + + SPI_SCLK(b) + + + + SPI1_MOSI + + + + + + + + PA13 + + + + INT + + + + + PWM + + + + + + SERIAL2_RX + + + + + + + SPI_SCLK(b) + + + + SPI1_MISO + + + + + + + + PA14 + + + + INT + + + + + + SPI_SCLK(b) + + + + SPI1_SCLK + + + + + + + + PA15 + + + + INT + + + + + + SPI_SCLK(b) + + + + SPI1_SS + + + + + + + IR_TX (a) + + + + PA25 + + + + INT + + + + + PWM + + + + + + I2C_SCL + + + + + + + + PA26 + + + + INT + + + + + PWM + + + + + IR_RX (a) + + + + I2C_SDA + + + + + + + + + diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) top 2023-01-03.png b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) top 2023-01-03.png new file mode 100644 index 00000000..85db33cf Binary files /dev/null and b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) top 2023-01-03.png differ diff --git a/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) top 2023-01-03.svg b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) top 2023-01-03.svg new file mode 100644 index 00000000..355a82ed --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/AMB25 (RTL8720DF)/graphics/AMB25 (RTL8720DF) top 2023-01-03.svg @@ -0,0 +1,1935 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/BW16-TypeC (RTL8720DN) EVB.fzpz b/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/BW16-TypeC (RTL8720DN) EVB.fzpz index 0944d45a..e0d7c348 100644 Binary files a/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/BW16-TypeC (RTL8720DN) EVB.fzpz and b/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/BW16-TypeC (RTL8720DN) EVB.fzpz differ diff --git a/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/graphics/BW16-TypeC (RTL8720DN) 2023-01-09.svg b/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/graphics/BW16-TypeC (RTL8720DN) 2023-01-09.svg new file mode 100644 index 00000000..072643d6 --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/graphics/BW16-TypeC (RTL8720DN) 2023-01-09.svg @@ -0,0 +1,2601 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GNS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/graphics/BW16-TypeC PCB 2023-01-09.svg b/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/graphics/BW16-TypeC PCB 2023-01-09.svg new file mode 100644 index 00000000..6fc7fd93 --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/BW16-TypeC (RTL8720DN)/graphics/BW16-TypeC PCB 2023-01-09.svg @@ -0,0 +1,432 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM) PCB.fzpz b/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM) PCB.fzpz new file mode 100644 index 00000000..b7b26941 Binary files /dev/null and b/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM) PCB.fzpz differ diff --git a/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/graphics/AW-CU488 (RTL8721DM) 2022-11-07.png b/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/graphics/AW-CU488 (RTL8721DM) 2022-11-07.png new file mode 100644 index 00000000..37b93914 Binary files /dev/null and b/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/graphics/AW-CU488 (RTL8721DM) 2022-11-07.png differ diff --git a/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/graphics/AW-CU488 (RTL8721DM) 2022-11-07.svg b/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/graphics/AW-CU488 (RTL8721DM) 2022-11-07.svg new file mode 100644 index 00000000..03d7b15e --- /dev/null +++ b/Ameba_misc/Fritzing and Pinmux/SparkFun AzureWave Thing Plus AW-CU488 (RTL8721DM)/graphics/AW-CU488 (RTL8721DM) 2022-11-07.svg @@ -0,0 +1,3504 @@ + + + + + + + + + + + + + layer 21 + + text:+ + + + + + text:- + - + + + element:C1 + + package:0402-TIGHT + + + + element:C2 + + package:0402-TIGHT + + + + element:C3 + + package:0402-TIGHT + + + + element:C4 + + package:0603 + + + + element:C6 + + package:0402-TIGHT + + + + element:C7 + + package:0402-TIGHT + + + + element:C10 + + package:0402-TIGHT + + + + element:C19 + + package:0402-TIGHT + + + + element:CHG + + package:SMT-JUMPER_3_1-NC_TRACE_SILK + + + + element:D1 + + package:LED-0603 + + + + + element:D2 + + package:SOD-323 + + + + + + + element:D3 + + package:LED-0603 + + + + + element:D4 + + package:LED-0603 + + + + + element:D6 + + package:SOT886 + + + + + + + element:FD1 + + package:FIDUCIAL-MICRO + + + + element:FD2 + + package:FIDUCIAL-MICRO + + + + element:FD3 + + package:FIDUCIAL-MICRO + + + + element:FD4 + + package:FIDUCIAL-MICRO + + + + element:H1 + + package:STAND-OFF + + + + element:H2 + + package:STAND-OFF + + + + element:J1 + + package:THING_PLUS + + + + element:J2 + + package:JST-2-SMD + + + + + + + + + + + + + element:J3 + + package:JST04_1MM_RA + + + + + + + + + + element:J5 + + package:USB-C-16P-4LAYER-ISOLATED + + + + + + element:J6 + + package:1X05_NO_SILK + + + + element:J7 + + package:1X05_NO_SILK + + + + element:JP1 + + package:SMT-JUMPER_2_NC_TRACE_SILK + + + + element:JP2 + + package:SMT-JUMPER_2_NC_TRACE_SILK + + + + element:LED + + package:SMT-JUMPER_2_NC_TRACE_SILK + + + + element:LOGO1 + + package:SFE_LOGO_NAME_.1 + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + + + element:LOGO2 + + package:OSHW-LOGO-MINI + + + + element:LOGO3 + + package:SFE_LOGO_NAME_FLAME_.1 + + + + element:LOGO6 + + package:QWIIC_4MM + + polygon + + + + polygon + + + + + + element:Q1 + + package:SOT23-3 + + + + + + + + element:Q2 + + package:SC70-6 + + + + + + + + + + + element:R1 + + package:0402-TIGHT + + + + element:R2 + + package:0402-TIGHT + + + + element:R3 + + package:0402-TIGHT + + + + element:R4 + + package:0402-TIGHT + + + + element:R5 + + package:0402-TIGHT + + + + element:R6 + + package:0603 + + + + element:R7 + + package:0402-TIGHT + + + + element:R8 + + package:0402-TIGHT + + + + element:R9 + + package:0402-TIGHT + + + + element:R10 + + package:0402-TIGHT + + + + element:R11 + + package:0402-TIGHT + + + + element:R12 + + package:0402-TIGHT + + + + element:R13 + + package:0402-TIGHT + + + + element:R15 + + package:0402-TIGHT + + + + element:R17 + + package:0402-TIGHT + + + + element:R18 + + package:0402-TIGHT + + + + element:S1 + + package:TACTILE_SWITCH_SMD_4.6X2.8MM + + + + + + + + + element:S2 + + package:TACTILE_SWITCH_SMD_4.6X2.8MM + + + + + + + + + element:U$1 + + package:#10#30 + + polygon + + + + polygon + + + + + + element:U$2 + + package:BOOT0 + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + + + element:U$3 + + package:CHG0 + + + + element:U$4 + + package:#500#0 + + + + element:U$5 + + package:#11#30 + + polygon + + + + + + element:U$6 + + package:AZUREWAVE0 + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + + + element:U$7 + + package:1330 + + polygon + + + + polygon + + + + + + element:U$8 + + package:AZUREWAVE0 + + + + element:U$9 + + package:AW#CU488_0 + + + + element:U$10 + + package:THING_PLUS_0 + + + + element:U$11 + + package:MA0 + + + + element:U$12 + + package:#12#30 + + polygon + + + + + + element:U$14 + + package:#13#30 + + polygon + + + + + + element:U$15 + + package:#JP1#1 + + + + element:U$16 + + package:#0#1 + + polygon + + + + polygon + + + + + + element:U$18 + + package:#A0#30 + + polygon + + + + polygon + + + + polygon + + + + + + element:U$19 + + package:#JP2#4 + + + + element:U$20 + + package:#USBSHLD#GND#3 + + + + element:U$23 + + package:PWR0 + + polygon + + + + polygon + + + + polygon + + + + + + element:U$27 + + package:AW#CU488_0 + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + + + element:U$29 + + package:#LED#0 + + + + element:U$32 + + package:#GND#0 + + + + element:U$41 + + package:#VUSB#0 + + + + element:U$42 + + package:#VBAT#0 + + + + element:U$43 + + package:#EN#0 + + + + element:U$45 + + package:#3V3#0 + + + + element:U$46 + + package:##RESET##0 + + + + element:U$48 + + package:#4#TX1#14 + + + + element:U$49 + + package:#3#RX1#14 + + + + element:U$50 + + package:#2#POCI#14 + + + + element:U$53 + + package:#A1#6 + + polygon + + + + polygon + + + + + + element:U$54 + + package:#A2#6 + + polygon + + + + polygon + + + + + + element:U$55 + + package:#A3#6 + + polygon + + + + polygon + + + + + + element:U$56 + + package:#A4#6 + + polygon + + + + polygon + + + + + + element:U$57 + + package:#A5#6 + + polygon + + + + polygon + + + + + + element:U$60 + + package:#100#0 + + + + element:U$62 + + package:THING_PLUS_0 + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + + + element:U$64 + + package:#1#PICO#14 + + + + element:U$67 + + package:#13#14 + + + + element:U$68 + + package:#12#14 + + + + element:U$69 + + package:#11#14 + + + + element:U$70 + + package:#10#14 + + + + element:U$71 + + package:#9#A6#14 + + + + element:U$72 + + package:#8#CS#14 + + + + element:U$73 + + package:#7#14 + + + + element:U$74 + + package:#6#SCL#14 + + + + element:U$75 + + package:#5#SDA#14 + + + + element:U$76 + + package:#0#SCK#14 + + + + element:U$77 + + package:#14#A0#15 + + + + element:U$78 + + package:CHG0 + + polygon + + + + polygon + + + + polygon + + + + + + element:U$79 + + package:RESET0 + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + polygon + + + + + + element:U$80 + + package:#15#A1#15 + + + + element:U$81 + + package:#16#A2#16 + + + + element:U$82 + + package:#17#A3#17 + + + + element:U$83 + + package:#18#A4#18 + + + + element:U$84 + + package:#19#A5#19 + + + + element:U$85 + + package:#20#20 + + + + element:U$86 + + package:#GND#0 + + + + element:U$87 + + package:#21#21 + + + + element:U$88 + + package:#22#22 + + + + element:U$89 + + package:#23#23 + + + + element:U$90 + + package:#24#TX#24 + + + + element:U$91 + + package:#25#RX#25 + + + + element:U$92 + + package:#26#26 + + + + element:U$93 + + package:#27#27 + + + + element:U$94 + + package:#28#28 + + + + element:U$95 + + package:#29#29 + + + + element:U1 + + package:LGA150_AW-CU488 + + + + + + + + + element:U2 + + package:QFN24 + + + + + + + + + + + + + element:U3 + + package:SOT23-5 + + + + + + + + element:U4 + + package:SOT23-5 + + + + + + + + element:USBSHLD + + package:SMT-JUMPER_2_NC_TRACE_SILK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sparkfun_qwiic_onboard_connector.svg + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureWave Model: + AW-CU88 + + + + + + + + + + + diff --git a/Arduino_package/ameba_d_tools_linux/debug/RTL872x_Arduino_debug.JLinkScript b/Arduino_package/ameba_d_tools_linux/debug/RTL872x_Arduino_debug.JLinkScript new file mode 100644 index 00000000..e6ca6402 --- /dev/null +++ b/Arduino_package/ameba_d_tools_linux/debug/RTL872x_Arduino_debug.JLinkScript @@ -0,0 +1,22 @@ +void ConfigTargetSettings(void) { + JLINK_CORESIGHT_AddAP(0, CORESIGHT_APB_AP); + JLINK_CORESIGHT_AddAP(1, CORESIGHT_AHB_AP); + JLINK_CORESIGHT_AddAP(2, CORESIGHT_AHB_AP); + JLINK_CPU = CORTEX_M33; + JLINK_CORESIGHT_IndexAHBAPToUse = 2; + + JLINK_ExecCommand("map ram 0x10000000-0x1007FFFF"); + JLINK_ExecCommand("map add 0x08000000-0x0FFFFFFF N FLASH"); + JLINK_ExecCommand("DisableFlashBPs"); + JLINK_ExecCommand("DisableFlashDL"); + + JTAG_WriteClocks(1); + JTAG_Speed = 1000; +} + +void AfterResetTarget(void) { + unsigned int TMP; + TMP = MEM_ReadU32(0x480003F8); + TMP = TMP | (1<<25); + MEM_WriteU32(0x480003F8, TMP); +} \ No newline at end of file diff --git a/Arduino_package/ameba_d_tools_linux/tools/linux/src/postbuild_img2_arduino_linux.cpp b/Arduino_package/ameba_d_tools_linux/tools/linux/src/postbuild_img2_arduino_linux.cpp index e47009f6..74f967d4 100644 --- a/Arduino_package/ameba_d_tools_linux/tools/linux/src/postbuild_img2_arduino_linux.cpp +++ b/Arduino_package/ameba_d_tools_linux/tools/linux/src/postbuild_img2_arduino_linux.cpp @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) { // check if this symbole appears in the map file for (iter = lines.begin(); iter != lines.end(); ++iter) { if ((iter->find(bksym)) != string::npos) { - cerr << endl << "ERROR: " << msg << endl << endl; + cerr << "ERROR: " << msg << endl; ret = -1; break; } diff --git a/Arduino_package/ameba_d_tools_macos/debug/RTL872x_Arduino_debug.JLinkScript b/Arduino_package/ameba_d_tools_macos/debug/RTL872x_Arduino_debug.JLinkScript new file mode 100644 index 00000000..e6ca6402 --- /dev/null +++ b/Arduino_package/ameba_d_tools_macos/debug/RTL872x_Arduino_debug.JLinkScript @@ -0,0 +1,22 @@ +void ConfigTargetSettings(void) { + JLINK_CORESIGHT_AddAP(0, CORESIGHT_APB_AP); + JLINK_CORESIGHT_AddAP(1, CORESIGHT_AHB_AP); + JLINK_CORESIGHT_AddAP(2, CORESIGHT_AHB_AP); + JLINK_CPU = CORTEX_M33; + JLINK_CORESIGHT_IndexAHBAPToUse = 2; + + JLINK_ExecCommand("map ram 0x10000000-0x1007FFFF"); + JLINK_ExecCommand("map add 0x08000000-0x0FFFFFFF N FLASH"); + JLINK_ExecCommand("DisableFlashBPs"); + JLINK_ExecCommand("DisableFlashDL"); + + JTAG_WriteClocks(1); + JTAG_Speed = 1000; +} + +void AfterResetTarget(void) { + unsigned int TMP; + TMP = MEM_ReadU32(0x480003F8); + TMP = TMP | (1<<25); + MEM_WriteU32(0x480003F8, TMP); +} \ No newline at end of file diff --git a/Arduino_package/ameba_d_tools_macos/tools/macos/src/postbuild_img2_arduino_macos.cpp b/Arduino_package/ameba_d_tools_macos/tools/macos/src/postbuild_img2_arduino_macos.cpp index 50f38a36..9ff5dfb4 100644 --- a/Arduino_package/ameba_d_tools_macos/tools/macos/src/postbuild_img2_arduino_macos.cpp +++ b/Arduino_package/ameba_d_tools_macos/tools/macos/src/postbuild_img2_arduino_macos.cpp @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) { // check if this symbole appears in the map file for (iter = lines.begin(); iter != lines.end(); ++iter) { if ((iter->find(bksym)) != string::npos) { - cerr << endl << "ERROR: " << msg << endl << endl; + cerr << "ERROR: " << msg << endl; ret = -1; break; } diff --git a/Arduino_package/ameba_d_tools_windows/debug/RTL872x_Arduino_debug.JLinkScript b/Arduino_package/ameba_d_tools_windows/debug/RTL872x_Arduino_debug.JLinkScript new file mode 100644 index 00000000..e6ca6402 --- /dev/null +++ b/Arduino_package/ameba_d_tools_windows/debug/RTL872x_Arduino_debug.JLinkScript @@ -0,0 +1,22 @@ +void ConfigTargetSettings(void) { + JLINK_CORESIGHT_AddAP(0, CORESIGHT_APB_AP); + JLINK_CORESIGHT_AddAP(1, CORESIGHT_AHB_AP); + JLINK_CORESIGHT_AddAP(2, CORESIGHT_AHB_AP); + JLINK_CPU = CORTEX_M33; + JLINK_CORESIGHT_IndexAHBAPToUse = 2; + + JLINK_ExecCommand("map ram 0x10000000-0x1007FFFF"); + JLINK_ExecCommand("map add 0x08000000-0x0FFFFFFF N FLASH"); + JLINK_ExecCommand("DisableFlashBPs"); + JLINK_ExecCommand("DisableFlashDL"); + + JTAG_WriteClocks(1); + JTAG_Speed = 1000; +} + +void AfterResetTarget(void) { + unsigned int TMP; + TMP = MEM_ReadU32(0x480003F8); + TMP = TMP | (1<<25); + MEM_WriteU32(0x480003F8, TMP); +} \ No newline at end of file diff --git a/Arduino_package/ameba_d_tools_windows/tools/windows/src/postbuild_img2_arduino_windows.cpp b/Arduino_package/ameba_d_tools_windows/tools/windows/src/postbuild_img2_arduino_windows.cpp index aa6e6c1a..b4926e65 100644 --- a/Arduino_package/ameba_d_tools_windows/tools/windows/src/postbuild_img2_arduino_windows.cpp +++ b/Arduino_package/ameba_d_tools_windows/tools/windows/src/postbuild_img2_arduino_windows.cpp @@ -274,7 +274,6 @@ int main(int argc, char *argv[]) { if (pos != string::npos) { check_powersavemode = 326; } - } fout.close(); diff --git a/Arduino_package/hardware/boards.txt b/Arduino_package/hardware/boards.txt index 67ef145a..de60bb38 100644 --- a/Arduino_package/hardware/boards.txt +++ b/Arduino_package/hardware/boards.txt @@ -1,138 +1,234 @@ -menu.AutoUploadMode=Auto Upload Mode -menu.EraseFlash=Erase Flash +menu.AutoUploadMode=* Auto Upload Mode +menu.EraseFlash=* Erase Flash +menu.StdLibInit=* Standard Lib Enable ############################################################## # PLEASE DO NOT PUT BOARDS ABOVE THE OFFICIAL AMEBA BOARDS! ## ############################################################## -ameba_rtl8722dm.name=AMB21/AMB22 (RTL8722DM/CSM) -#ameba_rtl8722dm.vid.0=0x0403 -#ameba_rtl8722dm.pid.0=0x6001 - -ameba_rtl8722dm.upload.tool=ameba_d_tools -ameba_rtl8722dm.upload.protocol=usb_serial -ameba_rtl8722dm.upload.maximum_size=2097152 -ameba_rtl8722dm.upload.use_1200bps_touch=false -ameba_rtl8722dm.upload.wait_for_upload_port=false -ameba_rtl8722dm.upload.native_usb=false - -ameba_rtl8722dm.build.tarch=cortex-m33 -ameba_rtl8722dm.build.mcu=RTL8722DM/CSM -ameba_rtl8722dm.build.f_cpu=200000000L -ameba_rtl8722dm.build.usb_product="AMB21" -ameba_rtl8722dm.build.board=AMEBA -ameba_rtl8722dm.build.core=ambd -ameba_rtl8722dm.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM {build.usb_flags} -ameba_rtl8722dm.build.ldscript=linker_scripts/gcc/rlx8721d_img2_is_arduino.ld -ameba_rtl8722dm.build.variant=rtl8722dm - -ameba_rtl8722dm.menu.EraseFlash.Disable=Disable -ameba_rtl8722dm.menu.EraseFlash.Disable.build.erase_flash=Disable -ameba_rtl8722dm.menu.EraseFlash.Enable=Enable -ameba_rtl8722dm.menu.EraseFlash.Enable.build.erase_flash=Enable - -#ameba_rtl8722dm.menu.AutoUploadMode.Disable=Disable -#ameba_rtl8722dm.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable -#ameba_rtl8722dm.menu.AutoUploadMode.Enable=Enable -#ameba_rtl8722dm.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable +Ameba_AMB21_AMB22.name=AMB21/AMB22 (RTL8722DM/CSM) +#Ameba_AMB21_AMB22.vid.0=0x0403 +#Ameba_AMB21_AMB22.pid.0=0x6001 + +Ameba_AMB21_AMB22.upload.tool=ameba_d_tools +Ameba_AMB21_AMB22.upload.protocol=usb_serial +Ameba_AMB21_AMB22.upload.maximum_size=2097152 +Ameba_AMB21_AMB22.upload.use_1200bps_touch=false +Ameba_AMB21_AMB22.upload.wait_for_upload_port=false +Ameba_AMB21_AMB22.upload.native_usb=false + +Ameba_AMB21_AMB22.build.tarch=cortex-m33 +Ameba_AMB21_AMB22.build.mcu=RTL8722DM/CSM +Ameba_AMB21_AMB22.build.f_cpu=200000000L +Ameba_AMB21_AMB22.build.usb_product="AMB21" +Ameba_AMB21_AMB22.build.board=AMEBA +Ameba_AMB21_AMB22.build.core=ambd +Ameba_AMB21_AMB22.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM {build.usb_flags} +Ameba_AMB21_AMB22.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld +Ameba_AMB21_AMB22.build.variant=rtl8722dm + +Ameba_AMB21_AMB22.menu.EraseFlash.Disable=Disable +Ameba_AMB21_AMB22.menu.EraseFlash.Disable.build.erase_flash=Disable +Ameba_AMB21_AMB22.menu.EraseFlash.Enable=Enable +Ameba_AMB21_AMB22.menu.EraseFlash.Enable.build.erase_flash=Enable + +#Ameba_AMB21_AMB22.menu.AutoUploadMode.Disable=Disable +#Ameba_AMB21_AMB22.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable +#Ameba_AMB21_AMB22.menu.AutoUploadMode.Enable=Enable +#Ameba_AMB21_AMB22.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable + +Ameba_AMB21_AMB22.menu.StdLibInit.Disable=NA +Ameba_AMB21_AMB22.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM {build.usb_flags} +Ameba_AMB21_AMB22.menu.StdLibInit.Enable=Arduino_STD_PRINTF +Ameba_AMB21_AMB22.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM {build.usb_flags} -DArduino_STD_PRINTF ############################################################## -ameba_rtl8722dm_mini.name=AMB23 (RTL8722DM_MINI) -#ameba_rtl8722dm_mini.vid.0=0x0403 -#ameba_rtl8722dm_mini.pid.0=0x6001 - -ameba_rtl8722dm_mini.upload.tool=ameba_d_tools -ameba_rtl8722dm_mini.upload.protocol=usb_serial -ameba_rtl8722dm_mini.upload.maximum_size=2097152 -ameba_rtl8722dm_mini.upload.use_1200bps_touch=false -ameba_rtl8722dm_mini.upload.wait_for_upload_port=false -ameba_rtl8722dm_mini.upload.native_usb=false - -ameba_rtl8722dm_mini.build.tarch=cortex-m33 -ameba_rtl8722dm_mini.build.mcu=RTL8722DM -ameba_rtl8722dm_mini.build.f_cpu=200000000L -ameba_rtl8722dm_mini.build.usb_product="AMB23" -ameba_rtl8722dm_mini.build.board=AMEBA -ameba_rtl8722dm_mini.build.core=ambd -ameba_rtl8722dm_mini.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM_MINI {build.usb_flags} -ameba_rtl8722dm_mini.build.ldscript=linker_scripts/gcc/rlx8721d_img2_is_arduino.ld -ameba_rtl8722dm_mini.build.variant=rtl8722dm_mini - -ameba_rtl8722dm_mini.menu.EraseFlash.Disable=Disable -ameba_rtl8722dm_mini.menu.EraseFlash.Disable.build.erase_flash=Disable -ameba_rtl8722dm_mini.menu.EraseFlash.Enable=Enable -ameba_rtl8722dm_mini.menu.EraseFlash.Enable.build.erase_flash=Enable - -#ameba_rtl8722dm_mini.menu.AutoUploadMode.Disable=Disable -#ameba_rtl8722dm_mini.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable -#ameba_rtl8722dm_mini.menu.AutoUploadMode.Enable=Enable -#ameba_rtl8722dm_mini.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable +Ameba_AMB23.name=AMB23 (RTL8722DM) +#Ameba_AMB23.vid.0=0x0403 +#Ameba_AMB23.pid.0=0x6001 + +Ameba_AMB23.upload.tool=ameba_d_tools +Ameba_AMB23.upload.protocol=usb_serial +Ameba_AMB23.upload.maximum_size=2097152 +Ameba_AMB23.upload.use_1200bps_touch=false +Ameba_AMB23.upload.wait_for_upload_port=false +Ameba_AMB23.upload.native_usb=false + +Ameba_AMB23.build.tarch=cortex-m33 +Ameba_AMB23.build.mcu=RTL8722DM +Ameba_AMB23.build.f_cpu=200000000L +Ameba_AMB23.build.usb_product="AMB23" +Ameba_AMB23.build.board=AMEBA +Ameba_AMB23.build.core=ambd +Ameba_AMB23.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM_MINI {build.usb_flags} +Ameba_AMB23.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld +Ameba_AMB23.build.variant=rtl8722dm_mini + +Ameba_AMB23.menu.EraseFlash.Disable=Disable +Ameba_AMB23.menu.EraseFlash.Disable.build.erase_flash=Disable +Ameba_AMB23.menu.EraseFlash.Enable=Enable +Ameba_AMB23.menu.EraseFlash.Enable.build.erase_flash=Enable + +#Ameba_AMB23.menu.AutoUploadMode.Disable=Disable +#Ameba_AMB23.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable +#Ameba_AMB23.menu.AutoUploadMode.Enable=Enable +#Ameba_AMB23.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable + +Ameba_AMB23.menu.StdLibInit.Disable=NA +Ameba_AMB23.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM_MINI {build.usb_flags} +Ameba_AMB23.menu.StdLibInit.Enable=Arduino_STD_PRINTF +Ameba_AMB23.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8722DM_MINI {build.usb_flags} -DArduino_STD_PRINTF ############################################################## -ameba_rtl8720dn_bw16.name=BW16 (RTL8720DN) -#ameba_rtl8720dn_bw16.vid.0=0x1A86 -#ameba_rtl8720dn_bw16.pid.0=0x7523 - -ameba_rtl8720dn_bw16.upload.tool=ameba_d_tools -ameba_rtl8720dn_bw16.upload.protocol=usb_serial -ameba_rtl8720dn_bw16.upload.maximum_size=2097152 -ameba_rtl8720dn_bw16.upload.use_1200bps_touch=false -ameba_rtl8720dn_bw16.upload.wait_for_upload_port=false -ameba_rtl8720dn_bw16.upload.native_usb=false - -ameba_rtl8720dn_bw16.build.tarch=cortex-m33 -ameba_rtl8720dn_bw16.build.mcu=RTL8720DN -ameba_rtl8720dn_bw16.build.f_cpu=200000000L -ameba_rtl8720dn_bw16.build.usb_product="BW16" -ameba_rtl8720dn_bw16.build.board=AMEBA -ameba_rtl8720dn_bw16.build.core=ambd -ameba_rtl8720dn_bw16.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DN_BW16 {build.usb_flags} -ameba_rtl8720dn_bw16.build.ldscript=linker_scripts/gcc/rlx8721d_img2_is_arduino.ld -ameba_rtl8720dn_bw16.build.variant=rtl8720dn_bw16 - -ameba_rtl8720dn_bw16.menu.EraseFlash.Disable=Disable -ameba_rtl8720dn_bw16.menu.EraseFlash.Disable.build.erase_flash=Disable -ameba_rtl8720dn_bw16.menu.EraseFlash.Enable=Enable -ameba_rtl8720dn_bw16.menu.EraseFlash.Enable.build.erase_flash=Enable - -ameba_rtl8720dn_bw16.menu.AutoUploadMode.Disable=Disable -ameba_rtl8720dn_bw16.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable -ameba_rtl8720dn_bw16.menu.AutoUploadMode.Enable=Enable -ameba_rtl8720dn_bw16.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable +Ai-Thinker_BW16.name=Ai-Thinker BW16 (RTL8720DN) +#Ai-Thinker_BW16.vid.0=0x1A86 +#Ai-Thinker_BW16.pid.0=0x7523 + +Ai-Thinker_BW16.upload.tool=ameba_d_tools +Ai-Thinker_BW16.upload.protocol=usb_serial +Ai-Thinker_BW16.upload.maximum_size=2097152 +Ai-Thinker_BW16.upload.use_1200bps_touch=false +Ai-Thinker_BW16.upload.wait_for_upload_port=false +Ai-Thinker_BW16.upload.native_usb=false + +Ai-Thinker_BW16.build.tarch=cortex-m33 +Ai-Thinker_BW16.build.mcu=RTL8720DN +Ai-Thinker_BW16.build.f_cpu=200000000L +Ai-Thinker_BW16.build.usb_product="BW16" +Ai-Thinker_BW16.build.board=AMEBA +Ai-Thinker_BW16.build.core=ambd +Ai-Thinker_BW16.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DN_BW16 {build.usb_flags} +Ai-Thinker_BW16.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld +Ai-Thinker_BW16.build.variant=rtl8720dn_bw16 + +Ai-Thinker_BW16.menu.EraseFlash.Disable=Disable +Ai-Thinker_BW16.menu.EraseFlash.Disable.build.erase_flash=Disable +Ai-Thinker_BW16.menu.EraseFlash.Enable=Enable +Ai-Thinker_BW16.menu.EraseFlash.Enable.build.erase_flash=Enable + +Ai-Thinker_BW16.menu.AutoUploadMode.Disable=Disable +Ai-Thinker_BW16.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable +Ai-Thinker_BW16.menu.AutoUploadMode.Enable=Enable +Ai-Thinker_BW16.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable + +Ai-Thinker_BW16.menu.StdLibInit.Disable=NA +Ai-Thinker_BW16.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DN_BW16 {build.usb_flags} +Ai-Thinker_BW16.menu.StdLibInit.Enable=Arduino_STD_PRINTF +Ai-Thinker_BW16.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DN_BW16 {build.usb_flags} -DArduino_STD_PRINTF ############################################################## -awcu488_thingplus.name=AW-CU488 Thing Plus (RTL8721DM) -#awcu488_thingplus.vid.0=0x10C4 -#awcu488_thingplus.pid.0=0xEA60 - -awcu488_thingplus.upload.tool=ameba_d_tools -awcu488_thingplus.upload.protocol=usb_serial -awcu488_thingplus.upload.maximum_size=2097152 -awcu488_thingplus.upload.use_1200bps_touch=false -awcu488_thingplus.upload.wait_for_upload_port=false -awcu488_thingplus.upload.native_usb=false - -awcu488_thingplus.build.tarch=cortex-m33 -awcu488_thingplus.build.mcu=RTL8721DM -awcu488_thingplus.build.f_cpu=200000000L -awcu488_thingplus.build.usb_product="AW-CU488_ThingPlus" -awcu488_thingplus.build.board=AMEBA -awcu488_thingplus.build.core=ambd -awcu488_thingplus.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8721DM {build.usb_flags} -awcu488_thingplus.build.ldscript=linker_scripts/gcc/rlx8721d_img2_is_arduino.ld -awcu488_thingplus.build.variant=awcu488_thingplus - -awcu488_thingplus.menu.EraseFlash.Disable=Disable -awcu488_thingplus.menu.EraseFlash.Disable.build.erase_flash=Disable -awcu488_thingplus.menu.EraseFlash.Enable=Enable -awcu488_thingplus.menu.EraseFlash.Enable.build.erase_flash=Enable - -awcu488_thingplus.menu.AutoUploadMode.Disable=Disable -awcu488_thingplus.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable -awcu488_thingplus.menu.AutoUploadMode.Enable=Enable -awcu488_thingplus.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable \ No newline at end of file +SparkFun_ThingPlus-AWCU488.name=SparkFun AzureWave Thing Plus - AW-CU488 (RTL8721DM) +#SparkFun_ThingPlus-AWCU488.vid.0=0x10C4 +#SparkFun_ThingPlus-AWCU488.pid.0=0xEA60 + +SparkFun_ThingPlus-AWCU488.upload.tool=ameba_d_tools +SparkFun_ThingPlus-AWCU488.upload.protocol=usb_serial +SparkFun_ThingPlus-AWCU488.upload.maximum_size=2097152 +SparkFun_ThingPlus-AWCU488.upload.use_1200bps_touch=false +SparkFun_ThingPlus-AWCU488.upload.wait_for_upload_port=false +SparkFun_ThingPlus-AWCU488.upload.native_usb=false + +SparkFun_ThingPlus-AWCU488.build.tarch=cortex-m33 +SparkFun_ThingPlus-AWCU488.build.mcu=RTL8721DM +SparkFun_ThingPlus-AWCU488.build.f_cpu=200000000L +SparkFun_ThingPlus-AWCU488.build.usb_product="AW-CU488_ThingPlus" +SparkFun_ThingPlus-AWCU488.build.board=AMEBA +SparkFun_ThingPlus-AWCU488.build.core=ambd +SparkFun_ThingPlus-AWCU488.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8721DM {build.usb_flags} +SparkFun_ThingPlus-AWCU488.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld +SparkFun_ThingPlus-AWCU488.build.variant=sparkfun_thingplus-awcu488 + +SparkFun_ThingPlus-AWCU488.menu.EraseFlash.Disable=Disable +SparkFun_ThingPlus-AWCU488.menu.EraseFlash.Disable.build.erase_flash=Disable +SparkFun_ThingPlus-AWCU488.menu.EraseFlash.Enable=Enable +SparkFun_ThingPlus-AWCU488.menu.EraseFlash.Enable.build.erase_flash=Enable + +SparkFun_ThingPlus-AWCU488.menu.AutoUploadMode.Disable=Disable +SparkFun_ThingPlus-AWCU488.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable +SparkFun_ThingPlus-AWCU488.menu.AutoUploadMode.Enable=Enable +SparkFun_ThingPlus-AWCU488.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable + +SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Disable=NA +SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8721DM {build.usb_flags} +SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Enable=Arduino_STD_PRINTF +SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8721DM {build.usb_flags} -DArduino_STD_PRINTF + +############################################################## + +Ameba_AMB25_AMB26.name=AMB25/AMB26 (RTL8720DF) +#Ameba_AMB25_AMB26.vid.0=0x10C4 +#Ameba_AMB25_AMB26.pid.0=0xEA60 + +Ameba_AMB25_AMB26.upload.tool=ameba_d_tools +Ameba_AMB25_AMB26.upload.protocol=usb_serial +Ameba_AMB25_AMB26.upload.maximum_size=2097152 +Ameba_AMB25_AMB26.upload.use_1200bps_touch=false +Ameba_AMB25_AMB26.upload.wait_for_upload_port=false +Ameba_AMB25_AMB26.upload.native_usb=false + +Ameba_AMB25_AMB26.build.tarch=cortex-m33 +Ameba_AMB25_AMB26.build.mcu=RTL8720DF +Ameba_AMB25_AMB26.build.f_cpu=200000000L +Ameba_AMB25_AMB26.build.usb_product="AMB25/AMB26" +Ameba_AMB25_AMB26.build.board=AMEBA +Ameba_AMB25_AMB26.build.core=ambd +Ameba_AMB25_AMB26.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DF {build.usb_flags} +Ameba_AMB25_AMB26.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld +Ameba_AMB25_AMB26.build.variant=ameba_amb25_amb26 + +Ameba_AMB25_AMB26.menu.EraseFlash.Disable=Disable +Ameba_AMB25_AMB26.menu.EraseFlash.Disable.build.erase_flash=Disable +Ameba_AMB25_AMB26.menu.EraseFlash.Enable=Enable +Ameba_AMB25_AMB26.menu.EraseFlash.Enable.build.erase_flash=Enable + +Ameba_AMB25_AMB26.menu.AutoUploadMode.Disable=Disable +Ameba_AMB25_AMB26.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable +Ameba_AMB25_AMB26.menu.AutoUploadMode.Enable=Enable +Ameba_AMB25_AMB26.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable + +Ameba_AMB25_AMB26.menu.StdLibInit.Disable=NA +Ameba_AMB25_AMB26.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DF {build.usb_flags} +Ameba_AMB25_AMB26.menu.StdLibInit.Enable=Arduino_STD_PRINTF +Ameba_AMB25_AMB26.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DF {build.usb_flags} -DArduino_STD_PRINTF + +############################################################## + +u-blox_NORA-W30.name=u-blox NORA-W30 series (RTL8720DF) + +u-blox_NORA-W30.upload.tool=ameba_d_tools +u-blox_NORA-W30.upload.protocol=usb_serial +u-blox_NORA-W30.upload.maximum_size=2097152 +u-blox_NORA-W30.upload.use_1200bps_touch=false +u-blox_NORA-W30.upload.wait_for_upload_port=false +u-blox_NORA-W30.upload.native_usb=false + +u-blox_NORA-W30.build.tarch=cortex-m33 +u-blox_NORA-W30.build.mcu=RTL8720DF +u-blox_NORA-W30.build.f_cpu=200000000L +u-blox_NORA-W30.build.usb_product="u-blox_NORA-W30" +u-blox_NORA-W30.build.board=AMEBA +u-blox_NORA-W30.build.core=ambd +u-blox_NORA-W30.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DF {build.usb_flags} +u-blox_NORA-W30.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld +u-blox_NORA-W30.build.variant=u-blox_NORA-W30 + +u-blox_NORA-W30.menu.EraseFlash.Disable=Disable +u-blox_NORA-W30.menu.EraseFlash.Disable.build.erase_flash=Disable +u-blox_NORA-W30.menu.EraseFlash.Enable=Enable +u-blox_NORA-W30.menu.EraseFlash.Enable.build.erase_flash=Enable + +u-blox_NORA-W30.menu.AutoUploadMode.Disable=Disable +u-blox_NORA-W30.menu.AutoUploadMode.Disable.build.auto_upload_mode=Disable +u-blox_NORA-W30.menu.AutoUploadMode.Enable=Enable +u-blox_NORA-W30.menu.AutoUploadMode.Enable.build.auto_upload_mode=Enable + +u-blox_NORA-W30.menu.StdLibInit.Disable=NA +u-blox_NORA-W30.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DF {build.usb_flags} +u-blox_NORA-W30.menu.StdLibInit.Enable=Arduino_STD_PRINTF +u-blox_NORA-W30.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_RTL8720DF {build.usb_flags} -DArduino_STD_PRINTF + diff --git a/Arduino_package/hardware/cores/ambd/Arduino.h b/Arduino_package/hardware/cores/ambd/Arduino.h index ae21acf2..82772cff 100644 --- a/Arduino_package/hardware/cores/ambd/Arduino.h +++ b/Arduino_package/hardware/cores/ambd/Arduino.h @@ -24,12 +24,13 @@ #include #include #include - +#include "avr/dtostrf.h" +#include "itoa.h" #include "binary.h" //#define Arduino_STD_PRINTF #ifdef Arduino_STD_PRINTF - +#define STD_PRINTF #ifdef __cplusplus #include #endif // __cplusplus diff --git a/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino b/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino index 0ef7707a..dac3ea09 100644 --- a/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino +++ b/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino @@ -31,6 +31,9 @@ void setup() { #elif defined(BOARD_RTL8721DM) // attaches the servo on PWM pin 3 to the servo object myservo.attach(3); +#elif defined(BOARD_RTL8720DF) + // attaches the servo on PWM pin 7 to the servo object + myservo.attach(7); #else // attaches the servo on PWM pin 10 to the servo object myservo.attach(10); diff --git a/Arduino_package/hardware/libraries/Analog/examples/TonePlayMelody/TonePlayMelody.ino b/Arduino_package/hardware/libraries/Analog/examples/TonePlayMelody/TonePlayMelody.ino index 333ec9d6..e161314a 100644 --- a/Arduino_package/hardware/libraries/Analog/examples/TonePlayMelody/TonePlayMelody.ino +++ b/Arduino_package/hardware/libraries/Analog/examples/TonePlayMelody/TonePlayMelody.ino @@ -112,15 +112,17 @@ void play(int *melody, int *noteDurations, int num) { int noteDuration = 3000 / noteDurations[note]; #if defined(BOARD_RTL8722DM) - tone(8, melody[note], noteDuration); + tone(8, melody[note], noteDuration); #elif defined(BOARD_RTL8722DM_MINI) - tone(7, melody[note], noteDuration); + tone(7, melody[note], noteDuration); #elif defined(BOARD_RTL8720DN_BW16) - tone(PA25, melody[note], noteDuration); + tone(PA25, melody[note], noteDuration); #elif defined(BOARD_RTL8721DM) - tone(3, melody[note], noteDuration); + tone(3, melody[note], noteDuration); +#elif defined(BOARD_RTL8720DF) + tone(7, melody[note], noteDuration); #else - tone(10, melody[note], noteDuration); + tone(10, melody[note], noteDuration); #endif delay(noteDuration * 1.30); diff --git a/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp b/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp index 6577e282..4cb3fa84 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp +++ b/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp @@ -1,7 +1,7 @@ #include "AudioCodec.h" -#if defined(BOARD_RTL8720DN_BW16) -#error Sorry, RTL8720DN/BW16 do not support AudioCodec. +#if defined(BOARD_RTL8720DN_BW16) || defined(BOARD_RTL8720DF) +#error Sorry, AudioCodec is not supported on RTL8720DN and RTL8720DF. #endif #ifdef __cplusplus diff --git a/Arduino_package/hardware/libraries/BLE/src/BLEDevice.h b/Arduino_package/hardware/libraries/BLE/src/BLEDevice.h index 25e00ad6..9efb6fbf 100644 --- a/Arduino_package/hardware/libraries/BLE/src/BLEDevice.h +++ b/Arduino_package/hardware/libraries/BLE/src/BLEDevice.h @@ -17,8 +17,8 @@ extern "C" { #include "app_msg.h" #include "profile_server.h" #include "profile_client.h" -#include "app_flags.h" -#include "link_mgr.h" +#include "ble_central_app_flags.h" +#include "ble_central_link_mgr.h" #ifdef __cplusplus } diff --git a/Arduino_package/hardware/libraries/Debugging/examples/ExampleDebug/ExampleDebug.ino b/Arduino_package/hardware/libraries/Debugging/examples/ExampleDebug/ExampleDebug.ino new file mode 100644 index 00000000..53e51074 --- /dev/null +++ b/Arduino_package/hardware/libraries/Debugging/examples/ExampleDebug/ExampleDebug.ino @@ -0,0 +1,44 @@ + +// Debugging requires the use of a SEGGER JLink debug probe, and that SEGGER JLink Software Pack is installed +// For Windows, SEGGER JLink Software Pack should be installed at C:/Program Files/SEGGER/JLink/ +// SEGGER JLink Software Pack can be downloaded at https://www.segger.com/downloads/jlink/ + +// Before debugging, make sure to edit debug_custom.json and ensure that the "serverArgs" field has the correct directory to the JLinkScript file +// Default directories are shown below, where you will need to replace * with your account username, and replace ** with the version number of the installed tools: +// Windows: C:/Users/*/AppData/Local/Arduino15/packages/realtek/tools/ameba_d_tools/**/debug/RTL872x_Arduino_debug.JLinkScript +// Linux: /home/*/.arduino15/packages/realtek/tools/ameba_d_tools/**/debug/RTL872x_Arduino_debug.JLinkScript +// MacOS: /Users/*/Library/Arduino15/packages/realtek/tools/ameba_d_tools/**/debug/RTL872x_Arduino_debug.JLinkScript + +// Also, ensure you have enabled Sketch > Optimize for Debugging + +// If you wish to debug your own sketches, copy the debug_custom.json file into your sketch folder + +#define LED_PIN LED_BUILTIN + +int i; +void setup() { + Serial.begin(115200); + pinMode(LED_PIN, OUTPUT); + for (i = 0; i < 10; i++) { + digitalWrite(LED_PIN, HIGH); + delay(100); + digitalWrite(LED_PIN, LOW); + delay(100); + } + i = 0; +} + +void loop() { + i++; + digitalWrite(LED_PIN, HIGH); + delay(500); + if ((i%10)==0) { + Serial.println(i); + // If you need more breakpoints, you can use either of the instructions below to add a software breakpoint in program execution + // To continue program execution from a software breakpoint, use "Step Over" first before "Continue" + //__BKPT(); + __asm__("BKPT"); + } + digitalWrite(LED_PIN, LOW); + delay(500); +} diff --git a/Arduino_package/hardware/libraries/Debugging/examples/ExampleDebug/debug_custom.json b/Arduino_package/hardware/libraries/Debugging/examples/ExampleDebug/debug_custom.json new file mode 100644 index 00000000..e35e54b9 --- /dev/null +++ b/Arduino_package/hardware/libraries/Debugging/examples/ExampleDebug/debug_custom.json @@ -0,0 +1,16 @@ +{ + "name": "JLink Attach", + "request": "attach", + "servertype": "jlink", + "interface": "swd", + "device": "Cortex-M33", + "serverArgs": ["-scriptfile", "{replace with your Arduino15 packages directory}/packages/realtek/tools/ameba_d_tools/{replace with tools version number}/debug/RTL872x_Arduino_debug.JLinkScript"], + "debuggerArgs": ["-init-eval-command", "maintenance set target-async on"], + "postAttachCommands": [ + "monitor clrbp", + "monitor reset", + "break setup", + "continue", + "clear setup" + ] +} \ No newline at end of file diff --git a/Arduino_package/hardware/libraries/Debugging/library.properties b/Arduino_package/hardware/libraries/Debugging/library.properties new file mode 100644 index 00000000..b3a42f07 --- /dev/null +++ b/Arduino_package/hardware/libraries/Debugging/library.properties @@ -0,0 +1,9 @@ +name=AmebaDebugExample +version=1.0.0 +author=Realtek +maintainer=Realtek +sentence=Debugging example for RTL872x. +paragraph= +category=Debugging +url= +architectures=AmebaD diff --git a/Arduino_package/hardware/libraries/Debugging/src/Debug.h b/Arduino_package/hardware/libraries/Debugging/src/Debug.h new file mode 100644 index 00000000..577f37fd --- /dev/null +++ b/Arduino_package/hardware/libraries/Debugging/src/Debug.h @@ -0,0 +1 @@ +//Empty header file to remove warnings \ No newline at end of file diff --git a/Arduino_package/hardware/libraries/IRDevice/examples/IRRecvNEC/IRRecvNEC.ino b/Arduino_package/hardware/libraries/IRDevice/examples/IRRecvNEC/IRRecvNEC.ino index 4d8a6ae4..902b5245 100644 --- a/Arduino_package/hardware/libraries/IRDevice/examples/IRRecvNEC/IRRecvNEC.ino +++ b/Arduino_package/hardware/libraries/IRDevice/examples/IRRecvNEC/IRRecvNEC.ino @@ -11,6 +11,9 @@ #elif defined(BOARD_RTL8721DM) #define IR_RX_PIN 5 #define IR_TX_PIN 6 +#elif defined(BOARD_RTL8720DF) +#define IR_RX_PIN 6 +#define IR_TX_PIN 7 #endif uint8_t adr = 0; diff --git a/Arduino_package/hardware/libraries/IRDevice/examples/IRSendNEC/IRSendNEC.ino b/Arduino_package/hardware/libraries/IRDevice/examples/IRSendNEC/IRSendNEC.ino index 355b74c8..5a4dac81 100644 --- a/Arduino_package/hardware/libraries/IRDevice/examples/IRSendNEC/IRSendNEC.ino +++ b/Arduino_package/hardware/libraries/IRDevice/examples/IRSendNEC/IRSendNEC.ino @@ -11,6 +11,9 @@ #elif defined(BOARD_RTL8721DM) #define IR_RX_PIN 5 #define IR_TX_PIN 6 +#elif defined(BOARD_RTL8720DF) +#define IR_RX_PIN 6 +#define IR_TX_PIN 7 #endif uint8_t adr = 0; diff --git a/Arduino_package/hardware/libraries/IRDevice/examples/IRSendRAW/IRSendRAW.ino b/Arduino_package/hardware/libraries/IRDevice/examples/IRSendRAW/IRSendRAW.ino index e57ae9b2..2461ff97 100644 --- a/Arduino_package/hardware/libraries/IRDevice/examples/IRSendRAW/IRSendRAW.ino +++ b/Arduino_package/hardware/libraries/IRDevice/examples/IRSendRAW/IRSendRAW.ino @@ -12,6 +12,9 @@ #elif defined(BOARD_RTL8721DM) #define IR_RX_PIN 5 #define IR_TX_PIN 6 +#elif defined(BOARD_RTL8720DF) +#define IR_RX_PIN 6 +#define IR_TX_PIN 7 #endif #define CARRIER_FREQ 38000 diff --git a/Arduino_package/hardware/libraries/IRDevice/examples/IRSendSONY/IRSendSONY.ino b/Arduino_package/hardware/libraries/IRDevice/examples/IRSendSONY/IRSendSONY.ino index 549dbef4..f0abdf7f 100644 --- a/Arduino_package/hardware/libraries/IRDevice/examples/IRSendSONY/IRSendSONY.ino +++ b/Arduino_package/hardware/libraries/IRDevice/examples/IRSendSONY/IRSendSONY.ino @@ -12,6 +12,9 @@ #elif defined(BOARD_RTL8721DM) #define IR_RX_PIN 5 #define IR_TX_PIN 6 +#elif defined(BOARD_RTL8720DF) +#define IR_RX_PIN 6 +#define IR_TX_PIN 7 #endif #define CARRIER_FREQ 40000 diff --git a/Arduino_package/hardware/libraries/MQTTClient/examples/LASS_Basic/LASS_Basic.ino b/Arduino_package/hardware/libraries/MQTTClient/examples/LASS_Basic/LASS_Basic.ino index 353ba31b..ed785fd4 100644 --- a/Arduino_package/hardware/libraries/MQTTClient/examples/LASS_Basic/LASS_Basic.ino +++ b/Arduino_package/hardware/libraries/MQTTClient/examples/LASS_Basic/LASS_Basic.ino @@ -54,6 +54,8 @@ PMS3003 pms(2, 1); // SoftwareSerial RX/TX PMS3003 pms(PB2, PB1); // SoftwareSerial RX/TX #elif defined(BOARD_RTL8721DM) PMS3003 pms(3, 4); // SoftwareSerial RX/TX +#elif defined(BOARD_RTL8720DF) +PMS3003 pms(17, 16); // SoftwareSerial RX/TX #else PMS3003 pms(0, 1); // SoftwareSerial RX/TX #endif diff --git a/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleepMode/DeepSleepMode.ino b/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleepMode/DeepSleepMode.ino index a1fcf419..8b38313e 100644 --- a/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleepMode/DeepSleepMode.ino +++ b/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleepMode/DeepSleepMode.ino @@ -38,6 +38,13 @@ //SET_AON_GPIO_WAKEUP_PA19 // pin 8 //SET_AON_GPIO_WAKEUP_PA15 // pin 28 //SET_AON_GPIO_WAKEUP_PA14 // pin 29 + //For board AMB25/AMB26 + //SET_AON_GPIO_WAKEUP_PA12 // pin 3 + //SET_AON_GPIO_WAKEUP_PA13 // pin 2 + //SET_AON_GPIO_WAKEUP_PA14 // pin 1 + //SET_AON_GPIO_WAKEUP_PA15 // pin 0 + //SET_AON_GPIO_WAKEUP_PA25 // pin 7 + //SET_AON_GPIO_WAKEUP_PA26 // pin 6 #define DS_WAKEUP_SOURCE SET_DS_AON_TIMER_WAKEUP diff --git a/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_Eink_Example/DeepSleep_DHT_Eink_Example.ino b/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_Eink_Example/DeepSleep_DHT_Eink_Example.ino index bf9a5bf3..863387be 100644 --- a/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_Eink_Example/DeepSleep_DHT_Eink_Example.ino +++ b/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_Eink_Example/DeepSleep_DHT_Eink_Example.ino @@ -63,6 +63,14 @@ DHT dht(DHTPIN, DHTTYPE); //SET_AON_GPIO_WAKEUP_PA19 // pin 8 //SET_AON_GPIO_WAKEUP_PA15 // pin 28 //SET_AON_GPIO_WAKEUP_PA14 // pin 29 +//For board AMB25/AMB26 + //SET_AON_GPIO_WAKEUP_PA12 // pin 3 + //SET_AON_GPIO_WAKEUP_PA13 // pin 2 + //SET_AON_GPIO_WAKEUP_PA14 // pin 1 + //SET_AON_GPIO_WAKEUP_PA15 // pin 0 + //SET_AON_GPIO_WAKEUP_PA25 // pin 7 + //SET_AON_GPIO_WAKEUP_PA26 // pin 6 + #define DS_WAKEUP_SOURCE SET_DS_AON_TIMER_WAKEUP diff --git a/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_LCD_Example/DeepSleep_DHT_LCD_Example.ino b/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_LCD_Example/DeepSleep_DHT_LCD_Example.ino index d9622cfa..1bafaec0 100644 --- a/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_LCD_Example/DeepSleep_DHT_LCD_Example.ino +++ b/Arduino_package/hardware/libraries/PowerSave/examples/DeepSleep_DHT_LCD_Example/DeepSleep_DHT_LCD_Example.ino @@ -48,6 +48,12 @@ DHT dht(DHTPIN, DHTTYPE); //SET_AON_GPIO_WAKEUP_PA19 // pin 8 //SET_AON_GPIO_WAKEUP_PA15 // pin 28 //SET_AON_GPIO_WAKEUP_PA14 // pin 29 +//For board AMB25/AMB26 + //SET_AON_GPIO_WAKEUP_PA12 // pin 3 + //SET_AON_GPIO_WAKEUP_PA13 // pin 2 + //SET_AON_GPIO_WAKEUP_PA14 // pin 1 + //SET_AON_GPIO_WAKEUP_PA15 // pin 0 + #define DS_WAKEUP_SOURCE SET_DS_AON_TIMER_WAKEUP #define AON_TIMER_SLEEP_DURATION 5000 diff --git a/Arduino_package/hardware/libraries/PowerSave/examples/TicklessMode/TicklessMode.ino b/Arduino_package/hardware/libraries/PowerSave/examples/TicklessMode/TicklessMode.ino index 48cbf39b..750973c9 100644 --- a/Arduino_package/hardware/libraries/PowerSave/examples/TicklessMode/TicklessMode.ino +++ b/Arduino_package/hardware/libraries/PowerSave/examples/TicklessMode/TicklessMode.ino @@ -38,6 +38,13 @@ //SET_AON_GPIO_WAKEUP_PA19 // pin 8 //SET_AON_GPIO_WAKEUP_PA15 // pin 28 //SET_AON_GPIO_WAKEUP_PA14 // pin 29 +//For board AMB25/AMB26 + //SET_AON_GPIO_WAKEUP_PA12 // pin 3 + //SET_AON_GPIO_WAKEUP_PA13 // pin 2 + //SET_AON_GPIO_WAKEUP_PA14 // pin 1 + //SET_AON_GPIO_WAKEUP_PA15 // pin 0 + //SET_AON_GPIO_WAKEUP_PA25 // pin 7 + //SET_AON_GPIO_WAKEUP_PA26 // pin 6 #define TL_WAKEUP_SOURCE SET_TL_UART_WAKEUP diff --git a/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp b/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp index 0bb8b966..98dbdb58 100644 --- a/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp +++ b/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp @@ -242,6 +242,14 @@ void PMUClass::TL_RTC_WAKEUP(void) { //AON_WAKEPIN_WAKEUP_PA19 // pin 8 //AON_WAKEPIN_WAKEUP_PA15 // pin 28 //AON_WAKEPIN_WAKEUP_PA14 // pin 29 +//For board AMB25/AMB26 + //SET_AON_GPIO_WAKEUP_PA12 // pin 3 + //SET_AON_GPIO_WAKEUP_PA13 // pin 2 + //SET_AON_GPIO_WAKEUP_PA14 // pin 1 + //SET_AON_GPIO_WAKEUP_PA15 // pin 0 + //SET_AON_GPIO_WAKEUP_PA25 // pin 7 + //SET_AON_GPIO_WAKEUP_PA26 // pin 6 + #if defined(BOARD_RTL8722DM) void PMUClass::AON_WAKEPIN_WAKEUP_PA12(void) { @@ -383,10 +391,10 @@ void PMUClass::AON_WAKEPIN_WAKEUP_PA19(void) { printf("Set Deepsleep wakeup AON pin PA19 / pin 8. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA20(void) { - printf("RTL8720DN_BW16 does not support Deepsleep wakeup AON pin PA20. \r\n"); + printf("BOARD_RTL8721DM does not support Deepsleep wakeup AON pin PA20. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA21(void) { - printf("RTL8720DN_BW16 does not support Deepsleep wakeup AON pin PA21. \r\n"); + printf("BOARD_RTL8721DM does not support Deepsleep wakeup AON pin PA21. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA25(void) { printf("Set Deepsleep wakeup AON pin PA25 / pin 6. \r\n"); @@ -394,6 +402,45 @@ void PMUClass::AON_WAKEPIN_WAKEUP_PA25(void) { void PMUClass::AON_WAKEPIN_WAKEUP_PA26(void) { printf("Set Deepsleep wakeup AON pin PA26 / pin 5. \r\n"); } + +#elif defined(BOARD_RTL8720DF) +void PMUClass::AON_WAKEPIN_WAKEUP_PA12(void) { + printf("Set Deepsleep wakeup AON pin PA12 / pin 3. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA13(void) { + printf("Set Deepsleep wakeup AON pin PA13 / pin 2. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA14(void) { + printf("Set Deepsleep wakeup AON pin PA14 / pin 1. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA15(void) { + printf("Set Deepsleep wakeup AON pin PA15 / pin 0. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA16(void) { + printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA16. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA17(void) { + printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA17. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA18(void) { + printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA18. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA19(void) { + printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA19. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA20(void) { + printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA20. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA21(void) { + printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA21. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA25(void) { + printf("Set Deepsleep wakeup AON pin PA25 / pin 7. \r\n"); +} +void PMUClass::AON_WAKEPIN_WAKEUP_PA26(void) { + printf("Set Deepsleep wakeup AON pin PA26 / pin 6. \r\n"); +} + #endif PMUClass PowerSave; diff --git a/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_PM2.5/ILI9341_TFT_LCD_PM2.5.ino b/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_PM2.5/ILI9341_TFT_LCD_PM2.5.ino index 66d85145..ace7f1a3 100644 --- a/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_PM2.5/ILI9341_TFT_LCD_PM2.5.ino +++ b/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_PM2.5/ILI9341_TFT_LCD_PM2.5.ino @@ -13,8 +13,8 @@ For all supports boards (AMB21/AMB22, AMB23, BW16/BW16-TypeC, AW-CU488_ThingPlus), ILI9341 TFT LCD with SPI interface has these pins: Select 2 GPIO pins connect to RST and D/C. And default SPI/SPI1 connect to CS, MOSI, MISO and CLK. - RST : connect to pin 8 - D/C : connect to pin 9 + RST : connect to pin 4 + D/C : connect to pin 5 CS : connect to SPI_SS MOSI : connect to SPI_MOSI MISO : connect to SPI_MISO @@ -34,8 +34,9 @@ SoftwareSerial mySerial(SERIAL1_RX, SERIAL1_TX); // RX, TX #define TFT_RESET 4 #define TFT_DC 5 #define TFT_CS SPI_SS +#define SPI_BUS SPI -AmebaILI9341 tft = AmebaILI9341(TFT_CS, TFT_DC, TFT_RESET); +AmebaILI9341 tft = AmebaILI9341(TFT_CS, TFT_DC, TFT_RESET, SPI_BUS); #define ILI9341_SPI_FREQUENCY 20000000 @@ -65,7 +66,7 @@ void setup() { mySerial.begin(9600); // PMS 3003 UART has baud rate 9600 tft.begin(); - SPI.setDefaultFrequency(ILI9341_SPI_FREQUENCY); + SPI_BUS.setDefaultFrequency(ILI9341_SPI_FREQUENCY); drawPictureFrames(); } diff --git a/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_basic/ILI9341_TFT_LCD_basic.ino b/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_basic/ILI9341_TFT_LCD_basic.ino index 3be29fd5..357e77aa 100644 --- a/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_basic/ILI9341_TFT_LCD_basic.ino +++ b/Arduino_package/hardware/libraries/SPI/examples/ILI9341_TFT_LCD_basic/ILI9341_TFT_LCD_basic.ino @@ -19,8 +19,9 @@ #define TFT_RESET 4 #define TFT_DC 5 #define TFT_CS SPI_SS +#define SPI_BUS SPI -AmebaILI9341 tft = AmebaILI9341(TFT_CS, TFT_DC, TFT_RESET); +AmebaILI9341 tft = AmebaILI9341(TFT_CS, TFT_DC, TFT_RESET, SPI_BUS); #define ILI9341_SPI_FREQUENCY 20000000 @@ -29,7 +30,7 @@ void setup() { Serial.println("ILI9341 Test!"); tft.begin(); - SPI.setDefaultFrequency(ILI9341_SPI_FREQUENCY); + SPI_BUS.setDefaultFrequency(ILI9341_SPI_FREQUENCY); Serial.println("test filling screen"); testFillScreen(); diff --git a/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.cpp b/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.cpp index f6bba9c8..e58a860a 100644 --- a/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.cpp +++ b/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.cpp @@ -1,15 +1,16 @@ #include "AmebaILI9341.h" -#include "SPI.h" + #include "font5x7.h" #include -AmebaILI9341::AmebaILI9341(int csPin, int dcPin, int resetPin) +AmebaILI9341::AmebaILI9341(int csPin, int dcPin, int resetPin, SPIClass& targetSPI) : _spi(targetSPI) { _csPin = csPin; // TODO: no effect now, use pin 10 as default _dcPin = dcPin; _resetPin = resetPin; +// _spi = targetSPI; _dcPort = _dcMask = 0; @@ -33,7 +34,7 @@ void AmebaILI9341::begin(void) _dcPort = digitalPinToPort(_dcPin); _dcMask = digitalPinToBitMask(_dcPin); - SPI.begin(); + _spi.begin(); reset(); @@ -168,35 +169,35 @@ void AmebaILI9341::setAddress(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1 } *portOutputRegister(_dcPort) &= ~(_dcMask); - SPI.transfer(ILI9341_CASET); + _spi.transfer(ILI9341_CASET); *portOutputRegister(_dcPort) |= (_dcMask); - SPI.transfer(x >> 8); - SPI.transfer(x & 0xFF); - SPI.transfer((x+w) >> 8); - SPI.transfer((x+w) & 0xFF); + _spi.transfer(x >> 8); + _spi.transfer(x & 0xFF); + _spi.transfer((x+w) >> 8); + _spi.transfer((x+w) & 0xFF); *portOutputRegister(_dcPort) &= ~(_dcMask); - SPI.transfer(ILI9341_PASET); + _spi.transfer(ILI9341_PASET); *portOutputRegister(_dcPort) |= (_dcMask); - SPI.transfer(y >> 8); - SPI.transfer(y & 0xFF); - SPI.transfer((y+h) >> 8); - SPI.transfer((y+h) & 0xFF); + _spi.transfer(y >> 8); + _spi.transfer(y & 0xFF); + _spi.transfer((y+h) >> 8); + _spi.transfer((y+h) & 0xFF); *portOutputRegister(_dcPort) &= ~(_dcMask); - SPI.transfer(ILI9341_RAMWR); + _spi.transfer(ILI9341_RAMWR); } void AmebaILI9341::writecommand(uint8_t command) { *portOutputRegister(_dcPort) &= ~(_dcMask); - SPI.transfer(command); + _spi.transfer(command); } void AmebaILI9341::writedata(uint8_t data) { *portOutputRegister(_dcPort) |= (_dcMask); - SPI.transfer(data); + _spi.transfer(data); } void AmebaILI9341::setRotation(uint8_t m) @@ -262,8 +263,8 @@ void AmebaILI9341::fillRectangle(int16_t x, int16_t y, int16_t w, int16_t h, uin *portOutputRegister(_dcPort) |= (_dcMask); for (i = 0; i < pixelCount; i++) { - SPI.transfer(color_hi); - SPI.transfer(color_lo); + _spi.transfer(color_hi); + _spi.transfer(color_lo); } } @@ -275,8 +276,8 @@ void AmebaILI9341::drawPixel(int16_t x, int16_t y, uint16_t color) setAddress(x, y, (x + 1), (y + 1)); *portOutputRegister(_dcPort) |= (_dcMask); - SPI.transfer(color >> 8); - SPI.transfer(color & 0xFF); + _spi.transfer(color >> 8); + _spi.transfer(color & 0xFF); } void AmebaILI9341::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) @@ -314,8 +315,8 @@ void AmebaILI9341::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint *portOutputRegister(_dcPort) |= (_dcMask); linelen = abs(y1-y0); for (idx = 0; idx < linelen; idx++) { - SPI.transfer(color_hi); - SPI.transfer(color_lo); + _spi.transfer(color_hi); + _spi.transfer(color_lo); } } else if (y0 == y1) { // draw horizontal line @@ -336,8 +337,8 @@ void AmebaILI9341::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint *portOutputRegister(_dcPort) |= (_dcMask); linelen = abs(x1 - x0); for (idx = 0; idx < linelen; idx++) { - SPI.transfer(color_hi); - SPI.transfer(color_lo); + _spi.transfer(color_hi); + _spi.transfer(color_lo); } } else { // Bresenham's line algorithm diff --git a/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.h b/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.h index e6d6950a..c8ba4ec9 100644 --- a/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.h +++ b/Arduino_package/hardware/libraries/SPI/src/AmebaILI9341.h @@ -3,6 +3,8 @@ #include "Print.h" #include +#include "SPI.h" + #define ILI9341_TFTWIDTH 240 #define ILI9341_TFTHEIGHT 320 @@ -92,7 +94,7 @@ class AmebaILI9341 : public Print { public: - AmebaILI9341(int csPin, int dcPin, int resetPin); + AmebaILI9341(int csPin, int dcPin, int resetPin, SPIClass& targetSPI = SPI); void begin(void); @@ -152,6 +154,7 @@ class AmebaILI9341 : public Print { uint16_t background; uint8_t fontsize; uint8_t rotation; + SPIClass& _spi; }; #endif diff --git a/Arduino_package/hardware/libraries/SPI/src/SPI.cpp b/Arduino_package/hardware/libraries/SPI/src/SPI.cpp index 8fca8231..3f5792e5 100644 --- a/Arduino_package/hardware/libraries/SPI/src/SPI.cpp +++ b/Arduino_package/hardware/libraries/SPI/src/SPI.cpp @@ -310,6 +310,10 @@ SPIClass SPI((void *)(&spi_obj0), SPI_MOSI, SPI_MISO, SPI_SCLK, SPI_SS); SPIClass SPI((void *)(&spi_obj0), SPI_MOSI, SPI_MISO, SPI_SCLK, SPI_SS); // 1, 2, 0, 8 SPIClass SPI1((void *)(&spi_obj1), SPI1_MOSI, SPI1_MISO, SPI1_SCLK, SPI1_SS); // 14, 15, 16, 17 or 4, 3, 29, 28 +#elif defined(BOARD_RTL8720DF) +SPIClass SPI((void *)(&spi_obj0), SPI_MOSI, SPI_MISO, SPI_SCLK, SPI_SS); // 17, 16, 19, 18 +SPIClass SPI1((void *)(&spi_obj1), SPI1_MOSI, SPI1_MISO, SPI1_SCLK, SPI1_SS); // 3, 2, 1, 0 + #else -#error chack the borad supported SPI +#error check the board supported SPI #endif diff --git a/Arduino_package/hardware/libraries/SPI/src/SPI.h b/Arduino_package/hardware/libraries/SPI/src/SPI.h index 348215f4..f227bfca 100644 --- a/Arduino_package/hardware/libraries/SPI/src/SPI.h +++ b/Arduino_package/hardware/libraries/SPI/src/SPI.h @@ -121,6 +121,9 @@ extern SPIClass SPI; #elif defined(BOARD_RTL8721DM) extern SPIClass SPI; extern SPIClass SPI1; +#elif defined(BOARD_RTL8720DF) +extern SPIClass SPI; +extern SPIClass SPI1; #else #error check the board supported #endif diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino index a622bc18..dc4106d5 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino @@ -27,7 +27,9 @@ #elif defined(BOARD_RTL8720DN_BW16) SoftwareSerial mySerial(PB2, PB1); // RX, TX #elif defined(BOARD_RTL8721DM) - SoftwareSerial mySerial(3, 4); // RX, TX + SoftwareSerial mySerial(3, 4); // RX, TX +#elif defined(BOARD_RTL8720DF) + SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX #endif diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino index 261a6451..70f2a72f 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino @@ -25,6 +25,9 @@ (BOARD RTL8721DM) * RX is digital pin 3 (connect to PMS 3003 TX) * TX is digital pin 4 (connect to PMS 3003 RX) + (BOARD RTL8720DF) + * RX is digital pin 17 (Connect to PMS 3003 TX) + * TX is digital pin 16 (Connect to PMS 3003 RX) */ #include @@ -36,7 +39,9 @@ #elif defined(BOARD_RTL8720DN_BW16) SoftwareSerial mySerial(PB2, PB1); // RX, TX #elif defined(BOARD_RTL8721DM) - SoftwareSerial mySerial(3, 4); // RX, TX + SoftwareSerial mySerial(3, 4); // RX, TX +#elif defined(BOARD_RTL8720DF) + SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX #endif diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino index 67d526c5..89a69152 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino @@ -15,6 +15,9 @@ (BOARD RTL8721DM) * RX is digital pin 3 (connect to the other device TX) * TX is digital pin 4 (connect to the other device RX) + (BOARD RTL8720DF) + * RX is digital pin 17 (connect to the other device TX) + * TX is digital pin 16 (connect to the other device RX) */ #include @@ -27,6 +30,8 @@ SoftwareSerial mySerial(PB2, PB1); // RX, TX #elif defined(BOARD_RTL8721DM) SoftwareSerial mySerial(3, 4); // RX, TX +#elif defined(BOARD_RTL8720DF) + SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX #endif diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino index f9b448e1..94bf099e 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino @@ -27,6 +27,12 @@ The circuit: (BOARD RTL8721DM) * TX is digital pin 4 (connect to the other device RX) * RTS is pin PA_14 (connect to the other device CTS) * CTS is pin PA_15 (connect to the other device RTS) + +The circuit: (BOARD RTL8720DF) +* RX is digital pin 17 (connect to the other device TX) +* TX is digital pin 16 (connect to the other device RX) +* RTS is pin PB_21 (connect to the other device CTS) +* CTS is pin PB_20 (connect to the other device RTS) */ @@ -44,6 +50,8 @@ The circuit: (BOARD RTL8721DM) SoftwareSerial mySerial(PB2, PB1); // RX, TX #elif defined(BOARD_RTL8721DM) SoftwareSerial mySerial(3, 4); // RX, TX +#elif defined(BOARD_RTL8720DF) + SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX #endif diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino index 2b5d66b7..98f31463 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino @@ -17,6 +17,12 @@ (BOARD RTL8720DN / BW16) * RX is digital pin PB2 (connect to the other device TX) * TX is digital pin PB1 (connect to the other device RX) + (BOARD RTL8721DM) + * RX is digital pin 3 (connect to the other device TX) + * TX is digital pin 4 (connect to the other device RX) + (BOARD RTL8720DF) + * RX is digital pin 17 (connect to the other device TX) + * TX is digital pin 16 (connect to the other device RX) */ #include @@ -29,6 +35,8 @@ SoftwareSerial mySerial(PB2, PB1); // RX, TX #elif defined(BOARD_RTL8721DM) SoftwareSerial mySerial(3, 4); // RX, TX +#elif defined(BOARD_RTL8720DF) + SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX #endif diff --git a/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Basics/WS2812B_Basics.ino b/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Basics/WS2812B_Basics.ino index e4107168..29051579 100644 --- a/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Basics/WS2812B_Basics.ino +++ b/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Basics/WS2812B_Basics.ino @@ -2,10 +2,12 @@ #define NUM_OF_LEDS 8 // There are mutiple choice of SPI_MOSI pins depends on different boards. The default is SPI_MOSI/SPI1_MOSI -// AMB21/AMB22 pin 11/ pin21 -// AMB23 pin 9/ pin 4 +// AMB21/AMB22 pin 11 / pin21 +// AMB23 pin 9 / pin 4 // BW16/BW16 Type C pin 12 -// AW-CU488 ThingPlus pin 1/ pin 14 +// AW-CU488 ThingPlus pin 1 / pin 14 +// AMB25/AMB26 pin 17 / pin 3 + WS2812B led(SPI_MOSI, NUM_OF_LEDS); void setup() { @@ -19,7 +21,7 @@ void setup() { led.show(); delay(1000); //Fill the entire LED strip with the same color - led.fill(60, 0, 25, 0, 8); + led.fill(60, 0, 25, 0, NUM_OF_LEDS); led.show(); } diff --git a/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Patterns/WS2812B_Patterns.ino b/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Patterns/WS2812B_Patterns.ino index 55abbe0a..6cf40fad 100644 --- a/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Patterns/WS2812B_Patterns.ino +++ b/Arduino_package/hardware/libraries/WS2812B/examples/WS2812B_Patterns/WS2812B_Patterns.ino @@ -5,10 +5,12 @@ uint32_t rgbhue; // There are mutiple choice of SPI_MOSI pins depends on different boards. The default is SPI_MOSI/SPI1_MOSI -// AMB21/AMB22 pin 11/ pin 21 -// AMB23 pin 9/ pin 4 +// AMB21/AMB22 pin 11 / pin21 +// AMB23 pin 9 / pin 4 // BW16/BW16 Type C pin 12 -// AW-CU488 ThingPlus pin 1/ pin 14 +// AW-CU488 ThingPlus pin 1 / pin 14 +// AMB25/AMB26 pin 17 / pin 3 + WS2812B led(SPI_MOSI,NUM_OF_LEDS); void setup() { diff --git a/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.cpp b/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.cpp index 6f38ca5a..a760ec6c 100644 --- a/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.cpp +++ b/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.cpp @@ -63,7 +63,7 @@ void WS2812B::show(void) { Pinmux_Config((PinName)g_APinDescription[SPI_SCLK].pinname, PINMUX_FUNCTION_GPIO); Pinmux_Config((PinName)g_APinDescription[SPI_SCLK].pinname, PINMUX_FUNCTION_GPIO); Pinmux_Config((PinName)g_APinDescription[SPI_SS].pinname, PINMUX_FUNCTION_GPIO); - } else if (_input_pin== SPI1_MOSI) { + } else if (_input_pin == SPI1_MOSI) { spi_init((spi_t *)pSpiMaster, (PinName)g_APinDescription[_input_pin].pinname, (PinName)g_APinDescription[SPI1_MISO].pinname, (PinName)g_APinDescription[SPI1_SCLK].pinname, (PinName)g_APinDescription[SPI1_SS].pinname); //Revert the unneccesary SPI pins to GPIO functions Pinmux_Config((PinName)g_APinDescription[SPI1_SCLK].pinname, PINMUX_FUNCTION_GPIO); @@ -80,20 +80,22 @@ void WS2812B::show(void) { //Initialise SPI SPI.begin(); //Revert the unneccesary SPI pins to GPIO functions - Pinmux_Config(SPI_MISO, PINMUX_FUNCTION_GPIO); - Pinmux_Config(SPI_SCLK, PINMUX_FUNCTION_GPIO); - Pinmux_Config(SPI_SS, PINMUX_FUNCTION_GPIO); + Pinmux_Config((PinName)g_APinDescription[SPI_MISO].pinname, PINMUX_FUNCTION_GPIO); + Pinmux_Config((PinName)g_APinDescription[SPI_SCLK].pinname, PINMUX_FUNCTION_GPIO); + Pinmux_Config((PinName)g_APinDescription[SPI_SS].pinname, PINMUX_FUNCTION_GPIO); SPI.setDefaultFrequency(2500000); - SPI.setDataMode(SPI_SS, 12, 0); - } else if (_input_pin== SPI1_MOSI) { + SPI.setDataMode(12, 0); +#if !defined(BOARD_RTL8722DM_MINI) && !defined(BOARD_RTL8720DN_BW16) + } else if (_input_pin == SPI1_MOSI) { //Initialise SPI SPI1.begin(); //Revert the unneccesary SPI pins to GPIO functions - Pinmux_Config(SPI1_MISO, PINMUX_FUNCTION_GPIO); - Pinmux_Config(SPI1_SCLK, PINMUX_FUNCTION_GPIO); - Pinmux_Config(SPI1_SS, PINMUX_FUNCTION_GPIO); + Pinmux_Config((PinName)g_APinDescription[SPI1_MISO].pinname, PINMUX_FUNCTION_GPIO); + Pinmux_Config((PinName)g_APinDescription[SPI1_SCLK].pinname, PINMUX_FUNCTION_GPIO); + Pinmux_Config((PinName)g_APinDescription[SPI1_SS].pinname, PINMUX_FUNCTION_GPIO); SPI1.setDefaultFrequency(2500000); - SPI1.setDataMode(SPI1_SS, 12, 0); + SPI1.setDataMode(12, 0); +#endif } else { printf("spi_init: error. wrong spi_idx \r\n"); return; diff --git a/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.h b/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.h index 1eed57e6..af8e75bb 100644 --- a/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.h +++ b/Arduino_package/hardware/libraries/WS2812B/src/WS2812B.h @@ -51,6 +51,9 @@ extern SPIClass SPI; #elif defined(BOARD_RTL8721DM) extern SPIClass SPI; extern SPIClass SPI1; +#elif defined(BOARD_RTL8720DF) +extern SPIClass SPI; +extern SPIClass SPI1; #else #error check the board supported #endif diff --git a/Arduino_package/hardware/libraries/WiFi/examples/WiFiWebServer/WiFiWebServer.ino b/Arduino_package/hardware/libraries/WiFi/examples/WiFiWebServer/WiFiWebServer.ino index ee60abd6..28eb8f3d 100644 --- a/Arduino_package/hardware/libraries/WiFi/examples/WiFiWebServer/WiFiWebServer.ino +++ b/Arduino_package/hardware/libraries/WiFi/examples/WiFiWebServer/WiFiWebServer.ino @@ -4,6 +4,9 @@ char ssid[] = "yourNetwork"; // your network SSID (name) char pass[] = "Password"; // your network password int keyIndex = 0; // your network key Index number (needed only for WEP) +//State the analog pin that you want to read +int analogChannel = 0; + int status = WL_IDLE_STATUS; WiFiServer server(80); @@ -60,14 +63,12 @@ void loop() { client.println(""); client.println(""); // output the value of each analog input pin - for (int analogChannel = 0; analogChannel < 6; analogChannel++) { - int sensorReading = analogRead(analogChannel); - client.print("analog input "); - client.print(analogChannel); - client.print(" is "); - client.print(sensorReading); - client.println("
"); - } + int sensorReading = analogRead(analogChannel); + client.print("analog input "); + client.print(analogChannel); + client.print(" is "); + client.print(sensorReading); + client.println("
"); client.println(""); break; } diff --git a/Arduino_package/hardware/libraries/Wire/src/Wire.cpp b/Arduino_package/hardware/libraries/Wire/src/Wire.cpp index 0f99c4b2..5e5a43ba 100644 --- a/Arduino_package/hardware/libraries/Wire/src/Wire.cpp +++ b/Arduino_package/hardware/libraries/Wire/src/Wire.cpp @@ -320,6 +320,11 @@ TwoWire Wire = TwoWire(I2C_SDA, I2C_SCL); // PA_26, PA_25 // HW: I2C0 TwoWire Wire = TwoWire(I2C_SDA, I2C_SCL); // PA_26, PA_25 / PB_6, PB_5 +#elif defined(BOARD_RTL8720DF) +// SDA SCL +// HW: I2C0 +TwoWire Wire = TwoWire(I2C_SDA, I2C_SCL); // PA_26, PA_25 + #else #error check the board supported #endif diff --git a/Arduino_package/hardware/libraries/Wire/src/Wire.h b/Arduino_package/hardware/libraries/Wire/src/Wire.h index 9701039b..443ca973 100644 --- a/Arduino_package/hardware/libraries/Wire/src/Wire.h +++ b/Arduino_package/hardware/libraries/Wire/src/Wire.h @@ -111,6 +111,8 @@ extern TwoWire Wire1; extern TwoWire Wire; #elif defined(BOARD_RTL8721DM) extern TwoWire Wire; +#elif defined(BOARD_RTL8720DF) +extern TwoWire Wire; #endif #endif diff --git a/Arduino_package/hardware/platform.txt b/Arduino_package/hardware/platform.txt index de4ba36c..a5a5a2b4 100644 --- a/Arduino_package/hardware/platform.txt +++ b/Arduino_package/hardware/platform.txt @@ -20,17 +20,25 @@ ameba.project=realtek_amebaD_va0_example compiler.path={runtime.tools.ameba_d_asdk_toolchain.path}/bin/ compiler.c.cmd=arm-none-eabi-gcc +# O2 = optimize for code size and execution speed +# Og = optimize for debugging experience +# g3 = add in maximum debug info +# gdwarf-3 = debug info in DWARF-3 format +compiler.optimization_flags=-O2 +compiler.optimization_flags.release=-O2 +compiler.optimization_flags.debug=-Og -g3 -gdwarf-3 + ###--save-temps -compiler.c.flags=-ffunction-sections -march=armv8-m.main+dsp -mthumb -mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16 -g -gdwarf-3 -nostartfiles -nodefaultlibs -nostdlib -O2 -D__FPU_PRESENT -gdwarf-3 -fstack-usage -fdata-sections -nostartfiles -nostdlib -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Wno-write-strings -Wno-maybe-uninitialized -c -MMD -Wextra +compiler.c.flags={compiler.optimization_flags} -ffunction-sections -march=armv8-m.main+dsp -mthumb -mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16 -nostartfiles -nodefaultlibs -nostdlib -D__FPU_PRESENT -fstack-usage -fdata-sections -nostartfiles -nostdlib -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Wno-write-strings -Wno-maybe-uninitialized -c -MMD -Wextra compiler.c.elf.cmd=arm-none-eabi-gcc ### -Wl,--warn-section-align -compiler.c.elf.flags=-O2 -march=armv8-m.main+dsp -mthumb -mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16 -nostartfiles -specs nosys.specs -Wl,--gc-sections +compiler.c.elf.flags={compiler.optimization_flags} -march=armv8-m.main+dsp -mthumb -mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16 -nostartfiles -specs nosys.specs -Wl,--gc-sections compiler.S.flags=-c -g -x assembler-with-cpp compiler.cpp.cmd=arm-none-eabi-g++ ### --save-temps -compiler.cpp.flags=-ffunction-sections -march=armv8-m.main+dsp -mthumb -mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16 -g -gdwarf-3 -nostartfiles -nodefaultlibs -nostdlib -O2 -D__FPU_PRESENT -gdwarf-3 -fstack-usage -fdata-sections -nostartfiles -nostdlib -Wall -Wpointer-arith -Wundef -Wno-write-strings -Wno-maybe-uninitialized -c -MMD -Wextra +compiler.cpp.flags={compiler.optimization_flags} -ffunction-sections -march=armv8-m.main+dsp -mthumb -mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16 -nostartfiles -nodefaultlibs -nostdlib -D__FPU_PRESENT -fstack-usage -fdata-sections -nostartfiles -nostdlib -Wall -Wpointer-arith -Wundef -Wno-write-strings -Wno-maybe-uninitialized -c -MMD -Wextra compiler.ar.cmd=arm-none-eabi-ar compiler.ar.flags=rcs @@ -41,6 +49,7 @@ compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc, compiler.elf2hex.flags=-O binary compiler.elf2hex.cmd=arm-none-eabi-objcopy compiler.ldflags= +compiler.libraries.ldflags= compiler.size.cmd=arm-none-eabi-size compiler.define=-DARDUINO= @@ -60,7 +69,7 @@ compiler.elf2hex.extra_flags= # Ameba include path # ------------------ ###"-I{ameba.sdkpath}/component/common/network/ssl/polarssl-1.3.8/include" -compiler.ameba.c.include= "-I." "-I{ameba.sdkpath}/project/{ameba.project}/inc/inc_hp" "-I{ameba.sdkpath}/component/os/freertos" "-I{ameba.sdkpath}/component/os/freertos/freertos_v10.2.0/Source/include" "-I{ameba.sdkpath}/component/os/freertos/freertos_v10.2.0/Source/portable/GCC/ARM_CM33/non_secure" "-I{ameba.sdkpath}/component/os/os_dep/include" "-I{ameba.sdkpath}/component/soc/realtek/amebad/misc" "-I{ameba.sdkpath}/component/common/api/network/include" "-I{ameba.sdkpath}/component/common/api" "-I{ameba.sdkpath}/component/common/api/at_cmd" "-I{ameba.sdkpath}/component/common/api/platform" "-I{ameba.sdkpath}/component/common/api/wifi" "-I{ameba.sdkpath}/component/common/api/wifi/rtw_wpa_supplicant/src" "-I{ameba.sdkpath}/component/common/api/wifi/rtw_wpa_supplicant/src/crypto" "-I{ameba.sdkpath}/component/common/application" "-I{ameba.sdkpath}/component/common/media/framework" "-I{ameba.sdkpath}/component/common/example" "-I{ameba.sdkpath}/component/common/example/wlan_fast_connect" "-I{ameba.sdkpath}/component/common/mbed/api" "-I{ameba.sdkpath}/component/common/mbed/hal" "-I{ameba.sdkpath}/component/common/mbed/hal_ext" "-I{ameba.sdkpath}/component/common/mbed/targets/hal/rtl8721d" "-I{ameba.sdkpath}/component/common/network" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/port/realtek/freertos" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/src/include" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/src/include/lwip" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/port/realtek" "-I{ameba.sdkpath}/component/common/test" "-I{ameba.sdkpath}/component/soc/realtek/amebad/cmsis" "-I{ameba.sdkpath}/component/soc/realtek/amebad/fwlib" "-I{ameba.sdkpath}/component/soc/realtek/amebad/misc" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/include" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/osdep" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/hci" "-I{ameba.sdkpath}/component/common/network/ssl/ssl_ram_map/rom" "-I{ameba.sdkpath}/component/common/utilities" "-I{ameba.sdkpath}/component/common/video/v4l2/inc" "-I{ameba.sdkpath}/component/common/media/rtp_codec" "-I{ameba.sdkpath}/component/common/file_system/fatfs" "-I{ameba.sdkpath}/component/common/file_system/fatfs/r0.10c/include" "-I{ameba.sdkpath}/component/common/file_system/ftl" "-I{ameba.sdkpath}/component/common/drivers/sdio/realtek/sdio_host/inc" "-I{ameba.sdkpath}/component/common/audio" "-I{ameba.sdkpath}/component/common/drivers/i2s" "-I{ameba.sdkpath}/component/common/application/xmodem" "-I{ameba.sdkpath}/component/common/network/mDNS" "-I{ameba.sdkpath}/component/soc/realtek/amebad/fwlib/include" "-I{ameba.sdkpath}/component/soc/realtek/amebad/swlib/string" "-I{ameba.sdkpath}/component/soc/realtek/amebad/app/monitor/include" "-I{ameba.sdkpath}/component/soc/realtek/amebad/app/xmodem" "-I{ameba.sdkpath}/component/common/network/ssl/mbedtls-2.4.0/include" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/amebad/lib" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/amebad/src" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/amebad/src/vendor_cmd" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/common/inc" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/example/bt_config" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/app" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/client" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/server" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/os" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/platform" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/stack" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/src/app/ble_central_client" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/src/mcu/module/data_uart_cmd" "-I{ameba.sdkpath}/component/common/drivers/ir/protocol" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/core/option" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/hal" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/hal/phydm" "-I{ameba.sdkpath}/component/common/network/ssl/mbedtls-2.4.0/include" "-I{ameba.sdkpath}/component/common/drivers/si" "-I{ameba.sdkpath}/component/common/drivers/usb/common_new" "-I{ameba.sdkpath}/component/common/drivers/usb/device_new/cdc_acm" "-I{ameba.sdkpath}/component/common/drivers/usb/device_new/core" "-I{ameba.sdkpath}/component/common/drivers/usb/device_new/hid" +compiler.ameba.c.include= "-I." "-I{ameba.sdkpath}/project/{ameba.project}/inc/inc_hp" "-I{ameba.sdkpath}/component/os/freertos" "-I{ameba.sdkpath}/component/os/freertos/freertos_v10.2.0/Source/include" "-I{ameba.sdkpath}/component/os/freertos/freertos_v10.2.0/Source/portable/GCC/ARM_CM33/non_secure" "-I{ameba.sdkpath}/component/os/os_dep/include" "-I{ameba.sdkpath}/component/soc/realtek/amebad/misc" "-I{ameba.sdkpath}/component/common/api/network/include" "-I{ameba.sdkpath}/component/common/api" "-I{ameba.sdkpath}/component/common/api/at_cmd" "-I{ameba.sdkpath}/component/common/api/platform" "-I{ameba.sdkpath}/component/common/api/wifi" "-I{ameba.sdkpath}/component/common/api/wifi/rtw_wpa_supplicant/src" "-I{ameba.sdkpath}/component/common/api/wifi/rtw_wpa_supplicant/src/crypto" "-I{ameba.sdkpath}/component/common/application" "-I{ameba.sdkpath}/component/common/media/framework" "-I{ameba.sdkpath}/component/common/example" "-I{ameba.sdkpath}/component/common/example/wlan_fast_connect" "-I{ameba.sdkpath}/component/common/mbed/api" "-I{ameba.sdkpath}/component/common/mbed/hal" "-I{ameba.sdkpath}/component/common/mbed/hal_ext" "-I{ameba.sdkpath}/component/common/mbed/targets/hal/rtl8721d" "-I{ameba.sdkpath}/component/common/network" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/port/realtek/freertos" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/src/include" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/src/include/lwip" "-I{ameba.sdkpath}/component/common/network/lwip/lwip_v2.0.2/port/realtek" "-I{ameba.sdkpath}/component/common/test" "-I{ameba.sdkpath}/component/soc/realtek/amebad/cmsis" "-I{ameba.sdkpath}/component/soc/realtek/amebad/fwlib" "-I{ameba.sdkpath}/component/soc/realtek/amebad/misc" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/include" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/osdep" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/hci" "-I{ameba.sdkpath}/component/common/network/ssl/ssl_ram_map/rom" "-I{ameba.sdkpath}/component/common/utilities" "-I{ameba.sdkpath}/component/common/video/v4l2/inc" "-I{ameba.sdkpath}/component/common/media/rtp_codec" "-I{ameba.sdkpath}/component/common/file_system/fatfs" "-I{ameba.sdkpath}/component/common/file_system/fatfs/r0.10c/include" "-I{ameba.sdkpath}/component/common/file_system/ftl" "-I{ameba.sdkpath}/component/common/drivers/sdio/realtek/sdio_host/inc" "-I{ameba.sdkpath}/component/common/audio" "-I{ameba.sdkpath}/component/common/drivers/i2s" "-I{ameba.sdkpath}/component/common/application/xmodem" "-I{ameba.sdkpath}/component/common/network/mDNS" "-I{ameba.sdkpath}/component/soc/realtek/amebad/fwlib/include" "-I{ameba.sdkpath}/component/soc/realtek/amebad/swlib/string" "-I{ameba.sdkpath}/component/soc/realtek/amebad/app/monitor/include" "-I{ameba.sdkpath}/component/soc/realtek/amebad/app/xmodem" "-I{ameba.sdkpath}/component/common/network/ssl/mbedtls-2.4.0/include" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/amebad/lib" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/amebad/src" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/amebad/src/vendor_cmd" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/board/common/inc" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/example/bt_config" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/app" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/client" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/server" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/os" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/platform" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/inc/stack" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/example/ble_central" "-I{ameba.sdkpath}/component/common/bluetooth/realtek/sdk/example/ble_peripheral" "-I{ameba.sdkpath}/component/common/drivers/ir/protocol" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/core/option" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/hal" "-I{ameba.sdkpath}/component/common/drivers/wlan/realtek/src/hal/phydm" "-I{ameba.sdkpath}/component/common/network/ssl/mbedtls-2.4.0/include" "-I{ameba.sdkpath}/component/common/drivers/si" "-I{ameba.sdkpath}/component/common/drivers/usb/common_new" "-I{ameba.sdkpath}/component/common/drivers/usb/device_new/cdc_acm" "-I{ameba.sdkpath}/component/common/drivers/usb/device_new/core" "-I{ameba.sdkpath}/component/common/drivers/usb/device_new/hid" compiler.arduino.c.include="-I{build.core.path}" compiler.ameba.c.flags= -DARDUINO_SDK -DCONFIG_PLATFORM_8721D -DCONFIG_USE_MBEDTLS_ROM_ALG -DCONFIG_FUNCION_O0_OPTIMIZE -DDM_ODM_SUPPORT_TYPE=32 {compiler.arduino.c.include} @@ -70,7 +79,8 @@ compiler.ameba.c.flags= -DARDUINO_SDK -DCONFIG_PLATFORM_8721D -DCONFIG_USE_MBEDT # ------------------- ###compiler.ameba.ar.list= "{build.variant.path}/lib_cmsis_dsp.a" "{build.variant.path}/lib_coap.a" "{build.variant.path}/lib_dct.a" "{build.variant.path}/lib_eap.a" "{build.variant.path}/lib_httpc.a" "{build.variant.path}/lib_httpd.a" "{build.variant.path}/lib_m4a_self.a" "{build.variant.path}/lib_mdns.a" "{build.variant.path}/lib_tftp.a" "{build.variant.path}/lib_usbd.a" "{build.variant.path}/lib_usbh.a" "{build.variant.path}/lib_usbd_new.a" "{build.variant.path}/lib_user.a" "{build.variant.path}/lib_websocket.a" "{build.variant.path}/lib_wlan.a" "{build.variant.path}/lib_wps.a" "{build.variant.path}/lib_arduino_bt.a" "{build.variant.path}/btgap.a" "{build.variant.path}/lib_arduino.a" "{build.variant.path}/lib_arduino_mbedtls240.a" "{build.variant.path}/lib_pmc_hp.a" "{build.variant.path}/lib_pmc_lp.a" -compiler.ameba.ar.list= "{runtime.platform.path}/variants/common_libs/lib_cmsis_dsp.a" "{runtime.platform.path}/variants/common_libs/lib_coap.a" "{runtime.platform.path}/variants/common_libs/lib_dct.a" "{runtime.platform.path}/variants/common_libs/lib_eap.a" "{runtime.platform.path}/variants/common_libs/lib_httpc.a" "{runtime.platform.path}/variants/common_libs/lib_httpd.a" "{runtime.platform.path}/variants/common_libs/lib_m4a_self.a" "{runtime.platform.path}/variants/common_libs/lib_mdns.a" "{runtime.platform.path}/variants/common_libs/lib_tftp.a" "{runtime.platform.path}/variants/common_libs/lib_usbd.a" "{runtime.platform.path}/variants/common_libs/lib_usbh.a" "{runtime.platform.path}/variants/common_libs/lib_usbd_new.a" "{runtime.platform.path}/variants/common_libs/lib_user.a" "{runtime.platform.path}/variants/common_libs/lib_websocket.a" "{runtime.platform.path}/variants/common_libs/lib_wlan.a" "{runtime.platform.path}/variants/common_libs/lib_wps.a" "{runtime.platform.path}/variants/common_libs/lib_arduino_bt.a" "{runtime.platform.path}/variants/common_libs/btgap.a" "{runtime.platform.path}/variants/common_libs/lib_arduino.a" "{runtime.platform.path}/variants/common_libs/lib_arduino_mbedtls240.a" "{runtime.platform.path}/variants/common_libs/lib_pmc_hp.a" "{runtime.platform.path}/variants/common_libs/lib_pmc_lp.a" +#"{runtime.platform.path}/variants/common_libs/lib_arduino_bt.a" +compiler.ameba.ar.list= "{runtime.platform.path}/variants/common_libs/lib_cmsis_dsp.a" "{runtime.platform.path}/variants/common_libs/lib_coap.a" "{runtime.platform.path}/variants/common_libs/lib_dct.a" "{runtime.platform.path}/variants/common_libs/lib_eap.a" "{runtime.platform.path}/variants/common_libs/lib_httpc.a" "{runtime.platform.path}/variants/common_libs/lib_httpd.a" "{runtime.platform.path}/variants/common_libs/lib_m4a_self.a" "{runtime.platform.path}/variants/common_libs/lib_mdns.a" "{runtime.platform.path}/variants/common_libs/lib_tftp.a" "{runtime.platform.path}/variants/common_libs/lib_usbd.a" "{runtime.platform.path}/variants/common_libs/lib_usbh.a" "{runtime.platform.path}/variants/common_libs/lib_usbd_new.a" "{runtime.platform.path}/variants/common_libs/lib_user.a" "{runtime.platform.path}/variants/common_libs/lib_websocket.a" "{runtime.platform.path}/variants/common_libs/lib_wlan.a" "{runtime.platform.path}/variants/common_libs/lib_wps.a" "{runtime.platform.path}/variants/common_libs/btgap.a" "{runtime.platform.path}/variants/common_libs/lib_arduino.a" "{runtime.platform.path}/variants/common_libs/lib_arduino_mbedtls240.a" "{runtime.platform.path}/variants/common_libs/lib_pmc_hp.a" "{runtime.platform.path}/variants/common_libs/lib_pmc_lp.a" # USB Flags # --------- @@ -92,7 +102,7 @@ recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -m recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{runtime.tools.ameba_d_asdk_toolchain.path}/lib/" "-L{build.variant.path}/linker_scripts/gcc" "-T{build.variant.path}/{build.ldscript}" {compiler.c.elf.flags} "-Wl,-Map={build.path}/application.map" {compiler.c.elf.extra_flags} -o "{build.path}/application.axf" -Wl,--start-group {object_files} -Wl,--end-group -Wl,--start-group -Wl,--whole-archive "{build.path}/{archive_file}" -Wl,--no-whole-archive {compiler.ameba.ar.list} -Wl,--end-group -lm -lstdc++ +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{runtime.tools.ameba_d_asdk_toolchain.path}/lib/" "-L{build.variant.path}/linker_scripts/gcc" "-T{build.variant.path}/{build.ldscript}" {compiler.c.elf.flags} "-Wl,-Map={build.path}/application.map" {compiler.c.elf.extra_flags} -o "{build.path}/application.axf" -Wl,--start-group {object_files} {compiler.libraries.ldflags} -Wl,--end-group -Wl,--start-group -Wl,--whole-archive "{build.path}/{archive_file}" -Wl,--no-whole-archive {compiler.ameba.ar.list} -Wl,--end-group -lm -lstdc++ ## Create nm map recipe.nm.pattern=cp "{build.path}/{build.project_name}.axf" "{build.path}/application.axf" @@ -143,3 +153,23 @@ tools.ameba_d_tools.upload.pattern.macosx="{runtime.tools.ameba_d_tools.path}/up #tools.ameba_d_tools.upload.network_pattern="{runtime.tools.ameba_d_tools.path}/upload_ota.exe" -i "{serial.port}" -p "{network.port}" -f "{runtime.tools.ameba_d_tools.path}\ota.bin" #tools.ameba_d_tools.upload.network_pattern.windows="{runtime.tools.ameba_d_tools.path}/upload_ota.exe" -i "{serial.port}" -p "{network.port}" -f "{runtime.tools.ameba_d_tools.path}\ota.bin" + +# Debugger configuration (general options) +# ---------------------------------------- +tools.gdb.path={runtime.tools.ameba_d_asdk_toolchain.path}/bin/ +tools.gdb.cmd=arm-none-eabi-gdb +tools.gdb.cmd.windows=arm-none-eabi-gdb.exe +tools.gdb.debug.pattern="{path}/{cmd}" --interpreter=mi2 -ex "set pagination off" --baud 115200 -ex "set target-charset ASCII" -ex "target remote {debug.port}" {build.path}/application.axf + +debug.executable={build.path}/application.axf +debug.toolchain=gcc +debug.toolchain.path={runtime.tools.ameba_d_asdk_toolchain.path}/bin/ +debug.toolchain.prefix=arm-none-eabi- + +# Options for JLink GDB server +# ---------------------------------------- +debug.server=jlink +debug.server.jlink.path.windows=C:/Program Files/SEGGER/JLink/JLinkGDBServerCL.exe +#debug.server.jlink.device=CORTEX-M33 +#debug.server.jlink.interface=swd +#debug.server.jlink.script={runtime.tools.ameba_d_tools.path}/tools/debug/RTL8722_Arduino_debug.JLinkScript diff --git a/Arduino_package/hardware/system/component/common/api/network/include/lwipopts.h b/Arduino_package/hardware/system/component/common/api/network/include/lwipopts.h index d2681703..95622a32 100644 --- a/Arduino_package/hardware/system/component/common/api/network/include/lwipopts.h +++ b/Arduino_package/hardware/system/component/common/api/network/include/lwipopts.h @@ -383,6 +383,7 @@ Certain platform allows computing and verifying the IP, UDP, TCP and ICMP checks /* Added by Realtek start */ #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1 #define LWIP_DNS_LEGACY_SUPPORT 0 +#define LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP 0 /* Added by Realtek end */ /* Extra options for lwip_v2.0.2 which should not affect lwip_v1.4.1 */ diff --git a/Arduino_package/hardware/system/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_eap_config.c b/Arduino_package/hardware/system/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_eap_config.c index 43f95247..3f7dc813 100644 --- a/Arduino_package/hardware/system/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_eap_config.c +++ b/Arduino_package/hardware/system/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_eap_config.c @@ -500,12 +500,24 @@ int eap_cert_setup(ssl_context *ssl) #elif CONFIG_USE_MBEDTLS +#if CONFIG_MBEDTLS_VERSION3 == 1 +#include "mbedtls/build_info.h" +#include "ssl_misc.h" +#define MBEDTLS_SSL_COMPRESSION_ADD 0 +#define MBEDTLS_SSL_MAX_CONTENT_LEN MBEDTLS_SSL_IN_CONTENT_LEN +#else #include +#include +#endif #include #include -#include -int max_buf_bio_size = MBEDTLS_SSL_BUFFER_LEN; +int max_buf_bio_size = ( MBEDTLS_SSL_MAX_CONTENT_LEN \ + + MBEDTLS_SSL_COMPRESSION_ADD \ + + 29 /* counter + header + IV */ \ + + MBEDTLS_SSL_MAC_ADD \ + + MBEDTLS_SSL_PADDING_ADD \ + ); //modify by Relatek, original define is MBEDTLS_SSL_BUFFER_LEN struct eap_tls{ void *ssl; @@ -632,10 +644,18 @@ int eap_cert_setup(struct eap_tls *tls_context) if(mbedtls_x509_crt_parse(_cli_crt, eap_client_cert, eap_client_cert_len) != 0) return -1; if(eap_client_key_pwd){ +#if CONFIG_MBEDTLS_VERSION3 == 1 + if(mbedtls_pk_parse_key(_clikey_rsa, eap_client_key, eap_client_key_len, eap_client_key_pwd, strlen(eap_client_key_pwd)+1, rtw_get_random_bytes_f_rng, (void*)1) != 0) +#else if(mbedtls_pk_parse_key(_clikey_rsa, eap_client_key, eap_client_key_len, eap_client_key_pwd, strlen(eap_client_key_pwd)+1) != 0) +#endif return -1; }else{ +#if CONFIG_MBEDTLS_VERSION3 == 1 + if(mbedtls_pk_parse_key(_clikey_rsa, eap_client_key, eap_client_key_len, eap_client_key_pwd, 0, rtw_get_random_bytes_f_rng, (void*)1) != 0) +#else if(mbedtls_pk_parse_key(_clikey_rsa, eap_client_key, eap_client_key_len, eap_client_key_pwd, 0) != 0) +#endif return -1; } diff --git a/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.c b/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.c index 3450d469..d6083611 100644 --- a/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.c +++ b/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.c @@ -1258,8 +1258,27 @@ This method is to modify the mac and don't write to efuse. **/ extern int rltk_change_mac_address_from_ram(int idx, u8 *mac); int wifi_change_mac_address_from_ram(int idx, u8 *mac) -{ - return rltk_change_mac_address_from_ram(idx, mac); +{ + int ret = 0; + int ret_ps = 0; + const char * ifname = WLAN0_NAME; + if ((0 != idx) && (1 != idx)) { + RTW_API_INFO("\n\rInvalid interface selected"); + return RTW_ERROR; + } + if (1 == idx) { + ifname = WLAN1_NAME; + } + ret_ps = wext_disable_powersave(ifname); + if (RTW_SUCCESS != ret_ps) { + RTW_API_INFO("\n\rFailed to disable powersave"); + } + ret = rltk_change_mac_address_from_ram(idx, mac); + ret_ps = wext_resume_powersave(ifname); + if (RTW_SUCCESS != ret_ps) { + RTW_API_INFO("\n\rFailed to resume powersave"); + } + return ret; } //----------------------------------------------------------------------------// @@ -1282,12 +1301,46 @@ int wifi_get_mac_address(char * mac) return ret; } +int wifi_get_interface_mac_address(int idx, char * mac) +{ + int ret = 0; + char buf[32]; + rtw_memset(buf, 0, sizeof(buf)); + rtw_memcpy(buf, "read_mac", 8); + + if (WLAN0_IDX == idx) { + ret = wext_private_command_with_retval(WLAN0_NAME, buf, buf, 32); + } + else if (WLAN1_IDX == idx) { + if (wifi_mode == RTW_MODE_STA_AP) { + ret = wext_private_command_with_retval(WLAN1_NAME, buf, buf, 32); + } + else { + RTW_API_INFO("\n\rInvalid interface selected"); + ret = RTW_ERROR; + return ret; + } + } + else { + RTW_API_INFO("\n\rInvalid interface selected"); + ret = RTW_ERROR; + return ret; + } + strcpy(mac, buf); + return ret; +} + //----------------------------------------------------------------------------// int wifi_enable_powersave(void) { return wext_enable_powersave(WLAN0_NAME, 1, 1); } +int wifi_enable_powersave_for_coex(void) +{ + return wext_enable_powersave(WLAN0_NAME, 0, 1); +} + int wifi_resume_powersave(void) { return wext_resume_powersave(WLAN0_NAME); @@ -1524,6 +1577,9 @@ _WEAK void wifi_set_mib(void) //trp tis wext_set_trp_tis(RTW_TRP_TIS_DISABLE); wext_set_anti_interference(DISABLE); +#if defined(CONFIG_IEEE80211K) + wext_set_enable_80211k(1); +#endif #ifdef CONFIG_POWER_SAVING //PS_MODE_MIN:1(default), PS_MODE_MAX:2 wext_set_powersave_mode(1); @@ -3119,7 +3175,7 @@ int wifi_show_setting(const char *ifname, rtw_wifi_setting_t *pSetting) //----------------------------------------------------------------------------// int wifi_set_network_mode(rtw_network_mode_t mode) { - if((mode == RTW_NETWORK_B) || (mode == RTW_NETWORK_BG) || (mode == RTW_NETWORK_BGN)) + if((mode == RTW_NETWORK_B) || (mode == RTW_NETWORK_BG) || (mode == RTW_NETWORK_BGN) || (mode == RTW_NETWORK_ABGN)) return rltk_wlan_wireless_mode((unsigned char) mode); return -1; @@ -3969,6 +4025,13 @@ int wifi_set_igi(uint8_t igi, uint8_t enable) return rltk_wlan_set_igi(igi, enable); } +int wifi_set_ap_uapsd(uint8_t enable){ + return wext_set_uapsd_enable(enable); +} + +int wifi_set_bcn_period(uint8_t period){ + return wext_set_bcn_period(period); +} /* Data rate input table 0x00->1M diff --git a/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.h b/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.h index e50c0279..ddaeffd5 100644 --- a/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.h +++ b/Arduino_package/hardware/system/component/common/api/wifi/wifi_conf.h @@ -253,7 +253,11 @@ int wifi_is_ready_to_transceive(rtw_interface_t interface); /** * @brief This function sets the current Media Access Control (MAC) address of the 802.11 device but don't -write to efuse or flash, it is temporary to modify the MAC. + * write to efuse or flash, it is to modify the MAC temporarily in RAM. + * Only call this API BEFORE connecting to a network, BEFORE fast connect and BEFORE starting SoftAP(For AP mode). + * Example: + * u8 mac[ETH_ALEN] = {0x00, 0xe0, 0x4c, 0x87, 0x12, 0x34}; + * ret = wifi_change_mac_address_from_ram(0,mac); * @param[in] idx: 0=> wlan0, 1=>wlan1. * @param[in] mac: Wi-Fi MAC address. * @return RTW_SUCCESS or RTW_ERROR @@ -261,20 +265,44 @@ write to efuse or flash, it is temporary to modify the MAC. int wifi_change_mac_address_from_ram(int idx, u8 *mac); /** - * @brief This function sets the current Media Access Control (MAC) address of the 802.11 device. + * @brief This function sets the current Media Access Control (MAC) address of the 802.11 device in Efuse. + * Example: + * #define MAC_VALID "ecf00e4e751c" + * ret = wifi_set_mac_address((char *)MAC_VALID); * @param[in] mac: Wi-Fi MAC address. * @return RTW_SUCCESS or RTW_ERROR */ int wifi_set_mac_address(char * mac); /** - * @brief Retrieves the current Media Access Control (MAC) address + * @brief Retrieves from RAM space WLAN0's current Media Access Control (MAC) address * (or Ethernet hardware address) of the 802.11 device. - * @param[in] mac: Point to the result of the mac address will be get. + * Example: + * char *mac; + * mac = (char*)malloc(18*sizeof(char)); + * ret = wifi_get_mac_address(mac); + * printf("\nGet MAC address: %s\n", mac); + * free(mac); + * @param[in] mac: Pointer to the result of the mac address,it must be at least 18 bytes long. * @return RTW_SUCCESS or RTW_ERROR */ int wifi_get_mac_address(char * mac); +/** + * @brief Retrieves from RAM space the selected interface's current Media Access Control (MAC) address + * (or Ethernet hardware address) of the 802.11 device. + * Example: + * char *mac; + * mac = (char*)malloc(18*sizeof(char)); + * ret = wifi_get_interface_mac_address(0,mac); + * printf("\nGet MAC address of wlan0: %s\n", mac); + * free(mac); + * @param[in] idx: 0=> wlan0, 1=>wlan1. + * @param[in] mac: Pointer to the result of the mac address, it must be at least 18 bytes long. + * @return RTW_SUCCESS or RTW_ERROR + */ +int wifi_get_interface_mac_address(int idx, char * mac); + /** * @brief Enable Wi-Fi powersave mode. * @param None @@ -282,6 +310,13 @@ int wifi_get_mac_address(char * mac); */ int wifi_enable_powersave(void); +/** + * @brief Enable Wi-Fi powersave mode for coexistence. + * @param None + * @return RTW_SUCCESS or RTW_ERROR. + */ +int wifi_enable_powersave_for_coex(void); + /** * @brief Resume Wi-Fi powersave mode. * @param None @@ -1184,6 +1219,20 @@ int wifi_ap_switch_chl_and_inform(unsigned char new_channel); */ int wifi_set_igi(uint8_t igi, uint8_t enable); +/** + * @brief Set softap uapsd feature. + * @param[in] enable: 1, enable uapsd; 0, disable uapsd. + * @return 0: success. + */ +int wifi_set_ap_uapsd(uint8_t enable); + +/** + * @brief Set softap bcn period. + * @param[in] period: default 100ms. + * @return 0: success. + */ +int wifi_set_bcn_period(uint8_t period); + #ifdef __cplusplus } #endif diff --git a/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.c b/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.c index c44eb6f4..576d41c5 100644 --- a/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.c +++ b/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.c @@ -904,6 +904,13 @@ int wext_get_bcn_rssi(const char *ifname, int *rssi) return ret; } +int wext_set_bcn_period(__u8 period){ + int ret = 0; + extern u8 custom_beacon_period; + custom_beacon_period = period; + return ret; +} + int wext_set_pscan_channel(const char *ifname, __u8 *ch, __u8 *pscan_config, __u8 length) { struct rtwreq iwr; @@ -1564,6 +1571,14 @@ int wext_set_bw40_enable(__u8 enable) return 0; } + +int wext_set_uapsd_enable(__u8 enable){ + int ret = 0; + extern u8 custom_uapsd; + custom_uapsd = enable; + return ret; +} + extern int rltk_get_auto_chl(const char *ifname, unsigned char *channel_set, unsigned char channel_num); int wext_get_auto_chl(const char *ifname, unsigned char *channel_set, unsigned char channel_num) { @@ -1813,6 +1828,14 @@ int wext_wlan_redl_fw(const char *ifname){ } #endif +#ifdef CONFIG_IEEE80211K +u8 rtw_enable_80211k = 1; +void wext_set_enable_80211k(__u8 enable) +{ + rtw_enable_80211k = enable; +} +#endif + #ifdef CONFIG_POWER_SAVING extern u8 rtw_power_mgnt; void wext_set_powersave_mode(__u8 ps_mode){ diff --git a/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.h b/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.h index 3f109452..ada32075 100644 --- a/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.h +++ b/Arduino_package/hardware/system/component/common/api/wifi/wifi_util.h @@ -94,9 +94,14 @@ int wext_add_mac_filter(unsigned char* hwaddr); int wext_del_mac_filter(unsigned char* hwaddr); void wext_set_indicate_mgnt(int enable); int wext_get_bcn_rssi(const char *ifname, int *rssi); +int wext_set_bcn_period(__u8 period); +#if defined(CONFIG_IEEE80211K) +void wext_set_enable_80211k(__u8 enable); +#endif void wext_set_powersave_mode(__u8 ps_mode); int wext_set_ant_div_gpio(__u8 type); int wext_set_bw40_enable(__u8 enable); +int wext_set_uapsd_enable(__u8 enable); #ifdef CONFIG_SW_MAILBOX_EN int wext_mailbox_to_wifi(const char *ifname, char *buf, __u16 buf_len); #endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/board/amebad/lib/release_note.txt b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/board/amebad/lib/release_note.txt index 69c4bb53..98805e31 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/board/amebad/lib/release_note.txt +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/board/amebad/lib/release_note.txt @@ -2,6 +2,23 @@ /* * Release Note */ + v1.0.1.186 + 2022/09/28 + 1. Add API le_bond_get_pair_procedure_type. + + v1.0.1.185 + 2022/09/23 + 1. Fix a bug about timer not stop when disconnect. + + v1.0.1.184 + 2022/08/31 + 1. Add API client_send_exchange_mtu_req. + 2. Add GAP_PARAM_MASTER_INIT_GATT_MTU_REQ . + + v1.0.1.183 + 2022/08/26 + 1. Fix an exchange mtu issue. + v1.0.1.179 2022/06/10 1. Add API le_get_dev_ltk. @@ -21,7 +38,7 @@ v1.0.1.162 2021/09/18 1. Fix a bug for H4 when receive error data. - + v1.0.1.158 2021/07/23 1. Fix a bug for bte_deinit. diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/app_flags.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_app_flags.h similarity index 80% rename from Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/app_flags.h rename to Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_app_flags.h index 47e26185..edbad4a1 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/app_flags.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_app_flags.h @@ -12,12 +12,15 @@ *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

************************************************************************************** */ -#ifndef _APP_FLAGS_H_ -#define _APP_FLAGS_H_ +#ifndef _BLE_CENTRAL_APP_FLAGS_H_ +#define _BLE_CENTRAL_APP_FLAGS_H_ #include #include +#include + + /** @defgroup CENTRAL_CLIENT_Config Central Client App Configuration * @brief This file is used to config app functions. * @{ @@ -27,10 +30,14 @@ *============================================================================*/ /** @brief Config APP LE link number */ -#define APP_MAX_LINKS 3 +#if defined(CONFIG_PLATFORM_8721D) +#define BLE_CENTRAL_APP_MAX_LINKS 3 +#elif defined(CONFIG_PLATFORM_8710C) +#define BLE_CENTRAL_APP_MAX_LINKS 1 +#endif /** @brief Config the discovery table number of gcs_client */ -#define APP_MAX_DISCOV_TABLE_NUM 40 +#define BLE_CENTRAL_APP_MAX_DISCOV_TABLE_NUM 40 /** @} */ /* End of group CENTRAL_CLIENT_Config */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/app_task.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_app_task.h similarity index 80% rename from Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/app_task.h rename to Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_app_task.h index 8dfcd2ac..7d122079 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/app_task.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_app_task.h @@ -12,16 +12,16 @@ *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

************************************************************************************** */ -#ifndef _APP_TASK_H_ -#define _APP_TASK_H_ - -extern void driver_init(void); +#ifndef _BLE_CENTRAL_APP_TASK_H_ +#define _BLE_CENTRAL_APP_TASK_H_ /** * @brief Initialize App task * @return void */ -void app_task_init(void); +void ble_central_app_task_init(void); +void ble_central_app_main_task(void *p_param); +void ble_central_app_task_deinit(void); #endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_at_cmd.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_at_cmd.h new file mode 100644 index 00000000..c630e0d6 --- /dev/null +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_at_cmd.h @@ -0,0 +1,16 @@ +#ifndef _BLE_CENTRAL_AT_CMD_H_ +#define _BLE_CENTRAL_AT_CMD_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +int ble_central_at_cmd_scan(int argc, char **argv); +int ble_central_app_handle_at_cmd(uint16_t subtype, void *arg); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif + diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/central_client_app.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_client_app.h similarity index 74% rename from Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/central_client_app.h rename to Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_client_app.h index d2308e50..0248085d 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/central_client_app.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_client_app.h @@ -13,8 +13,8 @@ ************************************************************************************** */ -#ifndef _CENTRAL_CLIENT_APP_H_ -#define _CENTRAL_CLIENT_APP_H_ +#ifndef _BLE_CENTRAL_CLIENT_APP_H_ +#define _BLE_CENTRAL_CLIENT_APP_H_ #ifdef __cplusplus extern "C" { @@ -25,10 +25,18 @@ extern "C" { #include #include + +#define BD_ADDR_FMT "%02x:%02x:%02x:%02x:%02x:%02x" +#define BD_ADDR_ARG(x) (x)[5],(x)[4],(x)[3],(x)[2],(x)[1],(x)[0] +#define UUID_128_FORMAT "0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X:0x%2X" +#define UUID_128(x) x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15] + + + /*============================================================================* * Variables *============================================================================*/ -extern T_CLIENT_ID gcs_client_id; /**< General Common Services client client id*/ +extern T_CLIENT_ID ble_central_gcs_client_id; /**< General Common Services client client id*/ /*============================================================================* * Functions @@ -41,14 +49,14 @@ extern T_CLIENT_ID gcs_client_id; /**< General Common Services client * @param[in] io_msg IO message data * @return void */ -void app_handle_io_msg(T_IO_MSG io_msg); +void ble_central_app_handle_io_msg(T_IO_MSG io_msg); /** * @brief Callback for gap le to notify app * @param[in] cb_type callback msy type @ref GAP_LE_MSG_Types. * @param[in] p_cb_data point to callback data @ref T_LE_CB_DATA. * @retval result @ref T_APP_RESULT */ -T_APP_RESULT app_gap_callback(uint8_t cb_type, void *p_cb_data); +T_APP_RESULT ble_central_app_gap_callback(uint8_t cb_type, void *p_cb_data); /** * @brief Callback will be called when data sent from profile client layer. @@ -57,7 +65,7 @@ T_APP_RESULT app_gap_callback(uint8_t cb_type, void *p_cb_data); * @param p_data pointer to data. * @retval result @ref T_APP_RESULT */ -T_APP_RESULT gcs_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); +T_APP_RESULT ble_central_gcs_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); #ifdef __cplusplus } diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/link_mgr.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_link_mgr.h similarity index 77% rename from Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/link_mgr.h rename to Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_link_mgr.h index fd7f2794..e32a2ac1 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/link_mgr.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/ble_central/ble_central_link_mgr.h @@ -12,13 +12,14 @@ *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

************************************************************************************** */ -#ifndef _LINK_MANAGER_H_ -#define _LINK_MANAGER_H_ +#ifndef _BLE_CENTRAL_LINK_MANAGER_H_ +#define _BLE_CENTRAL_LINK_MANAGER_H_ /*============================================================================* * Header Files *============================================================================*/ #include #include +#include /*============================================================================* * Constants @@ -39,14 +40,26 @@ typedef struct /** @addtogroup CENTRAL_CLIENT_SCAN_MGR * @{ */ +#if F_BT_LE_USE_RANDOM_ADDR +typedef struct +{ + uint8_t is_exist; + uint8_t reserved; /**< remote BD type*/ + uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ +} T_APP_STATIC_RANDOM_ADDR; +#endif + /*============================================================================* * Variables *============================================================================*/ /** @brief App link table */ -extern T_APP_LINK app_link_table[APP_MAX_LINKS]; +extern T_APP_LINK ble_central_app_link_table[BLE_CENTRAL_APP_MAX_LINKS]; /*============================================================================* * Functions *============================================================================*/ - +#if F_BT_LE_USE_RANDOM_ADDR +uint32_t ble_central_app_save_static_random_address(T_APP_STATIC_RANDOM_ADDR *p_addr); +uint32_t ble_central_app_load_static_random_address(T_APP_STATIC_RANDOM_ADDR *p_addr); +#endif #endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/bt_config/bt_config_wifi.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/bt_config/bt_config_wifi.h index f26d29d7..58f8cbb3 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/bt_config/bt_config_wifi.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/example/bt_config/bt_config_wifi.h @@ -42,13 +42,13 @@ #define DEBUG 0 #if DEBUG - #define BC_DBG_PREFIX "\n\r[BT Config Wifi][DBG] " + #define BC_DBG_PREFIX "\r\n[BT Config Wifi][DBG] " #define BC_DBG(...) printf(BC_DBG_PREFIX __VA_ARGS__); #else #define BC_DBG(...) #endif -#define BC_PREFIX "\n\r[BT Config Wifi] " +#define BC_PREFIX "\r\n[BT Config Wifi] " #define BC_printf(...) printf(BC_PREFIX __VA_ARGS__); #define BC_BSSID_LEN (6) diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_bond_le.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_bond_le.h index c0800401..85c452b7 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_bond_le.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_bond_le.h @@ -197,6 +197,78 @@ T_GAP_CAUSE le_bond_get_param(T_LE_BOND_PARAM_TYPE param, void *p_value); */ T_GAP_CAUSE le_bond_pair(uint8_t conn_id); +/** + * @brief Get type of LE pair procedure. + * + * NOTE: The API should only be used when receive @ref GAP_MSG_LE_BOND_JUST_WORK, + * @ref GAP_MSG_LE_BOND_PASSKEY_DISPLAY, @ref GAP_MSG_LE_BOND_PASSKEY_INPUT, + * @ref GAP_MSG_LE_BOND_USER_CONFIRMATION, @ref GAP_MSG_LE_BOND_OOB_INPUT. + * + * @param[in] conn_id Connection ID. + * @param[in,out] p_value Pointer to location to get the value. + * Value of LE pair procedure type: + * 0: LE Legacy Pairing + * 1: LE Secure Connections + * All other values: Reserved for future use. + * @return Operation result. + * @retval GAP_CAUSE_SUCCESS Operation success. + * @retval GAP_CAUSE_NON_CONN Operation failure. No connection. + * + * Example usage + * \code{.c} + void app_handle_gap_msg(T_IO_MSG *p_gap_msg) + { + ... + case GAP_MSG_LE_BOND_JUST_WORK: + { + ... + if (le_bond_get_pair_procedure_type(conn_id, &le_pair_proc_type) == GAP_CAUSE_SUCCESS) + { + ... + } + break; + + case GAP_MSG_LE_BOND_PASSKEY_DISPLAY: + { + ... + if (le_bond_get_pair_procedure_type(conn_id, &le_pair_proc_type) == GAP_CAUSE_SUCCESS) + { + ... + } + break; + + case GAP_MSG_LE_BOND_PASSKEY_INPUT: + { + ... + if (le_bond_get_pair_procedure_type(conn_id, &le_pair_proc_type) == GAP_CAUSE_SUCCESS) + { + ... + } + break; + + case GAP_MSG_LE_BOND_USER_CONFIRMATION: + { + ... + if (le_bond_get_pair_procedure_type(conn_id, &le_pair_proc_type) == GAP_CAUSE_SUCCESS) + { + ... + } + break; + + case GAP_MSG_LE_BOND_OOB_INPUT: + { + ... + if (le_bond_get_pair_procedure_type(conn_id, &le_pair_proc_type) == GAP_CAUSE_SUCCESS) + { + ... + } + break; + ... + } + * \endcode + */ +T_GAP_CAUSE le_bond_get_pair_procedure_type(uint8_t conn_id, uint8_t *p_value); + /** * @brief Get the display key information * @@ -275,6 +347,7 @@ T_GAP_CAUSE le_bond_get_display_key(uint8_t conn_id, uint32_t *p_key); T_GAP_CAUSE le_bond_passkey_input_confirm(uint8_t conn_id, uint32_t passcode, T_GAP_CFM_CAUSE cause); +#if F_BT_LE_SMP_OOB_SUPPORT /** * @brief Send oob data to gap bond manager when pairing with out of bond, * and local should input oob data. @@ -311,7 +384,6 @@ T_GAP_CAUSE le_bond_passkey_input_confirm(uint8_t conn_id, uint32_t passcode, } * \endcode */ -#if F_BT_LE_SMP_OOB_SUPPORT T_GAP_CAUSE le_bond_oob_input_confirm(uint8_t conn_id, T_GAP_CFM_CAUSE cause); #endif /** @@ -389,6 +461,7 @@ T_GAP_CAUSE le_bond_just_work_confirm(uint8_t conn_id, T_GAP_CFM_CAUSE cause); */ T_GAP_CAUSE le_bond_passkey_display_confirm(uint8_t conn_id, T_GAP_CFM_CAUSE cause); +#if F_BT_LE_4_2_SC_SUPPORT /** * @brief Send user confirmation request to confirm result to upper stack * @param[in] conn_id Connection ID. @@ -424,7 +497,6 @@ T_GAP_CAUSE le_bond_passkey_display_confirm(uint8_t conn_id, T_GAP_CFM_CAUSE cau } * \endcode */ -#if F_BT_LE_4_2_SC_SUPPORT T_GAP_CAUSE le_bond_user_confirm(uint8_t conn_id, T_GAP_CFM_CAUSE cause); #endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_le.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_le.h index 06b4612c..a796a4c7 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_le.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap/gap_le.h @@ -69,6 +69,9 @@ typedef enum GAP_PARAM_DS_DATA_OFFSET = 0x232, //!< Downstream pool buffer data offset. Read only. size is uint16. GAP_PARAM_LE_REMAIN_CREDITS = 0x233, //!< Remain credits avaiable for TX. Read only. size is uint16. GAP_PARAM_MAX_WL_SIZE = 0x234, //!< Max white list size. Read only. size is uint16. +#if F_BT_LE_GAP_CENTRAL_SUPPORT + GAP_PARAM_MASTER_INIT_GATT_MTU_REQ = 0x23b, //!< Master initiate the GATT exchange MTU procedure. Write Only. Size is uint8. Default value is true. +#endif } T_GAP_LE_PARAM_TYPE; /** diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/profile_client.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/profile_client.h index bc7f7d3a..a965246f 100644 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/profile_client.h +++ b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/profile_client.h @@ -533,6 +533,31 @@ T_GAP_CAUSE client_attr_write(uint8_t conn_id, T_CLIENT_ID client_id, */ T_GAP_CAUSE client_attr_ind_confirm(uint8_t conn_id); +/** + * @brief Send the exchange MTU request. + * This function is used to send the exchange MTU request. + * + * @param[in] conn_id Connection id indicate which link is. + * @retval GAP_CAUSE_SUCCESS: Write request success. + * @retval other: Write request failed. + * + * Example usage + * \code{.c} + uint8_t *p_data_buf; + uint16_t data_offset; + static T_USER_CMD_PARSE_RESULT cmd_send_mtu_req(T_USER_CMD_PARSED_VALUE *p_parse_value) + { + T_GAP_CAUSE cause; + uint8_t conn_id = p_parse_value->dw_param[0]; + + cause = client_send_exchange_mtu_req(conn_id); + return (T_USER_CMD_PARSE_RESULT)cause; + } + * \endcode + */ +T_GAP_CAUSE client_send_exchange_mtu_req(uint8_t conn_id); + + /** End of GATT_Client_Exported_Functions * @} */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/app_flags.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/app_flags.h deleted file mode 100644 index 0aee458f..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/app_flags.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _APP_FLAGS_H_ -#define _APP_FLAGS_H_ - -#include "bt_flags.h" -#define APP_MAX_LINKS 4 - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/app_task.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/app_task.h deleted file mode 100644 index 0507cd99..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/app_task.h +++ /dev/null @@ -1,32 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file application.h - * @brief Application task related interfaces. - * @details - * @author ranhui - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion **/ -#ifndef _APP_TASK_H_ -#define _APP_TASK_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** Add Includes here **/ - -/** Add all public functions here **/ -extern void app_task_init(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/ble_auto_test_application.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/ble_auto_test_application.h deleted file mode 100644 index 27c1aee1..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/ble_auto_test_application.h +++ /dev/null @@ -1,59 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file ble_auto_test_application.h -* @brief gap roles test app implementation -* @details gap roles test app implementation -* @author jane -* @date 2016-02-18 -* @version v0.1 -* ********************************************************************************************************* -*/ - -#ifndef _GAP_ROLES_TEST_APP_H_ -#define _GAP_ROLES_TEST_APP_H_ -#include "app_msg.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include "profile_client.h" -#endif -#if F_BT_LE_GATT_SERVER_SUPPORT -#include "profile_server.h" -#include "privacy_mgnt.h" -#endif - - -extern void app_handle_io_msg(T_IO_MSG io_msg); -extern T_APP_RESULT app_gap_callback(uint8_t cb_type, - void *p_cb_data); -#if F_BT_LE_GATT_CLIENT_SUPPORT -extern T_APP_RESULT app_simp_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); -extern T_APP_RESULT app_gap_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); -extern T_APP_RESULT app_general_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, - void *p_data); -#endif -#if F_BT_LE_GATT_SERVER_SUPPORT -extern T_APP_RESULT app_profile_callback(T_SERVER_ID serviceID, void *p_data); -#endif -#if F_BT_LE_4_1_CBC_SUPPORT -T_APP_RESULT app_credit_based_conn_callback(uint8_t cbc_type, void *p_cbc_data); -#endif -#if F_BT_LE_GATT_CLIENT_SUPPORT -T_APP_RESULT test_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); -#endif -void tc_start_next_case(void); -void tc_add_case(uint32_t count); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/ble_auto_test_case.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/ble_auto_test_case.h deleted file mode 100644 index 71486d7b..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/ble_auto_test_case.h +++ /dev/null @@ -1,231 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_CASE_H_ -#define _BLE_AUTO_TEST_CASE_H_ -#include "app_msg.h" -#include -#include -#include "user_cmd_parse.h" - -#define TC_0001_SUPPORT 0 -#define TC_0002_SUPPORT 0 -#define TC_100_SUPPORT 0 -#define TC_101_SUPPORT 0 -#define TC_200_SUPPORT 1 -#define TC_200_SUT_SUPPORT 1 -#define TC_206_SUPPORT 1 -#define TC_206_SUT_SUPPORT 1 -#define TC_207_SUPPORT 1 -#define TC_207_SUT_SUPPORT 1 -#define TC_208_SUPPORT 1 -#define TC_208_SUT_SUPPORT 1 -#define TC_300_SUPPORT 0 -#define TC_300_SUT_SUPPORT 0 -#define TC_301_SUPPORT 0 -#define TC_301_SUT_SUPPORT 0 -#define TC_310_SUPPORT 0 -#define TC_310_SUT_SUPPORT 0 -#define TC_311_SUPPORT 0 -#define TC_311_SUT_SUPPORT 0 -#define TC_400_SUPPORT 0 -#define TC_400_SUT_SUPPORT 0 -#define TC_401_SUPPORT 0 -#define TC_401_SUT_SUPPORT 0 -#define TC_500_SUPPORT 1 -#define TC_500_SUT_SUPPORT 1 -#define TC_501_SUPPORT 1 -#define TC_501_SUT_SUPPORT 1 -#define TC_502_SUPPORT 1 -#define TC_502_SUT_SUPPORT 0 -#define TC_600_SUPPORT 1 -#define TC_600_SUT_SUPPORT 1 -#define TC_601_SUPPORT 1 -#define TC_601_SUT_SUPPORT 1 -#define TC_700_SUPPORT 0 -#define TC_700_SUT_SUPPORT 0 -#if F_BT_LE_5_0_SUPPORT -#define TC_800_SUPPORT 0 -#define TC_800_SUT_SUPPORT 0 -#define TC_801_SUPPORT 0 -#define TC_801_SUT_SUPPORT 0 -#endif -#if F_BT_LE_PRIVACY_SUPPORT -#define TC_900_SUPPORT 0 -#define TC_900_SUT_SUPPORT 0 -#define TC_901_SUPPORT 0 -#define TC_901_SUT_SUPPORT 0 -#endif -#if F_BT_UPPER_STACK_USE_VIRTUAL_HCI -#define TC_1000_SUPPORT 0 -#endif -#if F_BT_LE_4_1_CBC_SUPPORT -#define TC_1100_SUPPORT 1 -#define TC_1100_SUT_SUPPORT 1 -#define TC_1101_SUPPORT 1 -#define TC_1101_SUT_SUPPORT 1 -#define TC_1102_SUPPORT 1 -#define TC_1102_SUT_SUPPORT 1 -#endif -#define TC_1200_SUPPORT 0 -#define TC_1201_SUPPORT 0 -#define TC_1202_SUPPORT 0 -#define TC_1203_SUPPORT 0 -#if F_BT_LE_5_0_AE_SCAN_SUPPORT -#define TC_1204_SUPPORT 1 -#define TC_1205_SUPPORT 1 -#define TC_1206_SUPPORT 1 -#endif -#define TC_1207_SUPPORT 0 -#if F_BT_LE_5_0_AE_ADV_SUPPORT -#define TC_1204_SUT_SUPPORT 1 -#define TC_1205_SUT_SUPPORT 1 -#define TC_1206_SUT_SUPPORT 1 -#endif - -#if F_BT_LE_GAP_PERIPHERAL_SUPPORT -#include -#endif - -#include - -#if F_BT_LE_GAP_PERIPHERAL_SUPPORT -#include -#include -#include -#include -#include -#include -#include -#if F_BT_LE_5_0_SUPPORT -#include -#endif -#include -#include -#if F_BT_LE_4_1_CBC_SUPPORT -#include -#endif -#endif - -#if F_BT_LE_GAP_CENTRAL_SUPPORT -#include -#include -#include -#include -#include -#include -#if F_BT_LE_5_0_SUPPORT -#include -#endif -#if F_BT_LE_4_1_CBC_SUPPORT -#include -#endif -#endif - -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint8_t TGATTDBdAddr[6]; -extern TGATTDBdAddr g_cur_rembd; - - -typedef enum -{ - TC_IDLE = 0x0000, - TC_0001_ADV_PERFORMANCE = 1, - TC_0002_ADV_STRESS_START_STOP, - - TC_0100_SCAN_PERFORMANCE = 100, - TC_0101_SCAN_STRESS_ENABLE_DISABLE, - - TC_0200_TP_NOTIFICATION_TX_01 = 200, - TC_0201_TP_INDICATION_TX_01, - - TC_0202_TP_WRITE_COMMAND_TX_01, - TC_0203_TP_NOTIFICATION_RX_01, - TC_0204_TP_INDICATION_RX_01, - TC_0205_TP_WRITE_COMMAND_RX_01, - - TC_0206_TP_NOTIFICATION_TX_02, - TC_0207_TP_WRITE_COMMAND_RX_02, - TC_0208_TP_NOTIF_WRITE_CMD_TRX_02, - - TC_0300_ADV_ONLY = 300, - TC_0301_ADV_DISC, - - TC_0310_2M_LONGRANGE_1 = 310, - TC_0311_2M_LONGRANGE_2, - - TC_0400_CONN_PARAM_UPDATE_SLAVE = 400,//10 - TC_0401_CONN_PARAM_UPDATE_SLAVE_01, - - TC_0500_SLAVE_AUTO_ADV = 500, - TC_0501_SLAVE_AUTO_ADV_WITH_SEC_REQ, - TC_0502_SLAVE_MULTIPLE_LINK_AUTO_ADV, - - TC_0600_IOP_PAIR_LEGACL = 600, - TC_0601_IOP_PAIR_SC, - - TC_0700_STABLE_NOTIFICATION_TX_01 = 700, - - TC_0800_IOP_PAIR_LEGACL = 800, - TC_0801_IOP_PAIR_SC, - - TC_0900_PRIVACY_TEST_SLAVE = 900, - TC_0901_PRIVACY_TEST_MASTER, - - TC_1000_CP_TEST = 1000, - TC_1001_CP_TEST = 1001, - TC_1002_CP_TEST = 1002, - - TC_1100_BT41_CONN_TEST = 1100, - TC_1101_BT41_TRX_STRESS_TEST = 1101, - TC_1102_BT41_TP_TEST = 1102, - - TC_1200_MULTI_LINK_4_MASTER = 1200, - TC_1201_MULTI_LINK_4_MASTER, - TC_1202_MULTI_LINK_4_MASTER, - TC_1203_MULTI_LINK_4_MASTER, - TC_1204_MULTI_LINK_4_MASTER, - TC_1205_MULTI_LINK_4_MASTER, - TC_1206_MULTI_LINK_4_MASTER, - TC_1207_MULTI_LINK_4_MASTER, - - - TC_MAX = 65535 -} T_CUR_TEST_CASE; - - -typedef enum _T_CUR_DEVICE_ROLE -{ - TC_ROLE_UNDEFINED, - TC_ROLE_DUT, - TC_ROLE_SUT -} T_CUR_DEVICE_ROLE; - -T_CUR_DEVICE_ROLE app_get_cur_tc_role(void); -void app_set_cur_tc_role(T_CUR_DEVICE_ROLE role); - -T_CUR_TEST_CASE app_get_cur_test_case(void); -void app_set_dlps_mode(T_USER_CMD_PARSED_VALUE *p_parse_value); -void app_select_cur_test_case(T_USER_CMD_PARSED_VALUE *p_parse_value); -void app_dump_cur_test_case(T_USER_CMD_PARSED_VALUE *p_parse_value); -bool app_set_rembd(T_USER_CMD_PARSED_VALUE *p_parse_value); -void app_set_cur_case(T_CUR_TEST_CASE test_case_id); - - -/** - common api -*/ -uint32_t os_time_get_elapsed(uint32_t begin, uint32_t end); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/cmd/user_cmd.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/cmd/user_cmd.h deleted file mode 100644 index c8239cab..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/cmd/user_cmd.h +++ /dev/null @@ -1,31 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************** -* @file user_cmd.h -* @brief Define user command. -* @details -* @author jane -* @date 2016-02-18 -* @version v0.1 -********************************************************************************************************* -*/ -#ifndef _USER_CMD_H_ -#define _USER_CMD_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "data_uart.h" -#include "user_cmd_parse.h" - -extern const T_USER_CMD_TABLE_ENTRY user_cmd_table[]; -extern T_USER_CMD_IF user_cmd_if; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/link_mgr.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/link_mgr.h deleted file mode 100644 index 247c71e8..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/link_mgr.h +++ /dev/null @@ -1,89 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file link_mgr.h - * @brief Define multilink manager struct and functions. - * @author jane - * @date 2017-06-06 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _LINK_MANAGER_H_ -#define _LINK_MANAGER_H_ -/*============================================================================* - * Header Files - *============================================================================*/ -#include -#include -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include "profile_client.h" -#endif - -/*============================================================================* - * Constants - *============================================================================*/ -/** @brief Define device list table size. */ -#define APP_MAX_DEVICE_INFO 6 - -/** @addtogroup SCATTERNET_GAP_MSG - * @{ - */ -/** - * @brief Application Link control block defination. - */ -typedef struct -{ - T_GAP_CONN_STATE conn_state; /**< Connection state. */ - T_GAP_REMOTE_ADDR_TYPE bd_type; /**< remote BD type*/ - uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ -} T_APP_LINK; -/** @} */ /* End of group SCATTERNET_GAP_MSG */ -/** @addtogroup SCATTERNET_SCAN_MGR GATT - * @{ - */ -/** - * @brief Device list block defination. - */ -typedef struct -{ - uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ - uint8_t bd_type; /**< remote BD type*/ -} T_DEV_INFO; -/** @} */ -/** @addtogroup SCATTERNET_RANDOM - * @{ - */ -#if F_BT_LE_USE_STATIC_RANDOM_ADDR -typedef struct -{ - uint8_t is_exist; - uint8_t reserved; /**< remote BD type*/ - uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ -} T_APP_STATIC_RANDOM_ADDR; -#endif -/** @} */ -/*============================================================================* - * Variables - *============================================================================*/ -/** @brief App link table */ -extern T_APP_LINK app_link_table[APP_MAX_LINKS]; -/** @brief Device list table, used to save discovered device informations. */ -extern T_DEV_INFO dev_list[APP_MAX_DEVICE_INFO]; -/** @brief The number of device informations saved in dev_list. */ -extern uint8_t dev_list_count; - -/*============================================================================* - * Functions - *============================================================================*/ -bool link_mgr_add_device(uint8_t *bd_addr, uint8_t bd_type); -void link_mgr_clear_device_list(void); - -#if F_BT_LE_USE_STATIC_RANDOM_ADDR -uint32_t app_save_static_random_address(T_APP_STATIC_RANDOM_ADDR *p_addr); -uint32_t app_load_static_random_address(T_APP_STATIC_RANDOM_ADDR *p_addr); -#endif -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/privacy_mgnt.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/privacy_mgnt.h deleted file mode 100644 index b7bc3375..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/privacy_mgnt.h +++ /dev/null @@ -1,66 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file privacy_mgnt.h - * @brief privacy managerment. - * @details privacy managerment. - * @author jane - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _PRIVACY_MGNT_H_ -#define _PRIVACY_MGNT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#if F_BT_LE_PRIVACY_SUPPORT -#include -#include - -#define PRIVACY_ENTRY_SIZE 4 -#define PRIVACY_RESOLVING_LIST_IDLE 0 -#define PRIVACY_RESOLVING_LIST_ADD_PENDING 1 -#define PRIVACY_RESOLVING_LIST_REMOVE_PENDING 2 -typedef struct -{ - bool is_used; - uint8_t addr[6]; - T_GAP_IDENT_ADDR_TYPE remote_bd_type; - bool is_add_to_list; - uint8_t pending; - -} T_LE_PRIVACY_ENTRY, *P_LE_PRIVACY_ENTRY; - -typedef enum -{ - PRIVACY_STATE_MSGTYPE, - PRIVACY_RESOLUTION_STATUS_MSGTYPE -} T_PRI_CB_TYPE; - -typedef enum -{ - PRIVACY_STATE_INIT, - PRIVACY_STATE_IDLE, //!< Disconnected. - PRIVACY_STATE_BUSY -} T_PRIVACY_STATE; -extern T_LE_PRIVACY_ENTRY privacy_table[PRIVACY_ENTRY_SIZE]; -typedef void(*P_FUN_PRIVACY_STATE_CB)(T_PRI_CB_TYPE type, uint8_t status); - -T_APP_RESULT App_PrivacyCallback(uint8_t msg_type, T_LE_PRIVACY_CB_DATA msg_data); -void privacy_init_resolving_list(P_FUN_PRIVACY_STATE_CB p_fun); -T_PRIVACY_STATE privacy_handle_pending_resolving_list(void); -void privacy_add_pending_resolving_list(T_GAP_RESOLV_LIST_OP op, - T_GAP_IDENT_ADDR_TYPE addr_type, uint8_t *addr); -#endif -#ifdef __cplusplus -} -#endif - -#endif /* _PRIVACY_MGNT_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_0001.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_0001.h deleted file mode 100644 index 97e0cea2..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_0001.h +++ /dev/null @@ -1,77 +0,0 @@ - - -#ifndef _BLE_AUTO_TEST_TC_0001_H_ -#define _BLE_AUTO_TEST_TC_0001_H_ - - -#if F_BT_LE_GAP_PERIPHERAL_SUPPORT - -#ifdef __cplusplus -extern "C" { -#endif - - - - -typedef struct t_adv_test_param -{ - uint16_t adv_interval_min; - uint16_t adv_interval_max; - - uint32_t start_adv_begin_time; - uint32_t start_adv_end_time; - uint32_t stop_adv_begin_time; - uint32_t stop_adv_end_time; - -} T_ADV_TEST_PARAM; - - - - -typedef struct _T_TC_0001_PARAM_DATA -{ - uint16_t id; - uint16_t result; - uint16_t adv_interval_min; - uint16_t adv_interval_max; -} T_TC_0001_PARAM_DATA; - -typedef struct _T_TC_0002_PARAM_DATA -{ - uint16_t id; - uint16_t result; - uint16_t adv_interval_min; - uint16_t adv_interval_max; - uint32_t max_count; -} T_TC_0002_PARAM_DATA; - - -/** - for case TC_0001_ADV_PERFORMANCE -*/ -void tc_0001_adv_start(uint16_t advIntMin, uint16_t advIntMax); -void tc_0001_adv_timeout_handler(void *pxTimer); -void tc_0001_adv_adv_state_change_to_idle(void); -void tc_0001_adv_adv_state_change_to_advertising(void); -void tc_0001_add_case(uint16_t adv_interval_min, uint16_t adv_interval_max); - - -/** - for case TC_0002_ADV_PERFORMANCE -*/ -void tc_0002_adv_start_stop_start(uint16_t advIntMin, uint16_t advIntMax, uint32_t max_count); -void tc_0002_adv_start_stop_adv_state_change_to_advertising(void); -void tc_0002_adv_start_stop_adv_state_change_to_idle(void); -void tc_0002_add_case(uint16_t adv_interval_min, uint16_t adv_interval_max, uint32_t max_count); - - - - -#ifdef __cplusplus -} -#endif - -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_100.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_100.h deleted file mode 100644 index 0943e2a3..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_100.h +++ /dev/null @@ -1,89 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_100_H_ -#define _BLE_AUTO_TEST_TC_100_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct t_scan_test_param -{ - uint16_t scan_interval; - uint16_t scan_window; - - uint32_t start_scan_begin_time; - uint32_t start_scan_end_time; - uint32_t stop_scan_begin_time; - uint32_t stop_scan_end_time; -} T_SCAN_TEST_PARAM; - - - -/** - for case TC_0100_SCAN_PERFORMANCE -*/ -void tc_0100_scan_perf_start(uint16_t scan_interval, uint16_t scan_window); -void tc_0100_scan_state_change_to_scaning(void); -void tc_0100_scan_state_change_to_idle(void); - - -/** - for case TC_0101_SCAN_STRESS_ENABLE_DISABLE -*/ -typedef struct -{ - T_GAP_SCAN_MODE mode; - uint16_t interval; - uint16_t window; - T_GAP_SCAN_FILTER_POLICY filter_policy; - uint8_t filter_duplicates; - - void *scan_enable_disable_timer_handle; - - uint32_t scan_enable_disable_begin_time; - uint32_t scan_enable_disable_max_enable_scan_ellapsed_time; - uint32_t scan_enable_disable_max_disable_scan_ellapsed_time; - uint32_t scan_enable_disable_max_count; - uint32_t scan_enable_disable_cur_count; -} T_TC_0101_PARAM; -typedef T_TC_0101_PARAM *P_TC_0101_PARAM; - - -typedef struct _T_TC_0101_IN_PARAM_DATA -{ - uint16_t id; - T_GAP_SCAN_MODE mode; - uint16_t interval; - uint16_t window; - T_GAP_SCAN_FILTER_POLICY filter_policy; - uint8_t filter_duplicates; - uint32_t max_count; -} T_TC_0101_IN_PARAM_DATA; - -void tc_0101_scan_stress_enable_disable_start(T_GAP_SCAN_MODE mode, - uint16_t interval, - uint16_t window, - T_GAP_SCAN_FILTER_POLICY filter_policy, - uint8_t filter_duplicates, - uint32_t max_count); -void tc_0101_scan_stress_enable_disable_state_change_to_scaning(void); -void tc_0101_scan_stress_enable_disable_state_change_to_idle(void); - - -void tc_0101_add_case(T_GAP_SCAN_MODE mode, - uint16_t interval, - uint16_t window, - T_GAP_SCAN_FILTER_POLICY filter_policy, - uint8_t filter_duplicates, - uint32_t max_count - ); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1000.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1000.h deleted file mode 100644 index ae8eb0ed..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1000.h +++ /dev/null @@ -1,23 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_1000_H_ -#define _BLE_AUTO_TEST_TC_1000_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#if F_CP_TEST_SUPPORT -void tc_1000_hw_init(void); -void tc_1000_start(void); -void tc_1001_start(void); -void tc_1002_start(void); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1100.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1100.h deleted file mode 100644 index 9b8ef713..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1100.h +++ /dev/null @@ -1,82 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_1100_H_ -#define _BLE_AUTO_TEST_TC_1100_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#if F_BT_LE_4_1_CBC_SUPPORT -void tc_1100_start(uint32_t count); -void tc_1100_link_connected(uint8_t conn_id); -void tc_1100_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1100_chann_connected(uint16_t cid); -void tc_1100_chann_disconnected(uint16_t cid, uint16_t cause); -void tc_1100_dump_result(void); -void tc_1100_receive_data(uint16_t cid); - -void tc_1101_start(uint32_t count, uint16_t data_len); -void tc_1101_dump_result(void); -void tc_1101_link_connected(uint8_t conn_id); -void tc_1101_receive_data(uint16_t cid, uint16_t length); -void tx_1101_send_data_cmpl(uint16_t cause, uint16_t credit); -void tc_1101_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1101_chann_connected(uint16_t cid, uint16_t mtu, uint16_t credit); -void tc_1101_chann_disconnected(uint16_t cid, uint16_t cause); - -void tc_1102_start(uint16_t data_len); -void tc_1102_conn_param_update_event(uint8_t conn_id); -void tc_1102_mtu_size_info(uint8_t conn_id); -void tc_1102_send_data_cmpl(uint16_t cause, uint16_t credit); -void tc_1102_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1102_chann_connected(uint16_t cid, uint16_t mtu, uint16_t credit); -void tc_1102_chann_disconnected(uint16_t cid, uint16_t cause); -#endif -#if 0 -typedef struct t_tp_test_config -{ - uint16_t con_interval; - uint16_t length; - uint8_t tx_octets; - -} T_TP_TEST_CONFIG; - - -typedef struct t_tp_test_param -{ - uint16_t con_interval; - uint16_t conn_slave_latency; - uint16_t conn_supervision_timeout; - uint16_t length; - uint32_t count; - uint32_t count_remain; - uint8_t initial_value; - - uint8_t conn_id; - uint32_t begin_time; - uint32_t end_time; - uint32_t data_rate; -} T_TP_TEST_PARAM; - - -/** - for case TC_0200_TP_NOTIFICATION_TX_01 -*/ -void tc_200_tp_notification_tx_start(void); -void tc_200_tp_notification_tx_init_config(uint16_t con_interval, uint16_t length, - uint8_t tx_octets); -void tc_200_tp_notification_tx_init_default_param(uint8_t conn_id); -void tc_200_tp_notification_tx_change_tx_octets(uint8_t conn_id, uint16_t tx_octets); -void tc_200_tp_notification_tx_config_with_fixed_interval(uint16_t con_interval); -void tc_200_tp_notification_tx_config_with_fixed_length(uint16_t length); -void tc_200_tp_notification_tx_conn_param_update_event(uint8_t conn_id); -void tc_200_tp_notification_tx_tx_data_complete(uint8_t credits); -void tc_200_tp_notification_tx_tx_config(void *pdata); -#endif -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1100_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1100_sut.h deleted file mode 100644 index 9af565ec..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1100_sut.h +++ /dev/null @@ -1,89 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_1100_SUT_H_ -#define _BLE_AUTO_TEST_TC_1100_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -void tc_1100_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_1100_sut_dump_result(void); -void tc_1100_sut_link_connected(uint8_t conn_id); -void tc_1100_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1100_sut_chann_connected(uint16_t cid); -void tc_1100_sut_chann_data_send_cmpl(uint16_t cause); -void tc_1100_sut_chann_disconnected(uint16_t cid, uint16_t cause); - -void tc_1101_sut_start(uint32_t count, uint8_t remote_bd[6], uint16_t data_len); -void tc_1101_sut_dump_result(void); -void tc_1101_sut_link_connected(uint8_t conn_id); -void tc_1101_sut_receive_data(uint16_t cid, uint16_t length); -void tc_1101_sut_chann_data_send_cmpl(uint16_t cause, uint8_t credit); -void tc_1101_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1101_sut_chann_connected(uint16_t cid, uint16_t mtu, uint8_t credit); -void tc_1101_sut_chann_disconnected(uint16_t cid, uint16_t cause); - -void tc_1102_sut_start(uint8_t remote_bd[6]); -void tc_1102_sut_conn_param_update_event(uint8_t conn_id); -void tc_1102_sut_dump_result(void); -void tc_1102_sut_link_connected(uint8_t conn_id); -void tc_1102_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1102_sut_chann_connected(uint16_t cid, uint16_t mtu, uint8_t credit); -void tc_1102_sut_receive_data(uint16_t cid, uint16_t length); -void tc_1102_sut_chann_disconnected(uint16_t cid, uint16_t cause); -#if 0 -typedef void (*P_FUN_PROFILE_CLIENT_RESULT_CB)(uint8_t conn_id, void *p_data); - -typedef enum -{ - TP_CONFIG_OP_SET_LL_DATA_LEN_27 = 1, - TP_CONFIG_OP_SET_LL_DATA_LEN_251 = 2, - TP_CONFIG_OP_START = 3, - - TP_CONFIG_OP_RFU = 0xFF -} T_TP_CONFIG_OP; - - -typedef enum -{ - TP_CONFIG_STATE_CONFIGING = 1, - TP_CONFIG_STATE_STARTED = 2, - - TP_CONFIG_STATE_RFU = 0xFF -} T_TP_CONFIG_STATE; - -void tc_20x_sut_client_result_callback(uint8_t conn_id, void *p_cb_data); - - -/** - -*/ -typedef struct _T_TC_200_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; - T_TP_CONFIG_STATE cur_config_state; - T_TP_CONFIG_OP cur_config_op; - uint32_t total_notify_rx_count; -} T_TC_200_SUT_IN_PARAM_DATA; - -void tc_200_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_200_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_200_sut_link_connected(uint8_t conn_id); -void tc_200_sut_conn_param_update_event(uint8_t conn_id); -void tc_200_sut_dump_result(void); -void tc_200_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1200.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1200.h deleted file mode 100644 index 8c1d0210..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1200.h +++ /dev/null @@ -1,87 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_1200_H_ -#define _BLE_AUTO_TEST_TC_1200_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - dut is slave, dut init connection param update -*/ - -typedef struct _T_TC_1200_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_1200_IN_PARAM_DATA; - - -void tc_1200_start(uint32_t count); -void tc_1200_scan_state_change_to_idle(void); -void tc_1200_link_connected(uint8_t conn_id); -void tc_1200_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1200_conn_param_update_evt(uint8_t conn_id); -void tc_1200_add_case(uint32_t max_count); - - -void tc_1201_start(uint32_t count); -void tc_1201_scan_state_change_to_idle(void); -void tc_1201_link_connected(uint8_t conn_id); -void tc_1201_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1201_conn_param_update_evt(uint8_t conn_id); -void tc_1201_add_case(uint32_t max_count); - - -void tc_1202_start(uint32_t count); -void tc_1202_scan_state_change_to_idle(void); -void tc_1202_link_connected(uint8_t conn_id); -void tc_1202_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1202_conn_param_update_evt(uint8_t conn_id); -void tc_1202_add_case(uint32_t max_count); - -void tc_1203_start(uint32_t count); -void tc_1203_scan_state_change_to_idle(void); -void tc_1203_link_connected(uint8_t conn_id); -void tc_1203_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1203_conn_param_update_evt(uint8_t conn_id); -void tc_1203_add_case(uint32_t max_count); - - -void tc_1204_start(uint32_t count); -void tc_1204_scan_state_change_to_idle(void); -void tc_1204_link_connected(uint8_t conn_id); -void tc_1204_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1204_conn_param_update_evt(uint8_t conn_id); -void tc_1204_add_case(uint32_t max_count); - -void tc_1205_start(uint32_t count); -void tc_1205_scan_state_change_to_idle(void); -void tc_1205_link_connected(uint8_t conn_id); -void tc_1205_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1205_conn_param_update_evt(uint8_t conn_id); -void tc_1205_add_case(uint32_t max_count); - -void tc_1206_start(uint32_t count); -void tc_1206_scan_state_change_to_idle(void); -void tc_1206_link_connected(uint8_t conn_id); -void tc_1206_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1206_conn_param_update_evt(uint8_t conn_id); -void tc_1206_add_case(uint32_t max_count); - -void tc_1207_start(uint32_t count); -void tc_1207_scan_state_change_to_idle(void); -void tc_1207_link_connected(uint8_t conn_id); -void tc_1207_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_1207_conn_param_update_evt(uint8_t conn_id); -void tc_1207_add_case(uint32_t max_count); - - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1200_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1200_sut.h deleted file mode 100644 index 0f1b03c7..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_1200_sut.h +++ /dev/null @@ -1,34 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_1200_SUT_H_ -#define _BLE_AUTO_TEST_TC_1200_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - dut is slave, dut init connection param update -*/ - - - -void tc_1204_sut_start(uint32_t count); -void tc_1204_sut_link_connected(uint8_t conn_id); -void tc_1204_sut_link_disconnected(uint8_t conn_id, uint16_t reason); - -void tc_1205_sut_start(uint32_t count); -void tc_1205_sut_link_connected(uint8_t conn_id); -void tc_1205_sut_link_disconnected(uint8_t conn_id, uint16_t reason); - -void tc_1206_sut_start(uint32_t count); -void tc_1206_sut_link_connected(uint8_t conn_id); -void tc_1206_sut_link_disconnected(uint8_t conn_id, uint16_t reason); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_200.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_200.h deleted file mode 100644 index 55df0b1e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_200.h +++ /dev/null @@ -1,104 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_200_H_ -#define _BLE_AUTO_TEST_TC_200_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - - - -typedef struct t_tp_test_config -{ - uint16_t con_interval; - uint16_t length; - uint8_t tx_octets; - bool test_drop_acl_data; - -} T_TP_TEST_CONFIG; - - -typedef struct t_tp_test_param -{ - uint16_t con_interval; - uint16_t conn_slave_latency; - uint16_t conn_supervision_timeout; - uint16_t length; - uint32_t count; - uint32_t count_remain; - uint8_t initial_value; - - uint8_t conn_id; - uint32_t begin_time; - uint32_t end_time; - uint32_t elapsed_time; - uint32_t data_rate; -} T_TP_TEST_PARAM; - - -/** - for case TC_0200_TP_NOTIFICATION_TX_01 -*/ -void tc_200_tp_notification_tx_start(void); -void tc_200_tp_notification_tx_init_config(uint16_t con_interval, uint16_t length, - uint8_t tx_octets, bool test_drop_acl_data); -void tc_200_tp_notification_tx_init_default_param(uint8_t conn_id); -void tc_200_tp_notification_tx_change_tx_octets(uint8_t conn_id, uint16_t tx_octets); -void tc_200_tp_notification_tx_config_with_fixed_interval(uint16_t con_interval); -void tc_200_tp_notification_tx_config_with_fixed_length(uint16_t length); -void tc_200_tp_notification_tx_conn_param_update_event(uint8_t conn_id); -void tc_200_tp_notification_tx_tx_data_complete(uint8_t credits); -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -void tc_200_tp_notification_phy_update_event(uint8_t conn_id, uint16_t cause, - T_GAP_PHYS_TYPE tx_phy, T_GAP_PHYS_TYPE rx_phy); -#endif -void tc_200_tp_notification_tx_tx_config(void *pdata); - -void tc_206_tp_notification_tx_start(void); -void tc_206_tp_notification_tx_init_config(uint16_t con_interval, uint16_t slave_latency, - uint16_t length, uint8_t mode, uint32_t max_count, uint8_t data_check); -void tc_206_tp_notification_tx_tx_data_complete(uint8_t credits); -void tc_206_tp_notification_tx_tx_config(void *pdata); -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -void tc_206_tp_notification_phy_update_event(uint8_t conn_id, uint16_t cause, - T_GAP_PHYS_TYPE tx_phy, T_GAP_PHYS_TYPE rx_phy); -#endif -void tc_206_tp_notification_tx_conn_param_update_event(uint8_t conn_id); -void tc_206_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_206_dump_result(void); - -void tc_207_tp_rx_start(void); -void tc_207_tp_rx_init_config(uint16_t con_interval, uint16_t slave_latency, - uint16_t length, uint8_t mode, uint32_t max_count, uint8_t data_check); -void tc_207_tp_rx_conn_param_update_event(uint8_t conn_id); -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -void tc_207_tp_phy_update_event(uint8_t conn_id, uint16_t cause, - T_GAP_PHYS_TYPE tx_phy, T_GAP_PHYS_TYPE rx_phy); -#endif -void tc_207_tp_handle_write_data(void *pdata); -void tc_207_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_207_dump_result(void); - -void tc_208_tp_trx_start(void); -void tc_208_tp_trx_init_config(uint16_t con_interval, uint16_t slave_latency, - uint16_t length, uint8_t mode, uint32_t max_count, uint8_t data_check); -void tc_208_tp_trx_conn_param_update_event(uint8_t conn_id); -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -void tc_208_tp_phy_update_event(uint8_t conn_id, uint16_t cause, - T_GAP_PHYS_TYPE tx_phy, T_GAP_PHYS_TYPE rx_phy); -#endif -void tc_208_tp_notification_tx_data_complete(uint8_t credits); -void tc_208_tp_notification_tx_tx_config(void *pdata); -void tc_208_tp_handle_write_data(void *pdata); -void tc_208_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_208_dump_result(void); -void tc_208_dump_tx_result(void); -void tc_208_dump_rx_result(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_200_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_200_sut.h deleted file mode 100644 index ff771709..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_200_sut.h +++ /dev/null @@ -1,100 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_200_SUT_H_ -#define _BLE_AUTO_TEST_TC_200_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*P_FUN_PROFILE_CLIENT_RESULT_CB)(uint8_t conn_id, void *p_data); - -typedef enum -{ - TP_CONFIG_OP_SET_LL_DATA_LEN_27 = 1, - TP_CONFIG_OP_SET_LL_DATA_LEN_251 = 2, - TP_CONFIG_OP_START = 3, - - TP_CONFIG_OP_RFU = 0xFF -} T_TP_CONFIG_OP; - - -typedef enum -{ - TP_CONFIG_STATE_CONFIGING = 1, - TP_CONFIG_STATE_STARTED = 2, - - TP_CONFIG_STATE_RFU = 0xFF -} T_TP_CONFIG_STATE; - -void tc_20x_sut_client_result_callback(uint8_t conn_id, void *p_cb_data); - - -/** - -*/ -typedef struct _T_TC_200_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; - T_TP_CONFIG_STATE cur_config_state; - T_TP_CONFIG_OP cur_config_op; - uint32_t total_notify_rx_count; -} T_TC_200_SUT_IN_PARAM_DATA; - -void tc_200_sut_start(uint32_t count, uint8_t mode, uint8_t mode_end, uint8_t remote_bd[6]); -void tc_200_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_200_sut_link_connected(uint8_t conn_id); -void tc_200_sut_conn_param_update_event(uint8_t conn_id); -void tc_200_sut_dump_result(void); -void tc_200_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - -void tc_206_sut_start(uint8_t remote_bd[6]); -void tc_206_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_206_sut_link_connected(uint8_t conn_id); -void tc_206_sut_conn_param_update_event(uint8_t conn_id); -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -void tc_206_sut_notification_phy_update_event(uint8_t conn_id, uint16_t cause, - T_GAP_PHYS_TYPE tx_phy, T_GAP_PHYS_TYPE rx_phy); -void tc_206_sut_phy_update(uint8_t conn_id); -#endif -void tc_206_sut_update_conn_param(uint8_t conn_id); -void tc_206_sut_dump_result(void); - -void tc_207_sut_start(uint8_t remote_bd[6]); -void tc_207_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_207_sut_link_connected(uint8_t conn_id); -void tc_207_sut_conn_param_update_event(uint8_t conn_id); -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -void tc_207_sut_notification_phy_update_event(uint8_t conn_id, uint16_t cause, - T_GAP_PHYS_TYPE tx_phy, T_GAP_PHYS_TYPE rx_phy); -void tc_207_sut_phy_update(uint8_t conn_id); -#endif -void tc_207_sut_update_conn_param(uint8_t conn_id); -void tc_207_sut_dump_result(void); -void tc_207_sut_tx_data_complete(uint8_t credits); - -void tc_208_sut_start(uint8_t remote_bd[6]); -void tc_208_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_208_sut_link_connected(uint8_t conn_id); -void tc_208_sut_conn_param_update_event(uint8_t conn_id); -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -void tc_208_sut_notification_phy_update_event(uint8_t conn_id, uint16_t cause, - T_GAP_PHYS_TYPE tx_phy, T_GAP_PHYS_TYPE rx_phy); -void tc_208_sut_phy_update(uint8_t conn_id); -#endif -void tc_208_sut_update_conn_param(uint8_t conn_id); -void tc_208_sut_dump_rx_result(void); -void tc_208_sut_dump_tx_result(void); -void tc_208_sut_tx_data_complete(uint8_t credits); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_300.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_300.h deleted file mode 100644 index 7cf6ce6b..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_300.h +++ /dev/null @@ -1,49 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_300_H_ -#define _BLE_AUTO_TEST_TC_300_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - - - - -typedef struct _T_TC_300_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_300_IN_PARAM_DATA; - - -void tc_300_adv_only_start(uint32_t count); -void tc_300_adv_only_link_connected(uint8_t conn_id); -void tc_300_adv_only_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_300_dump_result(void); -void tc_300_add_case(uint32_t max_count); - - -/** - TC_0301_ADV_DISC -*/ - -typedef struct _T_TC_301_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_301_IN_PARAM_DATA; - -void tc_301_adv_disc_start(uint32_t count); -void tc_301_adv_disc_link_connected(uint8_t conn_id); -void tc_301_adv_disc_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_301_dump_result(void); -void tc_301_add_case(uint32_t max_count); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_300_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_300_sut.h deleted file mode 100644 index f3b360df..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_300_sut.h +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_300_SUT_H_ -#define _BLE_AUTO_TEST_TC_300_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#if TC_300_SUT_SUPPORT -/** - TC_0300_ADV_ONLY -*/ -typedef struct _T_TC_300_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; -} T_TC_300_SUT_IN_PARAM_DATA; -void tc_300_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_300_sut_link_connected(uint8_t conn_id); -void tc_300_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_300_sut_dump_result(void); -void tc_300_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - - -/** - TC_0301_ADV_DISC -*/ -typedef struct _T_TC_301_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; -} T_TC_301_SUT_IN_PARAM_DATA; -void tc_301_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_301_sut_link_connected(uint8_t conn_id); -void tc_301_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_301_sut_dump_result(void); -void tc_301_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_310.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_310.h deleted file mode 100644 index 893006e8..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_310.h +++ /dev/null @@ -1,54 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_310_H_ -#define _BLE_AUTO_TEST_TC_310_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if TC_301_SUPPORT - -typedef struct _T_TC_310_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_310_IN_PARAM_DATA; - - -void tc_310_adv_only_start(uint32_t count); -void tc_310_adv_only_link_connected(uint8_t conn_id); -void tc_310_phy_update_evt(uint8_t conn_id, uint16_t cause, T_GAP_PHYS_TYPE tx_phy, - T_GAP_PHYS_TYPE rx_phy); -void tc_310_adv_only_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_310_dump_result(void); -void tc_310_add_case(uint32_t max_count); - - -/** - TC_0301_ADV_DISC -*/ - -typedef struct _T_TC_311_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_311_IN_PARAM_DATA; - -void tc_311_adv_disc_start(uint32_t count); -void tc_311_adv_disc_link_connected(uint8_t conn_id); -void tc_311_phy_update_evt(uint8_t conn_id, uint16_t cause, T_GAP_PHYS_TYPE tx_phy, - T_GAP_PHYS_TYPE rx_phy); - -void tc_311_adv_disc_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_311_dump_result(void); -void tc_311_add_case(uint32_t max_count); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_310_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_310_sut.h deleted file mode 100644 index 37419f4a..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_310_sut.h +++ /dev/null @@ -1,59 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_310_SUT_H_ -#define _BLE_AUTO_TEST_TC_310_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#if TC_310_SUT_SUPPORT -/** - TC_0300_ADV_ONLY -*/ -typedef struct _T_TC_310_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; -} T_TC_310_SUT_IN_PARAM_DATA; -void tc_310_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_310_sut_link_connected(uint8_t conn_id); -void tc_310_sut_phy_update_evt(uint8_t conn_id, uint16_t cause, T_GAP_PHYS_TYPE tx_phy, - T_GAP_PHYS_TYPE rx_phy); -void tc_310_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_310_sut_dump_result(void); -void tc_310_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - - -/** - TC_0301_ADV_DISC -*/ -typedef struct _T_TC_311_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; -} T_TC_311_SUT_IN_PARAM_DATA; -void tc_311_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_311_sut_link_connected(uint8_t conn_id); -void tc_311_sut_phy_update_evt(uint8_t conn_id, uint16_t cause, T_GAP_PHYS_TYPE tx_phy, - T_GAP_PHYS_TYPE rx_phy); -void tc_311_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_311_sut_dump_result(void); -void tc_311_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_400.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_400.h deleted file mode 100644 index 87f1e551..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_400.h +++ /dev/null @@ -1,52 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_400_H_ -#define _BLE_AUTO_TEST_TC_400_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - dut is slave, dut init connection param update -*/ - -typedef struct _T_TC_400_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_400_IN_PARAM_DATA; - - -void tc_400_start(uint32_t count); -void tc_400_link_connected(uint8_t conn_id); -void tc_400_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_400_conn_param_update_evt(uint8_t conn_id); -void tc_400_dump_result(void); -void tc_400_add_case(uint32_t max_count); - - -/** - dut is slave, sut init connection param update -*/ - -typedef struct _T_TC_401_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_401_IN_PARAM_DATA; - - -void tc_401_start(uint32_t count); -void tc_401_link_connected(uint8_t conn_id); -void tc_401_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_401_conn_param_update_evt(uint8_t conn_id); -void tc_401_dump_result(void); -void tc_401_add_case(uint32_t max_count); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_400_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_400_sut.h deleted file mode 100644 index 6528e3ea..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_400_sut.h +++ /dev/null @@ -1,48 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_400_SUT_H_ -#define _BLE_AUTO_TEST_TC_400_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - - - -typedef struct _T_TC_400_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint8_t remote_bd[6]; -} T_TC_400_SUT_IN_PARAM_DATA; - - -void tc_400_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_400_sut_link_connected(uint8_t conn_id); -void tc_400_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_400_sut_conn_param_update_evt(uint8_t conn_id); -void tc_400_sut_dump_result(void); -void tc_400_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - -typedef struct _T_TC_401_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint8_t remote_bd[6]; -} T_TC_401_SUT_IN_PARAM_DATA; - -void tc_401_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_401_sut_link_connected(uint8_t conn_id); -void tc_401_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_401_sut_conn_param_update_evt(uint8_t conn_id); -void tc_401_sut_dump_result(void); -void tc_401_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_500.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_500.h deleted file mode 100644 index ee08e2ba..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_500.h +++ /dev/null @@ -1,61 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_500_H_ -#define _BLE_AUTO_TEST_TC_500_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - - - -/** - TC_0500_SLAVE_AUTO_ADV -*/ - -typedef struct _T_TC_500_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_500_IN_PARAM_DATA; -void tc_500_salve_auto_adv_start(uint32_t count); -void tc_500_salve_auto_adv_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_500_salve_auto_adv_link_connected(uint8_t conn_id); -void tc_500_dump_result(void); -void tc_500_add_case(uint32_t max_count); - - -/** - TC_0501_SLAVE_AUTO_ADV_WITH_SEC_REQ -*/ -typedef struct _T_TC_501_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_501_IN_PARAM_DATA; -void tc_501_salve_auto_adv_with_sec_req_start(uint32_t count); -void tc_501_salve_auto_adv_with_sec_req_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_501_salve_auto_adv_with_sec_req_link_connected(uint8_t conn_id); -void tc_501_dump_result(void); -void tc_501_add_case(uint32_t max_count); - - -typedef struct _T_TC_502_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_502_IN_PARAM_DATA; -void tc_502_salve_auto_adv_start(uint32_t count); -void tc_502_salve_auto_adv_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_502_salve_auto_adv_link_connected(uint8_t conn_id); -void tc_502_dump_result(void); -void tc_502_add_case(uint32_t max_count); - - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_500_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_500_sut.h deleted file mode 100644 index 97299bcf..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_500_sut.h +++ /dev/null @@ -1,61 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_500_SUT_H_ -#define _BLE_AUTO_TEST_TC_500_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*P_FUN_PROFILE_CLIENT_RESULT_CB)(uint8_t conn_id, void *p_data); - - -void tc_50x_sut_client_result_callback(uint8_t conn_id, void *p_cb_data); - - -/** - TC_0500_SLAVE_AUTO_ADV -*/ -typedef struct _T_TC_500_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; -} T_TC_500_SUT_IN_PARAM_DATA; -void tc_500_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_500_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_500_sut_link_connected(uint8_t conn_id); -void tc_500_sut_dump_result(void); -void tc_500_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - - -/** - TC_0501_SLAVE_AUTO_ADV_WITH_SEC_REQ -*/ -typedef struct _T_TC_501_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint8_t remote_bd[6]; -} T_TC_501_SUT_IN_PARAM_DATA; -void tc_501_sut_start(uint32_t count, uint8_t remote_bd[6]); -void tc_501_sut_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_501_sut_link_connected(uint8_t conn_id); -void tc_501_sut_dump_result(void); -void tc_501_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_600.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_600.h deleted file mode 100644 index 392016b5..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_600.h +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_600_H_ -#define _BLE_AUTO_TEST_TC_600_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - TC_0600_IOP_PAIR_LEGACL -*/ -typedef struct _T_TC_600_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_600_IN_PARAM_DATA; -void tc_600_iop_android_legacl_pair_start(uint32_t count); -void tc_600_iop_android_legacl_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_600_iop_android_legacl_pair_link_connected(uint8_t conn_id); -void tc_600_iop_android_legacl_pair_state_to_start(uint8_t conn_id); -void tc_600_iop_android_legacl_pair_state_to_success(uint8_t conn_id); -void tc_600_iop_android_legacl_pair_state_to_fail(uint8_t conn_id, uint16_t reason); -void tc_600_dump_result(void); -void tc_600_add_case(uint32_t max_count); - - - - - - -/** - TC_0601_IOP_PAIR_SC -*/ -typedef struct _T_TC_601_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_601_IN_PARAM_DATA; -void tc_601_iop_android_sc_pair_start(uint32_t count); -void tc_601_iop_android_sc_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_601_iop_android_sc_pair_link_connected(uint8_t conn_id); -void tc_601_iop_android_sc_pair_state_to_start(uint8_t conn_id); -void tc_601_iop_android_sc_pair_state_to_success(uint8_t conn_id); -void tc_601_iop_android_sc_pair_state_to_fail(uint8_t conn_id); -void tc_601_dump_result(void); -void tc_601_add_case(uint32_t max_count); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_600_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_600_sut.h deleted file mode 100644 index 1dac7ab6..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_600_sut.h +++ /dev/null @@ -1,69 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_600_SUT_H_ -#define _BLE_AUTO_TEST_TC_600_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - TC_0600_IOP_PAIR_LEGACL -*/ -typedef struct _T_TC_600_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint32_t total_pair_start_count; - uint32_t total_pair_success_count; - uint32_t total_pair_fail_count; - uint8_t remote_bd[6]; -} T_TC_600_SUT_IN_PARAM_DATA; - -void tc_600_sut_iop_android_legacl_pair_start(uint32_t count, uint8_t remote_bd[6]); -void tc_600_sut_iop_android_legacl_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_600_sut_iop_android_legacl_pair_link_connected(uint8_t conn_id); -void tc_600_sut_iop_android_legacl_pair_state_to_start(uint8_t conn_id); -void tc_600_sut_iop_android_legacl_pair_state_to_success(uint8_t conn_id); -void tc_600_sut_iop_android_legacl_pair_state_to_fail(uint8_t conn_id, uint16_t reason); -void tc_600_sut_dump_result(void); -void tc_600_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - - - - -/** - TC_0601_IOP_PAIR_SC -*/ -typedef struct _T_TC_601_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint32_t total_pair_start_count; - uint32_t total_pair_success_count; - uint32_t total_pair_fail_count; - uint8_t remote_bd[6]; -} T_TC_601_SUT_IN_PARAM_DATA; -void tc_601_sut_iop_android_sc_pair_start(uint32_t count, uint8_t remote_bd[6]); -void tc_601_sut_iop_android_sc_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_601_sut_iop_android_sc_pair_link_connected(uint8_t conn_id); -void tc_601_sut_iop_android_sc_pair_state_to_start(uint8_t conn_id); -void tc_601_sut_iop_android_sc_pair_state_to_success(uint8_t conn_id); -void tc_601_sut_iop_android_sc_pair_state_to_fail(uint8_t conn_id); -void tc_601_sut_dump_result(void); -void tc_601_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_700.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_700.h deleted file mode 100644 index b359bf31..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_700.h +++ /dev/null @@ -1,26 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_700_H_ -#define _BLE_AUTO_TEST_TC_700_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - TC_0700_STABLE_NOTIFICATION_TX_01 -*/ -void tc_700_stable_notification_tx_01_start(void); -void tc_700_stable_notification_tx_01_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_700_stable_notification_tx_01_link_connected(uint8_t conn_id); -void tc_700_stable_notification_tx_01_tx_data_complete(uint8_t credits); -void tc_700_stable_notification_tx_01_cccd_enable(uint8_t conn_id, bool bEnable); -void tc_700_stable_notification_tx_conn_param_update_event(uint8_t conn_id); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_800.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_800.h deleted file mode 100644 index 02078883..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_800.h +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_800_H_ -#define _BLE_AUTO_TEST_TC_800_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - TC_0600_IOP_PAIR_LEGACL -*/ -typedef struct _T_TC_800_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_800_IN_PARAM_DATA; -void tc_800_iop_android_legacl_pair_start(uint32_t count); -void tc_800_iop_android_legacl_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_800_iop_android_legacl_pair_link_connected(uint8_t conn_id); -void tc_800_iop_android_legacl_pair_state_to_start(uint8_t conn_id); -void tc_800_iop_android_legacl_pair_state_to_success(uint8_t conn_id); -void tc_800_iop_android_legacl_pair_state_to_fail(uint8_t conn_id, uint16_t reason); -void tc_800_dump_result(void); -void tc_800_add_case(uint32_t max_count); - - - - - - -/** - TC_0601_IOP_PAIR_SC -*/ -typedef struct _T_TC_801_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; -} T_TC_801_IN_PARAM_DATA; -void tc_801_iop_android_sc_pair_start(uint32_t count); -void tc_801_iop_android_sc_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_801_iop_android_sc_pair_link_connected(uint8_t conn_id); -void tc_801_iop_android_sc_pair_state_to_start(uint8_t conn_id); -void tc_801_iop_android_sc_pair_state_to_success(uint8_t conn_id); -void tc_801_iop_android_sc_pair_state_to_fail(uint8_t conn_id); -void tc_801_dump_result(void); -void tc_801_add_case(uint32_t max_count); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_800_sut.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_800_sut.h deleted file mode 100644 index 2d1665f1..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_800_sut.h +++ /dev/null @@ -1,69 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_800_SUT_H_ -#define _BLE_AUTO_TEST_TC_800_SUT_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - TC_0600_IOP_PAIR_LEGACL -*/ -typedef struct _T_TC_800_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint32_t total_pair_start_count; - uint32_t total_pair_success_count; - uint32_t total_pair_fail_count; - uint8_t remote_bd[6]; -} T_TC_800_SUT_IN_PARAM_DATA; - -void tc_800_sut_iop_android_legacl_pair_start(uint32_t count, uint8_t remote_bd[6]); -void tc_800_sut_iop_android_legacl_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_800_sut_iop_android_legacl_pair_link_connected(uint8_t conn_id); -void tc_800_sut_iop_android_legacl_pair_state_to_start(uint8_t conn_id); -void tc_800_sut_iop_android_legacl_pair_state_to_success(uint8_t conn_id); -void tc_800_sut_iop_android_legacl_pair_state_to_fail(uint8_t conn_id, uint16_t reason); -void tc_800_sut_dump_result(void); -void tc_800_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - - - - -/** - TC_0601_IOP_PAIR_SC -*/ -typedef struct _T_TC_801_SUT_IN_PARAM_DATA -{ - uint16_t id; - uint32_t total_test_count; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t conn_supervision_timeout; - uint32_t total_pair_start_count; - uint32_t total_pair_success_count; - uint32_t total_pair_fail_count; - uint8_t remote_bd[6]; -} T_TC_801_SUT_IN_PARAM_DATA; -void tc_801_sut_iop_android_sc_pair_start(uint32_t count, uint8_t remote_bd[6]); -void tc_801_sut_iop_android_sc_pair_link_disconnected(uint8_t conn_id, uint16_t reason); -void tc_801_sut_iop_android_sc_pair_link_connected(uint8_t conn_id); -void tc_801_sut_iop_android_sc_pair_state_to_start(uint8_t conn_id); -void tc_801_sut_iop_android_sc_pair_state_to_success(uint8_t conn_id); -void tc_801_sut_iop_android_sc_pair_state_to_fail(uint8_t conn_id); -void tc_801_sut_dump_result(void); -void tc_801_sut_add_case(uint32_t max_count, uint8_t remote_bd[6]); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_900.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_900.h deleted file mode 100644 index 8d8d1d25..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_900.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_900_H_ -#define _BLE_AUTO_TEST_TC_900_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - - -typedef enum -{ - PRIVACY_INIT_STATE_INIT, - PRIVACY_INIT_STATE_REL_LIST, //!< Disconnected. - PRIVACY_INIT_STATE_REL_ENABLE, - PRIVACY_INIT_STATE_REL_IDLE -} T_PRIVACY_INIT_STATE; - - - -extern T_PRIVACY_INIT_STATE g_privacy_init_state; - -/** - TC_0900_PRIVACY_TEST_SLAVE -*/ -void tc_900_privacy_slave(void); - -/** - TC_0901_PRIVACY_TEST_MASTER -*/ -void tc_901_privacy_master(void); -void tc_901_handle_bond_modify_msg(T_LE_BOND_MODIFY_TYPE type, T_LE_KEY_ENTRY *p_entry); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_common.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_common.h deleted file mode 100644 index a44e5a2e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/tc_common.h +++ /dev/null @@ -1,100 +0,0 @@ - -#ifndef _BLE_AUTO_TEST_TC_COMMON_H_ -#define _BLE_AUTO_TEST_TC_COMMON_H_ -#include -#include -#ifdef __cplusplus -extern "C" { -#endif - -//#include "board.h" - -extern uint8_t gSimpleProfileServiceId; - -extern void *g_test_timer_handle; -extern uint32_t g_test_begin_time; -extern uint32_t g_test_end_time; - -extern uint16_t conn_interval; -extern uint16_t conn_latency; -extern uint16_t conn_supervision_timeout; - -typedef void(*P_FUN_TC_RESULT_CB)(uint16_t case_id, uint16_t result, void *p_cb_data); - - -extern P_FUN_TC_RESULT_CB p_tc_result_cb; - -typedef struct _BLE_DISCONN_REASON -{ - uint16_t reason_08; - uint16_t reason_13; - uint16_t reason_15; - uint16_t reason_16; - uint16_t reason_22; - uint16_t reason_28; - uint16_t reason_3d; - uint16_t reason_3e; - uint16_t reason_others; -} BLE_DISCONN_REASON; - -extern BLE_DISCONN_REASON g_ble_disconn_reason; - -#define VENDOR_BASE_ADDRESS 0x40058000 -#define VENDOR_READ(Vendor_offset) \ - ((uint32_t)*((volatile uint32_t*)(VENDOR_BASE_ADDRESS+(Vendor_offset)))) -#define VENDOR_WRITE(Vendor_offset, Value) \ - ((*((volatile uint32_t*)(VENDOR_BASE_ADDRESS + (Vendor_offset)))) = (Value)) - -#define TEST_CPU_CLOCK 20// MHz - -static inline void reset_vendor_counter(void) -{ -#if F_BT_UPPER_STACK_USE_VIRTUAL_HCI - /* reser the counter */ - VENDOR_WRITE(0x17C, (1U << 31)); - - /* set the counter */ - VENDOR_WRITE(0x17C, 0); -#else - -#endif -} -static inline uint32_t read_vendor_counter_no_display(void) -{ -#if F_BT_UPPER_STACK_USE_VIRTUAL_HCI - return (VENDOR_READ(0x17C) & 0x3FFFFFF); -#else - return 0; -#endif -} -void tc_check_remote_disc_reason(uint16_t case_id, uint16_t reason); -void tc_check_local_disc_reason(uint16_t case_id, uint16_t reason); - - -void tc_reg_result_callback(P_FUN_TC_RESULT_CB tc_result_cb); -void tc_update_disc_reason(uint16_t reason); -void tc_dump_disc_reason(void); - - - -typedef struct _T_TC_PARAM_DATA -{ - uint16_t id; -} T_TC_PARAM_DATA; - - -typedef struct _T_TC_PARAM -{ - struct _T_TC_PARAM *p_next; - T_TC_PARAM_DATA *p_data; -} T_TC_PARAM; - -extern T_OS_QUEUE tc_q; - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_pxpext_client.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_pxpext_client.h deleted file mode 100644 index 9f343d0e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_pxpext_client.h +++ /dev/null @@ -1,74 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file vendor_tp_client.h - * @brief - * @details Simple BLE data structs and external functions declaration. - * @author jane - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _VD_PXP_CLIENT_H_ -#define _VD_PXP_CLIENT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include "profile_client.h" - -typedef enum -{ - PXP_CLIENT_CB_TYPE_DISC_RESULT, //!< Discovery procedure state, done or pending. - PXP_CLIENT_CB_TYPE_WRITE_RESULT, //!< Read request's result data, responsed from server. - PXP_CLIENT_CB_TYPE_READ_RESULT, - PXP_CLIENT_CB_TYPE_INVALID //!< Invalid callback type, no practical usage. -} T_PXP_CB_TYPE; - -typedef struct -{ - bool is_found; - T_GATT_CHARACT_ELEM128 pxp_char; -} T_PXP_DISC_RESULT; - -typedef struct -{ - uint16_t cause; - uint16_t value_size; - uint8_t *pValue; -} T_PXP_READ_RESULT; - -typedef struct -{ - uint16_t cause; -} T_PXP_WRITE_RESULT; - -typedef union -{ - T_PXP_DISC_RESULT disc_result; - T_PXP_WRITE_RESULT write_result; - T_PXP_READ_RESULT read_result; -} T_PXP_DATA; - -typedef struct -{ - T_PXP_CB_TYPE cb_type; - T_PXP_DATA cb_content; -} T_PXP_CB_DATA; - - -T_CLIENT_ID vendor_pxpext_client_add(P_FUN_GENERAL_APP_CB app_cb); -bool vendor_pxpext_start_discovery(uint8_t conn_id); -bool vendor_pxpext_write_value(uint8_t conn_id, uint16_t length, uint8_t *p_value); -bool vendor_pxpext_read_value(uint8_t conn_id); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _VD_PXP_CLIENT_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_pxpext_service.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_pxpext_service.h deleted file mode 100644 index 24a515d3..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_pxpext_service.h +++ /dev/null @@ -1,32 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file vendor_tp_service.h - * @brief Demonstration of how to implement a self-definition service. - * @details Demonstration of different kinds of service interfaces. - * @author ethan - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _VENDOR_PXPEXT_SERVICE_H_ -#define _VENDOR_PXPEXT_SERVICE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Add Includes here */ -#include "profile_server.h" - - - -T_SERVER_ID vendor_pxpext_service_add(void *pFunc); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_client.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_client.h deleted file mode 100644 index eefa0116..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_client.h +++ /dev/null @@ -1,99 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file vendor_tp_client.h - * @brief - * @details Simple BLE data structs and external functions declaration. - * @author jane - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _VD_TP_CLIENT_H_ -#define _VD_TP_CLIENT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include "profile_client.h" - -typedef enum -{ - TP_CLIENT_CB_TYPE_DISC_RESULT, //!< Discovery procedure state, done or pending. - TP_CLIENT_CB_TYPE_WRITE_RESULT, //!< Read request's result data, responsed from server. - TP_CLIENT_CB_TYPE_READ_RESULT, //!< Read request's result data, responsed from server. - TP_CLIENT_CB_TYPE_NOTIF_IND_RESULT, - TP_CLIENT_CB_TYPE_INVALID //!< Invalid callback type, no practical usage. -} T_TP_CB_TYPE; - -typedef enum -{ - TP_WRITE_CCCD, - TP_WRITE_CHAR_VALUE, -} T_TP_WRITE_TYPE; - -typedef struct -{ - bool is_found; - T_GATT_CHARACT_ELEM16 char_tp; -} T_TP_DISC_RESULT; - -typedef struct -{ - uint8_t is_notif; - uint16_t value_size; - uint8_t *pValue; -} T_TP_NOTIF_IND_DATA; - -typedef struct -{ - T_TP_WRITE_TYPE type; - T_GATT_WRITE_TYPE write_type; - uint16_t cause; - uint8_t credits; -} T_TP_WRITE_RESULT; - -typedef enum -{ - TP_READ_PREFER_PARAM, -} T_TP_READ_TYPE; - -typedef struct -{ - T_TP_READ_TYPE type; - uint16_t cause; - uint16_t value_size; - uint8_t *p_value; -} T_TP_READ_RESULT; - -typedef union -{ - T_TP_DISC_RESULT disc_result; - T_TP_NOTIF_IND_DATA notif_ind_data; - T_TP_WRITE_RESULT write_result; - T_TP_READ_RESULT read_result; -} T_TP_DATA; - -typedef struct -{ - T_TP_CB_TYPE cb_type; - T_TP_DATA cb_content; -} T_TP_CB_DATA; - -T_CLIENT_ID tp_client_add(P_FUN_GENERAL_APP_CB app_cb); -bool tp_client_start_discovery(uint8_t conn_id); -bool tp_client_write_cccd(uint8_t conn_id, uint16_t cccd_bits); -bool tp_client_write_value(uint8_t conn_id, uint16_t length, uint8_t *p_value); -bool tp_client_write_command(uint8_t conn_id, uint16_t length, uint8_t *p_value); -bool tp_client_read_prefer_param(uint8_t conn_id); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _VD_TP_CLIENT_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_config.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_config.h deleted file mode 100644 index 84b06224..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_config.h +++ /dev/null @@ -1,53 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file simple_ble_config.h - * @brief This file includes common constants or types for Simple BLE service/client. - * And some optional feature may be defined in this file. - * @details - * @author Ethan - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion **/ -#ifndef _VENDOR_TP_CONFIG_H_ -#define _VENDOR_TP_CONFIG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct -{ - uint8_t data_check; - uint8_t initial_value; - uint8_t mode; - /** 0 : 1M + w/o data length extension - 1 : 1M + w data length extension - 2 : 2M + w/o data length extension - 3 : 2M + w data length extension - 4 : Coded(s=2) + w/o data length extension - 5 : Coded(s=2) + w data length extension - 6 : Coded(s=8) + w/o data length extension - 7 : Coded(s=8) + w data length extension - 8 : 1M + w/o data length extension(BT4.0) - */ - uint16_t con_interval; - uint16_t conn_slave_latency; - uint16_t conn_supervision_timeout; - uint16_t length; - uint32_t count; -} TTP_PERFER_PARAM; - -#define GATT_UUID_VENDOR_TP_SERVICE 0xA00D -#define GATT_UUID_VENDOR_TP_NOTIFY_INDICATE 0xB001 -#define GATT_UUID_VENDOR_TP_PREFER_PARAM 0xB002 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_service.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_service.h deleted file mode 100644 index e8cf08aa..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_auto_test/vendor_tp_service.h +++ /dev/null @@ -1,174 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file vendor_tp_service.h - * @brief Demonstration of how to implement a self-definition service. - * @details Demonstration of different kinds of service interfaces. - * @author ethan - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _VENDOR_TP_SERVICE_H_ -#define _VENDOR_TP_SERVICE_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include "profile_server.h" -#include "vendor_tp_config.h" - -/** @addtogroup SIMP SIMP - * @brief Simple BLE Profile - * @{ - */ - -/** @defgroup SIMP_Service SIMP Service - * @brief Simple BLE Service - * @{ - */ - -/** @defgroup SIMP_Service_Exported_Constants SIMP Service Exported Constants - * @brief macros that other .c files may use all defined here - * @{ - */ - -/** @defgroup SIMP_Service_Application_Parameters SIMP Service Application Parameters - * @brief Type of parameters set/got from application. - * @{ - */ -#define SIMPLE_BLE_SERVICE_PARAM_V1_READ_CHAR_VAL 0x01 -#define SIMPLE_BLE_SERVICE_PARAM_CTL_PNT_PROG_CLR 0x02 -/** @} */ - -///@cond -/** @brief Index of each characteristic in Demo Profile service database. */ -#define VENDOR_TP_SERVICE_CHAR_TP_WRITE_INDEX 0x02 -#define VENDOR_TP_SERVICE_CHAR_TP_NOTIFY_INDICATE_CCCD_INDEX (VENDOR_TP_SERVICE_CHAR_TP_WRITE_INDEX + 1) -///@endcond - -/** @defgroup SIMP_Service_Upstream_Message SIMP Service Upstream Message - * @brief Upstream message used to inform application. - * @{ - */ - -#define SIMP_WRITE_V1 1 - - -/** @} */ - -/** @defgroup SIMP_Service_Notify_Indicate_Info SIMP Service Notify Indicate Info - * @brief Parameter for enable or disable notification or indication. - * @{ - */ -#define VENDOR_TP_SERVICE_V1_NOTIFICATION_ENABLE 1 -#define VENDOR_TP_SERVICE_V1_NOTIFICATION_DISABLE 2 -#define VENDOR_TP_SERVICE_V1_INDICATION_ENABLE 3 -#define VENDOR_TP_SERVICE_V1_INDICATION_DISABLE 4 - - - -/** @} */ - -/** @} End of SIMP_Service_Upstream_Message */ - - - -/** @defgroup SIMP_Service_Exported_Types SIMP Service Exported Types - * @brief types that other.c files may use all defined here - * @{ - */ - -/** @defgroup TSIMP_WRITE_MSG TSIMP_WRITE_MSG - * @brief Simple BLE service written msg to application. - * @{ - */ - -typedef enum -{ - VENDOR_TP_OP_CONFIG_NOTIFY_PARAM1 = 0x01, - VENDOR_TP_OP_CONFIG_NOTIFY_PARAM2 = 0x02, - VENDOR_TP_OP_NOTIFY_START_TEST = 0x03, - -} VENDOR_TP_OP; - -typedef struct _TVENDOR_TP_CONFIG_NOTIFY_PARAM -{ - uint32_t count; - uint16_t length; -} TVENDOR_TP_CONFIG_NOTIFY_PARAM; - -typedef struct -{ - uint16_t length; - uint8_t *p_value; -} TVENDOR_TP_WRITE_DATA; - -typedef struct _TTP_WRITE_MSG -{ - T_WRITE_TYPE write_type; - VENDOR_TP_OP opcode; //!< ref: @ref SIMP_Control_Point_OpCodes, @ref SIMP_Service_Write_Info - union - { - TVENDOR_TP_CONFIG_NOTIFY_PARAM notify_param; - TVENDOR_TP_WRITE_DATA write_data; - uint8_t mode; - } u; -} TTP_WRITE_MSG; -/** @} End of TSIMP_WRITE_MSG */ - - -/** @defgroup TSIMP_UPSTREAM_MSG_DATA TSIMP_UPSTREAM_MSG_DATA - * @brief Simple BLE service callback message content. - * @{ - */ -typedef union _TTP_UPSTREAM_MSG_DATA -{ - uint8_t notification_indification_index; //!< ref: @ref SIMP_Service_Notify_Indicate_Info - uint8_t read_value_index; //!< ref: @ref SIMP_Service_Read_Info - TTP_WRITE_MSG write; -} TTP_UPSTREAM_MSG_DATA; -/** @} End of TSIMP_UPSTREAM_MSG_DATA */ - -/** @defgroup TSIMP_CALLBACK_DATA TSIMP_CALLBACK_DATA - * @brief Simple BLE service data to inform application. - * @{ - */ -typedef struct _TTP_CALLBACK_DATA -{ - T_SERVICE_CALLBACK_TYPE msg_type; - uint8_t conn_id; - TTP_UPSTREAM_MSG_DATA msg_data; -} TTP_CALLBACK_DATA; -/** @} End of TSIMP_CALLBACK_DATA */ - -/** @} End of SIMP_Service_Exported_Types */ - -/** @defgroup SIMP_Service_Exported_Functions SIMP Service Exported Functions - * @brief functions that other .c files may use all defined here - * @{ - */ -T_SERVER_ID vendor_tp_service_add(void *pFunc); -void vendor_tp_service_config_param(TTP_PERFER_PARAM param); -bool vendor_tp_service_v1_notification(uint8_t conn_id, T_SERVER_ID service_id, void *p_value, - uint16_t length); -bool vendor_tp_service_v1_indication(uint8_t conn_id, T_SERVER_ID service_id, void *p_value, - uint16_t length); - - -/** @} End of SIMP_Service_Exported_Functions */ - -/** @} End of SIMP_Service */ - -/** @} End of SIMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SIMPLE_BLE_SERVICE_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/user_cmd.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/user_cmd.h deleted file mode 100644 index c1615aa2..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/ble_central_client/user_cmd.h +++ /dev/null @@ -1,31 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************** -* @file user_cmd.h -* @brief Define user command. -* @details -* @author jane -* @date 2016-02-18 -* @version v0.1 -********************************************************************************************************* -*/ -#ifndef _USER_CMD_H_ -#define _USER_CMD_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -extern const T_USER_CMD_TABLE_ENTRY user_cmd_table[]; -extern T_USER_CMD_IF user_cmd_if; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/app_flags.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/app_flags.h deleted file mode 100644 index c3b377b5..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/app_flags.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _APP_FLAGS_H_ -#define _APP_FLAGS_H_ - -#include "bt_flags.h" - -#define F_BT_GAPS_CHAR_WRITEABLE 0 -#define F_BT_AIRPLANE_MODE_SUPPORT 0 -#define F_BT_ANCS_CLIENT_SUPPORT 0 -#define F_BT_ANCS_APP_FILTER (F_BT_ANCS_CLIENT_SUPPORT & 0) -#define F_BT_ANCS_GET_APP_ATTR (F_BT_ANCS_CLIENT_SUPPORT & 0) -#define F_BT_ANCS_CLIENT_DEBUG (F_BT_ANCS_CLIENT_SUPPORT & 0) - -#define F_BT_TASK_SCHEDULE_DEBUG 0 - -#define APP_HID_TEST 0 -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/app_task.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/app_task.h deleted file mode 100644 index 01d0a658..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/app_task.h +++ /dev/null @@ -1,34 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file app_task.h - * @brief Routines to create App task and handle events & messages - * @author jane - * @date 2017-06-02 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _APP_TASK_H_ -#define _APP_TASK_H_ - -#define MAX_NUMBER_OF_GAP_MESSAGE 0x20 - -extern void *evt_queue_handle; -extern void *io_queue_handle; -/** - * @brief Initialize App task - * @return void - */ -void app_task_init(void); -void app_task_deinit(void); -void app_send_msg(uint16_t sub_type); -void app_init(void); -bool upper_task_init(void); -void app_deinit(void); -void upper_task_deinit(void); -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/complete_ble_client.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/complete_ble_client.h deleted file mode 100644 index 10a72381..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/complete_ble_client.h +++ /dev/null @@ -1,332 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file complete_ble_client.h - * @brief Head file for using Simple BLE Client. - * @details Simple BLE data structs and external functions declaration. - * @author jane - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _COMPLETE_BLE_CLIENT_H_ -#define _COMPLETE_BLE_CLIENT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include - -/** @addtogroup PROFILE_API Profile APIs - * @{ - */ - -/** @addtogroup Bluetooth_Clients Bluetooth Clients - * @{ - */ - -/** @defgroup SIMP_Client Simple Ble service client - * @brief Simple BLE service client - * @details - Simple BLE Profile is a customized BLE-based Profile. Simple ble service please refer to @ref SIMP_Service . - * @{ - */ -/*============================================================================* - * Macros - *============================================================================*/ -/** @defgroup SIMP_Client_Exported_Macros SIMP Client Exported Macros - * @brief - * @{ - */ - -/** @defgroup SIMP_UUIDs1 SIMP UUIDs - * @brief Simple BLE Profile UUID definitions - * @{ - */ -#define GATT_UUID_SIMPLE_PROFILE 0xA00A -#define GATT_UUID_CHAR_SIMPLE_V1_READ 0xB001 -#define GATT_UUID_CHAR_SIMPLE_V2_WRITE 0xB002 -#define GATT_UUID_CHAR_SIMPLE_V3_NOTIFY 0xB003 -#define GATT_UUID_CHAR_SIMPLE_V4_INDICATE 0xB004 -#define GATT_UUID_CHAR_SIMPLE_V6_WRITE_LONG 0xB006 -#define GATT_UUID_CHAR_SIMPLE_V7_READ_LONG 0xB007 -#define GATT_UUID_CHAR_SIMPLE_V8 0xB008 -/** @} End of SIMP_UUIDs */ - -/** @brief Define links number. range: 0-4 */ -#define SIMP_MAX_LINKS 4 -/** End of SIMP_Client_Exported_Macros - * @} - */ - - -/*============================================================================* - * Types - *============================================================================*/ -/** @defgroup SIMP_Client_Exported_Types SIMP Client Exported Types - * @brief - * @{ - */ - -/** @brief SIMP client handle type*/ -typedef enum -{ - HDL_SIMBLE_SRV_START, //!< start handle of simple ble service - HDL_SIMBLE_SRV_END, //!< end handle of simple ble service - HDL_SIMBLE_V1_READ, //!< V1 read characteristic value handle - HDL_SIMBLE_V2_WRITE, //!< V2 write characteristic value handle - HDL_SIMBLE_V3_NOTIFY, //!< V3 notify characteristic value handle - HDL_SIMBLE_V3_NOTIFY_CCCD, //!< V3 notify characteristic CCCD handle - HDL_SIMBLE_V4_INDICATE, //!< V4 indicate characteristic value handle - HDL_SIMBLE_V4_INDICATE_CCCD, //!< V4 indicate characteristic CCCD handle - HDL_SIMBLE_V6_WRITE_LONG, // V6 write long value handle - HDL_SIMBLE_V7_READ_LONG, // V7 read long value handle - HDL_SIMBLE_V8, // V3 notify value handle - HDL_SIMBLE_V8_CCCD, // V3 notify CCCD handle - HDL_SIMBLE_CACHE_LEN //!< handle cache length -} T_SIMP_HANDLE_TYPE; - -/** @brief SIMP client discovery state*/ -typedef enum -{ - DISC_SIMP_IDLE, - DISC_SIMP_START, - DISC_SIMP_DONE, - DISC_SIMP_FAILED -} T_SIMP_DISC_STATE; - -/** @brief SIMP client read type*/ -typedef enum -{ - SIMP_READ_V1_READ, - SIMP_READ_V3_NOTIFY_CCCD, - SIMP_READ_V4_INDICATE_CCCD, - SIMP_READ_V7_READ_LONG = 4, - SIMP_READ_V8_CCCD = 5, -} T_SIMP_READ_TYPE; - -/** @brief SIMP client read value*/ -typedef struct -{ - uint16_t value_size; - uint8_t *p_value; -} T_SIMP_READ_VALUE; - -/** @brief SIMP client read data*/ -typedef union -{ - T_SIMP_READ_VALUE v1_read; - bool v3_notify_cccd; - bool v4_indicate_cccd; - uint16_t v8_notify_ind_cccd; - T_SIMP_READ_VALUE v7_read; -} T_SIMP_READ_DATA; - -/** @brief SIMP client read result*/ -typedef struct -{ - T_SIMP_READ_TYPE type; - T_SIMP_READ_DATA data; - uint16_t cause; -} T_SIMP_READ_RESULT; - - -/** @brief SIMP client write type*/ -typedef enum -{ - SIMP_WRITE_V2_WRITE, - SIMP_WRITE_V3_NOTIFY_CCCD, - SIMP_WRITE_V4_INDICATE_CCCD, - SIMP_WRITE_V6_WRITE_LONG, - SIMP_WRITE_V8_CCCD, -} T_SIMP_WRTIE_TYPE; - -/** @brief SIMP client write result*/ -typedef struct -{ - T_SIMP_WRTIE_TYPE type; - uint16_t cause; -} T_SIMP_WRITE_RESULT; - -/** @brief SIMP client notif/ind receive type*/ -typedef enum -{ - SIMP_V3_NOTIFY, - SIMP_V4_INDICATE, - SIMP_V8_NOTIFY, - SIMP_V8_INDICATE, -} T_SIMP_NOTIF_IND_TYPE; - -/** @brief SIMP client notif/ind receive data*/ -typedef struct -{ - uint16_t value_size; - uint8_t *p_value; -} T_SIMP_NOTIF_IND_VALUE; - -/** @brief SIMP client notif/ind receive content*/ -typedef struct -{ - T_SIMP_NOTIF_IND_TYPE type; - T_SIMP_NOTIF_IND_VALUE data; -} T_SIMP_NOTIF_IND_DATA; - -/** @brief SIMP client callback type*/ -typedef enum -{ - SIMP_CLIENT_CB_TYPE_DISC_STATE, //!< Discovery procedure state, done or pending. - SIMP_CLIENT_CB_TYPE_READ_RESULT, //!< Read request's result data, responsed from server. - SIMP_CLIENT_CB_TYPE_WRITE_RESULT, //!< Write request result, success or fail. - SIMP_CLIENT_CB_TYPE_NOTIF_IND_RESULT, //!< Notification or indication data received from server. - SIMP_CLIENT_CB_TYPE_INVALID //!< Invalid callback type, no practical usage. -} T_SIMP_CLIENT_CB_TYPE; - -/** @brief SIMP client callback content*/ -typedef union -{ - T_SIMP_DISC_STATE disc_state; - T_SIMP_READ_RESULT read_result; - T_SIMP_WRITE_RESULT write_result; - T_SIMP_NOTIF_IND_DATA notif_ind_data; -} T_SIMP_CLIENT_CB_CONTENT; - -/** @brief SIMP client callback data*/ -typedef struct -{ - T_SIMP_CLIENT_CB_TYPE cb_type; - T_SIMP_CLIENT_CB_CONTENT cb_content; -} T_SIMP_CLIENT_CB_DATA; - -/** End of SIMP_Client_Exported_Types * @} */ - -/** @defgroup SIMP_Client_Exported_Functions SIMP Client Exported Functions - * @{ - */ - -/** - * @brief Add simple ble service client to application. - * @param[in] app_cb pointer of app callback function to handle specific client module data. - * @param[in] link_num initialize link num. - * @return Client ID of the specific client module. - * @retval 0xff failed. - * @retval other success. - * - * Example usage - * \code{.c} - void app_le_profile_init(void) - { - client_init(1); - simple_ble_client_id = simp_ble_add_client(app_client_callback, APP_MAX_LINKS); - } - * \endcode - */ -T_CLIENT_ID simp_ble_add_client(P_FUN_GENERAL_APP_CB app_cb, uint8_t link_num); - -/** - * @brief Used by application, to start the discovery procedure of Simple BLE server. - * @param[in] conn_id connection ID. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_start_discovery(uint8_t conn_id); - -/** - * @brief Used by application, to read data from server by using handles. - * @param[in] conn_id connection ID. - * @param[in] read_type one of characteristic that has the readable property. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_read_by_handle(uint8_t conn_id, T_SIMP_READ_TYPE read_type); - -/** - * @brief Used by application, to read data from server by using UUIDs. - * @param[in] conn_id connection ID. - * @param[in] read_type one of characteristic that has the readable property. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_read_by_uuid(uint8_t conn_id, T_SIMP_READ_TYPE read_type); - -/** - * @brief Used by application, to write data of V2 write Characteristic. - * @param[in] conn_id connection ID. - * @param[in] length write data length - * @param[in] p_value point the value to write - * @param[in] type write type. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_write_v2_char(uint8_t conn_id, uint16_t length, uint8_t *p_value, - T_GATT_WRITE_TYPE type); - -/** - * @brief Used by application, to send write request to peer server's V6 Long Write Characteristic. - * @param conn_id: connection ID. - * @param length: value length. - * @param p_value: value point. - * @retval true--send request to upper stack success. - * false--send request to upper stack failed. - */ -bool simp_ble_client_write_v6_char(uint8_t conn_id, uint16_t length, uint8_t *p_value); -/** - * @brief Used by application, to enable or disable the notification of peer server's V3 Notify Characteristic. - * @param[in] conn_id connection ID. - * @param[in] notify 0--disable the notification, 1--enable the notification. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_set_v3_notify(uint8_t conn_id, bool notify); - -/** - * @brief Used by application, to enable or disable the indication of peer server's V4 Indicate Characteristic. - * @param[in] conn_id connection ID. - * @param[in] ind 0--disable the indication, 1--enable the indication. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_set_v4_ind(uint8_t conn_id, bool ind); - -bool simp_ble_client_set_v8_cccd(uint8_t conn_id, uint16_t cccd_bits); - - - - -/** - * @brief Used by application, to get handle cache. - * @param[in] conn_id connection ID. - * @param[in] p_hdl_cache pointer of the handle cache table - * @param[in] len the length of handle cache table - * @retval true success. - * @retval false failed. - */ -bool simp_ble_client_get_hdl_cache(uint8_t conn_id, uint16_t *p_hdl_cache, uint8_t len); - -/** - * @brief Used by application, to set handle cache. - * @param[in] conn_id connection ID. - * @param[in] p_hdl_cache pointer of the handle cache table - * @param[in] len the length of handle cache table - * @retval true success. - * @retval false failed. - */ -bool simp_ble_client_set_hdl_cache(uint8_t conn_id, uint16_t *p_hdl_cache, uint8_t len); - -/** @} End of SIMP_Client_Exported_Functions */ - -/** @} End of SIMP_Client */ - -/** @} End of Bluetooth_Clients */ - -/** @} End of PROFILE_API */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SIMPLE_BLE_CLIENT_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/complete_ble_service.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/complete_ble_service.h deleted file mode 100644 index d9c3644f..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/complete_ble_service.h +++ /dev/null @@ -1,255 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file complete_ble_service.h - * @brief Demonstration of how to implement a self-definition service. - * @details Demonstration of different kinds of service interfaces. - * @author - * @date - * @version - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _COMPLETE_BLE_SERVICE_H_ -#define _COMPLETE_BLE_SERVICE_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include -#include - -/** @addtogroup PROFILE_API Profile APIs - * @{ - */ - - -/** @addtogroup Bluetooth_Services Bluetooth Services - * @{ - */ - -/** @defgroup SIMP_Service Simple Ble Service - * @brief Simple BLE service - * @{ - */ -/*============================================================================* - * Macros - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Macros SIMP Service Exported Macros - * @brief - * @{ - */ - -/** @defgroup SIMP_Service_Application_Parameters SIMP Service Application Parameters - * @brief Type of parameters set/got from application. - * @{ - */ -typedef enum -{ - SIMPLE_BLE_SERVICE_PARAM_V1_READ_CHAR_VAL = 0x01, - SIMPLE_BLE_SERVICE_PARAM_V7_LEN = 0x02, -} T_SIMP_PARAM_TYPE; - -/** @} */ - - - -/** @defgroup SIMP_Service_Upstream_Message SIMP Service Upstream Message - * @brief Upstream message used to inform application. - * @{ - */ -/** @brief Index of each characteristic in Demo Profile service database. */ -#define SIMPLE_BLE_SERVICE_CHAR_V1_READ_INDEX 0x02 -#define SIMPLE_BLE_SERVICE_CHAR_V2_WRITE_INDEX 0x05 -#define SIMPLE_BLE_SERVICE_CHAR_V3_NOTIFY_INDEX 0x07 -#define SIMPLE_BLE_SERVICE_CHAR_V4_INDICATE_INDEX 0x0a -#define SIMPLE_BLE_SERVICE_CHAR_NOTIFY_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V3_NOTIFY_INDEX + 1) -#define SIMPLE_BLE_SERVICE_CHAR_INDICATE_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V4_INDICATE_INDEX + 1) -#define SIMPLE_BLE_SERVICE_CHAR_V6_WRITE_INDEX 0xd -#define SIMPLE_BLE_SERVICE_CHAR_V7_READ_LONG_INDEX 0xf -#define SIMPLE_BLE_SERVICE_CHAR_V8_NOTIFY_INDICATE_INDEX 0x11 -#define SIMPLE_BLE_SERVICE_CHAR_V8_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V8_NOTIFY_INDICATE_INDEX + 1) - -/** @defgroup SIMP_Service_Read_Info SIMP Service Read Info - * @brief Parameter for reading characteristic value. - * @{ - */ -#define SIMP_READ_V1 1 -#define SIMP_READ_V7 2 -/** @} */ - -/** @defgroup SIMP_Service_Write_Info SIMP Service Write Info - * @brief Parameter for writing characteristic value. - * @{ - */ -#define SIMP_WRITE_V2 1 -#define SIMP_WRITE_V6 2 -/** @} */ - -/** @defgroup SIMP_Service_Notify_Indicate_Info SIMP Service Notify Indicate Info - * @brief Parameter for enable or disable notification or indication. - * @{ - */ -#define SIMP_NOTIFY_INDICATE_V3_ENABLE 1 -#define SIMP_NOTIFY_INDICATE_V3_DISABLE 2 -#define SIMP_NOTIFY_INDICATE_V4_ENABLE 3 -#define SIMP_NOTIFY_INDICATE_V4_DISABLE 4 -#define SIMP_NOTIFY_INDICATE_V8_NOTIFY_ENABLE 7 -#define SIMP_NOTIFY_INDICATE_V8_INDICATE_ENABLE 8 -#define SIMP_NOTIFY_INDICATE_V8_NOTIFY_INDICATE_ENABLE 9 -#define SIMP_NOTIFY_INDICATE_V8_DISABLE 10 -/** @} */ - -#define SIMP_READ_V7_MAX_LEN 300 - -/** @} End of SIMP_Service_Upstream_Message */ - - - -/** @} End of SIMP_Service_Exported_Macros */ -/*============================================================================* - * Types - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Types SIMP Service Exported Types - * @brief - * @{ - */ - -/** @defgroup TSIMP_WRITE_MSG TSIMP_WRITE_MSG - * @brief Simple BLE service written msg to application. - * @{ - */ -typedef struct -{ - uint8_t opcode; //!< ref: @ref SIMP_Control_Point_OpCodes, @ref SIMP_Service_Write_Info - T_WRITE_TYPE write_type; - uint16_t len; - uint8_t *p_value; -} TSIMP_WRITE_MSG; -/** @} End of TSIMP_WRITE_MSG */ - - -/** @defgroup TSIMP_UPSTREAM_MSG_DATA TSIMP_UPSTREAM_MSG_DATA - * @brief Simple BLE service callback message content. - * @{ - */ -typedef union -{ - uint8_t notification_indification_index; //!< ref: @ref SIMP_Service_Notify_Indicate_Info - uint8_t read_value_index; //!< ref: @ref SIMP_Service_Read_Info - TSIMP_WRITE_MSG write; -} TSIMP_UPSTREAM_MSG_DATA; -/** @} End of TSIMP_UPSTREAM_MSG_DATA */ - -/** @defgroup TSIMP_CALLBACK_DATA TSIMP_CALLBACK_DATA - * @brief Simple BLE service data to inform application. - * @{ - */ -typedef struct -{ - uint8_t conn_id; - T_SERVICE_CALLBACK_TYPE msg_type; - TSIMP_UPSTREAM_MSG_DATA msg_data; -} TSIMP_CALLBACK_DATA; -/** @} End of TSIMP_CALLBACK_DATA */ - -/** @} End of SIMP_Service_Exported_Types */ -/*============================================================================* - * Functions - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Functions SIMP Service Exported Functions - * @brief - * @{ - */ - -/** - * @brief add Simple BLE service to application. - * - * @param[in] p_func pointer of app callback function called by profile. - * @return service ID auto generated by profile layer. - */ -T_SERVER_ID simp_ble_service_add_service(void *p_func); - -/** - * @brief Set service related data from application. - * - * @param[in] param_type parameter type to set. - * @param[in] len value length to be set. - * @param[in] p_value value to set. - * @return parameter set result. - * @retval 0 false - * @retval 1 true - */ -bool simp_ble_service_set_parameter(T_SIMP_PARAM_TYPE param_type, uint16_t len, void *p_value); - -/** - * @brief send notification of simple notify characteristic value. - * - * @param[in] conn_id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_send_v3_notify(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** - * @brief send indication of simple indicate characteristic value. - * - * @param[in] conn_id connection id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_send_v4_indicate(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** - * @brief send notification of simple notify characteristic value. - * - * @param[in] conn_id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_simple_v8_notify(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, - uint16_t length); - -/** - * @brief send indication of simple indicate characteristic value. - * - * @param[in] conn_id connection id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_simple_v8_indicate(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** @} End of SIMP_Service_Exported_Functions */ - -/** @} End of SIMP_Service */ - -/** @} End of Bluetooth_Services */ - -/** @} End of PROFILE_API */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SIMPLE_BLE_SERVICE_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/gap_test_app.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/gap_test_app.h deleted file mode 100644 index 8026fc23..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/gap_test_app.h +++ /dev/null @@ -1,132 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file gap_test_app.h - * @brief GAP roles test application implementation - * @author jane - * @date 2017-06-06 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ - -#ifndef _GAP_TEST_APP_H_ -#define _GAP_TEST_APP_H_ - -#ifdef __cplusplus -extern "C" { -#endif -/*============================================================================* - * Header Files - *============================================================================*/ -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include "profile_client.h" -#endif -#include -#include -#if F_BT_LE_PRIVACY_SUPPORT -#include -#endif -#include - -typedef enum -{ - GAP_TC_00_NORMAL = 0, - GAP_TC_01_ANCS = 1, - GAP_TC_02_GAPS_WRITEABLE = 2, - GAP_TC_03_PRIVACY = 3, - GAP_TC_04_PIN_CODE = 4, - GAP_TC_05_BT5 = 5, - GAP_TC_07_CCCD = 7, - GAP_TC_08_LOCAL_IRK = 8, - GAP_TC_09_SLAVE_LATENCY = 9, - GAP_TC_10_BT41 = 10, - GAP_TC_11_MIN_REM_SCA = 11, - GAP_TC_12_GAP_MSG_CALLBACK = 12, - GAP_TC_13_V3_V8_TX = 13, - GAP_TC_14_SRV_CHANGE = 14, - GAP_TC_15_HID_PROFILE = 15, -} T_GAP_TEST_CASE; - -typedef struct -{ - uint8_t v3_tx_idx; - uint8_t v3_tx_conn_id; - uint8_t v3_tx_len; - uint16_t v3_tx_num; - uint16_t v3_tx_cmp_num; - uint16_t v3_rx_num; - uint16_t v3_tx_cnt; - uint16_t v8_tx_cnt; - uint16_t v8_rx_num; -} T_GAP_V3_NOTIF_TEST; - -/*============================================================================* - * Variables - *============================================================================*/ -extern T_GAP_DEV_STATE gap_dev_state; -extern T_GAP_TEST_CASE gap_test_case; -extern T_GAP_V3_NOTIF_TEST gap_v3_notif_test; -#if F_BT_LE_GATT_CLIENT_SUPPORT -extern T_CLIENT_ID gaps_client_id; /**< Simple ble service client id*/ -extern T_CLIENT_ID simple_ble_client_id; /**< gap service client id*/ -#endif -extern T_SERVER_ID simp_srv_id; /**< Simple ble service id*/ -extern T_SERVER_ID hid_srv_id; - -/*============================================================================* - * Functions - *============================================================================*/ - -/** - * @brief All the application messages are pre-handled in this function - * @note All the IO MSGs are sent to this function, then the event handling - * function shall be called according to the MSG type. - * @param[in] io_msg IO message data - * @return void - */ -void app_handle_io_msg(T_IO_MSG io_msg); -/** - * @brief Callback for gap le to notify app - * @param[in] cb_type callback msy type @ref GAP_LE_MSG_Types. - * @param[in] p_cb_data point to callback data @ref T_LE_CB_DATA. - * @retval result @ref T_APP_RESULT - */ -T_APP_RESULT app_gap_callback(uint8_t cb_type, void *p_cb_data); - -/** - * @brief Callback will be called when data sent from profile client layer. - * @param client_id the ID distinguish which module sent the data. - * @param conn_id connection ID. - * @param p_data pointer to data. - * @retval result @ref T_APP_RESULT - */ -#if F_BT_LE_GATT_CLIENT_SUPPORT -T_APP_RESULT app_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); -#endif -T_APP_RESULT app_profile_callback(T_SERVER_ID service_id, void *p_data); - -void app_gap_common_callback(uint8_t cb_type, void *p_cb_data); -void app_gap_vendor_callback(uint8_t cb_type, void *p_cb_data); - -#if F_BT_GAPS_CHAR_WRITEABLE -T_APP_RESULT gap_service_callback(T_SERVER_ID service_id, void *p_para); -#endif - -#if F_BT_LE_PRIVACY_SUPPORT -void app_privacy_callback(T_PRI_CB_TYPE type, uint8_t status); -#endif - -#if F_BT_LE_4_1_CBC_SUPPORT -T_APP_RESULT app_credit_based_conn_callback(uint8_t cbc_type, void *p_cbc_data); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/link_mgr.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/link_mgr.h deleted file mode 100644 index d69ffbb8..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/link_mgr.h +++ /dev/null @@ -1,79 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file link_mgr.h - * @brief Define multilink manager struct and functions. - * @author jane - * @date 2017-06-06 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _LINK_MANAGER_H_ -#define _LINK_MANAGER_H_ -/*============================================================================* - * Header Files - *============================================================================*/ -#include -#include -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include "profile_client.h" -#endif -/*============================================================================* - * Constants - *============================================================================*/ -/** @brief Define links number. range: 0-4 */ -#define APP_MAX_LINKS 2 -#define APP_HDL_CACHE_LEN 24/** @brief Define device list table size. */ -#define APP_MAX_DEVICE_INFO 15 -typedef struct -{ - uint16_t uuid16; - uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ - uint8_t bd_type; /**< remote BD type*/ - uint8_t reserved[3]; /**< used to T_GATT_SERVER_DATABASE_INFO four byte alignment*/ - uint16_t hdl_cache[APP_HDL_CACHE_LEN]; -} T_GATT_SERVER_DATABASE_INFO; -/** - * @brief Application Link control block defination. - */ -typedef struct -{ - T_GAP_CONN_STATE conn_state; /**< Connection state. */ -#if F_BT_LE_GATT_CLIENT_SUPPORT - T_CLIENT_ID client_id; -#endif - uint8_t end_handle_idx; - uint8_t disc_state; - uint8_t state; - T_GATT_SERVER_DATABASE_INFO server_info; -} T_APP_LINK; -/** - * @brief Device list block defination. - */ -typedef struct -{ - uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ - uint8_t bd_type; /**< remote BD type*/ -} T_DEV_INFO; -/*============================================================================* - * Variables - *============================================================================*/ -/** @brief App link table */ -extern T_APP_LINK app_link_table[APP_MAX_LINKS]; -/** @brief Device list table, used to save discovered device informations. */ -extern T_DEV_INFO dev_list[APP_MAX_DEVICE_INFO]; -/** @brief The number of device informations saved in dev_list. */ -extern uint8_t dev_list_count; - -/*============================================================================* - * Functions - *============================================================================*/ -bool link_mgr_add_device(uint8_t *bd_addr, uint8_t bd_type); -void link_mgr_clear_device_list(void); - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/privacy_mgnt.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/privacy_mgnt.h deleted file mode 100644 index d38861af..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/privacy_mgnt.h +++ /dev/null @@ -1,66 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file privacy_mgnt.h - * @brief privacy managerment. - * @details privacy managerment. - * @author jane - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _PRIVACY_MGNT_H_ -#define _PRIVACY_MGNT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#if F_BT_LE_PRIVACY_SUPPORT -#include -#include - -#define PRIVACY_ENTRY_SIZE 4 -#define PRIVACY_RESOLVING_LIST_IDLE 0 -#define PRIVACY_RESOLVING_LIST_ADD_PENDING 1 -#define PRIVACY_RESOLVING_LIST_REMOVE_PENDING 2 -typedef struct -{ - bool is_used; - uint8_t addr[6]; - T_GAP_IDENT_ADDR_TYPE remote_bd_type; - bool is_add_to_list; - uint8_t pending; - -} T_LE_PRIVACY_ENTRY, *P_LE_PRIVACY_ENTRY; - -typedef enum -{ - PRIVACY_STATE_MSGTYPE, - PRIVACY_RESOLUTION_STATUS_MSGTYPE -} T_PRI_CB_TYPE; - -typedef enum -{ - PRIVACY_STATE_INIT, - PRIVACY_STATE_IDLE, //!< Disconnected. - PRIVACY_STATE_BUSY -} T_PRIVACY_STATE; -extern T_LE_PRIVACY_ENTRY privacy_table[PRIVACY_ENTRY_SIZE]; -typedef void(*P_FUN_PRIVACY_STATE_CB)(T_PRI_CB_TYPE type, uint8_t status); - -T_APP_RESULT privacy_msg_callback(uint8_t msg_type, T_LE_PRIVACY_CB_DATA msg_data); -void privacy_init_resolving_list(P_FUN_PRIVACY_STATE_CB p_fun); -T_PRIVACY_STATE privacy_handle_pending_resolving_list(void); -void privacy_add_pending_resolving_list(T_GAP_RESOLV_LIST_OP op, - T_GAP_IDENT_ADDR_TYPE addr_type, uint8_t *addr); -#endif -#ifdef __cplusplus -} -#endif - -#endif /* _PRIVACY_MGNT_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/test_task.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/test_task.h deleted file mode 100644 index e862c85e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/test_task.h +++ /dev/null @@ -1,26 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file app_task.h - * @brief Routines to create App task and handle events & messages - * @author jane - * @date 2017-06-02 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _TEST_TASK_H_ -#define _TEST_TASK_H_ - -/** - * @brief Initialize App task - * @return void - */ -void test_task_init(void); -void test_task_deinit(void); - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/uart_task.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/uart_task.h deleted file mode 100644 index 1fb8b53b..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/uart_task.h +++ /dev/null @@ -1,55 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file app_task.h - * @brief Routines to create App task and handle events & messages - * @author jane - * @date 2017-06-02 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _UART_TASK_H_ -#define _UART_TASK_H_ - - -typedef enum -{ - TC_IDLE = 0x0000, - TC_0001_IDLE = 1, - TC_0002_ADV, - TC_0003_SCAN, - TC_0004_CON_TX, - TC_0005_CON_RX, - - TC_MAX = 65535 -} T_CUR_TEST_CASE; - -typedef enum -{ - TC_START = 0x0000, - TC_DEL_STACK, - TC_ADD_STACK, - TC_STACK_STARTED, - TC_START_ADV, - TC_START_SCAN, - - TC_END -} T_TEST_PROC_SUBTYPE; - -extern T_CUR_TEST_CASE test_case_id; -extern uint32_t test_cur_count; -extern uint32_t test_max_count; -extern void *auto_test_timer; -void app_send_msg_to_uart_app(T_TEST_PROC_SUBTYPE sub_type, uint16_t cause); -/** - * @brief Initialize App task - * @return void - */ -void uart_task_init(void); - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/user_cmd.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/user_cmd.h deleted file mode 100644 index c1615aa2..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/deinit_test/user_cmd.h +++ /dev/null @@ -1,31 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************** -* @file user_cmd.h -* @brief Define user command. -* @details -* @author jane -* @date 2016-02-18 -* @version v0.1 -********************************************************************************************************* -*/ -#ifndef _USER_CMD_H_ -#define _USER_CMD_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -extern const T_USER_CMD_TABLE_ENTRY user_cmd_table[]; -extern T_USER_CMD_IF user_cmd_if; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/ancs.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/ancs.h deleted file mode 100644 index 939fd6ef..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/ancs.h +++ /dev/null @@ -1,260 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2015, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file ancs.h -* @brief ancs -* @details ancs -* @author ranhui -* @date 2015-03-27 -* @version v0.1 -* ********************************************************************************************************* -*/ - -#ifndef _ANCS_H__ -#define _ANCS_H__ - -#ifdef __cplusplus -extern "C" { -#endif -/*============================================================================* - * Header Files - *============================================================================*/ -#include -#include - -/** @addtogroup PERIPH_ANCS - * @{ - */ -/*============================================================================* - * Macros - *============================================================================*/ -/** @defgroup PERIPH_ANCS_Exported_Macros ANCS Exported Macros - * @{ - */ -#define ANCS_MAX_ATTR_LEN 256 //!< Max ancs attribute length - -#if F_BT_ANCS_GET_APP_ATTR -#define ANCS_APP_INDENTIFIER_MAX_LEN 30 //!< Max app indentifier length -#endif - -#define ANCS_MSG_QUEUE_NUM 5 //!< ANCS message queue size - - -/** @brief ANCS event flag */ -#define NS_EVENT_FLAG_SILENT (1 << 0) -#define NS_EVENT_FLAG_IMPORTANT (1 << 1) -#define NS_EVENT_FLAG_PRE_EXISTING (1 << 2) -#define NS_EVENT_FLAG_POSITIVE_ACTION (1 << 3) //!
© COPYRIGHT 2017 Realtek Semiconductor Corporation
- ************************************************************************************** - */ -#ifndef _APP_TASK_H_ -#define _APP_TASK_H_ - -#define MAX_NUMBER_OF_GAP_MESSAGE 0x20 - -extern void *evt_queue_handle; -extern void *io_queue_handle; -/** - * @brief Initialize App task - * @return void - */ -void app_task_init(void); - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/complete_ble_client.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/complete_ble_client.h deleted file mode 100644 index 10a72381..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/complete_ble_client.h +++ /dev/null @@ -1,332 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file complete_ble_client.h - * @brief Head file for using Simple BLE Client. - * @details Simple BLE data structs and external functions declaration. - * @author jane - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _COMPLETE_BLE_CLIENT_H_ -#define _COMPLETE_BLE_CLIENT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include - -/** @addtogroup PROFILE_API Profile APIs - * @{ - */ - -/** @addtogroup Bluetooth_Clients Bluetooth Clients - * @{ - */ - -/** @defgroup SIMP_Client Simple Ble service client - * @brief Simple BLE service client - * @details - Simple BLE Profile is a customized BLE-based Profile. Simple ble service please refer to @ref SIMP_Service . - * @{ - */ -/*============================================================================* - * Macros - *============================================================================*/ -/** @defgroup SIMP_Client_Exported_Macros SIMP Client Exported Macros - * @brief - * @{ - */ - -/** @defgroup SIMP_UUIDs1 SIMP UUIDs - * @brief Simple BLE Profile UUID definitions - * @{ - */ -#define GATT_UUID_SIMPLE_PROFILE 0xA00A -#define GATT_UUID_CHAR_SIMPLE_V1_READ 0xB001 -#define GATT_UUID_CHAR_SIMPLE_V2_WRITE 0xB002 -#define GATT_UUID_CHAR_SIMPLE_V3_NOTIFY 0xB003 -#define GATT_UUID_CHAR_SIMPLE_V4_INDICATE 0xB004 -#define GATT_UUID_CHAR_SIMPLE_V6_WRITE_LONG 0xB006 -#define GATT_UUID_CHAR_SIMPLE_V7_READ_LONG 0xB007 -#define GATT_UUID_CHAR_SIMPLE_V8 0xB008 -/** @} End of SIMP_UUIDs */ - -/** @brief Define links number. range: 0-4 */ -#define SIMP_MAX_LINKS 4 -/** End of SIMP_Client_Exported_Macros - * @} - */ - - -/*============================================================================* - * Types - *============================================================================*/ -/** @defgroup SIMP_Client_Exported_Types SIMP Client Exported Types - * @brief - * @{ - */ - -/** @brief SIMP client handle type*/ -typedef enum -{ - HDL_SIMBLE_SRV_START, //!< start handle of simple ble service - HDL_SIMBLE_SRV_END, //!< end handle of simple ble service - HDL_SIMBLE_V1_READ, //!< V1 read characteristic value handle - HDL_SIMBLE_V2_WRITE, //!< V2 write characteristic value handle - HDL_SIMBLE_V3_NOTIFY, //!< V3 notify characteristic value handle - HDL_SIMBLE_V3_NOTIFY_CCCD, //!< V3 notify characteristic CCCD handle - HDL_SIMBLE_V4_INDICATE, //!< V4 indicate characteristic value handle - HDL_SIMBLE_V4_INDICATE_CCCD, //!< V4 indicate characteristic CCCD handle - HDL_SIMBLE_V6_WRITE_LONG, // V6 write long value handle - HDL_SIMBLE_V7_READ_LONG, // V7 read long value handle - HDL_SIMBLE_V8, // V3 notify value handle - HDL_SIMBLE_V8_CCCD, // V3 notify CCCD handle - HDL_SIMBLE_CACHE_LEN //!< handle cache length -} T_SIMP_HANDLE_TYPE; - -/** @brief SIMP client discovery state*/ -typedef enum -{ - DISC_SIMP_IDLE, - DISC_SIMP_START, - DISC_SIMP_DONE, - DISC_SIMP_FAILED -} T_SIMP_DISC_STATE; - -/** @brief SIMP client read type*/ -typedef enum -{ - SIMP_READ_V1_READ, - SIMP_READ_V3_NOTIFY_CCCD, - SIMP_READ_V4_INDICATE_CCCD, - SIMP_READ_V7_READ_LONG = 4, - SIMP_READ_V8_CCCD = 5, -} T_SIMP_READ_TYPE; - -/** @brief SIMP client read value*/ -typedef struct -{ - uint16_t value_size; - uint8_t *p_value; -} T_SIMP_READ_VALUE; - -/** @brief SIMP client read data*/ -typedef union -{ - T_SIMP_READ_VALUE v1_read; - bool v3_notify_cccd; - bool v4_indicate_cccd; - uint16_t v8_notify_ind_cccd; - T_SIMP_READ_VALUE v7_read; -} T_SIMP_READ_DATA; - -/** @brief SIMP client read result*/ -typedef struct -{ - T_SIMP_READ_TYPE type; - T_SIMP_READ_DATA data; - uint16_t cause; -} T_SIMP_READ_RESULT; - - -/** @brief SIMP client write type*/ -typedef enum -{ - SIMP_WRITE_V2_WRITE, - SIMP_WRITE_V3_NOTIFY_CCCD, - SIMP_WRITE_V4_INDICATE_CCCD, - SIMP_WRITE_V6_WRITE_LONG, - SIMP_WRITE_V8_CCCD, -} T_SIMP_WRTIE_TYPE; - -/** @brief SIMP client write result*/ -typedef struct -{ - T_SIMP_WRTIE_TYPE type; - uint16_t cause; -} T_SIMP_WRITE_RESULT; - -/** @brief SIMP client notif/ind receive type*/ -typedef enum -{ - SIMP_V3_NOTIFY, - SIMP_V4_INDICATE, - SIMP_V8_NOTIFY, - SIMP_V8_INDICATE, -} T_SIMP_NOTIF_IND_TYPE; - -/** @brief SIMP client notif/ind receive data*/ -typedef struct -{ - uint16_t value_size; - uint8_t *p_value; -} T_SIMP_NOTIF_IND_VALUE; - -/** @brief SIMP client notif/ind receive content*/ -typedef struct -{ - T_SIMP_NOTIF_IND_TYPE type; - T_SIMP_NOTIF_IND_VALUE data; -} T_SIMP_NOTIF_IND_DATA; - -/** @brief SIMP client callback type*/ -typedef enum -{ - SIMP_CLIENT_CB_TYPE_DISC_STATE, //!< Discovery procedure state, done or pending. - SIMP_CLIENT_CB_TYPE_READ_RESULT, //!< Read request's result data, responsed from server. - SIMP_CLIENT_CB_TYPE_WRITE_RESULT, //!< Write request result, success or fail. - SIMP_CLIENT_CB_TYPE_NOTIF_IND_RESULT, //!< Notification or indication data received from server. - SIMP_CLIENT_CB_TYPE_INVALID //!< Invalid callback type, no practical usage. -} T_SIMP_CLIENT_CB_TYPE; - -/** @brief SIMP client callback content*/ -typedef union -{ - T_SIMP_DISC_STATE disc_state; - T_SIMP_READ_RESULT read_result; - T_SIMP_WRITE_RESULT write_result; - T_SIMP_NOTIF_IND_DATA notif_ind_data; -} T_SIMP_CLIENT_CB_CONTENT; - -/** @brief SIMP client callback data*/ -typedef struct -{ - T_SIMP_CLIENT_CB_TYPE cb_type; - T_SIMP_CLIENT_CB_CONTENT cb_content; -} T_SIMP_CLIENT_CB_DATA; - -/** End of SIMP_Client_Exported_Types * @} */ - -/** @defgroup SIMP_Client_Exported_Functions SIMP Client Exported Functions - * @{ - */ - -/** - * @brief Add simple ble service client to application. - * @param[in] app_cb pointer of app callback function to handle specific client module data. - * @param[in] link_num initialize link num. - * @return Client ID of the specific client module. - * @retval 0xff failed. - * @retval other success. - * - * Example usage - * \code{.c} - void app_le_profile_init(void) - { - client_init(1); - simple_ble_client_id = simp_ble_add_client(app_client_callback, APP_MAX_LINKS); - } - * \endcode - */ -T_CLIENT_ID simp_ble_add_client(P_FUN_GENERAL_APP_CB app_cb, uint8_t link_num); - -/** - * @brief Used by application, to start the discovery procedure of Simple BLE server. - * @param[in] conn_id connection ID. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_start_discovery(uint8_t conn_id); - -/** - * @brief Used by application, to read data from server by using handles. - * @param[in] conn_id connection ID. - * @param[in] read_type one of characteristic that has the readable property. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_read_by_handle(uint8_t conn_id, T_SIMP_READ_TYPE read_type); - -/** - * @brief Used by application, to read data from server by using UUIDs. - * @param[in] conn_id connection ID. - * @param[in] read_type one of characteristic that has the readable property. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_read_by_uuid(uint8_t conn_id, T_SIMP_READ_TYPE read_type); - -/** - * @brief Used by application, to write data of V2 write Characteristic. - * @param[in] conn_id connection ID. - * @param[in] length write data length - * @param[in] p_value point the value to write - * @param[in] type write type. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_write_v2_char(uint8_t conn_id, uint16_t length, uint8_t *p_value, - T_GATT_WRITE_TYPE type); - -/** - * @brief Used by application, to send write request to peer server's V6 Long Write Characteristic. - * @param conn_id: connection ID. - * @param length: value length. - * @param p_value: value point. - * @retval true--send request to upper stack success. - * false--send request to upper stack failed. - */ -bool simp_ble_client_write_v6_char(uint8_t conn_id, uint16_t length, uint8_t *p_value); -/** - * @brief Used by application, to enable or disable the notification of peer server's V3 Notify Characteristic. - * @param[in] conn_id connection ID. - * @param[in] notify 0--disable the notification, 1--enable the notification. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_set_v3_notify(uint8_t conn_id, bool notify); - -/** - * @brief Used by application, to enable or disable the indication of peer server's V4 Indicate Characteristic. - * @param[in] conn_id connection ID. - * @param[in] ind 0--disable the indication, 1--enable the indication. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_set_v4_ind(uint8_t conn_id, bool ind); - -bool simp_ble_client_set_v8_cccd(uint8_t conn_id, uint16_t cccd_bits); - - - - -/** - * @brief Used by application, to get handle cache. - * @param[in] conn_id connection ID. - * @param[in] p_hdl_cache pointer of the handle cache table - * @param[in] len the length of handle cache table - * @retval true success. - * @retval false failed. - */ -bool simp_ble_client_get_hdl_cache(uint8_t conn_id, uint16_t *p_hdl_cache, uint8_t len); - -/** - * @brief Used by application, to set handle cache. - * @param[in] conn_id connection ID. - * @param[in] p_hdl_cache pointer of the handle cache table - * @param[in] len the length of handle cache table - * @retval true success. - * @retval false failed. - */ -bool simp_ble_client_set_hdl_cache(uint8_t conn_id, uint16_t *p_hdl_cache, uint8_t len); - -/** @} End of SIMP_Client_Exported_Functions */ - -/** @} End of SIMP_Client */ - -/** @} End of Bluetooth_Clients */ - -/** @} End of PROFILE_API */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SIMPLE_BLE_CLIENT_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/complete_ble_service.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/complete_ble_service.h deleted file mode 100644 index d9c3644f..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/complete_ble_service.h +++ /dev/null @@ -1,255 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file complete_ble_service.h - * @brief Demonstration of how to implement a self-definition service. - * @details Demonstration of different kinds of service interfaces. - * @author - * @date - * @version - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _COMPLETE_BLE_SERVICE_H_ -#define _COMPLETE_BLE_SERVICE_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include -#include - -/** @addtogroup PROFILE_API Profile APIs - * @{ - */ - - -/** @addtogroup Bluetooth_Services Bluetooth Services - * @{ - */ - -/** @defgroup SIMP_Service Simple Ble Service - * @brief Simple BLE service - * @{ - */ -/*============================================================================* - * Macros - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Macros SIMP Service Exported Macros - * @brief - * @{ - */ - -/** @defgroup SIMP_Service_Application_Parameters SIMP Service Application Parameters - * @brief Type of parameters set/got from application. - * @{ - */ -typedef enum -{ - SIMPLE_BLE_SERVICE_PARAM_V1_READ_CHAR_VAL = 0x01, - SIMPLE_BLE_SERVICE_PARAM_V7_LEN = 0x02, -} T_SIMP_PARAM_TYPE; - -/** @} */ - - - -/** @defgroup SIMP_Service_Upstream_Message SIMP Service Upstream Message - * @brief Upstream message used to inform application. - * @{ - */ -/** @brief Index of each characteristic in Demo Profile service database. */ -#define SIMPLE_BLE_SERVICE_CHAR_V1_READ_INDEX 0x02 -#define SIMPLE_BLE_SERVICE_CHAR_V2_WRITE_INDEX 0x05 -#define SIMPLE_BLE_SERVICE_CHAR_V3_NOTIFY_INDEX 0x07 -#define SIMPLE_BLE_SERVICE_CHAR_V4_INDICATE_INDEX 0x0a -#define SIMPLE_BLE_SERVICE_CHAR_NOTIFY_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V3_NOTIFY_INDEX + 1) -#define SIMPLE_BLE_SERVICE_CHAR_INDICATE_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V4_INDICATE_INDEX + 1) -#define SIMPLE_BLE_SERVICE_CHAR_V6_WRITE_INDEX 0xd -#define SIMPLE_BLE_SERVICE_CHAR_V7_READ_LONG_INDEX 0xf -#define SIMPLE_BLE_SERVICE_CHAR_V8_NOTIFY_INDICATE_INDEX 0x11 -#define SIMPLE_BLE_SERVICE_CHAR_V8_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V8_NOTIFY_INDICATE_INDEX + 1) - -/** @defgroup SIMP_Service_Read_Info SIMP Service Read Info - * @brief Parameter for reading characteristic value. - * @{ - */ -#define SIMP_READ_V1 1 -#define SIMP_READ_V7 2 -/** @} */ - -/** @defgroup SIMP_Service_Write_Info SIMP Service Write Info - * @brief Parameter for writing characteristic value. - * @{ - */ -#define SIMP_WRITE_V2 1 -#define SIMP_WRITE_V6 2 -/** @} */ - -/** @defgroup SIMP_Service_Notify_Indicate_Info SIMP Service Notify Indicate Info - * @brief Parameter for enable or disable notification or indication. - * @{ - */ -#define SIMP_NOTIFY_INDICATE_V3_ENABLE 1 -#define SIMP_NOTIFY_INDICATE_V3_DISABLE 2 -#define SIMP_NOTIFY_INDICATE_V4_ENABLE 3 -#define SIMP_NOTIFY_INDICATE_V4_DISABLE 4 -#define SIMP_NOTIFY_INDICATE_V8_NOTIFY_ENABLE 7 -#define SIMP_NOTIFY_INDICATE_V8_INDICATE_ENABLE 8 -#define SIMP_NOTIFY_INDICATE_V8_NOTIFY_INDICATE_ENABLE 9 -#define SIMP_NOTIFY_INDICATE_V8_DISABLE 10 -/** @} */ - -#define SIMP_READ_V7_MAX_LEN 300 - -/** @} End of SIMP_Service_Upstream_Message */ - - - -/** @} End of SIMP_Service_Exported_Macros */ -/*============================================================================* - * Types - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Types SIMP Service Exported Types - * @brief - * @{ - */ - -/** @defgroup TSIMP_WRITE_MSG TSIMP_WRITE_MSG - * @brief Simple BLE service written msg to application. - * @{ - */ -typedef struct -{ - uint8_t opcode; //!< ref: @ref SIMP_Control_Point_OpCodes, @ref SIMP_Service_Write_Info - T_WRITE_TYPE write_type; - uint16_t len; - uint8_t *p_value; -} TSIMP_WRITE_MSG; -/** @} End of TSIMP_WRITE_MSG */ - - -/** @defgroup TSIMP_UPSTREAM_MSG_DATA TSIMP_UPSTREAM_MSG_DATA - * @brief Simple BLE service callback message content. - * @{ - */ -typedef union -{ - uint8_t notification_indification_index; //!< ref: @ref SIMP_Service_Notify_Indicate_Info - uint8_t read_value_index; //!< ref: @ref SIMP_Service_Read_Info - TSIMP_WRITE_MSG write; -} TSIMP_UPSTREAM_MSG_DATA; -/** @} End of TSIMP_UPSTREAM_MSG_DATA */ - -/** @defgroup TSIMP_CALLBACK_DATA TSIMP_CALLBACK_DATA - * @brief Simple BLE service data to inform application. - * @{ - */ -typedef struct -{ - uint8_t conn_id; - T_SERVICE_CALLBACK_TYPE msg_type; - TSIMP_UPSTREAM_MSG_DATA msg_data; -} TSIMP_CALLBACK_DATA; -/** @} End of TSIMP_CALLBACK_DATA */ - -/** @} End of SIMP_Service_Exported_Types */ -/*============================================================================* - * Functions - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Functions SIMP Service Exported Functions - * @brief - * @{ - */ - -/** - * @brief add Simple BLE service to application. - * - * @param[in] p_func pointer of app callback function called by profile. - * @return service ID auto generated by profile layer. - */ -T_SERVER_ID simp_ble_service_add_service(void *p_func); - -/** - * @brief Set service related data from application. - * - * @param[in] param_type parameter type to set. - * @param[in] len value length to be set. - * @param[in] p_value value to set. - * @return parameter set result. - * @retval 0 false - * @retval 1 true - */ -bool simp_ble_service_set_parameter(T_SIMP_PARAM_TYPE param_type, uint16_t len, void *p_value); - -/** - * @brief send notification of simple notify characteristic value. - * - * @param[in] conn_id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_send_v3_notify(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** - * @brief send indication of simple indicate characteristic value. - * - * @param[in] conn_id connection id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_send_v4_indicate(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** - * @brief send notification of simple notify characteristic value. - * - * @param[in] conn_id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_simple_v8_notify(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, - uint16_t length); - -/** - * @brief send indication of simple indicate characteristic value. - * - * @param[in] conn_id connection id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_simple_v8_indicate(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** @} End of SIMP_Service_Exported_Functions */ - -/** @} End of SIMP_Service */ - -/** @} End of Bluetooth_Services */ - -/** @} End of PROFILE_API */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SIMPLE_BLE_SERVICE_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/gap_test_app.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/gap_test_app.h deleted file mode 100644 index 1602c48e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/gap_test_app.h +++ /dev/null @@ -1,139 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file gap_test_app.h - * @brief GAP roles test application implementation - * @author jane - * @date 2017-06-06 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ - -#ifndef _GAP_TEST_APP_H_ -#define _GAP_TEST_APP_H_ - -#ifdef __cplusplus -extern "C" { -#endif -/*============================================================================* - * Header Files - *============================================================================*/ -#include "app_flags.h" -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include "profile_client.h" -#endif -#include -#include -#if F_BT_LE_PRIVACY_SUPPORT -#include -#endif - -typedef enum -{ - GAP_TC_00_NORMAL = 0, - GAP_TC_01_ANCS = 1, - GAP_TC_02_GAPS_WRITEABLE = 2, - GAP_TC_03_PRIVACY = 3, - GAP_TC_04_PIN_CODE = 4, - GAP_TC_05_BT5 = 5, - GAP_TC_07_CCCD = 7, - GAP_TC_08_LOCAL_IRK = 8, - GAP_TC_09_SLAVE_LATENCY = 9, - GAP_TC_10_BT41 = 10, - GAP_TC_11_MIN_REM_SCA = 11, - GAP_TC_12_GAP_MSG_CALLBACK = 12, - GAP_TC_13_V3_V8_TX = 13, - GAP_TC_14_SRV_CHANGE = 14, - GAP_TC_15_HID_PROFILE = 15, -} T_GAP_TEST_CASE; - -typedef struct -{ - uint8_t v3_tx_idx; - uint8_t v3_tx_conn_id; - uint8_t v3_tx_len; - uint16_t v3_tx_num; - uint16_t v3_tx_cmp_num; - uint16_t v3_rx_num; - uint16_t v3_tx_cnt; - uint16_t v8_tx_cnt; - uint16_t v8_rx_num; -} T_GAP_V3_NOTIF_TEST; - -/*============================================================================* - * Variables - *============================================================================*/ -extern T_GAP_TEST_CASE gap_test_case; -extern T_GAP_V3_NOTIF_TEST gap_v3_notif_test; -#if F_BT_LE_GATT_CLIENT_SUPPORT -extern T_CLIENT_ID gaps_client_id; /**< Simple ble service client id*/ -extern T_CLIENT_ID simple_ble_client_id; /**< gap service client id*/ -#if APP_GENERAL_CLIENT_TEST -extern T_CLIENT_ID gcs_client_id; -#endif -#endif -extern T_SERVER_ID simp_srv_id; /**< Simple ble service id*/ -extern T_SERVER_ID hid_srv_id; -#if F_BT_LE_PRIVACY_SUPPORT -extern T_PRIVACY_ADDR_RESOLUTION_STATE app_privacy_resolution_state; -#endif -/*============================================================================* - * Functions - *============================================================================*/ - -/** - * @brief All the application messages are pre-handled in this function - * @note All the IO MSGs are sent to this function, then the event handling - * function shall be called according to the MSG type. - * @param[in] io_msg IO message data - * @return void - */ -void app_handle_io_msg(T_IO_MSG io_msg); -/** - * @brief Callback for gap le to notify app - * @param[in] cb_type callback msy type @ref GAP_LE_MSG_Types. - * @param[in] p_cb_data point to callback data @ref T_LE_CB_DATA. - * @retval result @ref T_APP_RESULT - */ -T_APP_RESULT app_gap_callback(uint8_t cb_type, void *p_cb_data); - -/** - * @brief Callback will be called when data sent from profile client layer. - * @param client_id the ID distinguish which module sent the data. - * @param conn_id connection ID. - * @param p_data pointer to data. - * @retval result @ref T_APP_RESULT - */ -#if F_BT_LE_GATT_CLIENT_SUPPORT -T_APP_RESULT app_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); -#if APP_GENERAL_CLIENT_TEST -T_APP_RESULT gcs_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); -#endif -#endif -T_APP_RESULT app_profile_callback(T_SERVER_ID service_id, void *p_data); - -void app_gap_common_callback(uint8_t cb_type, void *p_cb_data); -void app_gap_vendor_callback(uint8_t cb_type, void *p_cb_data); - -#if F_BT_GAPS_CHAR_WRITEABLE -T_APP_RESULT gap_service_callback(T_SERVER_ID service_id, void *p_para); -#endif - -#if F_BT_LE_PRIVACY_SUPPORT -void app_privacy_callback(T_PRIVACY_CB_TYPE type, T_PRIVACY_CB_DATA cb_data); -#endif - -#if F_BT_LE_4_1_CBC_SUPPORT -T_APP_RESULT app_credit_based_conn_callback(uint8_t cbc_type, void *p_cbc_data); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/link_mgr.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/link_mgr.h deleted file mode 100644 index 4813dd64..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/link_mgr.h +++ /dev/null @@ -1,79 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file link_mgr.h - * @brief Define multilink manager struct and functions. - * @author jane - * @date 2017-06-06 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _LINK_MANAGER_H_ -#define _LINK_MANAGER_H_ -/*============================================================================* - * Header Files - *============================================================================*/ -#include "app_flags.h" -#include -#include -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include "profile_client.h" -#endif -/*============================================================================* - * Constants - *============================================================================*/ -/** @brief Define links number. range: 0-4 */ -#define APP_HDL_CACHE_LEN 24/** @brief Define device list table size. */ -#define APP_MAX_DEVICE_INFO 15 -typedef struct -{ - uint16_t uuid16; - uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ - uint8_t bd_type; /**< remote BD type*/ - uint8_t reserved[3]; /**< used to T_GATT_SERVER_DATABASE_INFO four byte alignment*/ - uint16_t hdl_cache[APP_HDL_CACHE_LEN]; -} T_GATT_SERVER_DATABASE_INFO; -/** - * @brief Application Link control block defination. - */ -typedef struct -{ - T_GAP_CONN_STATE conn_state; /**< Connection state. */ -#if F_BT_LE_GATT_CLIENT_SUPPORT - T_CLIENT_ID client_id; -#endif - uint8_t end_handle_idx; - uint8_t disc_state; - uint8_t state; - T_GATT_SERVER_DATABASE_INFO server_info; -} T_APP_LINK; -/** - * @brief Device list block defination. - */ -typedef struct -{ - uint8_t bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */ - uint8_t bd_type; /**< remote BD type*/ -} T_DEV_INFO; -/*============================================================================* - * Variables - *============================================================================*/ -/** @brief App link table */ -extern T_APP_LINK app_link_table[APP_MAX_LINKS]; -/** @brief Device list table, used to save discovered device informations. */ -extern T_DEV_INFO dev_list[APP_MAX_DEVICE_INFO]; -/** @brief The number of device informations saved in dev_list. */ -extern uint8_t dev_list_count; - -/*============================================================================* - * Functions - *============================================================================*/ -bool link_mgr_add_device(uint8_t *bd_addr, uint8_t bd_type); -void link_mgr_clear_device_list(void); - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/user_cmd.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/user_cmd.h deleted file mode 100644 index c1615aa2..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/gap_test/user_cmd.h +++ /dev/null @@ -1,31 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************** -* @file user_cmd.h -* @brief Define user command. -* @details -* @author jane -* @date 2016-02-18 -* @version v0.1 -********************************************************************************************************* -*/ -#ifndef _USER_CMD_H_ -#define _USER_CMD_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -extern const T_USER_CMD_TABLE_ENTRY user_cmd_table[]; -extern T_USER_CMD_IF user_cmd_if; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp.h deleted file mode 100644 index 5861faa0..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp.h +++ /dev/null @@ -1,289 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2014, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file aci_if.h -* @brief some macro/struct/functions declaration of aci interface -* @details none. -* @author tifnan -* @date 2014-10-17 -* @version v0.1 -* ********************************************************************************************************* -*/ - -#ifndef _HRP_H_ -#define _HRP_H_ - -/**************************************************************************** - * includes - ****************************************************************************/ - -#include -#include -#include - -#define HRP_SUB_TYPE 1 /* 0:sdk-v0,acut,bb3-dev; 1:sdk-v1,bcut */ -#define ACI_EN 0 - -#ifdef TEST_PROFILE -/* select which profiles to be tested */ - -#define LTP_TEST_APP 1 -#if LTP_TEST_APP -#define LTP_TEST_AVRCP 1 // 1 -- built success -#define LTP_TEST_A2DP 1 -#define LTP_TEST_HFP 1 -#define LTP_TEST_KEY_MGR 1 -#define LTP_TEST_GAP 1 -#define LTP_TEST_SPP 1 - -#define LE_SUPPORT 1 - -#else -#define LTP_TEST_AVRCP 0 // 1 -- built success -#define LTP_TEST_A2DP 0 -#define LTP_TEST_HFP 0 -#define LTP_TEST_KEY_MGR 0 -#define LTP_TEST_GAP 0 -#define LTP_TEST_SPP 0 -#endif -#endif - -/* buffer size */ -#define RX_BUFFER_SIZE 0x800 //must be 2^n,because {x&(RX_BUFFER_SIZE-1)} -#define RX_DISABLE_COUNT 0x200 -#define TX_BUFFER_SIZE1 0x400 //lorna change 0x200 --> 0x400 8K -#define RX_HANDLE_BUFFER_SIZE 0x400 - -#define BTLTP_DEFAULT_COPMSK 0x80 /* enable CRC */ - -#define BTHRP_ACTION_POOL_SIZE (2) /* enough */ -#define BT_GATT_SERVER_MAX_SERVICES_COUNT 8 -#define BTIF_MDL_COUNT 4 - -#define LTP_ACT_INFO_FLAG_ACT_INFO 0x01 -#define LTP_ACT_INFO_FLAG_GAP_REG 0x02 - -#ifdef TEST_PROFILE -#define LTP_ACT_INFO_FLAG_ALL (LTP_ACT_INFO_FLAG_ACT_INFO) -#else -#define LTP_ACT_INFO_FLAG_ALL (LTP_ACT_INFO_FLAG_ACT_INFO|LTP_ACT_INFO_FLAG_GAP_REG) -#endif - -#define BTIF_L2C_COUNT 6 -#define BT_MAX_MTU_SIZE 1021 //lorna change 335-->672-->1021 -#define BTLTP_US_BUFFER_SIZE (BT_MAX_MTU_SIZE + 32) -#define BTLTP_MAX_MSG_SIZE 1021 //lornachange 361-->672-->1021 - -#define BTHRP_QUEUE_ELEMENT_COUNT 10 - -#define LTP_TRACE_NONE 0 -#define LTP_TRACE_ERROR 1 -#define LTP_TRACE_INFO 2 -#define LTP_TRACE_DEBUG 3 -#define LTP_TRACE_ALL 4 - -/******************************** the define of events ltp used **********************************/ -#define LTP_EVENT_BTIF_MESSAGE 0x10 /* BTIF message */ -#define LTP_EVENT_UART_RX 0x21 /* data available */ -#define LTP_EVENT_UART_TX 0x12 /* transmit request */ -#define LTP_EVENT_UART_TX_COMPLETED 0x13 /* transmit completed */ -#define LTP_EVENT_PROFILE_MESSAGE 0x14 /* spp tx innner data event */ -#define LTP_EVENT_BTIF_L2C_DATA_RSP 0x15 /* l2cap tx innner data event */ -#define LTP_EVENT_MPA_L2C_DATA_RSP 0x16 /* l2cap tx innner data event */ - -/****************************************************************************/ -/* state */ -/****************************************************************************/ -typedef enum _TBTHrpState -{ - btltpStateInit, - btltpStateRegistering, - btltpStateIdle, - btltpStateReleasing, - btltpStateCount -} T_BT_HRP_STATE; - -/****************************************************************************/ -/* Tx Buffer callback handling */ -/****************************************************************************/ - -typedef enum -{ - btltpActionNotUsed, - btltpActionExit, - btltpActionReset, - btltpActionSendDataConf, - btltpActionSendDIDDeviceConf, - btltpActionSendSDPEndpointConf, - btltpActionReleaseBuffer -} TBTLtpActionCommand; - -typedef enum -{ - LTPProfileSppTxData -} TProfileEvent; - -typedef struct -{ - void *pBuffer; - uint32_t p_srv_handle; -} TBTLtpServiceAction; - -typedef union -{ - uint8_t *pReleaseBuffer; - uint16_t MDL_ID; - TBTLtpServiceAction serviceAction; -} TBTLtpActionData; - -typedef struct -{ - TBTLtpActionCommand Action; - TBTLtpActionData p; -} T_BT_HRP_ACTION; -typedef T_BT_HRP_ACTION *P_BT_HRP_ACTION; - -#define API_TYPE_GATT_SEND_VENDOR_HCI_CMD 3 -typedef struct _TApiBufVendorCmd -{ - uint16_t op; - uint8_t len; - uint8_t *para; -} TApiBufVendorCmd; - -typedef struct _TApiBufUserDefined -{ - uint16_t Type; - union - { - TApiBufVendorCmd ApiBufVendorCmd; - } p; -} TApiBufUserDefined; - - -/* Ltp data struct */ -typedef struct _TData -{ - uint8_t *pBuffer; - uint32_t Length; -} T_HRP_DATA; - - -/** @brief tcb to manage tx buffer */ -typedef struct -{ - uint16_t - tx_blk_idx; /* sending block index [0 -- TX_BUFFER_SIZE_MASK](block is sending now ) */ - uint16_t tx_free_blk_idx; /* free tx block index [0----TX_BUFFER_SIZE_MASK] */ - uint16_t tx_un_used_size; /* size of block which is discarded */ - uint16_t free_size; /* bytes can be used */ -} TxMemTCB, *PTxMemTCB; - -/** @brief aci control struct */ -typedef struct _ACI_TCB -{ - T_HRP_DATA TxData; - void *Handle; /* task handle */ - void *UarthandleEvent; /* task queue */ - void *QueueHandleEvent; /* task queue */ - void *QueueHandleMessage; /* message queue */ - void *QueueHandleTxData; /* Tx queue */ - void *QueueHandleRxData; /* Rx queue */ - void *QueueHandleTxRel; /* tx buffer release queue */ - uint32_t RxDataIndication; /* pending responses */ - uint32_t RxDataLength; - uint32_t RxOffset; - uint16_t RxReadIndex; - uint16_t RxWriteIndex; - uint8_t *p_rx_buf; /* pointer to the rx buffer allocated dynamically */ - uint8_t *p_tx_buf; /* pointer to the tx buffer allocated dynamically */ - uint8_t *p_rx_handle_buf; /* buffer address, handle uart rx data */ - uint8_t *P_RxBuffer; /* for rx */ - TxMemTCB tx_mem_tcb; /* manage tx bufer */ - - bool RxDisabled; - bool TxDisabled; -} ACI_TCB, *P_ACI_TCB; - -typedef struct _TBTHrp -{ - uint8_t *p_send_buffer; /* for saving the address of tx buffer */ - HRP_QUEUE_T FreeElementQueue; - - T_BT_HRP_STATE State; - -#if 0 - T_BT_HRP_MDL_CONTEXT MDLContextPool[BTIF_MDL_COUNT]; - - T_BT_HRP_L2C_CONTEXT L2cContextPool[BTIF_L2C_COUNT]; - uint16_t current_trx_cid; /* added for br/edr l2cap throughput test*/ - uint16_t current_trx_data_len; /* added for br/edr l2cap throughput test*/ -#endif - - void *QueueHandleProfileMessage; - - /* Buffer callback Action Handling */ - T_BT_HRP_ACTION ActionPool[BTHRP_ACTION_POOL_SIZE]; - P_BT_HRP_ACTION pBufferAction; - /* LTP re-assemble */ - uint8_t *pMsgBuffer; - T_HRP_LIB HRPLib; - T_HRP_ELEMENT ElementPool[BTHRP_QUEUE_ELEMENT_COUNT]; - /* COM interface */ - uint8_t ActInfoFlags; - uint8_t ownBDAddress[6]; - - uint8_t service_register_idx; - // TGattServiceTable gattServiceTable[BT_GATT_SERVER_MAX_SERVICES_COUNT]; //use for ACI - void *gattServiceHandle[BT_GATT_SERVER_MAX_SERVICES_COUNT];//use for LTP - - P_ACI_TCB p_aci_tcb; - uint16_t le_ds_pool_id; - uint16_t le_ds_data_offset; - uint8_t le_ds_credits; -} T_BT_HRP; -typedef T_BT_HRP *P_BT_HRP; - -typedef struct _TAciConfig -{ - uint8_t ltp_interface : 2; - uint8_t ltp_wake_up_pin_en : 1; - uint8_t ltp_trace_level: 3; - uint8_t reserved: 2; - - uint8_t uart_flow_control_en: 1; - uint8_t uart_word_len: 1; - uint8_t uart_parity: 2; - uint8_t reserved2: 4; - - /* ltp uart pin configuration */ - uint8_t uart_tx_pin_index; - uint8_t uart_rx_pin_index; - uint8_t uart_cts_pin_index; - uint8_t uart_rts_pin_index; - uint8_t gpio_h_pin_index; - uint8_t gpio_b_pin_index; - - uint32_t uart_baudrate; - - /* ltp spi pin configuration */ - uint8_t spi_mosi_pin_index; - uint8_t spi_miso_pin_index; - uint8_t spi_cs_pin_index; - uint8_t spi_clk_pin_index; - uint8_t spi_int_pin_index; /* used to notify master to read data drom bee */ - - uint8_t reserved3[7]; - -} TAciConfig; -typedef TAciConfig *PAciConfig; -extern PAciConfig P_AciConfig; -extern P_BT_HRP P_BtHrp; - -/* hrp_application.c */ -extern void hrp_buffer_release(void *pBuffer); -extern void hrp_write(uint8_t *p_buf, uint32_t buf_len); - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_app_flags.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_app_flags.h deleted file mode 100644 index 9eed223e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_app_flags.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _HRP_APP_FLAGS_H_ -#define _HRP_APP_FLAGS_H_ - -#include "bt_flags.h" - -/** @brief Config APP LE link number */ -#define APP_MAX_LINKS 3 - -#define F_BT_DLPS_EN 0 -#define F_BT_LE_BTIF_SUPPORT (F_BT_LE_SUPPORT && 1) - -#define F_BT_CONFIG_INTERNAL_API 1 - -//add for compile error -#define B_ADDR_LEN 6 -#define REMOTE_FEATURES_LEN 8 - -#define F_BT_PATCH_CHANGE_BOND_INFO 1 -#define F_BT_PATCH_SRV_CHANGE_IND 1 -#define F_BT_PATCH_ADD_PRIVACY_API 1 - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_application.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_application.h deleted file mode 100644 index b15212a5..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_application.h +++ /dev/null @@ -1,46 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2014, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file aci_service_handle.h -* @brief low power handle when using ACI. -* @details none. -* @author tifnan -* @date 2014-11-19 -* @version v0.1 -* ********************************************************************************************************* -*/ - -#ifndef _LTPLIB_APPLICATION_H_ -#define _LTPLIB_APPLICATION_H_ -#include - -#define MAX_NUMBER_OF_RX_EVENT 0x40 -#define MAX_NUMBER_OF_MESSAGE 0x20 -#define MAX_NUMBER_OF_TX_DATA 12 -#define MAX_NUMBER_OF_TX_REL MAX_NUMBER_OF_TX_DATA -#define MAX_NUMBER_OF_RX_DATA 12 -#define MAX_NUMBER_OF_GAP_TIMER 0x10 -#define BLT_MAX_NUMBER_OF_RX_EVENT 0x20 -#define BLT_MAX_NUMBER_OF_IO_EVENT 0x20 -#define MAX_NUMBER_OF_PROFILE_MSG 0x10 - -typedef enum -{ - HRP_STATUS_IDLE = 0, - HRP_STATUS_RESET = 1, - HRP_STATUS_ACTIVE = 2, -} T_HRP_STATUS; - - -uint8_t hrp_init(void); -uint8_t hrp_task_init(void); -void hrp_system_reset(void); -void hrp_timer_cb(void *xtimer); - -extern T_HRP_STATUS system_status; -extern HRP_MODULE_ID active_module; -extern P_BT_HRP P_BtHrp; -bool hrp_send_event(const unsigned char *pEvent); - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_module_id.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_module_id.h deleted file mode 100644 index 804db690..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_module_id.h +++ /dev/null @@ -1,47 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2014, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file aci_service_handle.h -* @brief low power handle when using ACI. -* @details none. -* @author tifnan -* @date 2014-11-19 -* @version v0.1 -* ********************************************************************************************************* -*/ - -#ifndef _LTPLIB_MODULE_ID_H_ -#define _LTPLIB_MODULE_ID_H_ - -typedef enum _HRP_MODULE_ID -{ - HRP_MODULE_RESERVED = 0, - HRP_MODULE_LOWER_STACK = 1, - HRP_MODULE_UPPER_STACK = 2, - HRP_MODULE_PROFILE = 3, - HRP_MODULE_RESERVED1, - - HRP_MODULE_AUDIO = 16, - HRP_MODULE_BLE_AUTO_TEST = 17, - - -} HRP_MODULE_ID; - -/************************************************/ -typedef enum -{ - HRP_BTIF_CMD_GROUP_STACK = 0, - HRP_BTIF_CMD_GROUP_SYSTEM = 1, -} HRP_BTIF_CMD_GROUP; - - - -/************************************************/ - - - - - - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_utils.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_utils.h deleted file mode 100644 index 14b1db54..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/application/hrp_utils.h +++ /dev/null @@ -1,505 +0,0 @@ -#ifndef _LTPLIB_UTILS_H_ -#define _LTPLIB_UTILS_H_ - -#include -#include - - - - -typedef enum _HRP_MODULE_ID -{ - HRP_MODULE_RESERVED = 0, - HRP_MODULE_LOWER_STACK = 1, - HRP_MODULE_UPPER_STACK = 2, - HRP_MODULE_PROFILE = 3, - HRP_MODULE_RESERVED1, - - HRP_MODULE_AUDIO = 16, - HRP_MODULE_BLE_AUTO_TEST = 17, - - -} HRP_MODULE_ID; - -bool hrp_handle_downstream_req(HRP_MODULE_ID module_id, uint8_t cmd_group, - uint16_t cmd_index, uint16_t param_list_len, uint8_t *p_param_list); - -bool hrp_handle_upperstream_events(HRP_MODULE_ID module_id, uint8_t cmd_group, - uint16_t cmd_index, uint16_t param_list_len, uint8_t *p_param_list); - - - -/****************************************************************************/ -/* target specific application context to be handed over to the application */ -/* this constand is used by the BTLTPTgtxxx function calls of this library */ -#define HRP_TGT_APPHANDLE void * - - -/* definition of valid LTP response causes */ -#define HRP_CAUSE_SUCCESS 0x00 -#define HRP_CAUSE_ACCEPT 0x01 -#define HRP_CAUSE_REJECT 0x02 -#define HRP_CAUSE_RESOURCE_ERROR 0x03 -#define HRP_CAUSE_INVALID_PARAMETER 0x04 -#define HRP_CAUSE_INVALID_STATE 0x05 -#define HRP_CAUSE_CONNECTION_DISCONNECT 0x06 -#define HRP_CAUSE_CONNECTION_DISCONNECTED LTP_CAUSE_CONNECTION_DISCONNECT -#define HRP_CAUSE_CONNECTION_LOST 0x07 -#define HRP_CAUSE_AUTHENTICATION_FAILED 0x08 -#define HRP_CAUSE_INIT_TIMEOUT 0x09 -#define HRP_CAUSE_INIT_OUT_OF_SYNC 0x0A -#define HRP_CAUSE_INIT_HARDWARE_fAILURE 0x0B -#define HRP_CAUSE_CONNECTION_PAUSED 0x30 -#define HRP_CAUSE_FLOWCONTROL_VIOLATION 0x31 -#define HRP_CAUSE_UNSPECIFIED 0xFD -#define HRP_CAUSE_NOT_SUPPORTED 0xFE - -/* definition of locally generated internal Event types */ -#define HRP_INTERNAL_EVENT_COMMUNICATION_OUT_OF_SYNC 0x40 -#define HRP_INTERNAL_EVENT_MALFORMED_MSG_RECEIVED 0x41 -#define HRP_INTERNAL_EVENT_INVALID_DATA_RECEIVED 0x42 - - - -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/** **/ -/** 3) Internal functionality used by the LTP-Lib **/ -/** **/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ - -/* macro definition for read/write uint16_t from/to uint8_t memory */ -#define NETSHORT2CHAR(p,w) \ - *((p)+1) = (uint8_t)((w) & 0xff); \ - *(p) = /*lint -e(572,778)*/ (uint8_t)(((w)>>8) & 0xff) - -#define NETCHAR2SHORT(p) ((*((p)+1)) & 0xff) + ((*(p)) << 8) - -#define NETCHAR2LONG(p) ((uint32_t)(*((p)+3)) & 0xff) + ((uint32_t)(*((p)+2)) << 8) \ - + ((uint32_t)(*((p)+1)) << 16) + ((uint32_t)(*((p)+0)) << 24) - -#define NET24BIT2CHAR(p,w) \ - *((p)+2) = (uint8_t)((w) & 0xff); \ - *((p)+1) = /*lint -e(572,778)*/ (uint8_t)(((w)>>8) & 0xff); \ - *((p)+0) = /*lint -e(572,778)*/ (uint8_t)(((w)>>16) & 0xff); \ - -#define NETLONG2CHAR(p,w) \ - *((p)+3) = (uint8_t)((w) & 0xff); \ - *((p)+2) = /*lint -e(572,778)*/ (uint8_t)(((w)>>8) & 0xff); \ - *((p)+1) = /*lint -e(572,778)*/ (uint8_t)(((w)>>16) & 0xff); \ - *((p)+0) = /*lint -e(572,778)*/ (uint8_t)(((w)>>24) & 0xff) - - -/* macro definition to identity internal event location */ -#define HRP_GENERATE_EVENT_ID ((0x00)<<24 | (((LTP_SOURCE_FILE_ID) & 0xFF)<<16) | ((__LINE__) & 0xFFFF)) - -/* message definitions */ -#define HRP_DATA_MIN_HEADER_LENGTH 7 -#define HRP_OPT_MASK_HEADER_CRC 0x03 -#define HRP_OPT_MASK_HEADER_CRC8 0x01 - -#define HRP_OPCODE_RESERVED 0x00 - -/* definitions of message properties */ -#define LTP_MDC_MSG 0x01 -#define LTP_MDH_MSG 0x02 -#define LTP_VAR_LEN_MSG 0x04 -#define LTP_CNF_MSG 0x08 - - - - -#ifdef __cplusplus -extern "C" { -#endif - -/* needed message structures */ - -/* data structure to describe message properties */ -typedef struct -{ - uint8_t opcode; - uint8_t length; - uint8_t properties; -} LTPCmdInfo; -typedef LTPCmdInfo *PLTPCmdInfo; - -/* internal Status definition for LTP-Lib */ -typedef enum -{ - HRPLibStatusIdle, /* ready to be called with 'LTPLibxxx' call*/ - HRPLibStatusResync, /* Lib is ready for re-sync */ - HRPLibStatusBusy, /* busy with 'LTPLibxxx' call (re-entrant) */ - HRPLibStatusOffSync /* Lib detected sync loss in receive data */ -} T_ENUM_HRP_STATUS; - -/* internal data container definition for LTP-Lib */ -typedef struct -{ - uint16_t Offset; /* offset to data in data buffer */ - uint16_t Length; /* length of data */ - uint8_t *BufferAddress; /* buffer address */ -} T_HRP_DATA_CB; -typedef T_HRP_DATA_CB *LTP_DATA_CB_P; - -/* internal data container definition for queue elements */ -struct hrpQueueElement /* dummy definition */ -{ - struct hrpQueueElement *Next; /* point to next element */ - uint8_t data[2]; /* user data */ -}; -typedef struct hrpQueueElement T_HRP_QUEUE_ELEMENT; -typedef T_HRP_QUEUE_ELEMENT *P_HRP_ELEMENT; - -/* internal data container definition for queue elements */ -typedef struct -{ - P_HRP_ELEMENT First; /* first element */ - P_HRP_ELEMENT Last; /* last element */ - uint16_t ElementCount; /* element count */ -} HRP_QUEUE_T, *HRP_QUEUE_P; - -void hrp_queue_in(HRP_QUEUE_P QueuePtr, void *pQueueElement); -void *hrp_queue_out(HRP_QUEUE_P QueuePtr); - -/* internal queue-element for LTP-Lib for data container */ -typedef struct -{ - /* This MUST be the FIRST structure element ! */ - T_HRP_QUEUE_ELEMENT QueueElement; - /* the 'real' data... */ - T_HRP_DATA_CB DataCB; -} T_HRP_ELEMENT; -typedef T_HRP_ELEMENT *P_HRP_ElEMENT; - - - -/* internal context definition for LTP-Lib. When ever a LTP-Lib function is */ -/* called, a pointer to this context must be provided */ -typedef struct -{ - HRP_TGT_APPHANDLE AppHandle; - T_ENUM_HRP_STATUS Status; - uint16_t ReceiveOffset; - uint16_t ReceiveMaxLength; - uint16_t SendOffset; - uint16_t HRPMsgStart; - P_HRP_ElEMENT pActiveElement; - uint8_t *pHRPMsg; - uint16_t HRPMsgPos; - uint16_t HRPMsgLength; - - HRP_QUEUE_T UsedElementQueue; - uint16_t HRPDataCollected; -} T_HRP_LIB; -typedef T_HRP_LIB *P_HRP_LIB; -typedef struct -{ - uint8_t seq_id; - bool crc8; - bool crc16; -} HRP_SEQ_ID; - -void hrp_lib_trigger_hrp_proccess(P_HRP_LIB p_hrp_lib); -static bool hrp_lib_trigger(P_HRP_LIB p_hrp_lib); -static bool bt_hrp_transfer_hrp_element_data(P_HRP_LIB p_hrp_lib, uint16_t copy_length); -static void bt_hrp_crc_error(P_HRP_LIB p_hrp_lib); -bool hrp_lib_send_internal_event_info(P_HRP_LIB p_hrp_lib, uint8_t copmsk, uint8_t *p_opt, - uint8_t cause, - uint8_t event_type, uint32_t event_info); - - -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/** **/ -/** 4) Target specifics that must be implemented by the user of the LTP-Lib**/ -/** **/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ - -/****************************************************************************/ -/* uint8_t * bt_hrp_tgt_send_buffer_alloc */ -/* ( */ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* uint16_t len : size of buffer to be allocated (bytes) */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* pointer to allocated memory in case of success */ -/* NULL pointer in case of an error */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This target specific function is used to allocate buffers for LTP */ -/* messages that are send to an application with the BT_LTP_Sendxxx */ -/* functions of this library. */ -/* */ -/* TODO: please implement this function for your target */ -/* */ -/****************************************************************************/ -uint8_t *bt_hrp_tgt_send_buffer_alloc(HRP_TGT_APPHANDLE app_handle, uint16_t len); - -/****************************************************************************/ -/* uint8_t * BTLTPTgtAssemblyBfferAlloc */ -/* ( */ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* pointer to allocated memory in case of success */ -/* NULL pointer in case of no buffer available (this is no error condition) */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This target specific function is used to allocate buffers for LTP- */ -/* message assembly that is processed by functions of this library. */ -/* */ -/* TODO: please implement this function for your target */ -/* */ -/****************************************************************************/ -uint8_t *bt_hrp_tgt_assembly_buffer_alloc(HRP_TGT_APPHANDLE app_handle); - -void bt_hrp_buffer_callback(void *Handle); - -/****************************************************************************/ -/* void bt_hrp_tgt_receive_buffer_release */ -/* ( */ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* uint8_t * pBuffer : pointer to receive buffer to be released*/ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* non */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This target specific function is used to released buffers for LTP */ -/* messages that are received and consumed by the 'hrp_lib_handle_receive_data' */ -/* function of this library. */ -/* */ -/* TODO: please implement this function for your target */ -/* */ -/****************************************************************************/ -void bt_hrp_tgt_receive_buffer_release(HRP_TGT_APPHANDLE app_handle, uint8_t *pBuffer); - -/****************************************************************************/ -/* bool bt_hrp_tgt_send_hrp_message */ -/* ( */ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* uint8_t * pMsg : pointer to of LTP msg buffer to be send */ -/* uint16_t offset */ -/* uint16_t dataLen */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* true in case the message could be send successfully, */ -/* false in case the message could not be send but was dumped */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This function is used to send an LTP message to an application with the */ -/* BT_LTP_Sendxxx functions of this library */ -/* */ -/* TODO: please implement this function for your target */ -/* */ -/****************************************************************************/ -bool bt_hrp_tgt_send_hrp_message(HRP_TGT_APPHANDLE app_handle, uint8_t *pMsg, uint16_t offset, - uint16_t data_len); - -/****************************************************************************/ -/* bool bt_hrp_tgt_handle_hrp_message */ -/* ( */ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* uint8_t * pMsgBuffer: pointer to message buffer */ -/* uint8_t cmd : identifier for LTP-command to be handled*/ -/* uint8_t copmsk : copmsk of LPT-command to be handled */ -/* uint8_t * pOpt : pointer to optional parameters of LTP- */ -/* command to be handled, or NULL in case */ -/* of no optional parameters included */ -/* uint16_t lenPara : length of mandatory parameters of LTP- */ -/* command to be handled */ -/* uint8_t * pPara : pointer to mandatory parameters of LTP- */ -/* command to be handled, or NULL in case */ -/* of no mandatory parameters included */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* false in case the message buffer shall not be re-used for LTP-msg */ -/* assembly by the LTP-Lib, otherwise true */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This function is called by the LTP-Lib if a complete LTP message is */ -/* assembled and is ready to be consumed by the application */ -/* */ -/* TODO: please implement this function for your target */ -/* */ -/****************************************************************************/ -bool bt_hrp_tgt_handle_hrp_message(HRP_TGT_APPHANDLE app_handle, uint8_t *p_msg_buffer, uint8_t cmd, - uint8_t copmsk, uint8_t *p_opt, uint16_t len_para, uint8_t *p_para); - -/****************************************************************************/ -/* PLTPElement BTLTPTgtQueueElementAlloc */ -/* ( */ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* pointer to allocated queue element in case of success */ -/* NULL pointer in case of no queue element available (this is no error */ -/* condition) */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This target specific function is used to allocate queue elements for LTP-*/ -/* message assembly that is processed by functions of this library. */ -/* */ -/* TODO: please implement this function for your target */ -/* */ -/****************************************************************************/ -P_HRP_ElEMENT bt_hrp_tgt_queue_element_alloc(HRP_TGT_APPHANDLE app_handle); - -/****************************************************************************/ -/* void bt_hrp_tgt_queue_element_release */ -/* ( */ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* non */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This target specific function is used to release queue elements for LTP- */ -/* message assembly that is processed by functions of this library. */ -/* */ -/* TODO: please implement this function for your target */ -/* */ -/****************************************************************************/ -void bt_hrp_tgt_queue_element_release(HRP_TGT_APPHANDLE app_handle, P_HRP_ElEMENT p_hrp_element); - -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/** **/ -/** 5) Utility fuctions that have to be integrated for using the LTP-Lib **/ -/** **/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ - -/****************************************************************************/ -/* bool hrp_lib_initialize */ -/* ( */ -/* P_HRP_LIB pLTPLib : pointer to LTP context to be initialized*/ -/* HRP_TGT_APPHANDLE AppHandle : Handle to identify application context */ -/* uint16_t receiveOffset : offset for assembled LTP-messages */ -/* uint16_t receiveMaxLen : max len for assembled LTP-messages */ -/* uint16_t sendOffset : offset for LTP-messages to be send */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* false if an internal error occured and the lib is not functional, */ -/* true otherwise (in case of success) */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This function has to be called to initialize the LTP-Lib at system */ -/* startup and/or reset */ -/* */ -/* TODO: please integrate this function into the target implementation */ -/* */ -/****************************************************************************/ -bool hrp_lib_initialize(P_HRP_LIB p_hrp_lib, HRP_TGT_APPHANDLE app_handle, uint16_t receive_offset, - uint16_t receive_max_len, uint16_t send_offset); - -/****************************************************************************/ -/* bool hrp_lib_shutdown */ -/* ( */ -/* P_HRP_LIB pLTPLib : pointer to LTP context to be initialized*/ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* false if an internal error occured and the lib is not functional, */ -/* true otherwise (in case of success) */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This function may be called to free all resources used by LTP-Lib */ -/* */ -/* TODO: please integrate this function into the target implementation */ -/* */ -/****************************************************************************/ -bool hrp_lib_shutdown(P_HRP_LIB p_hrp_lib); - -//void hrp_lib_trigger_hrp_proccess(P_HRP_LIB pLTPLib); - -#if F_LTPLIB_ASYNC_ASSEMBLY_SUPPORT -/****************************************************************************/ -/* void LTPLibHandleTimeout */ -/* ( */ -/* P_HRP_LIB pLTPLib : pointer to LTP context to be used */ -/* TLTPTimerID timerID : timer that timed out */ -/* ) */ -/****************************************************************************/ -void hrp_lib_handle_receive_data(P_HRP_LIB p_hrp_lib, TLTPTimerID timerID); -#endif - -/****************************************************************************/ -/* bool LTPLibHandleReceiveData */ -/* ( */ -/* P_HRP_LIB pLTPLib : pointer to LTP context to be used */ -/* uint8_t * pRxBuffer : pointer to buffer that contains new data */ -/* uint16_t rxLength : length of new data received */ -/* uint16_t rxOffset : offset of new data in buffer */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* false data could NOT be handled properly, */ -/* true otherwise */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This function has to be called to introduce new rx data received into */ -/* the LTP-Lib statemachine when ever new data is received */ -/* */ -/* TODO: please integrate this function into the target implementation */ -/* */ -/****************************************************************************/ -bool hrp_lib_handle_receive_data(P_HRP_LIB p_hrp_lib, uint8_t *p_rx_buffer, uint16_t rx_length, - uint16_t rx_offset); - -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/** **/ -/** 6) Utility functions that can be used by the user of the LTP-Lib **/ -/** **/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ - - - -/****************************************************************************/ -/* uint16_t hrp_lib_insert_header */ -/* ( */ -/* P_HRP_LIB pLTPLib : pointer to LTP context to be used */ -/* uint8_t * pBuffer : pointer to data buffer containing payload */ -/* uint16_t* offset : pointer to the offset of the payload */ -/* after call: offset of the message in buffer */ -/* uint16_t dataLen : payload length in buffer */ -/* uint8_t cmd : ltp command */ -/* uint8_t copmsk : bitmask defining content of optional parameter */ -/* uint8_t * pOpt : pointer to optional parameter structure */ -/* uint16_t* posParam : after call: offset of the first parameter */ -/* ) */ -/* return:------------------------------------------------------------------*/ -/* length of the ltp message in pBuffer beginning from *offset */ -/* if length is 0, the header could not be inserted */ -/* */ -/* Description:-------------------------------------------------------------*/ -/* This function can be used to insert a LTP message header with optional */ -/* parameters infront of a given message buffer with payload */ -/* */ -/****************************************************************************/ - - -#ifdef __cplusplus -} -#endif - -#endif /* LTPLIB_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif.h deleted file mode 100644 index 1a0a9351..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif.h +++ /dev/null @@ -1,7708 +0,0 @@ -/** - * Copyright (c) 2017, Realsil Semiconductor Corporation. All rights reserved. - */ - -#ifndef _BTIF_H_ -#define _BTIF_H_ - -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup STACK STACK - * \defgroup BTIF BTIF - * - * \brief Define parameters and structures used in Bluetooth stack APIs or messages. - * \details The BTIF module provide parameters and structure definitions that - * can be used in Bluetooth stack APIs and upstream messages that Bluetooth - * stack sent to APP. APIs such as release btif message buffers are also - * provided here.\n - * - * \ingroup STACK - */ - -/** - * - * \ingroup BTIF - */ -#define BTIF_NAME_LENGTH 40 /**< Max length of device name. */ - -/** - * btif.h - * - * \name BTIF_AUTHEN_FLAGS - * \brief Btif authentication support flags. - * \anchor BTIF_AUTHEN_FLAGS - */ -/** - * \ingroup BTIF - */ -#define BTIF_AUTHEN_BONDING 0x0001 /**< Dedicated bonding support. */ -#define BTIF_AUTHEN_GENERAL_BONDING 0x0002 /**< General bonding support. */ -#define BTIF_AUTHEN_MITM 0x0004 /**< MITM support. */ -#define BTIF_AUTHEN_SC 0x0008 /**< LE secure connections support. */ -#define BTIF_AUTHEN_KEY_PRESS 0x0010 /**< Keypress support. */ -#define BTIF_AUTHEN_FORCE_BONDING 0x0100 /**< Always force bonding. */ -#define BTIF_AUTHEN_SC_ONLY 0x0200 /**< Secure connections only mode support. */ -#define BTIF_AUTHEN_SC_BR 0x0400 /**< BR/EDR secure connections support. */ - -#define BTIF_LE_MAX_EXTENDED_SCAN_PHY_NUM 2 -#define BTIF_LE_MAX_EXTENDED_ADV_SETS_NUM 4//max is 63 by core spec -#define BTIF_LE_MAX_INIT_PHYS_NUM 3 - -#define LE_ADV_CHANNEL_37 0x01 /**< Enable channel 37 */ -#define LE_ADV_CHANNEL_38 0x02 /**< Enable channel 38 */ -#define LE_ADV_CHANNEL_39 0x04 /**< Enable channel 39 */ -#define LE_ADV_CHANNEL_ALL 0x07 /**< Enable all channels */ - -/* PairingReq / PairingRsp initKeyDist/respKeyDist */ -#define BTIF_LE_SMP_DIST_ENC_KEY 0x01 -#define BTIF_LE_SMP_DIST_ID_KEY 0x02 -#define BTIF_LE_SMP_DIST_SIGN_KEY 0x04 -#define BTIF_LE_SMP_DIST_LINK_KEY 0x08 - -#define BTIF_LE_CONN_INIT_PHY_1M 0x01 -#define BTIF_LE_CONN_INIT_PHY_2M 0x02 -#define BTIF_LE_CONN_INIT_PHY_CODED 0x04 - -#define BTIF_LE_TX_POWER_UNKNOWN 127 -#define BTIF_USE_LE_FIXED_DISPLAY_VALUE 0x80000000 - -/** -If extended advertising PDU types are being used (bit 4 = 0) then: -1. The advertisement shall not be both connectable and scannable. -2. High duty cycle directed connectable advertising shall not be used (bit 3 = 0). -*/ -#define BTIF_ADV_EVENT_PROP_CONNECTABLE_ADV 0x01 -#define BTIF_ADV_EVENT_PROP_SCANNABLE_ADV 0x02 -#define BTIF_ADV_EVENT_PROP_DIRECTED_ADV 0x04 -#define BTIF_ADV_EVENT_PROP_HDC_DIRECTED_ADV 0x08 -#define BTIF_ADV_EVENT_PROP_USE_LEGACY_ADV 0x10 -#define BTIF_ADV_EVENT_PROP_OMIT_ADV_ADDR 0x20 -#define BTIF_ADV_EVENT_PROP_INCLUDE_TX_POWER 0x40 - -#define BTIF_EXT_ADV_REPORT_CONNECTABLE_ADV 0x01 -#define BTIF_EXT_ADV_REPORT_SCANNABLE_ADV 0x02 -#define BTIF_EXT_ADV_REPORT_DIRECTED_ADV 0x04 -#define BTIF_EXT_ADV_REPORT_SCAN_RESPONSE 0x08 -#define BTIF_EXT_ADV_REPORT_USE_LEGACY_ADV 0x10 - -#define BTIF_LE_SCAN_PHY_LE_1M 0x01 -#define BTIF_LE_SCAN_PHY_LE_CODED 0x04 - -#define BTIF_LE_ALL_PHY_NO_PREFERENCE_TX 0x01 -#define BTIF_LE_ALL_PHY_NO_PREFERENCE_RX 0x02 - -#define BTIF_LE_TX_PHY_PREFERENCE_1M 0x01 -#define BTIF_LE_TX_PHY_PREFERENCE_2M 0x02 -#define BTIF_LE_TX_PHY_PREFERENCE_CODED 0x04 - -#define BTIF_LE_RX_PHY_PREFERENCE_1M 0x01 -#define BTIF_LE_RX_PHY_PREFERENCE_2M 0x02 -#define BTIF_LE_RX_PHY_PREFERENCE_CODED 0x04 - -/** - * btif.h - * - * \name BTIF_BR_SEC - * \brief Btif BR/EDR security requirement flags. - * \anchor BTIF_BR_SEC - */ -/** - * \ingroup BTIF - */ -#define BTIF_BR_SEC_OUTGOING 0x01 /**< Request for outgoing connection. */ -#define BTIF_BR_SEC_AUTHEN 0x02 /**< Authentication is required. */ -#define BTIF_BR_SEC_MITM 0x04 /**< MITM authentication is required, only possible if authentication is set. */ -#define BTIF_BR_SEC_AUTHOR 0x08 /**< User level authorization is required. */ -#define BTIF_BR_SEC_ENCRYPT 0x10 /**< Encryption on link is required, only possible if authentication is set. */ -#define BTIF_BR_SEC_SECURE_CONNECTIONS 0x20 /**< Secure connections is required. */ - -/** - * btif.h - * - * \name BTIF_BR_LINK_POLICY - * \brief Btif BR/EDR link policy. - * \anchor BTIF_BR_LINK_POLICY - */ -/** - * \ingroup BTIF - */ -#define BTIF_BR_LINK_POLICY_DISABLE_ALL 0x00 /**< Disable all link policies for BR/EDR link. */ -#define BTIF_BR_LINK_POLICY_ENABLE_ROLE_SWITCH 0x01 /**< Only enable role switch for BR/EDR link. */ -#define BTIF_BR_LINK_POLICY_ENABLE_SNIFF_MODE 0x04 /**< Only enable sniff mode for BR/EDR link. */ - -/** - * btif.h - * - * \name BTIF_BR_ACL_PKT_TYPE - * \brief Btif BR/EDR ACL link packet type. - * \anchor BTIF_BR_ACL_PKT_TYPE - */ -/** - * \ingroup BTIF - */ -#define BTIF_PKT_TYPE_NO_2DH1 0x0002 /**< Packet type 2DH1 shall not be used. */ -#define BTIF_PKT_TYPE_NO_3DH1 0x0004 /**< Packet type 3DH1 shall not be used. */ -#define BTIF_PKT_TYPE_DM1 0x0008 /**< Packet type DM1 may be used. */ -#define BTIF_PKT_TYPE_DH1 0x0010 /**< Packet type DH1 may be used. */ -#define BTIF_PKT_TYPE_NO_2DH3 0x0100 /**< Packet type 2DH3 shall not be used. */ -#define BTIF_PKT_TYPE_NO_3DH3 0x0200 /**< Packet type 3DH3 shall not be used. */ -#define BTIF_PKT_TYPE_DM3 0x0400 /**< Packet type DM3 may be used. */ -#define BTIF_PKT_TYPE_DH3 0x0800 /**< Packet type DH3 may be used. */ -#define BTIF_PKT_TYPE_NO_2DH5 0x1000 /**< Packet type 2DH5 shall not be used. */ -#define BTIF_PKT_TYPE_NO_3DH5 0x2000 /**< Packet type 3DH5 shall not be used. */ -#define BTIF_PKT_TYPE_DM5 0x4000 /**< Packet type DM5 may be used. */ -#define BTIF_PKT_TYPE_DH5 0x8000 /**< Packet type DH5 may be used. */ - -/** - * btif.h - * - * \name BTIF_BR_SCO_PKT_TYPE - * \brief Btif BR/EDR SCO link packet type. - * \anchor BTIF_BR_SCO_PKT_TYPE - */ -/** - * \ingroup BTIF - */ -#define BTIF_PKT_TYPE_HV1 0x0001 /**< Packet type HV1 may be used. */ -#define BTIF_PKT_TYPE_HV2 0x0002 /**< Packet type HV2 may be used. */ -#define BTIF_PKT_TYPE_HV3 0x0004 /**< Packet type HV3 may be used. */ -#define BTIF_PKT_TYPE_EV3 0x0008 /**< Packet type EV3 may be used. */ -#define BTIF_PKT_TYPE_EV4 0x0010 /**< Packet type EV4 may be used. */ -#define BTIF_PKT_TYPE_EV5 0x0020 /**< Packet type EV5 may be used. */ -#define BTIF_PKT_TYPE_NO_2EV3 0x0040 /**< Packet type 2EV3 shall not be used. */ -#define BTIF_PKT_TYPE_NO_3EV3 0x0080 /**< Packet type 3EV3 shall not be used. */ -#define BTIF_PKT_TYPE_NO_2EV5 0x0100 /**< Packet type 2EV5 shall not be used. */ -#define BTIF_PKT_TYPE_NO_3EV5 0x0200 /**< Packet type 3EV5 shall not be used. */ - -/** - * btif.h - * - * \name BTIF_BR_L2CAP_MODE - * \brief Btif BR/EDR L2CAP mode. - * \anchor BTIF_BR_L2CAP_MODE - */ -/** - * \ingroup BTIF - */ -#define BTIF_L2C_MODE_BASIC (1 << 0x00) /**< L2CAP channel mode: basic mode. */ -#define BTIF_L2C_MODE_ERTM (1 << 0x03) /**< L2CAP channel mode: enhanced retransmission mode. */ - -/** - * btif.h - * - * \name BTIF_BR_L2CAP_REJ_MODE - * \brief Btif BR/EDR L2CAP rej mode in ERTM. - * \anchor BTIF_BR_L2CAP_REJ_MODE - */ -/** - * \ingroup BTIF - */ -#define BTIF_L2C_ERTM_REJ 0x00 /**< Use REJ for L2CAP ERTM mode. */ -#define BTIF_L2C_ERTM_SREJ 0x01 /**< Use SREJ for L2CAP ERTM mode. */ - -/** - * btif.h - * - * \name BTIF_BR_AIR_MODE - * \brief Btif transmit air coding format on SCO/eSCO link. - * \anchor BTIF_BR_AIR_MODE - */ -/** - * \ingroup BTIF - */ -/**@{*/ -#define BTIF_AIR_MODE_U_LAW 0 /**< Air mode u-law log. */ -#define BTIF_AIR_MODE_A_LAW 1 /**< Air mode A-law log. */ -#define BTIF_AIR_MODE_CVSD 2 /**< Air mode CVSD. */ -#define BTIF_AIR_MODE_TRANSPARENT 3 /**< Air mode transparent data. */ -/**@}*/ - -/** - * btif.h - * - * \brief Btif cause used for response messages to tell results of request. - * Also used in some confirmation APIs to answer indications. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_CAUSE_SUCCESS = BTIF_SUCCESS, /**< Success. */ - BTIF_CAUSE_ACCEPT = (BTIF_ERR | BTIF_ACCEPT), /**< Accept for indication, only used when confirmation. */ - BTIF_CAUSE_REJECT = (BTIF_ERR | BTIF_ERR_REJECT), /**< Reject for indication, only used when confirmation. */ - BTIF_CAUSE_RESOURCE_ERROR = (BTIF_ERR | BTIF_ERR_NO_RESOURCE), /**< Error happened because of resource limitation. */ - BTIF_CAUSE_INVALID_PARAM = (BTIF_ERR | BTIF_ERR_INVALID_PARAM), /**< Error happened because of invalid parameters. */ - BTIF_CAUSE_INVALID_STATE = (BTIF_ERR | BTIF_ERR_INVALID_STATE), /**< Error happened because of invalid states. */ - BTIF_CAUSE_CONN_DISCONNECT = (BTIF_ERR | BTIF_ERR_CONN_DISCONNECT), /**< Connection disconnected. */ - BTIF_CAUSE_CONN_LOST = (BTIF_ERR | BTIF_ERR_CONN_LOST), /**< Connection lost. */ - BTIF_CAUSE_AUTHEN_FAIL = (BTIF_ERR | BTIF_ERR_AUTHEN_FAIL), /**< Authentication failed. */ - BTIF_CAUSE_INIT_TOUT = (BTIF_ERR | BTIF_ERR_INIT_TOUT), /**< Timeout when stack initialize. */ - BTIF_CAUSE_INIT_OUT_OF_SYNC = (BTIF_ERR | BTIF_ERR_INIT_OUT_OF_SYNC), /**< Out if sync with controllor when stack initialize. */ - BTIF_CAUSE_INIT_HARDWARE_ERROR = (BTIF_ERR | BTIF_ERR_INIT_HARDWARE_ERROR),/**< Hardware error happened when stack initialize. */ - BTIF_CAUSE_LOWER_LAYER_ERROR = (BTIF_ERR | BTIF_ERR_LOWER_LAYER_ERROR), /**< Error happended in lower layer. */ - BTIF_CAUSE_ADDR_NOT_RESOLVED = (BTIF_ERR | BTIF_ERR_ADDR_NOT_RESOLVED), /**< Address type is not resolved. */ - BTIF_CAUSE_TOUT = (BTIF_ERR | BTIF_ERR_TOUT), /**< Error happened because of timeout. */ - - BTIF_CAUSE_UNSPECIFIED = (BTIF_ERR | BTIF_ERR_UNSPECIFIED), /**< Unspecified error reason. */ - BTIF_CAUSE_NOT_SUPPORTED = (BTIF_ERR | BTIF_ERR_NOT_SUPPORTED), /**< Request not support. */ -} T_BTIF_CAUSE; - -/** - * btif.h - * - * \brief Btif key type. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_KEY_COMBINATION = 0x00, /**< Combination key. */ - BTIF_KEY_LOCAL_UNIT = 0x01, /**< Local unit key. */ - BTIF_KEY_REMOTE_UNIT = 0x02, /**< Remote unit key. */ - BTIF_KEY_DEBUG_COMBINATION = 0x03, /**< Debug combination key. */ - BTIF_KEY_UNAUTHEN = 0x04, /**< SSP generated link key without MITM protection. */ - BTIF_KEY_AUTHEN = 0x05, /**< SSP generated link key with MITM protection. */ - BTIF_KEY_CHANGED_COMBINATION = 0x06, /**< Changed combination key. */ - BTIF_KEY_UNAUTHEN_P256 = 0x07, /**< Security Connections generated link key without MITM protection. */ - BTIF_KEY_AUTHEN_P256 = 0x08, /**< Security Connections link key with MITM protection. */ - BTIF_KEY_LE_LOCAL_LTK = 0x11, /**< BLE Long Term Key Blob. */ - BTIF_KEY_LE_REMOTE_LTK = 0x12, /**< BLE Long Term Key Blob. */ - BTIF_KEY_LE_LOCAL_IRK = 0x13, /**< BLE Identity Resolving Key. */ - BTIF_KEY_LE_REMOTE_IRK = 0x14, /**< BLE Identity Resolving Key. */ - BTIF_KEY_LE_LOCAL_CSRK = 0x15, /**< BLE Local CSR Key. */ - BTIF_KEY_LE_REMOTE_CSRK = 0x16, /**< BLE Remote CSR Key. */ - BTIF_KEY_REQ_BR = 0x80, /**< Only used to request a BR/EDR link key. */ - BTIF_KEY_DELETE = 0xFF /**< Link key is no longer valid and should be deleted. */ -} T_BTIF_KEY_TYPE; - -typedef enum -{ - BTIF_REMOTE_ADDR_LE_PUBLIC = 0x00, - BTIF_REMOTE_ADDR_LE_RANDOM = 0x01, -#if F_BT_LE_PRIVACY_SUPPORT - BTIF_REMOTE_ADDR_LE_PUBLIC_IDENTITY = 0x02, - BTIF_REMOTE_ADDR_LE_RANDOM_IDENTITY = 0x03, -#endif - BTIF_REMOTE_ADDR_CLASSIC = 0x10, - BTIF_REMOTE_ADDR_ANY = 0x20, - BTIF_REMOTE_ADDR_LE_ANONYMOUS = 0xff, -} T_BTIF_REMOTE_ADDR_TYPE; - -/** - * btif.h - * - * \brief Btif operation code used to configure local device. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_DEV_CFG_OP_NAME = 0x10, /**< Configure local name and class of device. */ - BTIF_DEV_CFG_OP_DID_EIR, /**< Configure DID infomation in EIR. */ - BTIF_DEV_CFG_OP_EXT_EIR, /**< Configure extra data in EIR. */ - BTIF_DEV_CFG_OP_PAGE_SCAN, /**< Configure page scan parameters. */ - BTIF_DEV_CFG_OP_INQUIRY_SCAN, /**< Configure inquiry scan parameters. */ - BTIF_DEV_CFG_OP_INQUIRY_MODE, /**< Configure inquiry mode. */ - BTIF_DEV_CFG_OP_LINK_POLICY, /**< Configure default link policy used when connection established. */ - BTIF_DEV_CFG_OP_BT_MODE, /**< Configure Bluetooth mode. */ - BTIF_DEV_CFG_OP_ACCEPT_CONN_ROLE /**< Configure prefered link role when accept connection request. */ -} T_BTIF_DEV_CFG_OPCODE; - -/** - * btif.h - * - * \brief Btif ACL status used in ACL status information message. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_ACL_CONN_ACTIVE = 0x01, /**< ACL link in active mode. */ - BTIF_ACL_CONN_SNIFF = 0x02, /**< ACL link in sniff mode. */ - BTIF_ACL_AUTHEN_START = 0x03, /**< ACL link authentication start. */ - BTIF_ACL_AUTHEN_SUCCESS = 0x04, /**< ACL link authentication success. */ - BTIF_ACL_AUTHEN_FAIL = 0x05, /**< ACL link authentication fail. */ - BTIF_ACL_CONN_ENCRYPTED = 0x06, /**< ACL link encrypted. */ - BTIF_ACL_CONN_DISCONN = 0x07, /**< ACL link disconnected. */ - BTIF_ACL_CONN_NOT_ENCRYPTED = 0x08, /**< ACL link not encrypted. */ - BTIF_ACL_ADDR_RESOLVED = 0x09, /**< Address is resolved. */ - BTIF_ACL_ROLE_MASTER = 0x0A, /**< ACL link role is master. */ - BTIF_ACL_ROLE_SLAVE = 0x0B, /**< ACL link role is slave. */ - BTIF_ACL_CONN_SNIFF_SUBRATE = 0x0C, /**< ACL link in sniff subrate mode. */ - BTIF_ACL_CONN_FAIL = 0x0D, /**< ACL link is failed to connect. */ - BTIF_ACL_CONN_SUCCESS = 0x0E, /**< ACL link is connected successfully. */ - BTIF_ACL_CONN_READY = 0x0F, /**< ACL link is ready to be configured. */ - BTIF_ACL_CONN_BR_SC_START = 0x10, /**< BR/EDR Secure Connections information exchange is started. */ - BTIF_ACL_CONN_BR_SC_CMPL = 0x11 /**< BR/EDR Secure Connections information exchange is finished. */ -} T_BTIF_ACL_STATUS; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_AUTHEN_START or \ref BTIF_ACL_AUTHEN_SUCCESS or \ref - * BTIF_ACL_AUTHEN_FAIL or \ref BTIF_ACL_CONN_ENCRYPTED or \ref BTIF_ACL_CONN_NOT_ENCRYPTED. - * - * \ingroup BTIF - */ -typedef struct -{ - T_BTIF_KEY_TYPE key_type; /**< Key type of the link. */ - uint8_t key_size; /**< Key size of the link. */ - uint8_t encrypt_type; /**< Encryption type of the link. */ - uint16_t cause; /**< Authentication result. */ -} T_BTIF_ACL_STATUS_PARAM_AUTHEN; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_CONN_BR_SC_CMPL. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< BR/EDR Secure Connections information exchange result. */ -} T_BTIF_ACL_STATUS_PARAM_BR_SC_CMPL; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_ADDR_RESOLVED. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; -} T_BTIF_ACL_STATUS_PARAM_RESOLVE; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_CONN_SNIFF. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t interval; /**< Sniff interval of the ACL link. */ -} T_BTIF_ACL_STATUS_PARAM_SNIFF; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_CONN_SNIFF_SUBRATE. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t max_tx_latency; /**< Maximum latency for data transmitted to remote device. */ - uint16_t max_rx_latency; /**< Maximum latency for data received from remote device. */ - uint16_t min_remote_tout; /**< Base sniff subrate timeout remote device shall use. */ - uint16_t min_local_tout; /**< Base sniff subrate timeout local device will use. */ -} T_BTIF_ACL_STATUS_PARAM_SNIFF_SUBRATE; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_CONN_DISCONN. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< ACL link disconnect reason. */ -} T_BTIF_ACL_CONNECTION_DISCONNECT; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_CONN_FAIL. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< ACL link establish fail reason. */ -} T_BTIF_ACL_CONNECTION_FAIL; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_CONN_SUCCESS. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t handle; /**< ACL link handle. */ -} T_BTIF_ACL_CONNECTION_SUCCESS; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message when status is - * \ref BTIF_ACL_CONN_READY. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t handle; /**< ACL link handle. */ -} T_BTIF_ACL_CONNECTION_READY; - -/** - * btif.h - * - * \brief Parameters used in ACL status information message. - * - * \ingroup BTIF - */ -typedef union -{ - T_BTIF_ACL_CONNECTION_SUCCESS conn_success; /**< Parameter for link success to establish. */ - T_BTIF_ACL_CONNECTION_READY conn_ready; /**< Parameter for link ready to be used. */ - T_BTIF_ACL_CONNECTION_FAIL conn_fail; /**< Parameter for link fail to establish. */ - T_BTIF_ACL_CONNECTION_DISCONNECT conn_disconn; /**< Parameter for link disconnected. */ - T_BTIF_ACL_STATUS_PARAM_AUTHEN authen; /**< Parameter for authentication status. */ - T_BTIF_ACL_STATUS_PARAM_RESOLVE resolve; /**< Address resolvable paramter. */ - T_BTIF_ACL_STATUS_PARAM_SNIFF sniff; /**< Parameter for ACL link sniff mode. */ - T_BTIF_ACL_STATUS_PARAM_SNIFF_SUBRATE sniff_subrate;/**< Parameter for ACL link sniff subrate. */ - T_BTIF_ACL_STATUS_PARAM_BR_SC_CMPL br_sc_cmpl; /**< Parameter for BR SC complete. */ -} T_BTIF_ACL_STATUS_PARAM; - -/** - * btif.h - * - * \brief Keypress notification type. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_PASSKEY_ENTRY_STARTED, /**< The passkey key entry protocol procedure is started. */ - BTIF_PASSKEY_DIGIT_ENTERED, /**< A digit is entered by the remote user. */ - BTIF_PASSKEY_DIGIT_ERASED, /**< A digit is erased by the remote user. */ - BTIF_PASSKEY_CLEARED, /**< The display is cleared by the remote user. */ - BTIF_PASSKEY_ENTRY_CMPL, /**< The passkey key entry protocol procedure is completed. */ -} T_BTIF_KEYPRESS_NOTIF_TYPE; - -/** @brief define indentify address type */ -typedef enum -{ - BTIF_IDENT_ADDR_PUBLIC = 0x00, /* low energy public address. */ - BTIF_IDENT_ADDR_RAND = 0x01, /* low energy random address. */ -} T_BTIF_IDENT_ADDR_TYPE; - -/** @brief define local adress type */ -typedef enum -{ - BTIF_LOCAL_ADDR_LE_PUBLIC = 0x00, /**< Bluetooth low energy public address. */ - BTIF_LOCAL_ADDR_LE_RANDOM = 0x01, /**< Bluetooth low energy random address. */ -#if F_BT_LE_PRIVACY_SUPPORT - BTIF_LOCAL_ADDR_LE_RAP_OR_PUBLIC = 0x02, /**< Bluetooth low energy random address. */ - BTIF_LOCAL_ADDR_LE_RAP_OR_RAND = 0x03 /**< Bluetooth low energy random address. */ -#endif -} T_BTIF_LOCAL_ADDR_TYPE; - -typedef enum -{ - BTIF_ADDR_LE_RAND_STATIC = 0x00, - BTIF_ADDR_LE_RAND_NON_RESOLVABLE = 0x01, - BTIF_ADDR_LE_RAND_RESOLVABLE = 0x02 -} T_BTIF_ADDR_RAND; - -typedef enum -{ - BTIF_PDU_TYPE_ANY = 0x00, - BTIF_PDU_TYPE_NOTIFICATION = 0x01, - BTIF_PDU_TYPE_INDICATION = 0x02 -} T_BTIF_GATT_PDU_TYPE; - -typedef enum -{ - BTIF_GATT_DISCOVERY_SERVICE = 0x01, /**< all primary services */ - BTIF_GATT_DISCOVERY_SERVICE_BY_UUID, /**< service by UUID */ - BTIF_GATT_DISCOVERY_CHARACTER, /**< all characteristics */ - BTIF_GATT_DISCOVERY_CHARACTER_DESC, /**< all characteristic descriptors */ - BTIF_GATT_DISCOVERY_RELATIONSHIP /**< relationship (included services) */ -} T_BTIF_GATT_DISCOVERY_TYPE; - -typedef struct -{ - uint16_t att_handle; - uint16_t end_group_handle; - uint16_t uuid16; -} T_BTIF_GATT_GENERIC_ELEM16; - -typedef struct -{ - uint16_t att_handle; - uint16_t end_group_handle; - uint8_t uuid128[16]; -} T_BTIF_GATT_GENERIC_ELEM128; - -typedef T_BTIF_GATT_GENERIC_ELEM16 T_BTIF_GATT_SERVICE_ELEM16; -typedef T_BTIF_GATT_GENERIC_ELEM128 T_BTIF_GATT_SERVICE_ELEM128; - -typedef struct -{ - uint16_t att_handle; - uint16_t end_group_handle; -} T_BTIF_GATT_SERVICE_BY_UUID_ELEM; - -typedef struct -{ - uint16_t decl_handle; - uint16_t properties; /**< high nibble is reserved */ - uint16_t value_handle; - uint16_t uuid16; -} T_BTIF_GATT_CHARACT_ELEM16; - -typedef struct -{ - uint16_t decl_handle; - uint16_t properties; /**< high nibble is reserved */ - uint16_t value_handle; - uint8_t uuid128[16]; -} T_BTIF_GATT_CHARACT_ELEM128; - -typedef struct -{ - uint16_t handle; - uint16_t uuid16; -} T_BTIF_GATT_CHARACT_DESC_ELEM16; - -typedef struct -{ - uint16_t handle; - uint8_t uuid128[16]; -} T_BTIF_GATT_CHARACT_DESC_ELEM128; - -typedef struct -{ - uint16_t decl_handle; - uint16_t att_handle; - uint16_t end_group_handle; - uint16_t uuid16; -} T_BTIF_GATT_RELATION_ELEM16; - -typedef struct -{ - uint16_t decl_handle; - uint16_t att_handle; - uint16_t end_group_handle; - uint8_t uuid128[16]; -} T_BTIF_GATT_RELATION_ELEM128; - -typedef enum -{ - BTIF_GATT_READ_TYPE_BASIC = 0x01, /**< ATT "Read (Blob) Request" */ - BTIF_GATT_READ_TYPE_BY_UUID /**< ATT "Read By Type Request" */ -} T_BTIF_GATT_READ_TYPE; - -typedef enum -{ - BTIF_GATT_WRITE_TYPE_REQ = 0x01, /**< ATT "Write Request" */ - BTIF_GATT_WRITE_TYPE_CMD, /**< ATT "Write Command" */ - BTIF_GATT_WRITE_TYPE_PREP, /**< ATT "Prepare Write Request" */ - BTIF_GATT_WRITE_TYPE_SIGNED_CMD /**< ATT "Signed Write Command" */ -} T_BTIF_GATT_WRITE_TYPE; - -typedef enum -{ - BTIF_GATT_STORE_OP_GET_CCC_BITS, /**< get CCC Bits for one */ - BTIF_GATT_STORE_OP_SET_CCC_BITS, /**< set CCC Bits for one */ - BTIF_GATT_STORE_OP_DELETE_ALL_CCC_BITS, /**< delete all CCC Bits for all peers */ -} T_BTIF_GATT_STORE_OPCODE; - -typedef enum -{ - BTIF_LE_ADV_MODE_DISABLED = 0, - BTIF_LE_ADV_MODE_ENABLED -} T_BTIF_LE_ADV_MODE; - -typedef enum -{ - BTIF_LE_EXT_ADV_MODE_DISABLED = 0, - BTIF_LE_EXT_ADV_MODE_ENABLED -} T_BTIF_LE_EXT_ADV_MODE; - -typedef enum -{ - BTIF_LE_PERIODIC_ADV_MODE_DISABLED = 0, - BTIF_LE_PERIODIC_ADV_MODE_ENABLED -} T_BTIF_LE_PERIODIC_ADV_MODE; - -typedef enum -{ - BTIF_LE_AE_LEGACY_ADV_CONN_N_SCAN_UNDIRECTED = 0x13, - BTIF_LE_AE_LEGACY_ADV_CONN_LOW_DUTY_DIRECTED = 0x15, - BTIF_LE_AE_LEGACY_ADV_CONN_HIGH_DUTY_DIRECTED = 0x1D, - BTIF_LE_AE_LEGACY_ADV_SCAN_UNDIRECTED = 0x12, - BTIF_LE_AE_LEGACY_ADV_NON_SCAN_NON_CONN = 0x10, -} T_BTIF_LE_AE_LEGACY_ADV_PROPERTY; - -typedef enum -{ - BTIF_LE_PRIM_ADV_PHY_LE_1M = 1, - BTIF_LE_PRIM_ADV_PHY_LE_CODED = 3 -} T_BTIF_LE_PRIM_ADV_PHY_TYPE; - -typedef enum -{ - BTIF_LE_ADV_TYPE_UNDIRECTED = 0, - BTIF_LE_ADV_TYPE_DIRECTED_HIGH_DUTY, - BTIF_LE_ADV_TYPE_SCANNABLE, - BTIF_LE_ADV_TYPE_NON_CONNECTABLE, - BTIF_LE_ADV_TYPE_DIRECTED_LOW_DUTY -} T_BTIF_LE_ADV_TYPE; - -typedef enum -{ - BTIF_LE_SCAN_REQ_NOTIFY_DISABLE = 0, - BTIF_LE_SCAN_REQ_NOTIFY_ENABLE = 1 -} T_BTIF_LE_SCAN_REQ_NOTIFY_TYPE; - -/** This enum type describes adv type for BTIF_MSG_LE_SCAN_INFO. */ -typedef enum -{ - BTIF_LE_ADV_EVT_TYPE_UNDIRECTED = 0, /**< Connectable undirected advertising. */ - BTIF_LE_ADV_EVT_TYPE_DIRECTED = 1, /**< Connectable directed advertising. */ - BTIF_LE_ADV_EVT_TYPE_SCANNABLE = 2, /**< Scanable undirected advertising. */ - BTIF_LE_ADV_EVT_TYPE_NON_CONNECTABLE, /**< Nonconnectable undirected advertising. */ - BTIF_LE_ADV_EVT_TYPE_SCAN_RSP /**< scan response. */ -} T_BTIF_LE_ADV_EVT_TYPE; - -typedef enum -{ - BTIF_LE_ADV_EVT_TYPE_CONNECTABLE_DIRECTED = 0x01, /* Connectable undirected advertising */ -} T_BTIF_LE_DIRECT_ADV_EVT_TYPE; - -typedef enum -{ - BTIF_LE_ADV_FILTER_ANY = 0, - BTIF_LE_ADV_FILTER_WHITE_LIST_SCAN, - BTIF_LE_ADV_FILTER_WHITE_LIST_CONN, - BTIF_LE_ADV_FILTER_WHITE_LIST_ALL, -} T_BTIF_LE_ADV_FILTER_POLICY; - -typedef enum -{ - BTIF_LE_SCAN_FILTER_ANY = 0, - BTIF_LE_SCAN_FILTER_WHITE_LIST, - BTIF_LE_SCAN_FILTER_ANY_RPA, - BTIF_LE_SCAN_FILTER_WHITE_LIST_RPA, -} T_BTIF_LE_SCAN_FILTER_POLICY; - -typedef enum -{ - BTIF_LE_DATA_TYPE_ADV = 0, - BTIF_LE_DATA_TYPE_SCAN_RSP -} T_BTIF_LE_ADV_DATA_TYPE; - -typedef enum -{ - BTIF_LE_DATA_TYPE_EXT_ADV = 0, - BTIF_LE_DATA_TYPE_EXT_SCAN_RSP -} T_BTIF_LE_EXT_ADV_DATA_TYPE; - -typedef enum -{ - BTIF_LE_ADV_FRAG_OP_INTERMEDIATE_FRAG = 0, - BTIF_LE_ADV_FRAG_OP_FIRST_FRAG = 1, - BTIF_LE_ADV_FRAG_OP_LAST_FRAG = 2, - BTIF_LE_ADV_FRAG_OP_CMPL_ADV_DATA = 3, - BTIF_LE_ADV_FRAG_OP_UNCHANGE_UPDATE_DID = 4, -} T_BTIF_LE_ADV_FRAG_OP_TYPE; - -typedef enum -{ - BTIF_LE_ADV_FRAG_PREFER_MAY_FRAG_ALL = 0, - BTIF_LE_ADV_FRAG_PREFER_NOT_OR_MIN_FRAG = 1 -} T_BTIF_LE_ADV_FRAG_PREFERENCE_TYPE; - -typedef enum -{ - BTIF_LE_SCAN_MODE_DISABLED = 0, - BTIF_LE_SCAN_MODE_ENABLED = 1, -} T_BTIF_LE_SCAN_MODE; - -typedef enum -{ - BTIF_LE_SCAN_DUPLICATE_FILTER_DISABLED = 0, - BTIF_LE_SCAN_DUPLICATE_FILTER_ENABLED = 1, - BTIF_LE_SCAN_DUPLICATE_FILTER_ENABLED_RESET_FOR_EACH_PERIOD = 2, -} T_BTIF_LE_SCAN_FILTER_DUPLICATES; - -typedef enum -{ - BTIF_LE_SCAN_TYPE_PASSIVE, - BTIF_LE_SCAN_TYPE_ACTIVE -} T_BTIF_LE_SCAN_TYPE; - -typedef enum -{ - BTIF_LE_WHITE_LIST_OP_CLEAR = 0, - BTIF_LE_WHITE_LIST_OP_ADD, - BTIF_LE_WHITE_LIST_OP_REMOVE -} T_BTIF_LE_WHITE_LIST_OP; - -typedef enum -{ - BTIF_LE_ADV_SET_OP_CLEAR = 0, - BTIF_LE_ADV_SET_OP_ADD, - BTIF_LE_ADV_SET_OP_REMOVE -} T_BTIF_LE_ADV_SET_OP; - -typedef enum -{ - BTIF_DIRECT_ADDR_LE_PUBLIC = 0x00, - BTIF_DIRECT_ADDR_LE_RAND = 0x01, - BTIF_DIRECT_ADDR_LE_PUBLIC_IDENT = 0x02, - BTIF_DIRECT_ADDR_LE_RAND_IDENT = 0x03, - BTIF_DIRECT_ADDR_LE_RAND_UNABLE_RESOLV = 0xFE -} T_BTIF_DIRECT_ADDR_TYPE; - -typedef struct -{ - T_BTIF_LE_SCAN_TYPE scan_type; - uint16_t scan_interval; - uint16_t scan_window; -} T_BTIF_LE_EXT_SCAN_PARAM; - -typedef struct -{ - uint8_t adv_handle; - uint16_t duration; - uint8_t max_ext_adv_evt; -} T_BTIF_LE_EXT_ADV_SET_PARAM; - -typedef enum -{ - BTIF_LE_PERIODIC_ADV_LIST_OP_CLEAR = 0, - BTIF_LE_PERIODIC_ADV_LIST_OP_ADD, - BTIF_LE_PERIODIC_ADV_LIST_OP_REMOVE -} T_BTIF_LE_PERIODIC_ADV_LIST_OP; - -typedef enum -{ - BTIF_LE_RESOLVING_LIST_OP_CLEAR = 0, - BTIF_LE_RESOLVING_LIST_OP_ADD, - BTIF_LE_RESOLVING_LIST_OP_REMOVE -} T_BTIF_LE_RESOLVING_LIST_OP; - -typedef enum -{ - BTIF_LE_NETWORK_PRIVACY = 0, - BTIF_LE_DEVICE_PRIVACY -} T_BTIF_LE_PRIVACY_MODE; - -typedef enum -{ - BTIF_LE_PHY_1M = 0x01, - BTIF_LE_PHY_2M = 0x02, - BTIF_LE_PHY_CODED = 0x03 -} T_BTIF_LE_PHY_TYPE; - -typedef enum -{ - BTIF_LE_PHY_OPTIONS_LE_CODED_PREFERENCE_NO = 0, - BTIF_LE_PHY_OPTIONS_LE_CODED_PREFERENCE_S2 = 1, - BTIF_LE_PHY_OPTIONS_LE_CODED_PREFERENCE_S8 = 2 -} T_BTIF_LE_PHY_OPTIONS; - -typedef struct -{ - uint16_t scan_interval; - uint16_t scan_window; - uint16_t conn_interval_min; - uint16_t conn_interval_max; - uint16_t conn_latency; - uint16_t supv_tout; - uint16_t ce_len_min; - uint16_t ce_len_max; -} T_BTIF_LE_CONN_REQ_PARAM; - -typedef enum -{ - T_BTIF_SERVICE_APP_DEF = 0, /**< application provides services */ -} T_BTIF_GATT_SERVICE_ID; - -typedef enum -{ - BTIF_L2C_LE_CONN_ACCEPT = L2C_LE_CREDIT_CONN_SUCCESS, - BTIF_L2C_LE_CONN_PSM_NOT_SUPPORTED = (L2C_ERR | L2C_LE_CREDIT_RSP_PSM_NOT_SUPPORTED), - BTIF_L2C_LE_CONN_NO_RESOURCES = (L2C_ERR | L2C_LE_CREDIT_RSP_NO_RESOURCES), - BTIF_L2C_LE_CONN_INSUFFICIENT_AUTHEN = (L2C_ERR | L2C_LE_CREDIT_RSP_INSUFFICIENT_AUTHEN), - BTIF_L2C_LE_CONN_INSUFFICIENT_AUTHOR = (L2C_ERR | L2C_LE_CREDIT_RSP_INSUFFICIENT_AUTHOR), - BTIF_L2C_LE_CONN_INSUFFICIENT_ENCRYP_KEY_SIZE = (L2C_ERR | L2C_LE_CREDIT_RSP_INSUFFICIENT_ENCRYP_KEY_SIZE), - BTIF_L2C_LE_CONN_INSUFFICIENT_ENCRYP = (L2C_ERR | L2C_LE_CREDIT_RSP_INSUFFICIENT_ENCRYP), - BTIF_L2C_LE_CONN_INVAlID_SOURCE_CID = (L2C_ERR | L2C_LE_CREDIT_RSP_INVALID_SOURCE_CID), - BTIF_L2C_LE_CONN_SOURCE_CID_ALREADY_ALLOC = (L2C_ERR | L2C_LE_CREDIT_RSP_SOURCE_CID_ALREADY_ALLOC) -} T_BTIF_L2C_LE_CONN_STATUS; - -typedef enum -{ - BTIF_LE_SECURITY_NONE, - BTIF_LE_SECURITY_UNAUTHEN_ENCRYT, - BTIF_LE_SECURITY_AUTHEN_ENCRYT, - BTIF_LE_SECURITY_UNAUTHEN_DATA_SIGN, - BTIF_LE_SECURITY_AUTHEN_DATA_SIGN, - BTIF_LE_SECURITY_AUTHOR -} T_BTIF_LE_SECURITY_MODE; - -/** - * btif.h - * - * \brief Definition of input/output capabilities. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_IOCAP_DISPLAY_ONLY, /**< Only a Display present, no Keyboard or Yes/No Keys. */ - BTIF_IOCAP_DISPLAY_YES_NO, /**< Display and Yes/No Keys present. */ - BTIF_IOCAP_KEYBOARD_ONLY, /**< only a Keyboard present, no Display. */ - BTIF_IOCAP_NO_IO, /**< No input/output capabilities. */ - BTIF_IOCAP_KEYBOARD_DISPLAY /**< Keyboard and Display present, used in BLE only. */ -} T_BTIF_IOCAP; - -/** - * btif.h - * - * \brief BR/EDR bluetooth mode. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_BT_MODE21_DISABLED, /**< Disable all Bluetooth 2.1 functionality. */ - BTIF_BT_MODE21_ENABLED /**< Enable Bluetooth 2.1 functionality. */ -} T_BTIF_BT_MODE; - -/** - * btif.h - * - * \brief BR/EDR radio mode. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_RADIO_VISIBLE_CONNECTABLE = 0x01, /**< Enable both inquiry scan and page scan. */ - BTIF_RADIO_VISIBLE = 0x02, /**< Only enable inquiry scan. */ - BTIF_RADIO_CONNECTABLE = 0x03, /**< Only enable page scan. */ - BTIF_RADIO_NON_DISCVBL = 0x04, /**< Disable both inquiry scan and page scan. */ - BTIF_RADIO_OFF = 0x06 /**< Radio off mode. */ -} T_BTIF_RADIO_MODE; - -/** - * btif.h - * - * \brief BR/EDR page scan type. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_BR_PAGE_SCAN_STANDARD = 0, /**< BR/EDR page scan type standard. */ - BTIF_BR_PAGE_SCAN_INTERLACED, /**< BR/EDR page scan type interlaced. */ -} T_BTIF_BR_PAGE_SCAN_TYPE; - -/** - * btif.h - * - * \brief BR/EDR inquiry scan type. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_BR_INQUIRY_SCAN_STANDARD = 0, /**< BR/EDR inquiry scan type standard. */ - BTIF_BR_INQUIRY_SCAN_INTERLACED, /**< BR/EDR inquiry scan type interlaced. */ -} T_BTIF_BR_INQUIRY_SCAN_TYPE; - -/** - * btif.h - * - * \brief BR/EDR inquiry inquiry result type. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_BR_STANDARD_INQUIRY_RESULT = 0, /**< Inquiry reusult standard format. */ - BTIF_BR_INQUIRY_RESULT_WITH_RSSI, /**< Inquiry result format with RSSI. */ - BTIF_BR_EXTENDED_INQUIRY_RESULT, /**< Inquiry result with RSSI format or Extended inquiry result format. */ -} T_BTIF_BR_INQUIRY_MODE; - -/** - * btif.h - * - * \brief BR/EDR link policy. - * - * \ingroup BTIF - */ -typedef uint8_t T_BTIF_BR_LINK_POLICY; - -/** - * btif.h - * - * \brief BR/EDR link role. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_BR_LINK_ROLE_MASTER, /**< BR/EDR link role master. */ - BTIF_BR_LINK_ROLE_SLAVE /**< BR/EDR link role slave. */ -} T_BTIF_BR_LINK_ROLE; - -/** - * btif.h - * - * \brief Operation code used to configure ACL link. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_ACL_CFG_LINK_POLICY, /**< Configure ACL link policy. */ - BTIF_ACL_CFG_LINK_SUPV_TOUT, /**< Configure ACL link supervision timeout value. */ - BTIF_ACL_CFG_LINK_ROLE, /**< Configure ACL link role. */ - BTIF_ACL_CFG_PKT_TYPE, /**< Configure ACL link packet type. */ - BTIF_ACL_CFG_ENTER_SNIFF_MODE, /**< Configure ACL to enter sniff mode. */ - BTIF_ACL_CFG_EXIT_SNIFF_MODE, /**< Configure ACL to exit sniff mode. */ -} T_BTIF_ACL_CFG_OPCODE; - -/** - * btif.h - * - * \brief Parameters used to configure ACL link when operation code is \ref BTIF_ACL_CFG_LINK_POLICY. - * - * \ingroup BTIF - */ -typedef struct -{ - T_BTIF_BR_LINK_POLICY policy; /**< ACL link policy paramter to be configured. */ -} T_BTIF_ACL_CFG_PARAM_LINK_POLICY; - -/** - * btif.h - * - * \brief Parameters used to configure ACL link when operation code is \ref BTIF_ACL_CFG_LINK_SUPV_TOUT. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t tout; /**< ACL link supervision timeout value to be configured. */ -} T_BTIF_ACL_CFG_PARAM_LINK_SUPV_TOUT; - -/** - * btif.h - * - * \brief Parameters used to configure ACL link when operation code is \ref BTIF_ACL_CFG_LINK_ROLE. - * - * \ingroup BTIF - */ -typedef struct -{ - T_BTIF_BR_LINK_ROLE role; /**< ACL link role to be configured. */ -} T_BTIF_ACL_CFG_PARAM_LINK_ROLE; - -/** - * btif.h - * - * \brief Parameters used to configure ACL link when operation code is \ref BTIF_ACL_CFG_ENTER_SNIFF_MODE. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t min_interval; /**< Min sniff interval, only even values between 0x0002 and 0xFFFE are valid. */ - uint16_t max_interval; /**< Max sniff interval, only even values between 0x0002 and 0xFFFE are valid, should be larger than min_interval. */ - uint16_t sniff_attempt; /**< Number of baseband receive slots for sniff attempt. */ - uint16_t sniff_tout; /**< Number of baseband receive slots for sniff timeout. */ - uint16_t max_latency; /**< Max allowed sniff subrate of the remote device. Set to 0 if do not want to configure sniff subrate. */ - uint16_t min_remote_tout; /**< Min base sniff subrate timeout the remote device may use. */ - uint16_t min_local_tout; /**< Min base sniff subrate timeout the local device may use. */ -} T_BTIF_ACL_CFG_PARAM_SNIFF_MODE; - -/** - * btif.h - * - * \brief Parameters used to configure ACL link when operation code is \ref BTIF_ACL_CFG_PKT_TYPE. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t type; /**< ACL link packet type to be configured. */ -} T_BTIF_ACL_CFG_PKT_TYPE; - -/** - * btif.h - * - * \brief Parameters used to configure ACL link. - * - * \ingroup BTIF - */ -typedef union -{ - T_BTIF_ACL_CFG_PARAM_LINK_POLICY link_policy; /**< Parameter for link policy. */ - T_BTIF_ACL_CFG_PARAM_LINK_SUPV_TOUT supv_tout; /**< Parameter for supervision timeout. */ - T_BTIF_ACL_CFG_PARAM_LINK_ROLE link_role; /**< Parameter for link role. */ - T_BTIF_ACL_CFG_PARAM_SNIFF_MODE sniff_mode; /**< Parameter for sniff mode. */ - T_BTIF_ACL_CFG_PKT_TYPE pkt_type; /**< Parameter for link packet type. */ -} T_BTIF_ACL_CFG_PARAM; - -/** - * btif.h - * - * \brief SDP UUID type. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_UUID16, /**< UUID type 16 bits */ - BTIF_UUID32, /**< UUID type 32 bits */ - BTIF_UUID128 /**< UUID type 128 bits */ -} T_BTIF_UUID_TYPE; - -/** - * btif.h - * - * \brief SDP UUID data. - * - * \ingroup BTIF - */ -typedef union -{ - uint16_t uuid_16; /**< UUID data in 16 bits */ - uint32_t uuid_32; /**< UUID data in 32 bits */ - uint8_t uuid_128[16]; /**< UUID data in 128 bits */ -} T_BTIF_UUID_DATA; - -/** - * btif.h - * - * \brief SDP discovery type. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_SDP_DISCOV_TYPE_BR, /**< Discover normal SDP information */ - BTIF_SDP_DISCOV_TYPE_DID /**< Discover DID information */ -} T_BTIF_SDP_DISCOV_TYPE; - -/** - * btif.h - * - * \brief L2CAP cause used in L2CAP connection confirm API. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_L2C_CONN_ACCEPT = L2C_CONN_ACCEPT, /**< L2CAP connection accept */ - BTIF_L2C_CONN_PENDING = (L2C_ERR | L2C_ERR_PENDING), /**< L2CAP connection pending */ - BTIF_L2C_CONN_INVALID_PSM = (L2C_ERR | L2C_ERR_INVALID_PSM), /**< L2CAP connection reject because of PSM not support */ - BTIF_L2C_CONN_SECURITY_BLOCK = (L2C_ERR | L2C_ERR_SECURITY_BLOCK), /**< L2CAP connection reject because of security block */ - BTIF_L2C_CONN_NO_RESOURCE = (L2C_ERR | L2C_ERR_NO_RESOURCE), /**< L2CAP connection reject because of no resources available */ - BTIF_L2C_CONN_INVALID_PARAM = (L2C_ERR | L2C_ERR_INVALID_PARAM), /**< L2CAP connection reject because of invalid parameter */ - BTIF_L2C_CONN_INVALID_SOURCE_CID = (L2C_ERR | L2C_ERR_INVALID_SOURCE_CID), /**< L2CAP connection reject because of invalid source CID */ - BTIF_L2C_CONN_SOURCE_CID_ALLOCATED = (L2C_ERR | L2C_ERR_SOURCE_CID_ALLOCATED)/**< L2CAP connection reject because of source CID already allocated */ -} T_BTIF_L2C_CONN_CAUSE; - -/** - * btif.h - * - * \brief SCO packet status. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_SCO_PKT_STATUS_OK = 0, /**< SCO packet status for correctly received data */ - BTIF_SCO_PKT_STATUS_INVALID = 1, /**< SCO packet status for invalid data */ - BTIF_SCO_PKT_STATUS_NO_DATA = 2, /**< SCO packet status for no data received */ - BTIF_SCO_PKT_STATUS_PARTIAL_LOST = 3 /**< SCO packet status for data partially lost */ -} T_BTIF_SCO_PKT_STATUS; - -/** - * btif.h - * - * \brief Btif message types. - * - * \ingroup BTIF - */ -typedef enum -{ - BTIF_MSG_REGISTER_REQ = 0x01, - BTIF_MSG_REGISTER_RSP, /**< Response of registering callback function. */ - BTIF_MSG_RELEASE_REQ, - BTIF_MSG_RELEASE_RSP, /**< Response of releasing callback function. */ - BTIF_MSG_ACT_INFO, /**< Information of Bluetooth stack initialization. */ - BTIF_MSG_DEV_CFG_REQ, - BTIF_MSG_DEV_CFG_RSP, /**< Response of configuring local device. */ - - BTIF_MSG_ACL_STATUS_INFO, /**< Information of ACL link status. */ - BTIF_MSG_ACL_PRIORITY_SET_REQ, - BTIF_MSG_ACL_PRIORITY_SET_RSP, /**< Response of setting acl priority. */ - - BTIF_MSG_READ_RSSI_REQ, - BTIF_MSG_READ_RSSI_RSP, /**< Response of reading RSSI information. */ - BTIF_MSG_VENDOR_CMD_REQ, - BTIF_MSG_VENDOR_CMD_RSP, /**< Response of vendor command. */ - BTIF_MSG_VENDOR_EVT_INFO, /**< Information of vendor event. */ - - BTIF_MSG_PAIRABLE_MODE_SET_REQ, - BTIF_MSG_PAIRABLE_MODE_SET_RSP, /**< Response of setting radio mode. */ - BTIF_MSG_USER_PASSKEY_REQ_IND, /**< Indication of user passkey request. */ - BTIF_MSG_USER_PASSKEY_REQ_CFM, - BTIF_MSG_USER_PASSKEY_REQ_REPLY_REQ, - BTIF_MSG_USER_PASSKEY_REQ_REPLY_RSP, /**< Response of user passkey request reply. */ - BTIF_MSG_USER_PASSKEY_NOTIF_INFO, /**< Information of user passkey notification. */ - BTIF_MSG_AUTHEN_RESULT_IND, /**< Indication of authentication result. */ - BTIF_MSG_AUTHEN_RESULT_CFM, - BTIF_MSG_AUTHEN_KEY_REQ_IND, /**< Indication of authentication key request. */ - BTIF_MSG_AUTHEN_KEY_REQ_CFM, - BTIF_MSG_USER_CFM_REQ_IND, /**< Indication of user confirm request. */ - BTIF_MSG_USER_CFM_REQ_CFM, - BTIF_MSG_KEYPRESS_NOTIF_REQ, - BTIF_MSG_KEYPRESS_NOTIF_RSP, /**< Response of keypress notification. */ - BTIF_MSG_KEYPRESS_NOTIF_INFO, /**< Information of remote keypress notification. */ - BTIF_MSG_HW_ERROR_INFO, /**< Indication of hardware error. */ - - BTIF_MSG_REMOTE_OOB_REQ_IND = 0x0100, /**< Indication of remote OOB data request. */ - BTIF_MSG_REMOTE_OOB_REQ_CFM, - - // GATT - // server - BTIF_MSG_GATT_SRV_REG_REQ, - BTIF_MSG_GATT_SRV_REG_RSP, - BTIF_MSG_GATT_ATTR_UPDATE_REQ, - BTIF_MSG_GATT_ATTR_UPDATE_RSP, - BTIF_MSG_GATT_ATTR_UPDATE_STATUS_IND, - BTIF_MSG_GATT_ATTR_UPDATE_STATUS_CFM, - BTIF_MSG_GATT_ATTR_READ_IND, - BTIF_MSG_GATT_ATTR_READ_CFM, - BTIF_MSG_GATT_ATTR_WRITE_REQ_IND, - BTIF_MSG_GATT_ATTR_WRITE_REQ_CFM, - BTIF_MSG_GATT_ATTR_PREP_WRITE_IND, - BTIF_MSG_GATT_ATTR_PREP_WRITE_CFM, - BTIF_MSG_GATT_ATTR_EXEC_WRITE_IND, - BTIF_MSG_GATT_ATTR_EXEC_WRITE_CFM, - BTIF_MSG_GATT_ATTR_WRITE_CMD_INFO,//0x110 - BTIF_MSG_GATT_ATTR_CCCD_INFO, - // client - BTIF_MSG_GATT_DISCOVERY_REQ, - BTIF_MSG_GATT_DISCOVERY_RSP, - BTIF_MSG_GATT_DISCOVERY_IND, - BTIF_MSG_GATT_DISCOVERY_CFM, - BTIF_MSG_GATT_ATTR_READ_REQ, - BTIF_MSG_GATT_ATTR_READ_RSP, - BTIF_MSG_GATT_ATTR_READ_MULTI_REQ, - BTIF_MSG_GATT_ATTR_READ_MULTI_RSP, - BTIF_MSG_GATT_ATTR_WRITE_REQ, - BTIF_MSG_GATT_ATTR_WRITE_RSP, - BTIF_MSG_GATT_ATTR_PREP_WRITE_REQ, - BTIF_MSG_GATT_ATTR_PREP_WRITE_RSP, - BTIF_MSG_GATT_ATTR_EXEC_WRITE_REQ, - BTIF_MSG_GATT_ATTR_EXEC_WRITE_RSP, - - BTIF_MSG_GATT_ATTR_IND,//0x120 - BTIF_MSG_GATT_ATTR_CFM, - BTIF_MSG_GATT_ATTR_NOTIF_INFO, - - // common - BTIF_MSG_GATT_SECURITY_REQ, - BTIF_MSG_GATT_SECURITY_RSP, - BTIF_MSG_GATT_SERVER_STORE_IND, - BTIF_MSG_GATT_SERVER_STORE_CFM, - BTIF_MSG_GATT_MTU_SIZE_INFO, - // end of GATT - - BTIF_MSG_LE_CONN_REQ, - BTIF_MSG_LE_CONN_RSP, - BTIF_MSG_LE_CONN_IND, - BTIF_MSG_LE_CONN_CFM, - BTIF_MSG_LE_CONN_CMPL_INFO, - BTIF_MSG_LE_DISCONN_REQ, - BTIF_MSG_LE_DISCONN_RSP, - BTIF_MSG_LE_DISCONN_IND, - BTIF_MSG_LE_DISCONN_CFM,//0x130 - - BTIF_MSG_LE_ADV_REQ, - BTIF_MSG_LE_ADV_RSP, - BTIF_MSG_LE_ADV_PARAM_SET_REQ, - BTIF_MSG_LE_ADV_PARAM_SET_RSP, - BTIF_MSG_LE_ADV_DATA_SET_REQ, - BTIF_MSG_LE_ADV_DATA_SET_RSP, - BTIF_MSG_LE_SCAN_REQ, - BTIF_MSG_LE_SCAN_RSP, - BTIF_MSG_LE_SCAN_PARAM_SET_REQ, - BTIF_MSG_LE_SCAN_PARAM_SET_RSP, - BTIF_MSG_LE_SCAN_INFO, - BTIF_MSG_LE_MODIFY_WHITE_LIST_REQ, - BTIF_MSG_LE_MODIFY_WHITE_LIST_RSP, - BTIF_MSG_LE_CONN_UPDATE_REQ, - BTIF_MSG_LE_CONN_UPDATE_RSP, - BTIF_MSG_LE_CONN_UPDATE_IND,//0x140 - BTIF_MSG_LE_CONN_UPDATE_CFM, - BTIF_MSG_LE_CONN_PARAM_INFO, - BTIF_MSG_LE_CONN_PARAM_REQ_EVT_INFO, - BTIF_MSG_LE_CONN_PARAM_REQ_REPLY_REQ, - BTIF_MSG_LE_CONN_PARAM_REQ_REPLY_RSP, - BTIF_MSG_LE_CONN_PARAM_REQ_NEG_REPLY_REQ, - BTIF_MSG_LE_CONN_PARAM_REQ_NEG_REPLY_RSP, - - BTIF_MSG_LE_CREDIT_BASED_CONN_REQ, - BTIF_MSG_LE_CREDIT_BASED_CONN_RSP, - BTIF_MSG_LE_CREDIT_BASED_CONN_IND, - BTIF_MSG_LE_CREDIT_BASED_CONN_CFM, - BTIF_MSG_LE_CREDIT_BASED_DISCONN_REQ, - BTIF_MSG_LE_CREDIT_BASED_DISCONN_RSP, - BTIF_MSG_LE_CREDIT_BASED_DISCONN_IND, - BTIF_MSG_LE_CREDIT_BASED_DISCONN_CFM, - BTIF_MSG_LE_SEND_CREDIT_REQ,//0x150 - BTIF_MSG_LE_SEND_CREDIT_RSP, - BTIF_MSG_LE_CREDIT_BASED_DATA_REQ, - BTIF_MSG_LE_CREDIT_BASED_DATA_RSP, - BTIF_MSG_LE_CREDIT_BASED_DATA_IND, - BTIF_MSG_LE_CREDIT_BASED_DATA_CFM, - BTIF_MSG_LE_CREDIT_BASED_CONN_CMPL_INFO, - BTIF_MSG_LE_CREDIT_BASED_CONN_CREDIT_INFO, - BTIF_MSG_LE_CREDIT_BASED_SECURITY_REG_REQ, - BTIF_MSG_LE_CREDIT_BASED_SECURITY_REG_RSP, - BTIF_MSG_LE_CREDIT_BASED_PSM_REG_REQ, - BTIF_MSG_LE_CREDIT_BASED_PSM_REG_RSP, - BTIF_MSG_LE_SET_CHANN_CLASSIF_REQ, - BTIF_MSG_LE_SET_CHANN_CLASSIF_RSP, - BTIF_MSG_LE_READ_CHANN_MAP_REQ, - BTIF_MSG_LE_READ_CHANN_MAP_RSP, - BTIF_MSG_LE_RECEIVER_TEST_REQ, - BTIF_MSG_LE_RECEIVER_TEST_RSP, - BTIF_MSG_LE_TRANSMITTER_TEST_REQ,//0x162 - BTIF_MSG_LE_TRANSMITTER_TEST_RSP, - BTIF_MSG_LE_TEST_END_REQ, - BTIF_MSG_LE_TEST_END_RSP, - BTIF_MSG_LE_READ_ADV_TX_POWER_REQ, - BTIF_MSG_LE_READ_ADV_TX_POWER_RSP, - BTIF_MSG_LE_SET_RAND_ADDR_REQ, - BTIF_MSG_LE_SET_RAND_ADDR_RSP, - BTIF_MSG_LE_READ_MAX_DATA_LEN_REQ, - BTIF_MSG_LE_READ_MAX_DATA_LEN_RSP, - BTIF_MSG_LE_READ_DEFAULT_DATA_LEN_REQ, - BTIF_MSG_LE_READ_DEFAULT_DATA_LEN_RSP, - BTIF_MSG_LE_WRITE_DEFAULT_DATA_LEN_REQ, - BTIF_MSG_LE_WRITE_DEFAULT_DATA_LEN_RSP, - BTIF_MSG_LE_SET_DATA_LEN_REQ,//0x172 - BTIF_MSG_LE_SET_DATA_LEN_RSP, - BTIF_MSG_LE_DATA_LEN_CHANGE_INFO, - BTIF_MSG_LE_MODIFY_RESOLV_LIST_REQ, - BTIF_MSG_LE_MODIFY_RESOLV_LIST_RSP, - BTIF_MSG_LE_READ_PEER_RESOLV_ADDR_REQ, - BTIF_MSG_LE_READ_PEER_RESOLV_ADDR_RSP, - BTIF_MSG_LE_READ_LOCAL_RESOLV_ADDR_REQ, - BTIF_MSG_LE_READ_LOCAL_RESOLV_ADDR_RSP, - BTIF_MSG_LE_SET_RESOLUTION_ENABLE_REQ, - BTIF_MSG_LE_SET_RESOLUTION_ENABLE_RSP, - BTIF_MSG_LE_SET_RESOLV_PRIV_ADDR_TOUT_REQ, - BTIF_MSG_LE_SET_RESOLV_PRIV_ADDR_TOUT_RSP, - BTIF_MSG_LE_CONFIG_LOCAL_IRK_REQ, - BTIF_MSG_LE_CONFIG_LOCAL_IRK_RSP, - BTIF_MSG_LE_SET_PRIVACY_MODE_REQ, - BTIF_MSG_LE_SET_PRIVACY_MODE_RSP,//0x182 - BTIF_MSG_LE_DIRECT_ADV_INFO, - BTIF_MSG_LE_HIGH_DUTY_ADV_TOUT_INFO, - - BTIF_MSG_LE_SET_ADV_SET_RAND_ADDR_REQ, - BTIF_MSG_LE_SET_ADV_SET_RAND_ADDR_RSP, - - BTIF_MSG_LE_EXT_ADV_PARAM_SET_REQ, - BTIF_MSG_LE_EXT_ADV_PARAM_SET_RSP, - BTIF_MSG_LE_EXT_ADV_DATA_SET_REQ, - BTIF_MSG_LE_EXT_ADV_DATA_SET_RSP, - BTIF_MSG_LE_EXT_ADV_ENABLE_REQ, - BTIF_MSG_LE_EXT_ADV_ENABLE_RSP, - - BTIF_MSG_LE_EXT_SCAN_PARAM_SET_REQ, - BTIF_MSG_LE_EXT_SCAN_PARAM_SET_RSP, - BTIF_MSG_LE_EXT_SCAN_REQ, - BTIF_MSG_LE_EXT_SCAN_RSP,//0x190 - - BTIF_MSG_LE_SET_DEFAULT_PHY_REQ, - BTIF_MSG_LE_SET_DEFAULT_PHY_RSP, - - BTIF_MSG_LE_SET_PHY_REQ, - BTIF_MSG_LE_SET_PHY_RSP, - - BTIF_MSG_LE_ENHANCED_RECEIVER_TEST_REQ, - BTIF_MSG_LE_ENHANCED_RECEIVER_TEST_RSP, - BTIF_MSG_LE_ENHANCED_TRANSMITTER_TEST_REQ, - BTIF_MSG_LE_ENHANCED_TRANSMITTER_TEST_RSP, - - BTIF_MSG_LE_MODIFY_PERIODIC_ADV_LIST_REQ, - BTIF_MSG_LE_MODIFY_PERIODIC_ADV_LIST_RSP, - - BTIF_MSG_LE_READ_RF_PATH_COMPENSATION_REQ, - BTIF_MSG_LE_READ_RF_PATH_COMPENSATION_RSP, - - BTIF_MSG_LE_WRITE_RF_PATH_COMPENSATION_REQ, - BTIF_MSG_LE_WRITE_RF_PATH_COMPENSATION_RSP, - - BTIF_MSG_LE_MODIFY_ADV_SET_REQ, - BTIF_MSG_LE_MODIFY_ADV_SET_RSP,//0x1A0 - - BTIF_MSG_LE_SET_PERIODIC_ADV_PARAM_REQ, - BTIF_MSG_LE_SET_PERIODIC_ADV_PARAM_RSP, - BTIF_MSG_LE_SET_PERIODIC_ADV_DATA_REQ, - BTIF_MSG_LE_SET_PERIODIC_ADV_DATA_RSP, - BTIF_MSG_LE_SET_PERIODIC_ADV_ENABLE_REQ, - BTIF_MSG_LE_SET_PERIODIC_ADV_ENABLE_RSP, - BTIF_MSG_LE_PERIODIC_ADV_CREATE_SYNC_REQ, - BTIF_MSG_LE_PERIODIC_ADV_CREATE_SYNC_RSP, - BTIF_MSG_LE_PERIODIC_ADV_CREATE_SYNC_CANCEL_REQ, - BTIF_MSG_LE_PERIODIC_ADV_CREATE_SYNC_CANCEL_RSP, - BTIF_MSG_LE_PERIODIC_ADV_TERMINATE_SYNC_REQ, - BTIF_MSG_LE_PERIODIC_ADV_TERMINATE_SYNC_RSP, - - BTIF_MSG_LE_PHY_UPDATE_INFO, - BTIF_MSG_LE_EXT_ADV_REPORT_INFO, - BTIF_MSG_LE_PERIODIC_ADV_SYNC_ESTABLISHED_INFO, - BTIF_MSG_LE_PERIODIC_ADV_REPORT_INFO,//0x1B0 - BTIF_MSG_LE_PERIODIC_ADV_SYNC_LOST_INFO, - BTIF_MSG_LE_SCAN_TIMEOUT_INFO, - BTIF_MSG_LE_ADV_SET_TERMINATED_INFO, - BTIF_MSG_LE_SCAN_REQ_RECEIVED_INFO, - BTIF_MSG_LE_LOCAL_DEV_INFO, - BTIF_MSG_LE_ENABLE_EXT_ADV_MODE_REQ, - BTIF_MSG_LE_ENABLE_EXT_ADV_MODE_RSP, - BTIF_MSG_LE_REMOTE_FEATS_INFO, - BTIF_MSG_GATT_ATTR_WRITE_CMD_SIGNED_INFO, - BTIF_MSG_LE_SIGNED_STATUS_INFO, - - BTIF_MSG_JUST_WORK_REQ_IND, - BTIF_MSG_JUST_WORK_REQ_CFM, - - BTIF_MSG_USER_PASSKEY_NOTIF_IND, - BTIF_MSG_USER_PASSKEY_NOTIF_CFM, - - BTIF_MSG_GATT_SRV2_REG_REQ, - - BTIF_MSG_LE_SET_SUPPL_TEST_PARAMS_REQ = 0x0300, - BTIF_MSG_LE_SET_SUPPL_TEST_PARAMS_RSP, - BTIF_MSG_LE_SET_CONNLESS_SUPPL_TRANSMIT_PARAMS_REQ, - BTIF_MSG_LE_SET_CONNLESS_SUPPL_TRANSMIT_PARAMS_RSP, - BTIF_MSG_LE_SET_CONNLESS_SUPPL_TRANSMIT_ENABLE_REQ, - BTIF_MSG_LE_SET_CONNLESS_SUPPL_TRANSMIT_ENABLE_RSP, - BTIF_MSG_LE_SET_CONNLESS_IQ_SAMPLING_ENABLE_REQ, - BTIF_MSG_LE_SET_CONNLESS_IQ_SAMPLING_ENABLE_RSP, - BTIF_MSG_LE_SET_CONN_SUPPL_PARAMS_REQ, - BTIF_MSG_LE_SET_CONN_SUPPL_PARAMS_RSP, - BTIF_MSG_LE_CONN_SUPPL_REQUEST_ENABLE_REQ, - BTIF_MSG_LE_CONN_SUPPL_REQUEST_ENABLE_RSP, - BTIF_MSG_LE_CONN_SUPPL_RESPONSE_ENABLE_REQ, - BTIF_MSG_LE_CONN_SUPPL_RESPONSE_ENABLE_RSP, - BTIF_MSG_LE_READ_ANTENNA_INFORMATION_REQ, - BTIF_MSG_LE_READ_ANTENNA_INFORMATION_RSP, - - BTIF_MSG_LE_CONNLESS_IQ_REPORT_INFO, - BTIF_MSG_LE_CONN_IQ_REPORT_INFO, - BTIF_MSG_LE_SUPPL_REQUEST_FAILED_INFO, - - BTIF_MSG_RADIO_MODE_SET_REQ = 0x1000, - BTIF_MSG_RADIO_MODE_SET_RSP, /**< Response of setting radio mode. */ - - BTIF_MSG_INQUIRY_REQ, - BTIF_MSG_INQUIRY_RSP, /**< Response of starting inquiry. */ - BTIF_MSG_INQUIRY_RESULT_INFO, /**< Information of device found during inquiry. */ - BTIF_MSG_INQUIRY_CMPL_INFO, /**< Information of inquiry complete. */ - BTIF_MSG_INQUIRY_CANCEL_REQ, - BTIF_MSG_INQUIRY_CANCEL_RSP, /**< Response of canceling inquiry. */ - - BTIF_MSG_REMOTE_NAME_REQ, - BTIF_MSG_REMOTE_NAME_RSP, /**< Response of getting remote name. */ - - BTIF_MSG_SDP_DISCOV_REQ, - BTIF_MSG_SDP_DISCOV_RSP, /**< Response of starting SDP discovery. */ - BTIF_MSG_SDP_ATTR_IND, /**< Indication of attributes found during SDP discovery. */ - BTIF_MSG_SDP_ATTR_CFM, - BTIF_MSG_DID_ATTR_IND, /**< Indication of attributes found during DID discovery. */ - BTIF_MSG_DID_ATTR_CFM, - BTIF_MSG_SDP_DISCOV_CMPL_INFO, /**< Information of SDP discovery complete. */ - BTIF_MSG_STOP_SDP_DISCOV_REQ, - BTIF_MSG_STOP_SDP_DISCOV_RSP, /**< Response of stopping SDP discovery. */ - - BTIF_MSG_AUTHEN_REQ, - BTIF_MSG_AUTHEN_RSP, /**< Response of BR/EDR authentication. */ - BTIF_MSG_AUTHOR_REQ_IND, /**< Indication of authorization. */ - BTIF_MSG_AUTHOR_REQ_CFM, - BTIF_MSG_PIN_CODE_REQ_IND, /**< Indication of PIN code request. */ - BTIF_MSG_PIN_CODE_REQ_CFM, - BTIF_MSG_LEGACY_REMOTE_OOB_REQ_IND, /**< Indication of legacy remote OOB data request. */ - BTIF_MSG_LEGACY_REMOTE_OOB_REQ_CFM, - BTIF_MSG_LOCAL_OOB_REQ, - BTIF_MSG_LOCAL_OOB_RSP, /**< Response of getting local OOB data. */ - - BTIF_MSG_ACL_CFG_REQ, - BTIF_MSG_ACL_CFG_RSP, /**< Response of configuring ACL link. */ - - BTIF_MSG_SDP_REG_REQ, - BTIF_MSG_SDP_REG_RSP, /**< Response of registering SDP record to Bluetooth stack. */ - BTIF_MSG_L2C_PROTO_REG_REQ, - BTIF_MSG_L2C_PROTO_REG_RSP, /**< Response of registering protocol over L2CAP. */ - BTIF_MSG_L2C_CONN_REQ, - BTIF_MSG_L2C_CONN_RSP, /**< Response of L2CAP connection request. */ - BTIF_MSG_L2C_CONN_IND, /**< Indication of L2CAP connection request from remote device. */ - BTIF_MSG_L2C_CONN_CFM, - BTIF_MSG_L2C_CONN_CMPL_INFO, /**< Information of L2CAP channel establish result. */ - BTIF_MSG_L2C_DATA_REQ, - BTIF_MSG_L2C_DATA_RSP, /**< Response of L2CAP data. */ - BTIF_MSG_L2C_DATA_IND, /**< Indication of received L2CAP data from remote device. */ - BTIF_MSG_L2C_DATA_CFM, - BTIF_MSG_L2C_DISCONN_REQ, - BTIF_MSG_L2C_DISCONN_RSP, /**< Response of disconnecting L2CAP channel. */ - BTIF_MSG_L2C_DISCONN_IND, /**< Indication of L2CAP disconnection from remote device. */ - BTIF_MSG_L2C_DISCONN_CFM, - BTIF_MSG_L2C_SET_LOCAL_BUSY_REQ, - BTIF_MSG_L2C_SET_LOCAL_BUSY_RSP, /**< Response of setting local busy state in ERTM mode. */ - - BTIF_MSG_L2C_SEC_REG_REQ, - BTIF_MSG_L2C_SEC_REG_RSP, /**< Response of registering L2CAP security entry. */ - BTIF_MSG_RFC_AUTHEN_REQ, - BTIF_MSG_RFC_AUTHEN_RSP, /**< Response of authencation over RFCOMM channel. */ - - BTIF_MSG_SCO_CONN_REQ, - BTIF_MSG_SCO_CONN_RSP, /**< Response of creating SCO/eSCO connection. */ - BTIF_MSG_SCO_CONN_IND, /**< Indication of SCO/eSCO connection request from remote device. */ - BTIF_MSG_SCO_CONN_CFM, - BTIF_MSG_SCO_CONN_CMPL_INFO, /**< Information of SCO/eSCO connection establish result. */ - BTIF_MSG_SCO_DATA_REQ, - BTIF_MSG_SCO_DATA_RSP, /**< Response of setting SCO data to remote device. */ - BTIF_MSG_SCO_DATA_IND, /**< Indication of SCO data received from remote device. */ - BTIF_MSG_SCO_DATA_CFM, - BTIF_MSG_SCO_DISCONN_REQ, - BTIF_MSG_SCO_DISCONN_RSP, /**< Response of disconnecting SCO/eSCO link. */ - BTIF_MSG_SCO_DISCONN_IND, /**< Indication of SCO/eSCO disconnection from remote device. */ - BTIF_MSG_SCO_DISCONN_CFM, - - BTIF_MSG_ACL_DISCONN_REQ, - BTIF_MSG_ACL_DISCONN_RSP, /**< Response of disconnecting ACL link. */ - - BTIF_MSG_SETUP_QOS_REQ, - BTIF_MSG_SETUP_QOS_RSP, /**< Response of setting QOS for an ACL link. */ - - /*connectionless slave broadcast*/ - BTIF_MSG_LT_ADDR_SET_REQ, - BTIF_MSG_LT_ADDR_SET_RSP, - BTIF_MSG_LT_ADDR_DEL_REQ, - BTIF_MSG_LT_ADDR_DEL_RSP, - BTIF_MSG_SYNC_TRAIN_PARAM_SET_REQ, - BTIF_MSG_SYNC_TRAIN_PARAM_SET_RSP, - BTIF_MSG_SYNC_TRAIN_REQ, - BTIF_MSG_SYNC_TRAIN_RSP, - BTIF_MSG_SYNC_TRAIN_CMPL_INFO, - BTIF_MSG_SYNC_TRAIN_RCV_REQ, - BTIF_MSG_SYNC_TRAIN_RCV_RSP, - BTIF_MSG_SYNC_TRAIN_RCV_CMPL_INFO, - BTIF_MSG_CSB_SET_REQ, - BTIF_MSG_CSB_SET_RSP, - BTIF_MSG_CSB_RCV_SET_REQ, - BTIF_MSG_CSB_RCV_SET_RSP, - BTIF_MSG_CSB_TOUT_INFO, - BTIF_MSG_CSB_DATA_REQ, - BTIF_MSG_CSB_DATA_RSP, - BTIF_MSG_CSB_DATA_IND, - BTIF_MSG_CSB_DATA_CFM, - - BTIF_MSG_IDLE, -} T_BTIF_MSG_TYPE; - -/** - * btif.h - * - * \brief Response of registering callback function. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_REGISTER_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint32_t version; /**< Bluetooth stack software version. */ - uint16_t cause; /**< Result of register callback function. */ -} T_BTIF_REGISTER_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_RELEASE_RSP; - -/** - * btif.h - * - * \brief Local device information. It will be received in the callback function - * registered by \ref btif_register_req with message type as \ref - * BTIF_MSG_ACT_INFO. This message will be received right after register - * response \ref BTIF_MSG_REGISTER_RSP if register successfully. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t local_addr[6]; /**< Local bluetooth address. */ - uint16_t cause; /**< Result of bluetooth stack initialization. */ -} T_BTIF_ACT_INFO; - -/** - * btif.h - * - * \brief Response of configuring local device. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_DEV_CFG_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - T_BTIF_DEV_CFG_OPCODE op; /**< Operation code for device configuration. */ - uint16_t cause; /**< Device configuration result. */ -} T_BTIF_DEV_CFG_RSP; - -/** - * btif.h - * - * \brief ACL status information. It will be received in the callback function - * registered by \ref btif_register_req with message type as \ref - * BTIF_MSG_ACL_STATUS_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - T_BTIF_ACL_STATUS status; /**< ACL status information type. */ - T_BTIF_ACL_STATUS_PARAM p; /**< ACL status information parameter. */ -} T_BTIF_ACL_STATUS_INFO; - -/** - * btif.h - * - * \brief Response of setting link proirity. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_ACL_PRIORITY_SET_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - uint8_t conn_type; /**< Connection type, 0:BR/EDR ACL link, - 1:SCO/ESCO link, 2:LE link. */ - bool is_high_priority; /**< Set the link to high priority or not. */ - uint16_t cause; /**< Result of setting priority of the link. */ -} T_BTIF_ACL_PRIORITY_SET_RSP; - -/** - * btif.h - * - * \brief Response of reading RSSI. It will be received in the callback function - * registered by \ref btif_register_req with message type as \ref BTIF_MSG_READ_RSSI_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - uint16_t cause; /**< Result of reading RSSI. */ - int8_t rssi; /**< RSSI value read if success. */ -} T_BTIF_READ_RSSI_RSP; - -/** - * btif.h - * - * \brief Response of vendor command. It will be received in the callback function - * registered by \ref btif_register_req with message type as \ref BTIF_MSG_VENDOR_CMD_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t command; /**< Vendor command. Shoule be the same as that in request. */ - uint16_t cause; /**< Result of executing command. */ - bool is_cmpl_evt; /**< Whether the response is generated from command complete event. */ - uint8_t param_len; /**< Response parameter length. */ - uint8_t param[1]; /**< Response parameter buffer. */ -} T_BTIF_VENDOR_CMD_RSP; - -/** - * btif.h - * - * \brief Vendor event infomation. It will be received in the callback function - * registered by \ref btif_register_req with message type as \ref BTIF_MSG_VENDOR_EVT_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t param_len; /**< Information parameter length. */ - uint8_t param[1]; /**< Information parameter buffer. */ -} T_BTIF_VENDOR_EVT_INFO; - -/** - * btif.h - * - * \brief Response of setting pairable mode. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_PAIRABLE_MODE_SET_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of set pairable mode. */ -} T_BTIF_PAIRABLE_MODE_SET_RSP; - -/** - * btif.h - * - * \brief Indication to request user to input passkey. It will be received in - * the callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_USER_PASSKEY_REQ_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - bool key_press; /**< Whether keypress is needed. */ -} T_BTIF_USER_PASSKEY_REQ_IND; - -/** - * btif.h - * - * \brief Response of user passkey request reply. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_USER_PASSKEY_REQ_REPLY_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of user passkey request reply. */ -} T_BTIF_USER_PASSKEY_REQ_REPLY_RSP; - -/** - * btif.h - * - * \brief Information of user passkey notification. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_USER_PASSKEY_NOTIF_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - uint32_t display_value; /**< Passkey value. */ -} T_BTIF_USER_PASSKEY_NOTIF_INFO; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint32_t display_value; -} T_BTIF_USER_PASSKEY_NOTIF_IND; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; -} T_BTIF_JUST_WORK_REQ_IND; - -/** - * btif.h - * - * \brief Indication of authentication result. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_AUTHEN_RESULT_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - uint8_t key_len; /**< Key length. */ - T_BTIF_KEY_TYPE key_type; /**< Key type. */ - uint8_t link_key[28]; /**< Key value. */ - uint16_t cause; /**< Authentication result. */ -} T_BTIF_AUTHEN_RESULT_IND; - -/** - * btif.h - * - * \brief Indication to request key during authentication. It will be received - * in the callback function registered by \ref btif_register_req with - * message type as \ref BTIF_MSG_AUTHEN_KEY_REQ_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - T_BTIF_KEY_TYPE key_type; /**< Requested Key type. */ -} T_BTIF_AUTHEN_KEY_REQ_IND; - -/** - * btif.h - * - * \brief Indication to request user confirmation when pairing. It will be received - * in the callback function registered by \ref btif_register_req with - * message type as \ref BTIF_MSG_USER_CFM_REQ_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - uint32_t display_value; /**< Numeric value to be displayed. */ -} T_BTIF_USER_CFM_REQ_IND; - -/** - * btif.h - * - * \brief Response of keypress notification request. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_KEYPRESS_NOTIF_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Keypress notification result. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ -} T_BTIF_KEYPRESS_NOTIF_RSP; - -/** - * btif.h - * - * \brief Information of remote keypress notification. It will be received in - * the callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_KEYPRESS_NOTIF_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; /**< Address type of remote device. */ - T_BTIF_KEYPRESS_NOTIF_TYPE event_type; /**< Keypress notification type. */ -} T_BTIF_KEYPRESS_NOTIF_INFO; - -/** - * btif.h - * - * \brief Information of hardware error. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_HW_ERROR_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t hw_code; /**< Hardware error code. */ -} T_BTIF_HW_ERROR_INFO; - -/** - * btif.h - * - * \brief Indication to request remote LE OOB data. It will be received in - * the callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_REMOTE_OOB_REQ_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - T_BTIF_REMOTE_ADDR_TYPE addr_type; /**< Address type of remote device */ -} T_BTIF_REMOTE_OOB_REQ_IND; - -typedef struct -{ - void *p_srv_handle; - uint16_t cause; -} T_BTIF_GATT_SRV_REG_RSP; - -typedef struct -{ - void *p_srv_handle; - void *p_req_handle; - uint16_t link_id; - uint16_t attr_index; - uint16_t cause; -} T_BTIF_GATT_ATTR_UPDATE_RSP; - -typedef struct -{ - void *p_srv_handle; - void *p_req_handle; - uint16_t link_id; - uint16_t attr_index; - uint16_t cause; - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; -} T_BTIF_GATT_ATTR_UPDATE_STATUS_IND; - -typedef struct -{ - uint16_t link_id; - void *p_srv_handle; - uint16_t attr_index; - uint16_t read_offset; -} T_BTIF_GATT_ATTR_READ_IND; - -typedef struct -{ - uint16_t link_id; - void *p_srv_handle; - uint16_t attr_index; - uint16_t attr_len; - uint16_t handle; - uint16_t write_offset; - uint16_t gap; - uint8_t data[1]; -} T_BTIF_GATT_ATTR_WRITE_IND; - -typedef struct -{ - uint16_t link_id; - uint8_t flags; /**< 0x00-Cancel all writes, 0x01-write all values */ -} T_BTIF_GATT_ATTR_EXEC_WRITE_IND; - -typedef struct -{ - uint16_t link_id; - void *p_srv_handle; - uint16_t count; /**< nbr. of attr_index/CCCD value pairs */ - uint16_t gap; /**< offset of first pair in data[] */ - uint8_t data[1]; -} T_BTIF_GATT_ATTR_CCCD_INFO; - -typedef struct -{ - uint16_t link_id; - T_BTIF_GATT_DISCOVERY_TYPE type; - uint16_t cause; -} T_BTIF_GATT_DISCOVERY_RSP; - -typedef struct -{ - uint16_t link_id; - T_BTIF_GATT_DISCOVERY_TYPE type; - uint16_t cause; - uint16_t elem_cnt; - uint16_t elem_len; - uint16_t gap; - uint8_t list[1]; -} T_BTIF_GATT_DISCOVERY_IND; - -typedef struct -{ - uint16_t link_id; - T_BTIF_GATT_READ_TYPE read_type; - uint16_t cause; - uint16_t read_offset; - uint16_t total_len; - uint16_t attr_len; - uint16_t num_handle; - uint16_t gap; - uint8_t handles[1]; -} T_BTIF_GATT_ATTR_READ_RSP; - -#if F_BT_LE_ATT_READ_MULTI_SUPPORT -typedef struct -{ - uint16_t link_id; /**< local link ID. */ - uint16_t cause; /**< More detailed result information. */ - uint16_t total_len; /**< Total number of bytes stored in the value[] array. */ - uint16_t gap; /**< offset of first handle in value[] */ - uint8_t value[1]; /**< Array of attribute values read. */ -} T_BTIF_GATT_ATTR_READ_MULTI_RSP; -#endif - -typedef struct -{ - uint16_t link_id; - T_BTIF_GATT_WRITE_TYPE write_type; - uint16_t attr_handle; - uint16_t cause; - uint16_t attr_len; /**< attrib. value length */ - uint16_t gap; /**< offset of attrib. value in data[] */ - uint8_t data[1]; -} T_BTIF_GATT_ATTR_WRITE_RSP; - -typedef struct -{ - uint16_t link_id; /**< local link ID. */ - uint16_t cause; /**< More detailed result information. */ - uint16_t write_offset; /**< The offset of the first octet to be written. */ - uint16_t attr_len; /**< attrib. value length. */ - uint16_t gap; /**< offset of attrib. value in data[]. */ - uint8_t data[1]; /**< attrib. value in data[]. */ -} T_BTIF_GATT_ATTR_PREP_WRITE_RSP; - -typedef struct -{ - uint16_t link_id; /**< local link ID. */ - uint16_t cause; /**< More detailed result information. */ -} T_BTIF_GATT_ATTR_EXEC_WRITE_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t attr_handle; - uint16_t attr_len; /**< attrib. value length */ - uint16_t gap; /**< offset of attrib. value in data[] */ - uint8_t data[1]; -} T_BTIF_GATT_ATTR_IND; - -typedef T_BTIF_GATT_ATTR_IND T_BTIF_GATT_ATTR_NOTIF_INFO; - -typedef struct -{ - uint16_t link_id; - T_BTIF_KEY_TYPE key_type; - uint8_t key_size; - uint16_t cause; -} T_BTIF_GATT_SECURITY_RSP; - -typedef struct -{ - T_BTIF_GATT_STORE_OPCODE op; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint8_t bd_addr[6]; - uint8_t data_len; - uint8_t *p_data; -} T_BTIF_GATT_SERVER_STORE_IND; - -typedef struct -{ - uint16_t link_id; - uint16_t mtu_size; -} T_BTIF_GATT_MTU_SIZE_INFO; - -typedef struct -{ - uint16_t link_id; - uint16_t cause; - bool update_local; - uint32_t local_sign_count; - uint32_t remote_sign_count; -} T_BTIF_LE_SIGNED_STATUS_INFO; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint16_t link_id; - uint16_t cause; -} T_BTIF_LE_CONN_RSP; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; -} T_BTIF_LE_CONN_IND; - -typedef struct -{ - uint16_t cause; - uint16_t link_id; - uint16_t mtu_size; - uint8_t ds_credits; - T_BTIF_LOCAL_ADDR_TYPE own_addr_type; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint8_t bd_addr[6]; - uint16_t interval; - uint16_t latency; - uint16_t supv_tout; - T_BTIF_LE_PHY_TYPE tx_phy; - T_BTIF_LE_PHY_TYPE rx_phy; - uint8_t csa; -} T_BTIF_LE_CONN_CMPL_INFO; - -#if F_BT_LE_READ_REMOTE_FEATS -typedef struct -{ - uint16_t cause; - uint16_t link_id; - uint8_t remote_feats[8]; -} T_BTIF_LE_REMOTE_FEATS_INFO; -#endif - -typedef struct -{ - uint16_t link_id; - uint16_t cause; - uint16_t reason; -} T_BTIF_LE_DISCONN_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t cause; -} T_BTIF_LE_DISCONN_IND; - -typedef struct -{ - T_BTIF_LE_ADV_MODE adv_mode; - uint16_t cause; -} T_BTIF_LE_ADV_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_ADV_PARAM_SET_RSP; - -typedef struct -{ - T_BTIF_LE_ADV_DATA_TYPE data_type; - uint16_t cause; -} T_BTIF_LE_ADV_DATA_SET_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SCAN_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SCAN_PARAM_SET_RSP; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_LE_ADV_EVT_TYPE adv_type; - int8_t rssi; - uint8_t data_len; - uint8_t data[31]; -} T_BTIF_LE_SCAN_INFO; - -typedef struct -{ - T_BTIF_LE_WHITE_LIST_OP operation; - uint16_t cause; -} T_BTIF_LE_MODIFY_WHITE_LIST_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t cause; -} T_BTIF_LE_CONN_UPDATE_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t min_interval; - uint16_t max_interval; - uint16_t latency; - uint16_t supv_tout; -} T_BTIF_LE_CONN_UPDATE_IND; - -typedef struct -{ - uint16_t link_id; - uint16_t interval; - uint16_t latency; - uint16_t supv_tout; -} T_BTIF_LE_CONN_PARAM_INFO; - -typedef struct -{ - uint16_t link_id; - uint16_t min_interval; - uint16_t max_interval; - uint16_t latency; - uint16_t supv_tout; -} T_BTIF_LE_CONN_PARAM_REQ_EVT_INFO; - -typedef struct -{ - uint16_t cause; - uint16_t link_id; -} T_BTIF_LE_CONN_PARAM_REQ_REPLY_RSP; - -typedef struct -{ - uint16_t cause; - uint16_t link_id; -} T_BTIF_LE_CONN_PARAM_REQ_NEG_REPLY_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t cause; -} T_BTIF_LE_CREDIT_BASED_CONN_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; -} T_BTIF_LE_CREDIT_BASED_CONN_IND; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t cause; -} T_BTIF_LE_CREDIT_BASED_DISCONN_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t cause; -} T_BTIF_LE_CREDIT_BASED_DISCONN_IND; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t cause; -} T_BTIF_LE_SEND_CREDIT_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t cause; -} T_BTIF_LE_CREDIT_BASED_DATA_RSP; - -typedef struct -{ - uint16_t link_id; /**< local link ID. */ - uint16_t channel; /**< channel ID */ - uint16_t value_len; /**< value length */ - uint16_t gap; /**< offset of value in data[]. */ - uint8_t data[1]; /**< value. */ -} T_BTIF_LE_CREDIT_BASED_DATA_IND; - -typedef struct -{ - uint16_t cause; - uint16_t link_id; /**< local link ID. */ - uint16_t channel; /**< channel ID */ - uint16_t remote_mtu; /**< remote Maximum Transmission Unit */ - uint16_t remote_credits; /**< remote initial credits*/ - uint16_t max_ds_credits; /**< max downstream credits */ -} T_BTIF_LE_CREDIT_BASED_CONN_CMPL_INFO; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; -} T_BTIF_LE_CREDIT_BASED_CONN_CREDIT_INFO; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_CREDIT_BASED_SECURITY_REG_RSP; - -typedef struct -{ - uint16_t le_psm; - uint16_t cause; -} T_BTIF_LE_CREDIT_BASED_PSM_REG_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_CHANN_CLASSIF_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t cause; - uint8_t chann_map[5]; -} T_BTIF_LE_READ_CHANN_MAP_RSP; -#if F_BT_LE_4_0_DTM_SUPPORT -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_RECEIVER_TEST_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_TRANSMITTER_TEST_RSP; - -typedef struct -{ - uint16_t cause; - uint16_t num_pkts; -} T_BTIF_LE_TEST_END_RSP; -#endif -typedef struct -{ - uint16_t cause; - uint8_t tx_power_level; -} T_BTIF_LE_READ_ADV_TX_POWER_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_RAND_ADDR_RSP; - -typedef struct -{ - uint16_t cause; - uint16_t max_tx_oct; - uint16_t max_tx_time; - uint16_t max_rx_oct; - uint16_t max_rx_time; -} T_BTIF_LE_READ_MAX_DATA_LEN_RSP; - -typedef struct -{ - uint16_t cause; - uint16_t max_tx_oct; - uint16_t max_tx_time; -} T_BTIF_LE_READ_DEFAULT_DATA_LEN_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_WRITE_DEFAULT_DATA_LEN_RSP; - -typedef struct -{ - uint16_t cause; - uint16_t link_id; -} T_BTIF_LE_SET_DATA_LEN_RSP; - -typedef struct -{ - uint16_t link_id; - uint16_t max_tx_oct; - uint16_t max_tx_time; - uint16_t max_rx_oct; - uint16_t max_rx_time; -} T_BTIF_LE_DATA_LEN_CHANGE_INFO; - -typedef struct -{ - T_BTIF_LE_RESOLVING_LIST_OP operation; - uint16_t cause; -} T_BTIF_LE_MODIFY_RESOLV_LIST_RSP; - -typedef struct -{ - uint16_t cause; - uint8_t peer_resolv_addr[6]; -} T_BTIF_LE_READ_PEER_RESOLV_ADDR_RSP; - -typedef struct -{ - uint16_t cause; - uint8_t local_resolv_addr[6]; -} T_BTIF_LE_READ_LOCAL_RESOLV_ADDR_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_RESOLUTION_ENABLE_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_RESOLV_PRIV_ADDR_TOUT_RSP; - -//#if F_BT_LE_LOCAL_IRK_SETTING_SUPPORT -typedef struct -{ - uint16_t cause; - bool generate; - uint8_t local_irk[16]; -} T_BTIF_LE_CONFIG_LOCAL_IRK_RSP; -//#endif - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_PRIVACY_MODE_RSP; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint8_t direct_bd_addr[6]; - T_BTIF_DIRECT_ADDR_TYPE direct_addr_type; - T_BTIF_LE_DIRECT_ADV_EVT_TYPE direct_adv_type; - int8_t rssi; -} T_BTIF_LE_DIRECT_ADV_INFO; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_HIGH_DUTY_ADV_TIMEOUT_INFO; - -#if F_BT_LE_5_0_SUPPORT - -#if F_BT_LE_5_0_AE_ADV_SUPPORT -typedef struct -{ - uint16_t cause; - uint8_t adv_handle; - uint8_t rand_addr[6]; -} T_BTIF_LE_SET_ADV_SET_RAND_ADDR_RSP; - -typedef struct -{ - int8_t selected_tx_power; - uint16_t cause; -} T_BTIF_LE_EXT_ADV_PARAM_SET_RSP; - -typedef struct -{ - T_BTIF_LE_EXT_ADV_DATA_TYPE data_type; - uint16_t cause; -} T_BTIF_LE_EXT_ADV_DATA_SET_RSP; - -typedef struct -{ - T_BTIF_LE_EXT_ADV_MODE mode; - uint16_t cause; -} T_BTIF_LE_EXT_ADV_ENABLE_RSP; -#endif - -#if F_BT_LE_5_0_AE_SCAN_SUPPORT -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_EXT_SCAN_PARAM_SET_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_EXT_SCAN_RSP; -#endif - -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_DEFAULT_PHY_RSP; - -typedef struct -{ - uint16_t cause; - uint16_t link_id; -} T_BTIF_LE_SET_PHY_RSP; -#endif - -#if F_BT_LE_5_0_DTM_SUPPORT -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_ENHANCED_RECEIVER_TEST_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_ENHANCED_TRANSMITTER_TEST_RSP; -#endif -typedef struct -{ - T_BTIF_LE_PERIODIC_ADV_LIST_OP op; - uint16_t cause; -} T_BTIF_LE_MODIFY_PERIODIC_ADV_LIST_RSP; - -typedef struct -{ - uint16_t cause; - int8_t rf_tx_path_compensation; - int8_t rf_rx_path_compensation; -} T_BTIF_LE_READ_RF_PATH_COMPENSATION_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_WRITE_RF_PATH_COMPENSATION_RSP; - -typedef struct -{ - T_BTIF_LE_ADV_SET_OP op; - uint16_t cause; -} T_BTIF_LE_MODIFY_ADV_SET_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_PERIODIC_ADV_PARAM_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_PERIODIC_ADV_DATA_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_SET_PERIODIC_ADV_ENABLE_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_PERIODIC_ADV_CREATE_SYNC_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_PERIODIC_ADV_CREATE_SYNC_CANCEL_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_PERIODIC_ADV_TERMINATE_SYNC_RSP; - -#if F_BT_LE_5_0_SET_PHYS_SUPPORT -typedef struct -{ - uint16_t cause; - uint16_t link_id; - T_BTIF_LE_PHY_TYPE tx_phy; - T_BTIF_LE_PHY_TYPE rx_phy; -} T_BTIF_LE_PHY_UPDATE_INFO; -#endif -typedef enum -{ - BTIF_ADV_EVENT_TYPE_DATA_STATUS_COMPLETE = 0x00, - BTIF_ADV_EVENT_TYPE_DATA_STATUS_MORE = 0x01, - BTIF_ADV_EVENT_TYPE_DATA_STATUS_TRUNCATED = 0x02, - BTIF_ADV_EVENT_TYPE_DATA_STATUS_RFU = 0x03 -} T_BTIF_EXT_ADV_EVT_TYPE_DATA_STATUS; - -typedef struct -{ - uint16_t event_type; - T_BTIF_EXT_ADV_EVT_TYPE_DATA_STATUS data_status; - T_BTIF_REMOTE_ADDR_TYPE addr_type; - uint8_t bd_addr[6]; - T_BTIF_LE_PRIM_ADV_PHY_TYPE primary_phy; - uint8_t secondary_phy; - uint8_t adv_sid; - int8_t tx_power; - int8_t rssi; - uint16_t peri_adv_interval; - T_BTIF_DIRECT_ADDR_TYPE direct_addr_type; - uint8_t direct_addr[6]; - uint8_t data_len; - uint8_t *p_data; //max 229 bytes -} T_BTIF_LE_EXT_ADV_REPORT_INFO; - -typedef struct -{ - uint16_t cause; - uint8_t sync_handle; - uint8_t advertising_sid; - uint8_t advertiser_address_type; - uint8_t advertiser_address[6]; - T_BTIF_LE_PHY_TYPE advertiser_phy; - uint8_t periodic_advertising_interval; - uint8_t advertiser_clock_accuracy; -} T_BTIF_LE_PERIODIC_ADV_SYNC_ESTABLISHED_INFO; - -typedef struct -{ - uint16_t sync_handle; - int8_t tx_power; - int8_t rssi; - uint8_t rfu; - uint8_t data_status; - uint8_t data_len; - uint8_t *p_data; -} T_BTIF_LE_PERIODIC_ADV_REPORT_INFO; - -typedef struct -{ - uint8_t sync_handle; -} T_BTIF_LE_PERIODIC_ADV_SYNC_LOST_INFO; - -typedef struct -{ - uint16_t cause; - uint8_t adv_handle; - uint16_t conn_handle; - uint8_t num_cmpl_ext_adv_evt; -} T_BTIF_LE_ADV_SET_TERMINATED_INFO; - -typedef struct -{ - uint8_t adv_handle; - uint8_t scanner_addr_type; - uint8_t scanner_addr[6]; -} T_BTIF_LE_SCAN_REQ_RECEIVED_INFO; - -typedef struct -{ - uint16_t cause; - uint16_t le_max_ext_adv_len; - uint8_t le_max_num_of_adv_sets; - uint8_t le_periodic_adv_list_size; -} T_BTIF_LE_ENABLE_EXT_ADV_MODE_RSP; -#endif -typedef struct -{ - uint8_t le_local_feats[8]; - uint16_t le_ds_pool_id; - uint16_t le_ds_data_offset; - uint8_t le_ds_credits; - uint8_t le_max_wl_size; - uint8_t le_resolvable_list_size; - int8_t le_min_tx_power; - int8_t le_max_tx_power; -} T_BTIF_LE_LOCAL_DEV_INFO; - -/** - * btif.h - * - * \brief Response of setting radio mode. It will be received in the callback - * function registered by \ref btif_register_req with message type - * as \ref BTIF_MSG_RADIO_MODE_SET_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of set radio mode */ -} T_BTIF_RADIO_MODE_SET_RSP; - -/** - * btif.h - * - * \brief Response of starting inquiry. It will be received in the callback - * function registered by \ref btif_register_req with message type - * as \ref BTIF_MSG_INQUIRY_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of start inquiry */ -} T_BTIF_INQUIRY_RSP; - -/** - * btif.h - * - * \brief Information of devices which is found duing inquiry. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_INQUIRY_RESULT_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of device found when inquiry */ - uint32_t cod; /**< Class of device of device found when inquiry */ - int8_t rssi; /**< RSSI of device found when inquiry */ - uint8_t name[BTIF_NAME_LENGTH]; /**< Name of device found when inquiry */ -} T_BTIF_INQUIRY_RESULT_INFO; - -/** - * btif.h - * - * \brief Information of inquiry procedure complete. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_INQUIRY_CMPL_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Status of inquiry procedure */ -} T_BTIF_INQUIRY_CMPL_INFO; - -/** - * btif.h - * - * \brief Response of canceling inquiry. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_INQUIRY_CANCEL_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of cancel inquiry */ -} T_BTIF_INQUIRY_CANCEL_RSP; - -/** - * btif.h - * - * \brief Response of getting name of remote device. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_REMOTE_NAME_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of getting remote device's name */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - uint8_t name[BTIF_NAME_LENGTH]; /**< Name of remote device */ -} T_BTIF_REMOTE_NAME_RSP; - -/** - * btif.h - * - * \brief Response of starting SDP discovery. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_SDP_DISCOV_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - uint16_t cause; /**< Result of starting SDP discovery */ -} T_BTIF_SDP_DISCOV_RSP; - -/** - * btif.h - * - * \brief Indication of attributes found during SDP discovery. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_SDP_ATTR_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - uint8_t server_channel; /**< Server channel number */ - uint8_t supported_repos; /**< Supported repositories */ - uint16_t l2c_psm; /**< L2CAP PSM value */ - T_BTIF_UUID_TYPE srv_class_uuid_type; /**< Service class UUID type */ - T_BTIF_UUID_DATA srv_class_uuid_data; /**< Service class UUID data */ - uint16_t remote_version; /**< Remote profile version */ - uint16_t supported_feat; /**< Supported features */ - uint8_t *p_ext_data; /**< Address of extra data if used */ -} T_BTIF_SDP_ATTR_IND; - -/** - * btif.h - * - * \brief Indication of DID information found during SDP discovery. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_DID_ATTR_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t specific_id; /**< Specific ID of remote device */ - uint16_t vendor_id; /**< Vendor ID of remote device */ - uint16_t vendor_src; /**< Verndor source of remote device */ - uint16_t product_id; /**< Product ID of remote device */ - uint16_t version; /**< Version of remote device */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ -} T_BTIF_DID_ATTR_IND; - -/** - * btif.h - * - * \brief Information of SDP discovery complete. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_SDP_DISCOV_CMPL_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - uint16_t cause; /**< Status of SDP discovery procedure */ -} T_BTIF_SDP_DISCOV_CMPL_INFO; - -/** - * btif.h - * - * \brief Response of stopping SDP discovery. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_STOP_SDP_DISCOV_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - uint16_t cause; /**< Result of stop SDP discovey */ -} T_BTIF_STOP_SDP_DISCOV_RSP; - -/** - * btif.h - * - * \brief Response of BR/EDR authentication request. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_AUTHEN_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - uint16_t cause; /**< Result of authentication procedure */ -} T_BTIF_AUTHEN_RSP; - -/** - * btif.h - * - * \brief Indication to request user's authorization for service connection - * establish. It will be received in the callback function registered by - * \ref btif_register_req with message type as \ref BTIF_MSG_AUTHOR_REQ_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t psm; /**< PSM of protocol which the service is based on */ - uint16_t server_chann; /**< Server channel number when PSM is RFCOMM, otherwise is 0 */ - uint16_t uuid; /**< UUID of the service */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ - uint8_t outgoing; /**< Direction of the service, 1 for outgoing and 0 for incoming. */ -} T_BTIF_AUTHOR_REQ_IND; - -/** - * btif.h - * - * \brief Indication to request PIN code. It will be received in the callback - * function registered by \ref btif_register_req with message type - * as \ref BTIF_MSG_PIN_CODE_REQ_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ -} T_BTIF_PIN_CODE_REQ_IND; - -/** - * btif.h - * - * \brief Indication to request BR/EDR OOB data of remote device. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_LEGACY_REMOTE_OOB_REQ_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device */ -} T_BTIF_LEGACY_REMOTE_OOB_REQ_IND; - -/** - * btif.h - * - * \brief Response of getting local BR/EDR OOB data. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_LOCAL_OOB_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t data_c[16]; /**< OOB data simple pairing hash C. */ - uint8_t data_r[16]; /**< OOB data simple pairing randonizer R. */ - uint16_t cause; /**< Result of getting local OOB data. */ -} T_BTIF_LOCAL_OOB_RSP; - -/** - * btif.h - * - * \brief Response of configuring ACL link. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_ACL_CFG_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - T_BTIF_ACL_CFG_OPCODE op; /**< Operation code used to configure ACL link. */ - uint16_t cause; /**< Result of configuring ACL link. */ -} T_BTIF_ACL_CFG_RSP; - -/** - * btif.h - * - * \brief Response of registering SDP record. It will be received in the callback - * function registered by \ref btif_register_req with message type as - * \ref BTIF_MSG_SDP_REG_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of registering SDP record to Bluetooth stack. */ -} T_BTIF_SDP_REG_RSP; - -/** - * btif.h - * - * \brief Response of registering protocol over L2CAP. It will be received in - * the callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_L2C_PROTO_REG_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t psm; /**< PSM of the protocol. */ - uint16_t proto_id; /**< Protocol ID assigned by upper layer. Should be the same as request. */ - uint16_t cause; /**< Result of registering protocol to Bluetooth stack. */ -} T_BTIF_L2C_PROTO_REG_RSP; - -/** - * btif.h - * - * \brief Response of starting L2CAP connection request. It will be received in - * the callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_L2C_CONN_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cid; /**< Local CID assigned by Bluetooth stack. */ - uint16_t proto_id; /**< Protocol ID assigned by upper layer. Should be the same as request. */ - uint16_t cause; /**< Result of executing L2CAP connection request from upper layer. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ -} T_BTIF_L2C_CONN_RSP; - -/** - * btif.h - * - * \brief Indication of remote L2CAP connection request. It will be received in - * the callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_L2C_CONN_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cid; /**< Local CID assigned by Bluetooth stack. */ - uint16_t proto_id; /**< Protocol ID which is assigned by upper layer. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ -} T_BTIF_L2C_CONN_IND; - -/** - * btif.h - * - * \brief Information of L2CAP connection establish result. It will be received - * in the callback function registered by \ref btif_register_req with - * message type as \ref BTIF_MSG_L2C_CONN_CMPL_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of establishing a L2CAP channel with remote device. */ - uint16_t cid; /**< Local CID assigned by Bluetooth stack. */ - uint16_t remote_mtu; /**< Remote MTU value. */ - uint16_t proto_id; /**< Protocol ID assigned by upper layer. */ - uint16_t ds_data_offset; /**< Offset used to fill user data when sending L2CAP data to remote. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ -} T_BTIF_L2C_CONN_CMPL_INFO; - -/** - * btif.h - * - * \brief Indication of L2CAP data received from remote side. It will be received - * in the callback function registered by \ref btif_register_req with - * message type as \ref BTIF_MSG_L2C_DATA_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t proto_id; /**< Protocol ID assigned by upper layer. */ - uint16_t cid; /**< Local CID assigned by Bluetooth stack. */ - uint16_t length; /**< Length of L2CAP data. */ - uint16_t gap; /**< Offset from data parameter to the real L2CAP data. */ - uint8_t data[1]; /**< The rest of message which contains real L2CAP data at offset of gap. */ -} T_BTIF_L2C_DATA_IND; - -/** - * btif.h - * - * \brief Response of L2CAP disconnection request from upper layer. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_L2C_DISCONN_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cid; /**< Local CID assigned by Bluetooth stack. */ - uint16_t proto_id; /**< Protocol ID assigned by upper layer. */ - uint16_t cause; /**< Result of disconnecting L2CAP channel with remote device. */ -} T_BTIF_L2C_DISCONN_RSP; - -/** - * btif.h - * - * \brief Indication of L2CAP disconnection request from remote side. It will - * be received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_L2C_DISCONN_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cid; /**< Local CID assigned by Bluetooth stack. */ - uint16_t proto_id; /**< Protocol ID assigned by upper layer. */ - uint16_t cause; /**< L2CAP channel disconnect reason. */ -} T_BTIF_L2C_DISCONN_IND; - -/** - * btif.h - * - * \brief Response of setting local device into busy state in ERTM mode. It will - * be received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_L2C_SET_LOCAL_BUSY_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of setting local busy state in ERTM mode. */ -} T_BTIF_L2C_SET_LOCAL_BUSY_RSP; - -/** - * btif.h - * - * \brief Response of registering L2CAP security entry. It will be received - * in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_L2C_SEC_REG_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t psm; /**< PSM of the protocol. */ - uint16_t server_chann; /**< Server channel when PSM is RFCOMM, otherwise is 0. */ - uint8_t active; /**< Active/Deactive the security entry. */ - uint16_t uuid; /**< UUID of the service the security entry registered for. */ - uint16_t cause; /**< Result of registering L2CAP level security entry. */ -} T_BTIF_L2C_SEC_REG_RSP; - -/** - * btif.h - * - * \brief Result of authenticaion on profile over RFCOMM channel. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_RFC_AUTHEN_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t chann; /**< Local CID assigned by Bluetooth stack. */ - uint16_t dlci; /**< DCLI value of the RFCOMM channel. */ - uint16_t cause; /**< Result of authentication on the RFCOMM channel. */ - uint8_t outgoing; /**< Direction of the service, 1 for outgoing and 0 for incoming. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ -} T_BTIF_RFC_AUTHEN_RSP; - -/** - * btif.h - * - * \brief Response of SCO/eSCO connection request from upper layer. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_SCO_CONN_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of starting a SCO/eSCO connection. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ -} T_BTIF_SCO_CONN_RSP; - -/** - * btif.h - * - * \brief Indication of SCO/eSCO connection request from remote side. It will be - * received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_SCO_CONN_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ - uint8_t is_esco; /**< Connection type remote device want to create. 1 for eSCO and 0 for SCO. */ -} T_BTIF_SCO_CONN_IND; - -/** - * btif.h - * - * \brief Result of SCO/eSCO connection establish procedure. It will be received - * in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_SCO_CONN_CMPL_INFO. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t handle; /**< Connection handle of the SCO/eSCO link. */ - uint16_t cause; /**< Result of establishing the SCO/eSCO link. */ - uint8_t is_esco; /**< Whether this link is a SCO/eSCO link. 1 for eSCO and 0 for SCO. */ - uint8_t air_mode; /**< Air mode of the SCO/eSCO link. */ - uint16_t tx_length; /**< Length of the eSCO payload in transmit direction. 0 for SCO links. */ - uint16_t rx_length; /**< Length of the eSCO payload in receive direction. 0 for SCO links. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ -} T_BTIF_SCO_CONN_CMPL_INFO; - -/** - * btif.h - * - * \brief Indication of SCO/eSCO data from remote side. It will be received - * in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_SCO_DATA_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t handle; /**< Connection handle of the SCO/eSCO link. */ - T_BTIF_SCO_PKT_STATUS status; /**< Status of the SCO/eSCO data. */ - void *p_buf; /**< Address of the SCO/eSCO data. */ - uint16_t len; /**< Length of the SCO/eSCO data. */ -} T_BTIF_SCO_DATA_IND; - -/** - * btif.h - * - * \brief Response of SCO/eSCO disconnect request from upper layer. It will - * be received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_SCO_DISCONN_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t handle; /**< Connection handle of the SCO/eSCO link. */ - uint16_t cause; /**< Result of disconnecting the SCO/eSCO link. */ - uint16_t reason; /**< Disconnect reason for the SCO/eSCO link. */ -} T_BTIF_SCO_DISCONN_RSP; - -/** - * btif.h - * - * \brief Indication of SCO/eSCO disconnect request from remote side. It will - * be received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_SCO_DISCONN_IND. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t handle; /**< Connection handle of the SCO/eSCO link. */ - uint16_t cause; /**< Disconnect reason for the SCO/eSCO link. */ -} T_BTIF_SCO_DISCONN_IND; - -/** - * btif.h - * - * \brief Response of ACL disconnect request from upper layer. It will - * be received in the callback function registered by \ref btif_register_req - * with message type as \ref BTIF_MSG_ACL_DISCONN_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of disconnecting ACL link. */ - uint16_t reason; /**< Disconnect reason for the ACL link. */ - uint8_t bd_addr[6]; /**< Bluetooth address of remote device. */ -} T_BTIF_ACL_DISCONN_RSP; - -/** - * btif.h - * - * \brief Response of setup QOS for an ACL link. It will be received in the - * callback function registered by \ref btif_register_req with message - * type as \ref BTIF_MSG_SETUP_QOS_RSP. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t cause; /**< Result of setup QOS for the ACL link. */ - uint16_t handle; /**< Connection handle of the ACL link. */ -} T_BTIF_SETUP_QOS_RSP; - -typedef enum -{ - SMP_OOB_INVALID_TYPE, - SMP_OOB_PEER, - SMP_OOB_LOCAL, - SMP_OOB_BOTH -} T_BTIF_OOB_DATA_TYPE; - -typedef struct -{ - uint8_t present; - uint8_t rand[16]; - uint8_t confirm[16]; - uint8_t bd_addr_to[6]; - uint8_t local_sk[32]; - uint8_t local_pk[64]; -} T_BTIF_LOCAL_OOB_DATA; - -typedef struct -{ - uint8_t present; - uint8_t rand[16]; - uint8_t confirm[16]; - uint8_t bd_addr_from[6]; -} T_BTIF_PEER_OOB_DATA; - -typedef struct -{ - T_BTIF_LOCAL_OOB_DATA loc_oob_data; - T_BTIF_PEER_OOB_DATA peer_oob_data; -} T_SMP_SC_OOB_DATA; - -#if F_BT_LE_6_0_AOA_AOD_SUPPORT - -typedef struct -{ - uint16_t cause; - bool is_receiver; -} T_BTIF_LE_SET_SUPPL_TEST_PARAMS_RSP; - -#if F_BT_LE_6_0_AOX_CONNLESS_SUPPORT -typedef struct -{ - uint16_t cause; - uint16_t sync_handle; -} T_BTIF_LE_SET_CONNLESS_IQ_SAMPLING_ENABLE_RSP; -#endif -typedef struct -{ - uint16_t cause; - bool is_receiver; -} T_BTIF_LE_SET_CONN_SUPPL_PARAMS_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_CONN_SUPPL_REQUEST_ENABLE_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_LE_CONN_SUPPL_RESPONSE_ENABLE_RSP; - -typedef struct -{ - uint16_t cause; - uint8_t supported_sampling_rates; - uint8_t num_of_antennae; - uint8_t max_suppl_length; -} T_BTIF_LE_READ_ANTENNA_INFO_RSP; - - - -typedef struct -{ - uint16_t sync_handle; - uint8_t channel_index; - uint8_t suppl_type; - uint8_t slot_durations; - uint8_t packet_status; - uint8_t sample_count; //0x09 ?C 0x52 - uint8_t iq_sample[82 + 82]; -} T_BTIF_LE_CONNLESS_IQ_REPORT_INFO; - -typedef struct -{ - uint16_t conn_handle; - uint8_t rx_phy; - uint8_t data_chan_index; - uint8_t rssi; - uint8_t suppl_type; - uint8_t slot_durations; - uint8_t packet_status; - uint8_t sample_count;//0x09 ?C 0x52 - uint8_t iq_sample[82 + 82]; -} T_BTIF_LE_CONN_IQ_REPORT_INFO; - -typedef struct -{ - uint8_t status; - uint16_t conn_handle; - -} T_BTIF_LE_SUPPL_REQUEST_FAILED_INFO; -#endif - -typedef struct -{ - uint16_t cause; - uint8_t lt_addr; -} T_BTIF_LT_ADDR_SET_RSP; - -typedef struct -{ - uint16_t cause; - uint8_t lt_addr; -} T_BTIF_LT_ADDR_DEL_RSP; - -typedef struct -{ - uint16_t cause; - uint16_t interval; -} T_BTIF_SYNC_TRAIN_PARAM_SET_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_SYNC_TRAIN_RSP; - -typedef struct -{ - uint16_t cause; -} T_BTIF_SYNC_TRAIN_CMPL_INFO; - -typedef struct -{ - uint16_t cause; -} T_BTIF_SYNC_TRAIN_RCV_RSP; - -typedef struct -{ - uint16_t cause; - uint8_t bd_addr[6]; - uint32_t clk_offset; - uint8_t afh_chann_map[10]; - uint8_t lt_addr; - uint8_t srv_data; - uint32_t next_broadcast_inst; - uint16_t csb_interval; -} T_BTIF_SYNC_TRAIN_RCV_CMPL_INFO; - -typedef struct -{ - uint16_t cause; - uint8_t lt_addr; - uint16_t interval; -} T_BTIF_CSB_SET_RSP; - -typedef struct -{ - uint16_t cause; - uint8_t bd_addr[6]; - uint8_t lt_addr; -} T_BTIF_CSB_RCV_SET_RSP; - -typedef struct -{ - uint8_t bd_addr[6]; - uint8_t lt_addr; -} T_BTIF_CSB_TOUT_INFO; - -typedef struct -{ - uint16_t cause; - uint8_t lt_addr; -} T_BTIF_CSB_DATA_RSP; - -typedef struct -{ - uint8_t bd_addr[6]; - uint8_t lt_addr; - uint32_t clk; - uint32_t offset; - uint8_t rcv_status; - uint8_t fragment; - uint16_t data_len; - uint8_t data[1]; -} T_BTIF_CSB_DATA_IND; - -/** - * btif.h - * - * \brief Message data in upstream message from Bluetooth stack to APP. The - * specific value of the data is depeneded on message type . - * - * \ingroup BTIF - */ -typedef union -{ - T_BTIF_REGISTER_RSP register_rsp; - T_BTIF_RELEASE_RSP release_rsp; - T_BTIF_ACT_INFO act_info; - T_BTIF_DEV_CFG_RSP dev_cfg_rsp; - T_BTIF_ACL_STATUS_INFO acl_status_info; - T_BTIF_ACL_PRIORITY_SET_RSP acl_priority_set_rsp; - T_BTIF_READ_RSSI_RSP read_rssi_rsp; - T_BTIF_VENDOR_CMD_RSP vendor_cmd_rsp; - T_BTIF_VENDOR_EVT_INFO vendor_evt_info; - T_BTIF_PAIRABLE_MODE_SET_RSP pairable_mode_set_rsp; - T_BTIF_USER_PASSKEY_REQ_IND user_passkey_req_ind; - T_BTIF_JUST_WORK_REQ_IND just_work_req_ind; - T_BTIF_USER_PASSKEY_REQ_REPLY_RSP user_passkey_req_reply_rsp; - T_BTIF_USER_PASSKEY_NOTIF_INFO user_passkey_notif_info; - T_BTIF_USER_PASSKEY_NOTIF_IND user_passkey_notif_ind; - T_BTIF_AUTHEN_RESULT_IND authen_result_ind; - T_BTIF_AUTHEN_KEY_REQ_IND authen_key_req_ind; - T_BTIF_USER_CFM_REQ_IND user_cfm_req_ind; -#if F_BT_KEY_PRESS_SUPPORT - T_BTIF_KEYPRESS_NOTIF_RSP keypress_notif_rsp; - T_BTIF_KEYPRESS_NOTIF_INFO keypress_notif_info; -#endif - T_BTIF_HW_ERROR_INFO hw_error_info; - - T_BTIF_REMOTE_OOB_REQ_IND remote_ood_req_ind; - T_BTIF_GATT_SRV_REG_RSP gatt_srv_reg_rsp; - T_BTIF_GATT_ATTR_UPDATE_RSP gatt_attr_update_rsp; - T_BTIF_GATT_ATTR_UPDATE_STATUS_IND gatt_attr_update_status_ind; - T_BTIF_GATT_ATTR_READ_IND gatt_attr_read_ind; - T_BTIF_GATT_ATTR_WRITE_IND gatt_attr_write_ind; - T_BTIF_GATT_ATTR_EXEC_WRITE_IND gatt_attr_exec_write_ind; - T_BTIF_GATT_ATTR_CCCD_INFO gatt_attr_cccd_info; - T_BTIF_GATT_DISCOVERY_RSP gatt_discovery_rsp; - T_BTIF_GATT_DISCOVERY_IND gatt_discovery_ind; - T_BTIF_GATT_ATTR_READ_RSP gatt_attr_read_rsp; -#if F_BT_LE_ATT_READ_MULTI_SUPPORT - T_BTIF_GATT_ATTR_READ_MULTI_RSP gatt_attr_read_multi_rsp; -#endif - T_BTIF_GATT_ATTR_WRITE_RSP gatt_attr_write_rsp; - T_BTIF_GATT_ATTR_PREP_WRITE_RSP gatt_attr_prep_write_rsp; - T_BTIF_GATT_ATTR_EXEC_WRITE_RSP gatt_attr_exec_write_rsp; - T_BTIF_GATT_ATTR_IND gatt_attr_ind; - T_BTIF_GATT_ATTR_NOTIF_INFO gatt_attr_notif_info; - T_BTIF_GATT_SECURITY_RSP gatt_security_rsp; - T_BTIF_GATT_SERVER_STORE_IND gatt_server_store_ind; - T_BTIF_GATT_MTU_SIZE_INFO gatt_mtu_size_info; - - T_BTIF_LE_CONN_RSP le_conn_rsp; - T_BTIF_LE_CONN_IND le_conn_ind; - T_BTIF_LE_CONN_CMPL_INFO le_conn_cmpl_info; -#if F_BT_LE_READ_REMOTE_FEATS - T_BTIF_LE_REMOTE_FEATS_INFO le_remote_feats_info; -#endif - T_BTIF_LE_DISCONN_RSP le_disconn_rsp; - T_BTIF_LE_DISCONN_IND le_disconn_ind; - T_BTIF_LE_ADV_RSP le_adv_rsp; - T_BTIF_LE_ADV_PARAM_SET_RSP le_adv_param_set_rsp; - T_BTIF_LE_ADV_DATA_SET_RSP le_adv_data_set_rsp; - T_BTIF_LE_SCAN_RSP le_scan_rsp; - T_BTIF_LE_SCAN_PARAM_SET_RSP le_scan_param_set_rsp; - T_BTIF_LE_SCAN_INFO le_scan_info; - T_BTIF_LE_MODIFY_WHITE_LIST_RSP le_modify_white_list_rsp; - T_BTIF_LE_CONN_UPDATE_RSP le_conn_update_rsp; - T_BTIF_LE_CONN_UPDATE_IND le_conn_update_ind; - T_BTIF_LE_CONN_PARAM_INFO le_conn_param_info; -#if F_BT_LE_4_2_SUPPORT -#if F_BT_LE_4_2_CONN_PARAM_UPDATE_SUPPORT - T_BTIF_LE_CONN_PARAM_REQ_EVT_INFO le_conn_param_req_evt_info; - T_BTIF_LE_CONN_PARAM_REQ_REPLY_RSP le_conn_param_req_reply_rsp; - T_BTIF_LE_CONN_PARAM_REQ_NEG_REPLY_RSP le_conn_param_req_neg_reply_rsp; -#endif -#if F_BT_LE_4_2_DATA_LEN_EXT_SUPPORT - T_BTIF_LE_READ_MAX_DATA_LEN_RSP le_read_max_data_len_rsp; - T_BTIF_LE_READ_DEFAULT_DATA_LEN_RSP le_read_default_data_len_rsp; - T_BTIF_LE_WRITE_DEFAULT_DATA_LEN_RSP le_write_default_data_len_rsp; - T_BTIF_LE_SET_DATA_LEN_RSP le_set_data_len_rsp; - T_BTIF_LE_DATA_LEN_CHANGE_INFO le_data_len_change_info; -#endif -#endif -#if F_BT_LE_4_1_CBC_SUPPORT - T_BTIF_LE_CREDIT_BASED_CONN_RSP le_credit_based_conn_rsp; - T_BTIF_LE_CREDIT_BASED_CONN_IND le_credit_based_conn_ind; - T_BTIF_LE_CREDIT_BASED_DISCONN_RSP le_credit_based_disconn_rsp; - T_BTIF_LE_CREDIT_BASED_DISCONN_IND le_credit_based_disconn_ind; - T_BTIF_LE_SEND_CREDIT_RSP le_send_credit_rsp; - T_BTIF_LE_CREDIT_BASED_DATA_RSP le_credit_based_data_rsp; - T_BTIF_LE_CREDIT_BASED_DATA_IND le_credit_based_data_ind; - T_BTIF_LE_CREDIT_BASED_CONN_CMPL_INFO le_credit_based_conn_cmpl_info; - T_BTIF_LE_CREDIT_BASED_CONN_CREDIT_INFO le_credit_based_conn_credit_info; - T_BTIF_LE_CREDIT_BASED_SECURITY_REG_RSP le_credit_based_security_reg_rsp; - T_BTIF_LE_CREDIT_BASED_PSM_REG_RSP le_credit_based_psm_reg_rsp; -#endif - T_BTIF_LE_SET_CHANN_CLASSIF_RSP le_set_chann_classif_rsp; - T_BTIF_LE_READ_CHANN_MAP_RSP le_read_chann_map_rsp; -#if F_BT_LE_4_0_DTM_SUPPORT - T_BTIF_LE_RECEIVER_TEST_RSP le_receiver_test_rsp; - T_BTIF_LE_TRANSMITTER_TEST_RSP le_transmitter_test_rsp; - T_BTIF_LE_TEST_END_RSP le_test_end_rsp; -#endif - T_BTIF_LE_READ_ADV_TX_POWER_RSP le_read_adv_tx_power_rsp; - T_BTIF_LE_SET_RAND_ADDR_RSP le_set_rand_addr_rsp; - T_BTIF_LE_CONFIG_LOCAL_IRK_RSP le_config_local_irk_rsp; -#if F_BT_LE_PRIVACY_SUPPORT - T_BTIF_LE_MODIFY_RESOLV_LIST_RSP le_modify_resolv_list_rsp; - T_BTIF_LE_READ_PEER_RESOLV_ADDR_RSP le_read_peer_resolv_addr_rsp; - T_BTIF_LE_READ_LOCAL_RESOLV_ADDR_RSP le_read_local_resolv_addr_rsp; - T_BTIF_LE_SET_RESOLUTION_ENABLE_RSP le_set_resolution_enable_rsp; - T_BTIF_LE_SET_RESOLV_PRIV_ADDR_TOUT_RSP le_set_resolv_priv_addr_tout_rsp; - T_BTIF_LE_SET_PRIVACY_MODE_RSP le_set_privacy_mode_rsp; - T_BTIF_LE_DIRECT_ADV_INFO le_direct_adv_info; -#endif - T_BTIF_LE_HIGH_DUTY_ADV_TIMEOUT_INFO le_high_duty_adv_timeout_info; -#if F_BT_LE_5_0_SUPPORT -#if F_BT_LE_5_0_AE_ADV_SUPPORT - T_BTIF_LE_SET_ADV_SET_RAND_ADDR_RSP le_set_adv_set_rand_addr_rsp; - T_BTIF_LE_EXT_ADV_PARAM_SET_RSP le_ext_adv_param_set_rsp; - T_BTIF_LE_EXT_ADV_DATA_SET_RSP le_ext_adv_data_set_rsp; - T_BTIF_LE_EXT_ADV_ENABLE_RSP le_ext_adv_enable_rsp; - T_BTIF_LE_ADV_SET_TERMINATED_INFO le_adv_set_terminated_info; - T_BTIF_LE_SCAN_REQ_RECEIVED_INFO le_scan_req_received_info; - T_BTIF_LE_ENABLE_EXT_ADV_MODE_RSP le_enable_ext_adv_mode_rsp; - T_BTIF_LE_MODIFY_ADV_SET_RSP le_modify_adv_set_rsp; -#endif -#if F_BT_LE_5_0_AE_SCAN_SUPPORT - T_BTIF_LE_EXT_SCAN_PARAM_SET_RSP le_ext_scan_param_set_rsp; - T_BTIF_LE_EXT_SCAN_RSP le_ext_scan_rsp; - T_BTIF_LE_EXT_ADV_REPORT_INFO le_ext_adv_report_info; -#endif -#if F_BT_LE_5_0_SET_PHYS_SUPPORT - T_BTIF_LE_SET_DEFAULT_PHY_RSP le_set_default_phy_rsp; - T_BTIF_LE_SET_PHY_RSP le_set_phy_rsp; - T_BTIF_LE_PHY_UPDATE_INFO le_phy_update_info; -#endif -#if F_BT_LE_5_0_DTM_SUPPORT - T_BTIF_LE_ENHANCED_RECEIVER_TEST_RSP le_enhanced_receiver_test_rsp; - T_BTIF_LE_ENHANCED_TRANSMITTER_TEST_RSP le_enhanced_transmitter_test_rsp; -#endif -#if F_BT_LE_5_0_RF_PATH_SUPPORT - T_BTIF_LE_READ_RF_PATH_COMPENSATION_RSP le_read_rf_path_compensation_rsp; - T_BTIF_LE_WRITE_RF_PATH_COMPENSATION_RSP le_write_rf_path_compensation_rsp; -#endif -#if F_BT_LE_5_0_PERIODIC_ADV_SUPPORT - T_BTIF_LE_MODIFY_PERIODIC_ADV_LIST_RSP le_modify_periodic_adv_list_rsp; - T_BTIF_LE_SET_PERIODIC_ADV_PARAM_RSP le_set_periodic_adv_param_rsp; - T_BTIF_LE_SET_PERIODIC_ADV_DATA_RSP le_set_periodic_adv_data_rsp; - T_BTIF_LE_SET_PERIODIC_ADV_ENABLE_RSP le_set_periodic_adv_enable_rsp; - T_BTIF_LE_PERIODIC_ADV_CREATE_SYNC_RSP le_periodic_adv_create_sync_rsp; - T_BTIF_LE_PERIODIC_ADV_CREATE_SYNC_CANCEL_RSP le_periodic_adv_create_sync_cancel_rsp; - T_BTIF_LE_PERIODIC_ADV_TERMINATE_SYNC_RSP le_periodic_adv_terminate_sync_rsp; - T_BTIF_LE_PERIODIC_ADV_SYNC_ESTABLISHED_INFO le_periodic_adv_sync_established_info; - T_BTIF_LE_PERIODIC_ADV_REPORT_INFO le_periodic_adv_report_info; - T_BTIF_LE_PERIODIC_ADV_SYNC_LOST_INFO le_periodic_adv_sync_lost_info; -#endif -#endif - T_BTIF_LE_LOCAL_DEV_INFO le_local_dev_info; -#if F_BT_LE_ATT_SIGNED_WRITE_SUPPORT - T_BTIF_LE_SIGNED_STATUS_INFO le_signed_status_info; -#endif -#if F_BT_LE_6_0_AOA_AOD_SUPPORT - T_BTIF_LE_SET_SUPPL_TEST_PARAMS_RSP le_set_suppl_test_params_rsp; -#if F_BT_LE_6_0_AOX_CONNLESS_SUPPORT - T_BTIF_LE_SET_CONNLESS_IQ_SAMPLING_ENABLE_RSP le_set_connless_iq_sampling_enable_rsp; - T_BTIF_LE_CONNLESS_IQ_REPORT_INFO le_connless_iq_report_info; -#endif - T_BTIF_LE_SET_CONN_SUPPL_PARAMS_RSP le_set_conn_suppl_params_rsp; - T_BTIF_LE_CONN_SUPPL_REQUEST_ENABLE_RSP le_conn_suppl_request_enable_rsp; - T_BTIF_LE_CONN_SUPPL_RESPONSE_ENABLE_RSP le_conn_suppl_response_enable_rsp; - T_BTIF_LE_READ_ANTENNA_INFO_RSP le_read_antenna_info_rsp; - T_BTIF_LE_CONN_IQ_REPORT_INFO le_conn_iq_report_info; - T_BTIF_LE_SUPPL_REQUEST_FAILED_INFO le_suppl_request_failed_info; -#endif - -#if F_BT_BREDR_SUPPORT - T_BTIF_RADIO_MODE_SET_RSP radio_mode_set_rsp; - T_BTIF_INQUIRY_RSP inquiry_rsp; - T_BTIF_INQUIRY_RESULT_INFO inquiry_result_info; - T_BTIF_INQUIRY_CMPL_INFO inquiry_cmpl_info; - T_BTIF_INQUIRY_CANCEL_RSP inquiry_cancel_rsp; - T_BTIF_REMOTE_NAME_RSP remote_name_rsp; - T_BTIF_SDP_DISCOV_RSP sdp_discov_rsp; - T_BTIF_SDP_ATTR_IND sdp_attr_ind; - T_BTIF_DID_ATTR_IND did_attr_ind; - T_BTIF_SDP_DISCOV_CMPL_INFO sdp_discov_cmpl_info; - T_BTIF_STOP_SDP_DISCOV_RSP stop_sdp_discov_rsp; - T_BTIF_AUTHEN_RSP authen_rsp; - T_BTIF_AUTHOR_REQ_IND author_req_ind; - T_BTIF_PIN_CODE_REQ_IND pin_code_req_ind; - T_BTIF_LEGACY_REMOTE_OOB_REQ_IND legacy_remote_oob_req_ind; - T_BTIF_LOCAL_OOB_RSP local_oob_rsp; - T_BTIF_ACL_CFG_RSP acl_cfg_rsp; - T_BTIF_SDP_REG_RSP sdp_reg_rsp; - T_BTIF_L2C_PROTO_REG_RSP l2c_proto_reg_rsp; - T_BTIF_L2C_CONN_RSP l2c_conn_rsp; - T_BTIF_L2C_CONN_IND l2c_conn_ind; - T_BTIF_L2C_CONN_CMPL_INFO l2c_conn_cmpl_info; - T_BTIF_L2C_DATA_IND l2c_data_ind; - T_BTIF_L2C_DISCONN_RSP l2c_disconn_rsp; - T_BTIF_L2C_DISCONN_IND l2c_disconn_ind; - T_BTIF_L2C_SET_LOCAL_BUSY_RSP l2c_set_local_busy_rsp; - T_BTIF_L2C_SEC_REG_RSP l2c_sec_reg_rsp; - T_BTIF_RFC_AUTHEN_RSP rfc_authen_rsp; - T_BTIF_SCO_CONN_RSP sco_conn_rsp; - T_BTIF_SCO_CONN_IND sco_conn_ind; - T_BTIF_SCO_CONN_CMPL_INFO sco_conn_cmpl_info; - T_BTIF_SCO_DATA_IND sco_data_ind; - T_BTIF_SCO_DISCONN_RSP sco_disconn_rsp; - T_BTIF_SCO_DISCONN_IND sco_disconn_ind; - T_BTIF_ACL_DISCONN_RSP acl_disconn_rsp; - T_BTIF_SETUP_QOS_RSP setup_qos_rsp; - - T_BTIF_LT_ADDR_SET_RSP lt_addr_set_rsp; - T_BTIF_LT_ADDR_DEL_RSP lt_addr_del_rsp; - T_BTIF_SYNC_TRAIN_PARAM_SET_RSP sync_train_param_set_rsp; - T_BTIF_SYNC_TRAIN_RSP sync_train_rsp; - T_BTIF_SYNC_TRAIN_CMPL_INFO sync_train_cmpl_info; - T_BTIF_SYNC_TRAIN_RCV_RSP sync_train_rcv_rsp; - T_BTIF_SYNC_TRAIN_RCV_CMPL_INFO sync_train_rcv_cmpl_info; - T_BTIF_CSB_SET_RSP csb_set_rsp; - T_BTIF_CSB_RCV_SET_RSP csb_rcv_set_rsp; - T_BTIF_CSB_TOUT_INFO csb_tout_info; - T_BTIF_CSB_DATA_RSP csb_data_rsp; - T_BTIF_CSB_DATA_IND csb_data_ind; -#endif -} T_BTIF_UP_MSG_DATA; - -/** - * btif.h - * - * \brief Upstream message from Bluetooth stack to APP. It will be received - * in the callback function registered by \ref btif_register_req. - * - * \ingroup BTIF - */ -typedef struct -{ - uint16_t reserved; /**< Reserved for future use. */ - uint16_t command; /**< Message type defined as \ref T_BTIF_MSG_TYPE. */ - T_BTIF_UP_MSG_DATA p; /**< Message data defined as \ref T_BTIF_UP_MSG_DATA. */ -} T_BTIF_UP_MSG; - -/** - * btif.h - * - * \brief Prototype of callback function to handle btif messages from Bluetooth - * stack to upper layer. - * \details The callback function should be registered by \ref btif_register_req. - * Upstream messages will be handled in this function. Message types are - * defined in \ref T_BTIF_UP_MSG. Sending messages to APP task is - * highly recommended.\n - * - * \ingroup BTIF - */ -typedef void (* P_BTIF_CALLBACK)(T_BTIF_UP_MSG *p_msg); - -/** - * btif.h - * - * \brief Allocate a buffer from the specified pool in Bluetooth stack. This - * function is mainly used when sending LE ACL data to remote side. - * \c pool_id parameter should be the same as the one in upstream messages - * with message type as \ref BTIF_MSG_LE_LOCAL_DEV_INFO. - * - * \param[in] pool_id ID of the specified pool to allocate buffer from. - * \param[in] size Pool buffer size in bytes. - * \param[in] offset Offset in bytes. User data will be put start from the offset in the buffer. - * - * \return The address of the allocated pool buffer. If the address is NULL, - * the buffer allocation was failed. - * - * Example usage - \code{.c} - uint16_t ds_data_offset; - uint16_t ds_pool_id; - - // ... - // Assign ds_data_offset and ds_pool_id value by btif message. - // ... - - void test_send_notification(uint8_t *p_data, uint16_t data_len) - { - uint16_t length = data_len; - - if (data_len != 0 && p_data != NULL) - { - - uint8_t *p_buf = NULL; - uint16_t offset = ds_data_offset + 3; - - p_buf = btif_buffer_get(ds_pool_id, length, offset); - if (p_buf != NULL) - { - memcpy(p_buf + offset, p_data, length); - } - else - { - return; - } - - //local_mdl_id, p_service_handle, p_request_handle was get from btif message. - if (btif_gatt_attr_update_req(p_buf, local_mdl_id, p_service_handle, - p_request_handle, 4, length, offset, 0)) - { - - } - else - { - if (p_buf != NULL) - { - btif_buffer_put(p_buf); - } - } - } - } - \endcode - * - * \ingroup BTIF - */ -void *btif_buffer_get(uint16_t pool_id, uint16_t size, uint16_t offset); - -/** - * btif.h - * - * \brief Free a buffer from Bluetooth stack. The buffer can either be allocated - * by APP by \ref btif_buffer_get or allocated by Bluetooth stack and - * send to APP by callback function registered by \ref btif_register_req. - * - * \param[in] p_buf The address of the buffer. - * - * \return The status of the buffer freeing. - * \retval true Buffer was freed successfully. - * \retval false Buffer was failed to free. - * - * Example usage - \code{.c} - #define BTIF_MSG_EVENT 0x01 - - #define MAX_NUMBER_OF_RX_EVENT 0x10 - #define MAX_NUMBER_OF_MESSAGE 0x10 - - void *evt_q_handle; - void *msg_q_handle; - - // APP btif message callback function. - void app_btif_msg_cb(T_BTIF_UP_MSG *p_msg) - { - unsigned char event = BTIF_MSG_EVENT; - - if (os_msg_send(msg_q_handle, &p_msg, 0) == false) - { - APP_PRINT_WARN0("app_btif_msg_cb: Message Queue is full"); - btif_buffer_put(p_msg); - } - else if (os_msg_send(evt_q_handle, &event, 0) == false) - { - APP_PRINT_WARN0("app_btif_msg_cb: Event Queue is full"); - } - } - - void app_task(void *p_param) - { - char event; - - os_msg_queue_create(&evt_q_handle, MAX_NUMBER_OF_RX_EVENT, sizeof(unsigned char)); - os_msg_queue_create(&msg_q_handle, MAX_NUMBER_OF_MESSAGE, sizeof(T_BTIF_UP_MSG *)); - - //Register callback function - btif_register_req(app_btif_msg_cb); - - while (true) - { - if (os_msg_recv(evt_q_handle, &event, 0xFFFFFFFF) == true) - { - if (event == BTIF_MSG_EVENT) - { - T_BTIF_UP_MSG *p_msg; - - if (os_msg_recv(msg_q_handle, &p_msg, 0) == true) - { - // ... - // Handle btif message. - // ... - - btif_buffer_put(p_msg); - } - } - } - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_buffer_put(void *p_buf); - -/** - * btif.h - * - * \brief Send a request to register a callback function to handle btif - * upsteam messages from Bluetooth stack to APP. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_REGISTER_RSP - * and data is \ref T_BTIF_REGISTER_RSP will be received in the callback - * function. If the function was successfully registered, another message - * whose type is \ref BTIF_MSG_ACT_INFO and data is \ref T_BTIF_ACT_INFO - * will also be received after that. Sending messages to APP task - * in the callback function is highly recommended. Btif message - * buffer should be released after the message is truely handled. - * - * \param[in] p_callback Callback function to handle btif message. The function - * must has prototype as \ref P_BTIF_CALLBACK. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - #define BTIF_MSG_EVENT 0x01 - - #define MAX_NUMBER_OF_RX_EVENT 0x10 - #define MAX_NUMBER_OF_MESSAGE 0x10 - - void *evt_q_handle; - void *msg_q_handle; - - // APP btif message callback function. - void app_btif_msg_cb(T_BTIF_UP_MSG *p_msg) - { - unsigned char event = BTIF_MSG_EVENT; - - if (os_msg_send(msg_q_handle, &p_msg, 0) == false) - { - APP_PRINT_WARN0("app_btif_msg_cb: message queue is full"); - btif_buffer_put(p_msg); - } - else if (os_msg_send(evt_q_handle, &event, 0) == false) - { - APP_PRINT_WARN0("app_btif_msg_cb: event queue is full"); - } - } - - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_REGISTER_RSP: - APP_PRINT_TRACE1("register response cause: 0x%04x", p_msg->p.register_rsp.cause); - break; - - case BTIF_MSG_ACT_INFO: - APP_PRINT_TRACE1("local address: %s", TRACE_BDADDR(p_msg->p.act_info.local_addr)); - break; - - default: - break; - } - } - - void app_task(void *p_param) - { - char event; - - os_msg_queue_create(&evt_q_handle, MAX_NUMBER_OF_RX_EVENT, sizeof(unsigned char)); - os_msg_queue_create(&msg_q_handle, MAX_NUMBER_OF_MESSAGE, sizeof(T_BTIF_UP_MSG *)); - - //Register callback function - btif_register_req(app_btif_msg_cb); - - while (true) - { - if (os_msg_recv(evt_q_handle, &event, 0xFFFFFFFF) == true) - { - if (event == BTIF_MSG_EVENT) - { - T_BTIF_UP_MSG *p_msg; - - if (os_msg_recv(msg_q_handle, &p_msg, 0) == true) - { - app_handle_btif_msg(p_msg); - btif_buffer_put(p_msg); - } - } - } - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_register_req(P_BTIF_CALLBACK p_callback); - -/** - * btif.h - * - * \brief Send a request to read RSSI of remote device. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_READ_RSSI_RSP - * and data is \ref T_BTIF_READ_RSSI_RSP will be received in the callback - * function registered by \ref btif_register_req. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] remote_addr_type Address type of remote device. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_READ_RSSI_RSP: - { - T_BTIF_READ_RSSI_RSP *p_rsp = &p_msg->p.read_rssi_rsp; - - if (!p_rsp->cause) - { - APP_PRINT_TRACE1("RSSI value is %d", p_rsp->rssi); - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - - btif_read_rssi_req(bd_addr, BTIF_REMOTE_ADDR_CLASSIC); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_read_rssi_req(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type); - -/** - * btif.h - * - * \brief Send a request to set priority for an ACL link. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_ACL_PRIORITY_SET_RSP - * and data is \ref T_BTIF_ACL_PRIORITY_SET_RSP will be received in the callback - * function registered by \ref btif_register_req. To set priority for - * an ACL link, it must be connected and ready to be configured, which - * can be sure by receiving \ref BTIF_MSG_ACL_STATUS_INFO message with - * ACL status as \ref BTIF_ACL_CONN_READY. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] conn_type Connection type for the link. - * \param[in] is_high_priority Priority to set. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_READY: - btif_acl_priority_set_req(p_info->bd_addr, 0, true); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_ACL_PRIORITY_SET_RSP: - { - T_BTIF_ACL_PRIORITY_SET_RSP *p_rsp = &p_msg->p.acl_priority_set_rsp; - APP_PRINT_TRACE1("Configure ACL link priority response: cause 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_priority_set_req(uint8_t *bd_addr, uint8_t conn_type, bool is_high_priority); - -/** - * btif.h - * - * \brief Send a request to send vendor command to controller. If the request - * was successfully sent, a message whose type is \ref BTIF_MSG_VENDOR_CMD_RSP - * and data is \ref T_BTIF_VENDOR_CMD_RSP will be received in the callback - * function registered by \ref btif_register_req. - * - * \param[in] op Operation code of the command. - * \param[in] len Length of parameters of the command. - * \param[in] p_param Address of parameters of the command. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_VENDOR_CMD_RSP: - { - T_BTIF_VENDOR_CMD_RSP *p_rsp = &p_msg->p.vendor_cmd_rsp; - - if (p_rsp->command == 0xFC11) - { - APP_PRINT_TRACE1("vendor command response: cause 0x%04x", p_rsp->cause); - } - - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_vendor_cmd_req(0xFC11, 0, NULL); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_vendor_cmd_req(uint16_t op, uint8_t len, uint8_t *p_param); - -/** - * btif.h - * - * \brief Send a request to set pairable mode. If the request was successfully - * sent, a message whose type is \ref BTIF_MSG_PAIRABLE_MODE_SET_RSP - * and data is \ref T_BTIF_PAIRABLE_MODE_SET_RSP will be received in - * the callback function registered by \ref btif_register_req. - * - * \param[in] le_enable Whether to enable le pairing or not. - * \param[in] br_enable Whether to enable br pairing or not. - * \param[in] requirements Authentication requirement of the device. Valid values are the combination of \ref BTIF_AUTHEN_FLAGS. - * \param[in] io_caps Input/Output capabilities. Valid values is \ref T_BTIF_IOCAP. - * \param[in] oob_present Whether OOB data can be used or not. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_PAIRABLE_MODE_SET_RSP: - { - T_BTIF_PAIRABLE_MODE_SET_RSP *p_rsp = &p_msg->p.vendor_cmd_rsp; - - APP_PRINT_TRACE1("pairable mode set response: cause 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_pairable_mode_set_req(true, true, BTIF_AUTHEN_BONDING | BTIF_AUTHEN_MITM, BTIF_IOCAP_NO_IO, false); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_pairable_mode_set_req(bool le_enable, bool br_enable, uint16_t requirements, - T_BTIF_IOCAP io_caps, bool oob_present); - -/** - * btif.h - * - * \brief Send a confirmation for user passkey request indication. The function - * should be used when receiving message with type as \ref BTIF_MSG_USER_PASSKEY_REQ_IND - * in the callback function registered by \ref btif_register_req. If - * confirm with cause as \ref BTIF_CAUSE_ACCEPT, passkey should be input - * later using \ref btif_user_passkey_req_reply_req. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] remote_addr_type Address type of remote device. - * \param[in] cause Confirm result of user passkey request indication. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_USER_PASSKEY_REQ_IND: - { - T_BTIF_USER_PASSKEY_REQ_IND *p_ind = &p_msg->p.user_passkey_req_ind; - - btif_user_passkey_req_cfm(p_ind->bd_addr, p_ind->remote_addr_type, BTIF_CAUSE_ACCEPT); - btif_user_passkey_req_reply_req(p_ind->bd_addr, p_ind->remote_addr_type, 888888, BTIF_CAUSE_ACCEPT); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_user_passkey_req_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a request to input user passkey. If the request was successfully - * sent, a message whose type is \ref BTIF_MSG_USER_PASSKEY_REQ_REPLY_RSP - * and data is \ref T_BTIF_USER_PASSKEY_REQ_REPLY_RSP will be received in - * the callback function registered by \ref btif_register_req. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] remote_addr_type Address type of remote device. - * \param[in] passkey User passkey. Only valid when \c cause is \ref BTIF_CAUSE_ACCEPT. - * \param[in] cause Status of input user passkey. \ref BTIF_CAUSE_ACCEPT to input passkey, otherwise reject. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_USER_PASSKEY_REQ_IND: - { - T_BTIF_USER_PASSKEY_REQ_IND *p_ind = &p_msg->p.user_passkey_req_ind; - - btif_user_passkey_req_cfm(p_ind->bd_addr, p_ind->remote_addr_type, BTIF_CAUSE_ACCEPT); - btif_user_passkey_req_reply_req(p_ind->bd_addr, p_ind->remote_addr_type, 888888, BTIF_CAUSE_ACCEPT); - } - break; - - case BTIF_MSG_USER_PASSKEY_REQ_REPLY_RSP: - { - T_BTIF_USER_PASSKEY_REQ_REPLY_RSP *p_rsp = &p_msg->p.user_passkey_req_reply_rsp; - APP_PRINT_TRACE1("input user passkey result 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_user_passkey_req_reply_req(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - uint32_t passkey, T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a confirmation for authentication result indication. The function - * should be used when receiving message with type as \ref BTIF_MSG_AUTHEN_RESULT_IND - * in the callback function registered by \ref btif_register_req. User - * should save authetication information or delete old one according to - * key type in the indication message. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] remote_addr_type Address type of remote device. - * \param[in] cause Confirm result of authentication result indication. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_AUTHEN_RESULT_IND: - { - T_BTIF_AUTHEN_RESULT_IND *p_ind = &p_msg->p.authen_result_ind; - - if (p_ind->key_type == BTIF_KEY_DELETE) - { - //Delete link key saved before. - } - else - { - //Save link key information. - } - - btif_authen_result_cfm(p_ind->bd_addr, p_ind->remote_addr_type, BTIF_CAUSE_SUCCESS); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_authen_result_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - T_BTIF_KEY_TYPE key_type, T_BTIF_CAUSE cause); - - -/** - * btif.h - * - * \brief Send a confirmation for authentication key request indication. - * The function should be used when receiving message with type as - * \ref BTIF_MSG_AUTHEN_KEY_REQ_IND in the callback function registered - * by \ref btif_register_req. After receiving the indication, user should - * try to find key information and then use this function to confirm. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] remote_addr_type Address type of remote device. - * \param[in] key_len Length of the authenticaion key found. - * \param[in] p_key Address of the authenticaion key found. - * \param[in] key_type Type of the authenticaion key found. - * \param[in] cause Confirmation status for authentication key request indication. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_AUTHEN_KEY_REQ_IND: - { - T_BTIF_AUTHEN_KEY_REQ_IND *p_ind = &p_msg->p.authen_key_req_ind; - - if (p_ind->remote_addr_type == BTIF_REMOTE_ADDR_CLASSIC) - { - if (p_ind->key_type == BTIF_KEY_REQ_BR) - { - uint8_t link_key[16]; - uint8_t key_type; - - //Find BR/EDR link key for the address. - if (legacy_get_bond(p_ind->bd_addr, link_key, &key_type) == true) - { - btif_authen_key_req_cfm(p_ind->bd_addr, p_ind->remote_addr_type, 16, link_key, - (T_BTIF_KEY_TYPE)key_type, BTIF_CAUSE_ACCEPT); - } - else - { - btif_authen_key_req_cfm(p_ind->bd_addr, p_ind->remote_addr_type, 0, NULL, - p_ind->key_type, BTIF_CAUSE_REJECT); - } - } - } - else - { - //Handle indication for LE key request. - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_authen_key_req_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - uint8_t key_len, uint8_t *p_key, T_BTIF_KEY_TYPE key_type, - T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a confirmation for user confirm request indication. The - * function should be used when receiving message with type as \ref - * BTIF_MSG_USER_CFM_REQ_IND and specific numeric value in message - * data in the callback function registered by \ref btif_register_req. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] remote_addr_type Address type of remote device. - * \param[in] cause Confirmation status for user confirm request indication. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_USER_CFM_REQ_IND: - { - T_BTIF_USER_CFM_REQ_IND *p_ind = &p_msg->p.user_cfm_req_ind; - - btif_user_cfm_req_cfm(p_ind->bd_addr, p_ind->remote_addr_type, BTIF_CAUSE_ACCEPT); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_user_cfm_req_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a request to send keypress event to remote device. If the - * request was successfully sent, a message whose type is \ref - * BTIF_MSG_KEYPRESS_NOTIF_RSP and data is \ref T_BTIF_KEYPRESS_NOTIF_RSP - * will be received in the callback function registered by \ref btif_register_req. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] remote_addr_type Address type of remote device. - * \param[in] event_type Keypress event type. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_KEYPRESS_NOTIF_RSP: - { - T_BTIF_KEYPRESS_NOTIF_RSP *p_rsp = &p_msg->p.keypress_notif_rsp; - APP_PRINT_TRACE1("keypress response cause 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - - btif_keypress_notif_req(bd_addr, BTIF_REMOTE_ADDR_LE_PUBLIC, BTIF_PASSKEY_ENTRY_STARTED); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_keypress_notif_req(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - T_BTIF_KEYPRESS_NOTIF_TYPE event_type); - -bool btif_just_work_req_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - T_BTIF_CAUSE cause); - -bool btif_user_passkey_notif_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - T_BTIF_CAUSE cause); - -bool btif_set_link_key_convert(bool is_support); - -bool btif_user_defined(void *p_buf); - -T_BTIF_IDENT_ADDR_TYPE btif_convert_addr_type(T_BTIF_REMOTE_ADDR_TYPE type); - -bool btif_le_cfg_passkey_value(uint32_t value); - -void btif_le_cfg_slave_init_mtu(bool enable); - -void btif_le_cfg_local_key_distribute(uint8_t init_dist, uint8_t rsp_dist); - -bool btif_le_cfg_local_identity_address(uint8_t *addr, T_BTIF_IDENT_ADDR_TYPE type); - -bool btif_le_conn_req(bool use_extended_conn, uint8_t bd_addr[6], - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, T_BTIF_LOCAL_ADDR_TYPE local_addr_type, - uint8_t init_phys, uint16_t scan_timeout, T_BTIF_LE_CONN_REQ_PARAM *p_conn_req_param); - -bool btif_le_conn_cfm(uint8_t *bd_addr, T_BTIF_CAUSE cause); - -bool btif_le_disconn_req(uint16_t link_id, T_BTIF_CAUSE cause); - -bool btif_le_disconn_cfm(uint16_t link_id); - -bool btif_gatt_srv_reg_req(uint16_t num_attr, void *p_srv); - -bool btif_gatt_srv2_reg_req(uint16_t num_attr, void *p_srv, uint16_t start_handle); - -bool btif_gatt_attr_update_req(void *p_buf, uint16_t link_id, void *p_srv_handle, - void *p_req_handle, uint16_t attr_index, uint16_t attr_len, - uint16_t offset, T_BTIF_GATT_PDU_TYPE type); - -bool btif_gatt_attr_update_status_cfm(uint16_t link_id, void *p_srv_handle, - void *p_req_handle, uint16_t attr_index); - -bool btif_gatt_attr_read_cfm(void *p_buf, uint16_t link_id, void *p_srv_handle, uint16_t cause, - uint16_t attr_index, uint16_t attr_len, uint16_t offset); - -bool btif_gatt_attr_write_req_cfm(uint16_t link_id, void *p_srv_handle, - uint16_t cause, uint16_t attr_index); - -bool btif_gatt_attr_prep_write_cfm(void *p_buf, uint16_t link_id, void *p_srv_handle, - uint16_t cause, uint16_t attr_index, uint16_t attr_len, uint16_t offset); - -bool btif_gatt_attr_exec_write_cfm(uint16_t link_id, uint16_t cause, uint16_t handle); - -bool btif_gatt_attr_prep_write_req(void *p_buf, uint16_t link_id, uint16_t attr_handle, - uint16_t attr_len, uint16_t write_offset, uint16_t offset); - -bool btif_gatt_attr_exec_write_req(uint16_t link_id, uint8_t flags); - -bool btif_gatt_discovery_req(uint16_t link_id, T_BTIF_GATT_DISCOVERY_TYPE type, - uint16_t start_handle, uint16_t end_handle, uint16_t uuid16, uint8_t *p_uuid128); - -bool btif_gatt_discovery_cfm(uint16_t link_id, T_BTIF_GATT_DISCOVERY_TYPE type, - uint16_t start_handle, uint16_t end_handle); - -bool btif_gatt_attr_read_req(uint16_t link_id, T_BTIF_GATT_READ_TYPE read_type, - uint16_t read_offset, uint16_t start_handle, uint16_t end_handle, - uint16_t uuid16, uint8_t *p_uuid128); - -bool btif_gatt_attr_read_multi_req(uint16_t link_id, uint16_t num_handle, uint16_t *p_handle); - -bool btif_gatt_attr_write_req(void *p_buf, uint16_t link_id, T_BTIF_GATT_WRITE_TYPE write_type, - uint16_t attr_handle, uint16_t attr_len, uint16_t offset); - -bool btif_gatt_attr_cfm(uint16_t link_id); - -bool btif_gatt_security_req(uint16_t link_id, uint16_t requirements, uint8_t min_key_size); - -bool btif_gatt_server_store_cfm(T_BTIF_GATT_STORE_OPCODE op, uint8_t *bd_addr, - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, - uint8_t data_len, uint8_t *data, T_BTIF_CAUSE cause); - -#if F_BT_LE_SMP_OOB_SUPPORT -bool btif_remote_oob_req_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE addr_type, - uint8_t *p_data_c, T_BTIF_CAUSE cause); -#endif - -bool btif_le_adv_req(T_BTIF_LE_ADV_MODE adv_mode); - -bool btif_le_adv_param_set_req(T_BTIF_LE_ADV_TYPE adv_type, - T_BTIF_LE_ADV_FILTER_POLICY filter_policy, - uint16_t min_interval, uint16_t max_interval, - T_BTIF_LOCAL_ADDR_TYPE local_addr_type, uint8_t *bd_addr, - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type, uint8_t chann_map); - -bool btif_le_adv_data_set_req(T_BTIF_LE_ADV_DATA_TYPE data_type, uint8_t data_len, uint8_t *p_data); - -bool btif_le_scan_req(T_BTIF_LE_SCAN_MODE mode, T_BTIF_LE_SCAN_FILTER_DUPLICATES filter_duplicates); - -bool btif_le_scan_param_set_req(T_BTIF_LE_SCAN_TYPE type, uint16_t interval, uint16_t window, - T_BTIF_LE_SCAN_FILTER_POLICY filter_policy, T_BTIF_LOCAL_ADDR_TYPE local_addr_type); - -bool btif_le_ext_scan_req(T_BTIF_LE_SCAN_MODE mode, - T_BTIF_LE_SCAN_FILTER_DUPLICATES filter_duplicates, - uint16_t duration, uint16_t period); - -bool btif_le_ext_scan_param_set_req(T_BTIF_LOCAL_ADDR_TYPE local_addr_type, - T_BTIF_LE_SCAN_FILTER_POLICY filter_policy, - uint8_t scan_phys, - T_BTIF_LE_EXT_SCAN_PARAM *p_extended_scan_param); - -bool btif_le_modify_adv_set_req(T_BTIF_LE_ADV_SET_OP op, uint8_t adv_handle); - -bool btif_le_modify_white_list_req(T_BTIF_LE_WHITE_LIST_OP op, uint8_t *bd_addr, - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type); - -bool btif_le_conn_update_req(uint16_t link_id, uint16_t min_interval, uint16_t max_interval, - uint16_t conn_latency, uint16_t supv_tout, uint16_t min_ce_len, - uint16_t max_ce_len); - -bool btif_le_conn_update_cfm(uint16_t link_id, T_BTIF_CAUSE cause); - -bool btif_le_set_rand_addr_req(uint8_t *random_addr); - -bool btif_le_enable_ext_adv_mode_req(void); - -bool btif_le_set_adv_set_rand_addr_req(uint8_t *random_addr, uint8_t adv_handle); - -bool btif_le_credit_based_conn_req(uint16_t link_id, uint16_t le_psm, uint16_t mtu, - uint16_t initial_credits, uint16_t credits_threshold); - -bool btif_le_credit_based_conn_cfm(uint16_t link_id, uint16_t channel, uint16_t mtu, - uint16_t initial_credits, uint16_t credits_threshold, - T_BTIF_L2C_LE_CONN_STATUS cause); - -bool btif_le_credit_based_disconn_req(uint16_t link_id, uint16_t channel); - -bool btif_le_credit_based_disconn_cfm(uint16_t link_id, uint16_t channel); - -bool btif_le_send_credit_req(uint16_t link_id, uint16_t channel, uint16_t credits); - -bool btif_le_credit_based_data_req(void *p_buf, uint16_t link_id, uint16_t channel, - uint16_t length, uint16_t offset); - -bool btif_le_credit_based_data_cfm(uint16_t link_id, uint16_t channel, T_BTIF_CAUSE cause); - -bool btif_le_credit_based_security_reg_req(uint16_t le_psm, bool active, - T_BTIF_LE_SECURITY_MODE mode, uint8_t key_size); - -bool btif_le_credit_based_psm_reg_req(uint16_t le_psm, uint8_t action); - -bool btif_le_set_data_len_req(uint16_t link_id, uint16_t tx_oct, uint16_t tx_time); - -bool btif_le_conn_param_req_reply_req(uint16_t link_id, uint16_t min_interval, - uint16_t max_interval, uint16_t latency, uint16_t supv_tout, - uint16_t min_ce_len, uint16_t max_ce_len); - -bool btif_le_conn_param_req_neg_reply_req(uint16_t link_id, uint8_t reason); - -bool btif_le_config_local_irk_req(uint8_t *p_local_irk); - -bool btif_le_gen_rand_addr(T_BTIF_ADDR_RAND rand_addr_type, uint8_t *p_addr); - -bool btif_le_modify_resolv_list_req(T_BTIF_LE_RESOLVING_LIST_OP operation, - T_BTIF_IDENT_ADDR_TYPE peer_ident_addr_type, uint8_t *peer_ident_addr, - uint8_t *peer_irk, uint8_t *local_irk); - -bool btif_le_read_peer_resolv_addr_req(T_BTIF_IDENT_ADDR_TYPE peer_ident_addr_type, - uint8_t *peer_ident_addr); - -bool btif_le_read_local_resolv_addr_req(T_BTIF_IDENT_ADDR_TYPE peer_ident_addr_type, - uint8_t *peer_ident_addr); - -bool btif_le_set_resolution_enable_req(uint8_t enable); - -bool btif_le_set_resolv_priv_addr_tout_req(uint16_t timeout); - -bool btif_le_set_privacy_mode_req(T_BTIF_IDENT_ADDR_TYPE peer_identity_address_type, - uint8_t *peer_identity_address, T_BTIF_LE_PRIVACY_MODE privacy_mode); - -bool btif_le_set_chann_classif_req(uint8_t *p_chann_map); - -bool btif_le_read_chann_map_req(uint16_t link_id); - -bool btif_le_receiver_test_req(uint8_t rx_chann); - -bool btif_le_transmitter_test_req(uint8_t tx_chann, uint8_t data_len, uint8_t pkt_pl); - -bool btif_le_test_end_req(void); - -bool btif_le_read_adv_tx_power_req(void); - -bool btif_le_set_default_phy_req(uint8_t all_phys, uint8_t tx_phys, uint8_t rx_phys); - -bool btif_le_set_phy_req(uint16_t link_id, uint8_t all_phys, uint8_t tx_phys, - uint8_t rx_phys, T_BTIF_LE_PHY_OPTIONS phy_options); - -bool btif_le_ext_adv_enable_req(T_BTIF_LE_EXT_ADV_MODE adv_mode, uint8_t num_of_sets, - T_BTIF_LE_EXT_ADV_SET_PARAM *p_adv_set_param); - -bool btif_le_ext_adv_param_set_req(uint8_t adv_handle, uint16_t adv_event_prop, - uint32_t primary_adv_interval_min, uint32_t primary_adv_interval_max, - uint8_t primary_adv_channel_map, T_BTIF_LOCAL_ADDR_TYPE own_address_type, - T_BTIF_REMOTE_ADDR_TYPE peer_address_type, uint8_t *p_peer_address, - T_BTIF_LE_ADV_FILTER_POLICY filter_policy, uint8_t tx_power, - T_BTIF_LE_PRIM_ADV_PHY_TYPE primary_adv_phy, uint8_t secondary_adv_max_skip, - T_BTIF_LE_PHY_TYPE secondary_adv_phy, uint8_t adv_sid, - T_BTIF_LE_SCAN_REQ_NOTIFY_TYPE scan_req_notification_enable); - -bool btif_le_ext_adv_data_set_req(T_BTIF_LE_EXT_ADV_DATA_TYPE data_type, - uint8_t adv_handle, T_BTIF_LE_ADV_FRAG_OP_TYPE op, - T_BTIF_LE_ADV_FRAG_PREFERENCE_TYPE frag_preference, - uint8_t data_len, uint8_t *p_data); - -bool btif_le_enhanced_receiver_test_req(uint8_t rx_chann, uint8_t phy, uint8_t modulation_index); - -bool btif_le_enhanced_transmitter_test_req(uint8_t tx_chann, uint8_t data_len, - uint8_t pkt_pl, uint8_t phy); - -bool btif_le_modify_periodic_adv_list_req(T_BTIF_LE_PERIODIC_ADV_LIST_OP op, uint8_t adv_addr_type, - uint8_t *adv_addr, uint8_t adv_sid); - -bool btif_le_read_rf_path_compensation_req(void); - -bool btif_le_write_rf_path_compensation_req(int8_t rf_tx_path_compensation, - int8_t rf_rx_path_compensation); - -bool btif_le_set_periodic_adv_param_req(uint8_t adv_handle, uint16_t adv_interval_min, - uint16_t adv_interval_max, uint16_t adv_prop); - -bool btif_le_set_periodic_adv_data_req(uint8_t adv_handle, T_BTIF_LE_ADV_FRAG_OP_TYPE op, - uint8_t data_len, uint8_t *p_data); - -bool btif_le_set_periodic_adv_enable_req(T_BTIF_LE_PERIODIC_ADV_MODE mode, uint8_t adv_handle); - -bool btif_le_periodic_adv_create_sync_req(uint8_t filter_policy, uint8_t adv_sid, - uint8_t adv_addr_type, uint8_t adv_add[6], uint16_t skip, - uint16_t sync_timeout, uint16_t unused); - -bool btif_le_periodic_adv_create_sync_cancel_req(void); - -bool btif_le_periodic_adv_terminate_sync_req(uint16_t sync_handle); - -bool btif_remote_oob_req_cfm(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE addr_type, - uint8_t *p_data_c, T_BTIF_CAUSE cause); - -bool btif_le_sc_local_oob_init(uint64_t *p_ecc_rand_in, uint8_t *local_rand, - T_BTIF_LOCAL_OOB_DATA *p_local_oob_data); - -bool btif_le_sc_peer_oob_init(T_BTIF_PEER_OOB_DATA *p_peer_oob_data); - -#if F_BT_LE_6_0_AOA_AOD_SUPPORT -bool btif_le_set_suppl_test_params_req(bool is_receiver, uint8_t suppl_len, uint8_t suppl_slot_type, - uint8_t num_antena_ids, uint8_t antenna_switching_pattern); -#if F_BT_LE_6_0_AOX_CONNLESS_SUPPORT -bool btif_le_set_connless_suppl_transmit_params_req(uint8_t adv_handle, uint8_t suppl_type, - uint8_t suppl_len, - uint8_t num_antena_ids, uint8_t *p_antenna_id_list); -bool btif_le_set_connless_suppl_transmit_enable_req(uint8_t adv_handle, uint8_t enable); -bool btif_le_set_connless_iq_sample_enable_req(uint16_t sync_handle, uint8_t enable, - uint8_t slot_duration, - uint8_t num_antena_ids, uint8_t *p_antenna_id_list); -#endif -bool btif_le_set_conn_suppl_params_req(bool is_receiver, uint16_t link_id, uint8_t slot_duration, - uint8_t num_antena_ids, uint8_t *p_antenna_id_list); - -bool btif_le_conn_suppl_request_enable_req(uint16_t link_id, uint8_t enable, - uint16_t suppl_interval, - uint8_t suppl_len, uint8_t suppl_type); -bool btif_le_conn_suppl_response_enable_req(uint16_t link_id, uint8_t enable); -bool btif_le_read_antenna_info_req(void); -#endif - -/** - * btif.h - * - * \brief Send a request to configure name and class of device of local - * device. If the request was successfully sent, a message whose type - * is \ref BTIF_MSG_DEV_CFG_RSP and data is \ref T_BTIF_DEV_CFG_RSP - * will be received in the callback function registered by \ref - * btif_register_req. The operation code in \ref T_BTIF_DEV_CFG_RSP - * is \ref BTIF_DEV_CFG_OP_NAME. - * - * \param[in] cod Class of device to be configured. - * \param[in] p_name Address of name to be configured. The length of name should not be larger than \ref BTIF_NAME_LENGTH. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_NAME: - APP_PRINT_TRACE1("Configure local name result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_dev_cfg_name_req(0x000900, "New Name"); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_cfg_name_req(uint32_t cod, uint8_t *p_name); - -/** - * btif.h - * - * \brief Send a request to configure DID information in EIR data. If the - * request was successfully sent, a message whose type is \ref - * BTIF_MSG_DEV_CFG_RSP and data is \ref T_BTIF_DEV_CFG_RSP will be - * received in the callback function registered by \ref btif_register_req. - * The operation code in \ref T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_DID_EIR. - * - * \param[in] vendor_id Vendor ID. - * \param[in] vendor_id_src Vendor ID source. - * \param[in] product_id Product ID. - * \param[in] product_version Product version. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_DID_EIR: - APP_PRINT_TRACE1("Configure DID information result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_dev_did_eir_cfg_req(0x005D, 0x0001, 0x223B, 0x0100); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_did_eir_cfg_req(uint16_t vendor_id, uint16_t vendor_id_src, - uint16_t product_id, uint16_t product_version); - -/** - * btif.h - * - * \brief Send a request to configure extra information other than local - * name, service UUID and DID in EIR data. If the request was successfully - * sent, a message whose type is \ref BTIF_MSG_DEV_CFG_RSP and data is - * \ref T_BTIF_DEV_CFG_RSP will be received in the callback function - * registered by \ref btif_register_req. The operation code in \ref - * T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_EXT_EIR. - * - * \param[in] p_data Address of extra EIR data.The buffer should not be freed until receiving the response message. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - uint8_t *p_ext = NULL; - - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_EXT_EIR: - APP_PRINT_TRACE1("Configure extra eir data result 0x%04x", p_rsp->cause); - os_mem_free(p_ext); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - p_ext = os_mem_zalloc(30); - if (p_ext != NULL) - { - // ... - // Fill in extra EIR data. - // ... - btif_dev_ext_eir_cfg_req(p_ext); - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_ext_eir_cfg_req(uint8_t *p_data); - -/** - * btif.h - * - * \brief Send a request to configure page scan parameters and page timeout - * value. If the request was successfully sent, a message whose type is - * \ref BTIF_MSG_DEV_CFG_RSP and data is \ref T_BTIF_DEV_CFG_RSP will be - * received in the callback function registered by \ref btif_register_req. - * The operation code in \ref T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_PAGE_SCAN. - * - * \param[in] scan_type Page scan type. - * \param[in] interval Page scan interval. Only even values from 0x12 to 0x1000 are valid. - * \param[in] window Page scan window. Only values from 0x11 to 0x1000 are valid. Should be less than or equal to interval. - * \param[in] page_tout Page timeout value. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_PAGE_SCAN: - APP_PRINT_TRACE1("Configure page scan parameters result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - btif_dev_page_scan_cfg_req(BTIF_BR_PAGE_SCAN_STANDARD, 0x800, 0x12, 0x2000); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_page_scan_cfg_req(T_BTIF_BR_PAGE_SCAN_TYPE scan_type, - uint16_t interval, uint16_t window, uint16_t page_tout); - -/** - * btif.h - * - * \brief Send a request to configure inquiry scan parameters. If the request - * was successfully sent, a message whose type is \ref BTIF_MSG_DEV_CFG_RSP - * and data is \ref T_BTIF_DEV_CFG_RSP will be received in the callback - * function registered by \ref btif_register_req. The operation code in - * \ref T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_INQUIRY_SCAN. - * - * \param[in] scan_type Inquiry scan type. - * \param[in] interval Inquiry scan interval. Only even values from 0x12 to 0x1000 are valid. - * \param[in] window Inquiry scan window. Only values from 0x11 to 0x1000 are valid. Should be less than or equal to interval. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_INQUIRY_SCAN: - APP_PRINT_TRACE1("Configure inquiry scan parameters result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - btif_dev_inquiry_scan_cfg_req(BTIF_BR_INQUIRY_SCAN_STANDARD, 0x1000, 0x12); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_inquiry_scan_cfg_req(T_BTIF_BR_INQUIRY_SCAN_TYPE scan_type, - uint16_t interval, uint16_t window); - -/** - * btif.h - * - * \brief Send a request to configure inquiry mode. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_DEV_CFG_RSP - * and data is \ref T_BTIF_DEV_CFG_RSP will be received in the callback - * function registered by \ref btif_register_req. The operation code in - * \ref T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_INQUIRY_MODE. - * - * \param[in] mode Inquiry mode. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_INQUIRY_MODE: - APP_PRINT_TRACE1("Configure inquiry mode result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - btif_dev_inquiry_mode_cfg_req(BTIF_BR_EXTENDED_INQUIRY_RESULT); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_inquiry_mode_cfg_req(T_BTIF_BR_INQUIRY_MODE mode); - -/** - * btif.h - * - * \brief Send a request to configure default link policy to use after ACL - * connection is established and default page timeout value if local is - * master. If the request was successfully sent, a message whose type - * is \ref BTIF_MSG_DEV_CFG_RSP and data is \ref T_BTIF_DEV_CFG_RSP - * will be received in the callback function registered by \ref btif_register_req. - * The operation code in \ref T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_LINK_POLICY. - * - * \param[in] policy Default link policy to use after ACL link established. Valid values are combination of \ref BTIF_BR_LINK_POLICY. - * \param[in] supv_tout Default supervision timeout value to use if local is master. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_LINK_POLICY: - APP_PRINT_TRACE1("Configure link policy result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - btif_dev_link_policy_cfg_req(BTIF_BR_LINK_POLICY_ENABLE_ROLE_SWITCH | BTIF_BR_LINK_POLICY_ENABLE_SNIFF_MODE, 0x7D00); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_link_policy_cfg_req(T_BTIF_BR_LINK_POLICY policy, uint16_t supv_tout); - -/** - * btif.h - * - * \brief Send a request to configure Bluetooth mode. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_DEV_CFG_RSP - * and data is \ref T_BTIF_DEV_CFG_RSP will be received in the - * callback function registered by \ref btif_register_req. The operation - * code in \ref T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_BT_MODE. - * Default value of Bluetooth mode is \ref BTIF_BT_MODE21_DISABLED. - * Bluetooth mode can only be configured from \ref BTIF_BT_MODE21_DISABLED - * to \ref BTIF_BT_MODE21_ENABLED, not the other way around. - * - * \param[in] mode Bluetooth mode. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_BT_MODE: - APP_PRINT_TRACE1("Configure Bluetooth mode result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - btif_dev_bt_mode_cfg_req(BTIF_BT_MODE21_ENABLED); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_bt_mode_cfg_req(T_BTIF_BT_MODE mode); - -/** - * btif.h - * - * \brief Send a request to configure accept role to use when accepting - * connection request from remote device. If the request was successfully - * sent, a message whose type is \ref BTIF_MSG_DEV_CFG_RSP and data is - * \ref T_BTIF_DEV_CFG_RSP will be received in the callback function - * registered by \ref btif_register_req. The operation code in \ref - * T_BTIF_DEV_CFG_RSP is \ref BTIF_DEV_CFG_OP_ACCEPT_CONN_ROLE. - * - * \param[in] role Accept role to use. - * \arg \c 0 Become the Master for this connection. - * \arg \c 1 Remain the Slave for this connection. This is the default value. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_DEV_CFG_RSP: - { - T_BTIF_DEV_CFG_RSP *p_rsp = &p_msg->p.dev_cfg_rsp; - - switch (p_rsp->op) - { - case BTIF_DEV_CFG_OP_ACCEPT_CONN_ROLE: - APP_PRINT_TRACE1("Configure accept role result 0x%04x", p_rsp->cause); - break; - - default: - break; - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - btif_dev_accept_role_cfg_req(0); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_dev_accept_role_cfg_req(uint8_t role); - -/** - * btif.h - * - * \brief Send a request to set radio mode of local device. If the request - * was successfully sent, a message whose type is \ref BTIF_MSG_RADIO_MODE_SET_RSP - * and data is \ref T_BTIF_RADIO_MODE_SET_RSP will be received in the - * callback function registered by \ref btif_register_req. - * - * \param[in] mode Radio mode of local device. - * \param[in] limited Whether enable limited discoverable mode. Only valid when inquiry scan was enabled in mode. - * \param[in] limited_time Limited discoverable timeout value. Only valid when limited discoverable was enabled. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_RADIO_MODE_SET_RSP: - { - T_BTIF_RADIO_MODE_SET_RSP *p_rsp = &p_msg->p.radio_mode_set_rsp; - APP_PRINT_TRACE1("Set radio mode response: status 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - btif_radio_mode_set_req(BTIF_RADIO_VISIBLE_CONNECTABLE, false, 0); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_radio_mode_set_req(T_BTIF_RADIO_MODE mode, bool limited, uint8_t limited_time); - -/** - * btif.h - * - * \brief Send a request to start BR/EDR inquiry. If the request was successfully - * sent, multiple messages will be received in the callback function - * registered by \ref btif_register_req. The first one has message type - * as \ref BTIF_MSG_INQUIRY_RSP and data as \ref T_BTIF_INQUIRY_RSP, - * this message indicates whether inquiry was started successfully. If - * inquiry was started successfully, one or more messages whose type is - * \ref BTIF_MSG_INQUIRY_RESULT_INFO and data is \ref T_BTIF_INQUIRY_RESULT_INFO - * may be received, each message represents a remote device information. - * After inquiry procedure is done, a message whose type is \ref BTIF_MSG_INQUIRY_CMPL_INFO - * and data is \ref T_BTIF_INQUIRY_CMPL_INFO will be received. - * - * \param[in] limited_inquiry Start a limited inquiry or not. - * \arg \c true Start a limited inquiry. - * \arg \c false Start a general inquiry. - * \param[in] timeout Inquiry duration in 1.28s. The real inquiry time is timeout*1.28s. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_INQUIRY_RSP: - { - T_BTIF_INQUIRY_RSP *p_rsp = &p_msg->p.inquiry_rsp; - APP_PRINT_TRACE1("Inquiry response: status 0x%04x", p_rsp->cause); - } - break; - - case BTIF_MSG_INQUIRY_RESULT_INFO: - { - T_BTIF_INQUIRY_RESULT_INFO *p_info = &p_msg->p.inquiry_result_info; - APP_PRINT_TRACE2("Inqury result: remote addr %s, name %s", - TRACE_BDADDR(p_info->bd_addr), TRACE_STRING(p_info->name)); - } - break; - - case BTIF_MSG_INQUIRY_CMPL_INFO: - { - T_BTIF_INQUIRY_CMPL_INFO *p_info = &p_msg->p.inquiry_cmpl_info; - APP_PRINT_TRACE1("Inquiry complete: status 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_inquiry_req(false, 8); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_inquiry_req(bool limited_inquiry, uint8_t timeout); - -/** - * btif.h - * - * \brief Send a request to stop BR/EDR inquiry. If the request was successfully - * sent, a message whose type is \ref BTIF_MSG_INQUIRY_CANCEL_RSP and - * data is \ref T_BTIF_INQUIRY_CANCEL_RSP will be received in the callback - * function registered by \ref btif_register_req to indicates whether - * inquiry was stoped successfully. If inquiry was successfully stopped, - * no \ref BTIF_MSG_INQUIRY_CMPL_INFO will be received. - * - * \param[in] None. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_INQUIRY_RSP: - { - T_BTIF_INQUIRY_RSP *p_rsp = &p_msg->p.inquiry_rsp; - - if (!p_rsp->cause) - { - btif_inquiry_cancel_req; - } - } - break; - - case BTIF_MSG_INQUIRY_CANCEL_RSP: - { - T_BTIF_INQUIRY_CANCEL_RSP *p_rsp = &p_msg->p.inquiry_cancel_rsp; - APP_PRINT_TRACE1("Stop inquiry response: status 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_inquiry_req(false, 8); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_inquiry_cancel_req(void); - -/** - * btif.h - * - * \brief Send a request to get remote device's name. If the request was successfully - * sent, a message whose type is \ref BTIF_MSG_REMOTE_NAME_RSP and - * data is \ref T_BTIF_REMOTE_NAME_RSP will be received in the callback - * function registered by \ref btif_register_req to indicate the result - * of the procedure. If success, remote name will also be contained in - * the message data. - * - * \param[in] bd_addr Bluetooth address of remote device. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_REMOTE_NAME_RSP: - { - T_BTIF_REMOTE_NAME_RSP *p_rsp = &p_msg->p.remote_name_rsp; - - if (!p_rsp->cause) - { - APP_PRINT_TRACE1("Get remote name response: name is %s", - TRACE_STRING(p_rsp->name)); - } - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - btif_remote_name_req(bd_addr); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_remote_name_req(uint8_t *bd_addr); - -/** - * btif.h - * - * \brief Send a request to start SDP discovery. If the request was successfully - * sent, multiple messages will be received in the callback function - * registered by \ref btif_register_req. The first one has message type - * as \ref BTIF_MSG_SDP_DISCOV_RSP and data as \ref T_BTIF_SDP_DISCOV_RSP - * which indicates whether SDP discovery was started successfully. If - * SDP discovery was started successfully and discovery type is \ref - * BTIF_SDP_DISCOV_TYPE_BR, one or more messages whos type is \ref - * BTIF_MSG_SDP_ATTR_IND and data is \ref T_BTIF_SDP_ATTR_IND may be - * received. If discovery type is \ref BTIF_SDP_DISCOV_TYPE_DID, one - * message whose type is \ref BTIF_MSG_DID_ATTR_IND and data is \ref - * T_BTIF_DID_ATTR_IND may be received. After inquiry procedure is done, - * \ref BTIF_MSG_SDP_DISCOV_CMPL_INFO will be received. Only one - * SDP/DID discovery can be executed at the same time. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] type SDP discovery type. - * \arg \c \ref BTIF_SDP_DISCOV_TYPE_BR Normal SDP discovery. - * \arg \c \ref BTIF_SDP_DISCOV_TYPE_DID DID discovery. - * \param[in] uuid_type Type of UUID to discovery. Only valid when discovery type is \ref BTIF_SDP_DISCOV_TYPE_BR. - * \arg \c BTIF_UUID16 UUID in 16 bits. - * \arg \c BTIF_UUID32 UUID in 32 bits. - * \arg \c BTIF_UUID128 UUID in 128 bits. - * \param[in] uuid_data Discovery UUID data corresponding to uuid_type. Only valid when discovery type is \ref BTIF_SDP_DISCOV_TYPE_BR. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SDP_DISCOV_RSP: - { - T_BTIF_SDP_DISCOV_RSP *p_rsp = &p_msg->p.sdp_discov_rsp; - APP_PRINT_TRACE1("SDP discovery response: status 0x%04x", p_rsp->cause); - } - break; - - case BTIF_MSG_SDP_ATTR_IND: - { - T_BTIF_SDP_ATTR_IND *p_ind = &p_msg->p.sdp_attr_ind; - APP_PRINT_TRACE2("SDP discovery attribute: remote addr %s, remote version 0x%04x", - TRACE_BDADDR(p_ind->bd_addr), p_ind->remote_version); - btif_sdp_attr_cfm(BTIF_CAUSE_SUCCESS); - } - break; - - case BTIF_MSG_SDP_DISCOV_CMPL_INFO: - { - T_BTIF_SDP_DISCOV_CMPL_INFO *p_info = &p_msg->p.sdp_discov_cmpl_info; - APP_PRINT_TRACE1("SDP discovery complete: status 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - T_BTIF_UUID_DATA uuid_data; - - uuid_data.uuid_16 = UUID_HANDSFREE; - btif_sdp_discov_req(bd_addr, BTIF_SDP_DISCOV_TYPE_BR, BTIF_UUID16, uuid_data); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sdp_discov_req(uint8_t *bd_addr, T_BTIF_SDP_DISCOV_TYPE type, - T_BTIF_UUID_TYPE uuid_type, T_BTIF_UUID_DATA uuid_data); - -/** - * btif.h - * - * \brief Send a confirmation for normal SDP attribute indication. This function - * is used when receiving a message whose type is \ref BTIF_MSG_SDP_ATTR_IND - * and data is \ref T_BTIF_SDP_ATTR_IND in the callback function - * registered by \ref btif_register_req. If the confirmation was - * successfully sent, Bluetooth stack will start next SDP attribute - * request procedure. - * - * \param[in] cause Confirmation cause of the SDP attribute indication. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SDP_DISCOV_RSP: - { - T_BTIF_SDP_DISCOV_RSP *p_rsp = &p_msg->p.sdp_discov_rsp; - APP_PRINT_TRACE1("SDP discovery response: status 0x%04x", p_rsp->cause); - } - break; - - case BTIF_MSG_SDP_ATTR_IND: - { - T_BTIF_SDP_ATTR_IND *p_ind = &p_msg->p.sdp_attr_ind; - APP_PRINT_TRACE2("SDP discovery attribute: remote addr %s, remote version 0x%04x", - TRACE_BDADDR(p_ind->bd_addr), p_ind->remote_version); - btif_sdp_attr_cfm(BTIF_CAUSE_SUCCESS); - } - break; - - case BTIF_MSG_SDP_DISCOV_CMPL_INFO: - { - T_BTIF_SDP_DISCOV_CMPL_INFO *p_info = &p_msg->p.sdp_discov_cmpl_info; - APP_PRINT_TRACE1("SDP discovery complete: status 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - T_BTIF_UUID_DATA uuid_data; - - uuid_data.uuid_16 = UUID_HANDSFREE; - btif_sdp_discov_req(bd_addr, BTIF_SDP_DISCOV_TYPE_BR, BTIF_UUID16, uuid_data); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sdp_attr_cfm(T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a confirmation for DID attribute indication. This function is - * used when receiving a message whose type is \ref BTIF_MSG_DID_ATTR_IND - * and data is \ref T_BTIF_DID_ATTR_IND in the callback function registered - * by \ref btif_register_req. If the confirmation was successfully sent, - * Bluetooth stack will start next DID attribute request procedure. - * - * \param[in] cause Confirmation cause of the DID attribute indication. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SDP_DISCOV_RSP: - { - T_BTIF_SDP_DISCOV_RSP *p_rsp = &p_msg->p.sdp_discov_rsp; - APP_PRINT_TRACE1("SDP discovery response: status 0x%04x", p_rsp->cause); - } - break; - - case BTIF_MSG_DID_ATTR_IND: - { - T_BTIF_DID_ATTR_IND *p_ind = &p_msg->p.did_attr_ind; - APP_PRINT_TRACE2("DID discovery attribute: remote addr %s, product ID 0x%04x", - TRACE_BDADDR(p_ind->bd_addr), p_ind->product_id); - btif_did_attr_cfm(BTIF_CAUSE_SUCCESS); - } - break; - - case BTIF_MSG_SDP_DISCOV_CMPL_INFO: - { - T_BTIF_SDP_DISCOV_CMPL_INFO *p_info = &p_msg->p.sdp_discov_cmpl_info; - APP_PRINT_TRACE1("SDP discovery complete: status 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - T_BTIF_UUID_DATA uuid_data = {0}; - - btif_sdp_discov_req(bd_addr, BTIF_SDP_DISCOV_TYPE_DID, (T_BTIF_UUID_TYPE)0, uuid_data); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_did_attr_cfm(T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a request to stop SDP discovery. If the request was successfully - * sent, a message whose type is \ref BTIF_MSG_STOP_SDP_DISCOV_RSP and - * data is \ref T_BTIF_STOP_SDP_DISCOV_RSP will be received in the callback - * function registered by \ref btif_register_req. If SDP discovery was - * successfully stopped, no \ref BTIF_MSG_SDP_DISCOV_CMPL_INFO message - * will be received. - * - * \param[in] bd_addr Bluetooth address of remote device. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SDP_DISCOV_RSP: - { - T_BTIF_SDP_DISCOV_RSP *p_rsp = &p_msg->p.sdp_discov_rsp; - APP_PRINT_TRACE1("SDP discovery response: status 0x%04x", p_rsp->cause); - - if (!p_rsp->cause) - { - btif_stop_sdp_discov_req(p_rsp->bd_addr); - } - } - break; - - case BTIF_MSG_STOP_SDP_DISCOV_RSP: - { - T_BTIF_STOP_SDP_DISCOV_RSP *p_rsp = &p_msg->p.stop_sdp_discov_rsp; - APP_PRINT_TRACE1("Stop SDP discovery reponse: status 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - T_BTIF_UUID_DATA uuid_data; - - uuid_data.uuid_16 = UUID_HANDSFREE; - btif_sdp_discov_req(bd_addr, BTIF_SDP_DISCOV_TYPE_BR, BTIF_UUID16, uuid_data); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_stop_sdp_discov_req(uint8_t *bd_addr); - -/** - * btif.h - * - * \brief Send a request to start BR/EDR pairing with remote device. If the - * request was successfully sent, a message whose type is \ref BTIF_MSG_AUTHEN_RSP - * and data is \ref T_BTIF_AUTHEN_RSP will be received in the callback - * function registered by \ref btif_register_req when the pairing procedure - * is complete. - * - * \param[in] bd_addr Bluetooth address of remote device. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_AUTHEN_RSP: - { - T_BTIF_AUTHEN_RSP *p_rsp = &p_msg->p.authen_rsp; - APP_PRINT_TRACE1("BR/EDR pairing response: status 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - - btif_authen_req(bd_addr); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_authen_req(uint8_t *bd_addr); - -/** - * btif.h - * - * \brief Send a confirmation for authorization request indication. This function - * is used when receiving a message whose type is \ref BTIF_MSG_AUTHOR_REQ_IND - * and data is \ref T_BTIF_AUTHOR_REQ_IND in the callback function registered - * by \ref btif_register_req. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] cause Confirmation cause of authorization. \ref BTIF_CAUSE_ACCEPT for accept and others for reject. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_AUTHOR_REQ_IND: - { - T_BTIF_AUTHOR_REQ_IND *p_ind = &p_msg->p.author_req_ind; - btif_author_req_cfm(p_ind->bd_addr, BTIF_CAUSE_ACCEPT); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_author_req_cfm(uint8_t *bd_addr, T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a confirmation for PIN code request indication. This function - * is used when receiving a message whose type is \ref BTIF_MSG_PIN_CODE_REQ_IND - * and data is \ref T_BTIF_PIN_CODE_REQ_IND in the callback function - * registered by \ref btif_register_req. User can input PIN code by - * using this function. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] pin_code_len Length of PIN code. Should not be larger than 16. - * \param[in] pin_code Address of PIN code. - * \param[in] cause Confirmation cause. Pin code is only valid when cause is \ref BTIF_CAUSE_ACCEPT. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_PIN_CODE_REQ_IND: - { - T_BTIF_PIN_CODE_REQ_IND *p_ind = &p_msg->p.pin_code_req_ind; - btif_pin_code_req_cfm(p_ind->bd_addr, 4, "0000", BTIF_CAUSE_ACCEPT); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_pin_code_req_cfm(uint8_t *bd_addr, uint8_t pin_code_len, - uint8_t *pin_code, T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a confirmation for remote legacy OOB data request indication. - * This function is used when receiving a message whose type is \ref - * BTIF_MSG_LEGACY_REMOTE_OOB_REQ_IND and data is \ref - * T_BTIF_LEGACY_REMOTE_OOB_REQ_IND in the callback function - * registered by \ref btif_register_req. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] p_data_c Address of BR/EDR OOB data simple pairing hash C. - * \param[in] p_data_r Address of BR/EDR OOB data simple pairing randonizer R. - * \param[in] cause Confirmation cause. OOB data are only valid when cause is \ref BTIF_CAUSE_ACCEPT. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_LEGACY_REMOTE_OOB_REQ_IND: - { - T_BTIF_LEGACY_REMOTE_OOB_REQ_IND *p_ind = &p_msg->p.legacy_remote_oob_req_ind; - uint8_t oob_r[KEY_LEN] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - uint8_t oob_c[KEY_LEN] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - btif_legacy_remote_oob_req_cfm(p_ind->bd_addr, oob_c, oob_r, BTIF_CAUSE_ACCEPT); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_legacy_remote_oob_req_cfm(uint8_t *bd_addr, uint8_t *p_data_c, - uint8_t *p_data_r, T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Send a request to get local BR/EDR OOB data. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_LOCAL_OOB_RSP - * and data is \ref T_BTIF_LOCAL_OOB_RSP will be received in the callback - * function registered by \ref btif_register_req. - * - * \param[in] None. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_LOCAL_OOB_RSP: - { - T_BTIF_LOCAL_OOB_RSP *p_rsp = &p_msg->p.local_oob_rsp; - APP_PRINT_TRACE2("Local OOB data response: data c %b, data r %b", - TRACE_BINARY(16, p_rsp->data_c), TRACE_BINARY(16, p_rsp->data_r)); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_local_oob_req(); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_local_oob_req(void); - -/** - * btif.h - * - * \brief Send a request to configure link policy for an ACL link. If the - * request was successfully sent, a message whose type is \ref BTIF_MSG_ACL_CFG_RSP - * and data is \ref T_BTIF_ACL_CFG_RSP will be received in the callback - * function registered by \ref btif_register_req. Operation code in \ref - * T_BTIF_ACL_CFG_RSP should be \ref BTIF_ACL_CFG_LINK_POLICY. Bluetooth - * stack will automatically set link policy after ACL link is connected. - * To change the default link policy that Bluetooth stack will set, - * \ref btif_dev_link_policy_cfg_req can be used.\ref btif_acl_link_policy_cfg_req - * is used to change link policy after that. In order to avoid collision, - * user should set link policy after receiving \ref BTIF_MSG_ACL_STATUS_INFO - * message with ACL status as \ref BTIF_ACL_CONN_READY. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] policy Link policy to set. Valid values are combinations of \ref BTIF_BR_LINK_POLICY. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_READY: - btif_acl_link_policy_cfg_req(p_info->bd_addr, BTIF_BR_LINK_POLICY_DISABLE_ALL); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_ACL_CFG_RSP: - { - T_BTIF_ACL_CFG_RSP *p_rsp = &p_msg->p.acl_cfg_rsp; - - if (p_rsp->op == BTIF_ACL_CFG_LINK_POLICY) - { - APP_PRINT_TRACE1("Configure ACL link policy response: cause 0x%04x", p_rsp->cause); - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_link_policy_cfg_req(uint8_t *bd_addr, T_BTIF_BR_LINK_POLICY policy); - -/** - * btif.h - * - * \brief Send a request to configure link supervision timeout value for an - * ACL link. If the request was successfully sent, a message whose type - * is \ref BTIF_MSG_ACL_CFG_RSP and data is \ref T_BTIF_ACL_CFG_RSP - * will be received in the callback function registered by \ref btif_register_req. - * Operation code in \ref T_BTIF_ACL_CFG_RSP should be \ref BTIF_ACL_CFG_LINK_SUPV_TOUT. - * The function is only useful when local is master of the ACL link. - * Bluetooth stack will automatically set link supervision timeout value - * after ACL link is connected as master. To change the default link - * supervision timeout value that Bluetooth stack will set, \ref btif_dev_link_policy_cfg_req - * can be used.\ref btif_acl_link_supv_tout_cfg_req is used to change - * link supervision timeout value after that. In order to avoid collision, - * user should set link policy after receiving \ref BTIF_MSG_ACL_STATUS_INFO - * message with ACL status as \ref BTIF_ACL_CONN_READY. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] supv_tout Supervision timeout value to set. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_READY: - btif_acl_link_supv_tout_cfg_req(p_info->bd_addr, 0x7D00); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_ACL_CFG_RSP: - { - T_BTIF_ACL_CFG_RSP *p_rsp = &p_msg->p.acl_cfg_rsp; - - if (p_rsp->op == BTIF_ACL_CFG_LINK_SUPV_TOUT) - { - APP_PRINT_TRACE1("Configure ACL link supervision timeout response: cause 0x%04x", p_rsp->cause); - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_link_supv_tout_cfg_req(uint8_t *bd_addr, uint16_t supv_tout); - -/** - * btif.h - * - * \brief Send a request to switch link role for an ACL link. If the request - * was successfully sent, a message whose type is \ref BTIF_MSG_ACL_CFG_RSP - * and data is \ref T_BTIF_ACL_CFG_RSP will be received in the callback - * function registered by \ref btif_register_req. Operation code in \ref - * T_BTIF_ACL_CFG_RSP should be \ref BTIF_ACL_CFG_LINK_ROLE. If switch - * role procedure was successful, \ref BTIF_MSG_ACL_STATUS_INFO message - * will also be received with ACL status as \ref BTIF_ACL_ROLE_MASTER - * or \ref BTIF_ACL_ROLE_SLAVE depending on the switch request. If BR/EDR - * secure connections is supported, role change during SMP exchange is - * forbidden. Recommended timing to switch is after receiving \ref - * BTIF_MSG_ACL_STATUS_INFO message with ACL status as \ref BTIF_ACL_CONN_ENCRYPTED - * or ACL status as \ref BTIF_ACL_CONN_BR_SC_CMPL if \ref BTIF_ACL_CONN_BR_SC_START - * was received before. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] role Device role to configure. - * \arg \c 0 Switch to master role. - * \arg \c 1 Switch to slave role. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - uint8_t local_role = 0; - - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_ENCRYPTED: - if (local_role == 1) - { - legacy_cfg_acl_link_role(p_info->bd_addr, 0); - } - break; - - case BTIF_ACL_ROLE_MASTER: - local_role = 0; - break; - - case BTIF_ACL_ROLE_SLAVE: - local_role = 1; - break; - - default: - break; - - } - } - break; - - case BTIF_MSG_ACL_CFG_RSP: - { - T_BTIF_ACL_CFG_RSP *p_rsp = &p_msg->p.acl_cfg_rsp; - - if (p_rsp->op == BTIF_ACL_CFG_LINK_ROLE) - { - APP_PRINT_TRACE1("Configure ACL link role response: cause 0x%04x", p_rsp->cause); - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_link_role_cfg_req(uint8_t *bd_addr, T_BTIF_BR_LINK_ROLE role); - -/** - * btif.h - * - * \brief Send a request to change packet type for an ACL link. If the request - * was successfully sent, a message whose type is \ref BTIF_MSG_ACL_CFG_RSP - * and data is \ref T_BTIF_ACL_CFG_RSP will be received in the callback - * function registered by \ref btif_register_req. Operation code in \ref - * T_BTIF_ACL_CFG_RSP should be \ref BTIF_ACL_CFG_PKT_TYPE. BT stack - * will automatically set link packet type after ACL link is connected. - * In order to avoid collision, user should set link policy after - * receiving \ref BTIF_MSG_ACL_STATUS_INFO message with ACL status as - * \ref BTIF_ACL_CONN_READY. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] pkt_type Packet type to use. Valid values are combinations of \ref BTIF_BR_ACL_PKT_TYPE. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_READY: - btif_acl_pkt_type_cfg_req(p_info->bd_addr, - BTIF_PKT_TYPE_NO_3DH1 | BTIF_PKT_TYPE_DM1 | - BTIF_PKT_TYPE_DH1 | BTIF_PKT_TYPE_NO_3DH3 | - BTIF_PKT_TYPE_DM3 | BTIF_PKT_TYPE_DH3 | - BTIF_PKT_TYPE_NO_3DH5); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_ACL_CFG_RSP: - { - T_BTIF_ACL_CFG_RSP *p_rsp = &p_msg->p.acl_cfg_rsp; - - if (p_rsp->op == BTIF_ACL_CFG_PKT_TYPE) - { - APP_PRINT_TRACE1("Configure packet type response: cause 0x%04x", p_rsp->cause); - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_pkt_type_cfg_req(uint8_t *bd_addr, uint16_t pkt_type); - -/** - * btif.h - * - * \brief Send a request to configure ACL link with remote device into sniff - * mode. If the request was successfully sent, a message whose type is - * \ref BTIF_MSG_ACL_CFG_RSP and data is \ref T_BTIF_ACL_CFG_RSP will - * be received in the callback function registered by \ref btif_register_req. - * Operation code in \ref T_BTIF_ACL_CFG_RSP should be \ref BTIF_ACL_CFG_ENTER_SNIFF_MODE. - * If the link enters sniff mode successfully, \ref BTIF_MSG_ACL_STATUS_INFO - * message will also be received with ACL status as \ref BTIF_ACL_CONN_SNIFF, - * the actual sniff interval will also be contained in the message data. - * To configure an ACL link into sniff mode, the link must be connected - * and ready to be configured, which can be sure by receiving \ref - * BTIF_MSG_ACL_STATUS_INFO message with ACL status as \ref BTIF_ACL_CONN_READY. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] min_interval Min sniff interval, only even values between 0x0002 and 0xFFFE are valid. - * \param[in] max_interval Max sniff interval, only even values between 0x0002 and 0xFFFE are valid, should be larger than min_interval. - * \param[in] sniff_attempt Number of baseband receive slots for sniff attempt. - * \param[in] sniff_tout Number of baseband receive slots for sniff timeout. - * \param[in] max_latency Max allowed sniff subrate of the remote device. Set to 0 if do not want to configure sniff subrate. - * \param[in] min_remote_tout Min base sniff subrate timeout the remote device may use. - * \param[in] min_local_tout Min base sniff subrate timeout the local device may use. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_READY: - btif_acl_sniff_mode_enter_req(p_info->bd_addr, 192, 800, 4, 2, 0, 0, 0); - break; - - case BTIF_ACL_CONN_SNIFF: - APP_PRINT_TRACE1("ACL link into sniff mode: interval 0x%04x", p_info->p.sniff.interval); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_ACL_CFG_RSP: - { - T_BTIF_ACL_CFG_RSP *p_rsp = &p_msg->p.acl_cfg_rsp; - - if (p_rsp->op == BTIF_ACL_CFG_ENTER_SNIFF_MODE) - { - APP_PRINT_TRACE1("Configure sniff mode response: cause 0x%04x", p_rsp->cause); - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_sniff_mode_enter_req(uint8_t *bd_addr, uint16_t min_interval, uint16_t max_interval, - uint16_t sniff_attempt, uint16_t sniff_tout, uint16_t max_latency, - uint16_t min_remote_tout, uint16_t min_local_tout); - -/** - * btif.h - * - * \brief Send a request to configure ACL link with remote device to exit sniff - * mode. If the request was successfully sent, a message whose type is - * \ref BTIF_MSG_ACL_CFG_RSP and data is \ref T_BTIF_ACL_CFG_RSP will - * be received in the callback function registered by \ref btif_register_req. - * Operation code in \ref T_BTIF_ACL_CFG_RSP should be \ref BTIF_ACL_CFG_EXIT_SNIFF_MODE. - * If the link exits sniff mode successfully, \ref BTIF_MSG_ACL_STATUS_INFO - * message will also be received with ACL status as \ref BTIF_ACL_CONN_ACTIVE. - * To configure an ACL link to exit sniff mode, the link must be in sniff - * mode, which can be sure by receiving \ref BTIF_MSG_ACL_STATUS_INFO - * message with ACL status as \ref BTIF_ACL_CONN_SNIFF. - * - * \param[in] bd_addr Bluetooth address of remote device. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_SNIFF: - APP_PRINT_TRACE1("ACL link into sniff mode: interval 0x%04x", p_info->p.sniff.interval); - btif_acl_sniff_mode_exit_req(p_info->bd_addr); - break; - - case BTIF_ACL_CONN_ACTIVE: - APP_PRINT_TRACE0("ACL link into active mode"); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_ACL_CFG_RSP: - { - T_BTIF_ACL_CFG_RSP *p_rsp = &p_msg->p.acl_cfg_rsp; - - if (p_rsp->op == BTIF_ACL_CFG_EXIT_SNIFF_MODE) - { - APP_PRINT_TRACE1("EXIT sniff mode response: cause 0x%04x", p_rsp->cause); - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_sniff_mode_exit_req(uint8_t *bd_addr); - -/** - * btif.h - * - * \brief Send a request to register a SDP record into Bluetooth stack. If the - * request was successfully sent, a message whose type is \ref BTIF_MSG_SDP_REG_RSP - * and data is \ref T_BTIF_SDP_REG_RSP will be received in the callback - * function registered by \ref btif_register_req. - * - * \param[in] p_buf Address of SDP record buffer. The buffer shall not - * be released since Bluetooth stack will record the buffer - * address instead of copy the whole buffer. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - //DID SDP record buffer - const uint8_t did_sdp_record[] = - { - SDP_DATA_ELEM_SEQ_HDR, - 0x4D, - //attribute SDP_ATTR_SRV_CLASS_ID_LIST - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_SRV_CLASS_ID_LIST >> 8), - (uint8_t)SDP_ATTR_SRV_CLASS_ID_LIST, - SDP_DATA_ELEM_SEQ_HDR, - 0x03, - SDP_UUID16_HDR, - (uint8_t)(UUID_PNP_INFORMATION >> 8), - (uint8_t)(UUID_PNP_INFORMATION), - - //attribute SDP_ATTR_BROWSE_GROUP_LIST - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_BROWSE_GROUP_LIST >> 8), - (uint8_t)SDP_ATTR_BROWSE_GROUP_LIST, - SDP_DATA_ELEM_SEQ_HDR, - 0x03, - SDP_UUID16_HDR, - (uint8_t)(UUID_PUBLIC_BROWSE_GROUP >> 8), - (uint8_t)UUID_PUBLIC_BROWSE_GROUP, - - //attribute SDP_ATTR_LANG_BASE_ATTR_ID_LIST - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_LANG_BASE_ATTR_ID_LIST >> 8), - (uint8_t)SDP_ATTR_LANG_BASE_ATTR_ID_LIST, - SDP_DATA_ELEM_SEQ_HDR, - 0x09, - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_LANG_ENGLISH >> 8), - (uint8_t)SDP_LANG_ENGLISH, - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_CHARACTER_UTF8 >> 8), - (uint8_t)SDP_CHARACTER_UTF8, - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_BASE_LANG_OFFSET >> 8), - (uint8_t)SDP_BASE_LANG_OFFSET, - - //attribute SDP_ATTR_PROFILE_DESC_LIST - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_PROFILE_DESC_LIST >> 8), - (uint8_t)SDP_ATTR_PROFILE_DESC_LIST, - SDP_DATA_ELEM_SEQ_HDR, - 0x08, - SDP_DATA_ELEM_SEQ_HDR, - 0x06, - SDP_UUID16_HDR, - (uint8_t)(UUID_PNP_INFORMATION >> 8), - (uint8_t)UUID_PNP_INFORMATION, - SDP_UNSIGNED_TWO_BYTE, - 0x01,//version 1.3 - 0x03, - - //attribute SDP_ATTR_DIP_SPECIFICATION_ID - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_DIP_SPECIFICATION_ID >> 8), - (uint8_t)SDP_ATTR_DIP_SPECIFICATION_ID, - SDP_UNSIGNED_TWO_BYTE, - 0x01, - 0x03, - - //attribute SDP_ATTR_DIP_VENDOR_ID - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_DIP_VENDOR_ID >> 8), - (uint8_t)SDP_ATTR_DIP_VENDOR_ID, - SDP_UNSIGNED_TWO_BYTE, - //0x00,//0x005D : RealTek - //0x5D, - (uint8_t)(RTK_COMPANY_ID >> 8), - (uint8_t)RTK_COMPANY_ID, - - //attribute SDP_ATTR_DIP_PRODUCT_ID - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_DIP_PRODUCT_ID >> 8), - (uint8_t)SDP_ATTR_DIP_PRODUCT_ID, - SDP_UNSIGNED_TWO_BYTE, - 0x22,//8763 - 0x3B, - - //attribute SDP_ATTR_DIP_PRODUCT_VERSION - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_DIP_PRODUCT_VERSION >> 8), - (uint8_t)SDP_ATTR_DIP_PRODUCT_VERSION, - SDP_UNSIGNED_TWO_BYTE, - 0x01,// 1.0.0 - 0x00, - - //attribute SDP_ATTR_DIP_PRIMARY_RECORD - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_DIP_PRIMARY_RECORD >> 8), - (uint8_t)SDP_ATTR_DIP_PRIMARY_RECORD, - SDP_BOOL_ONE_BYTE, - true, - - //attribute SDP_ATTR_DIP_VENDOR_ID_SOURCE - SDP_UNSIGNED_TWO_BYTE, - (uint8_t)(SDP_ATTR_DIP_VENDOR_ID_SOURCE >> 8), - (uint8_t)SDP_ATTR_DIP_VENDOR_ID_SOURCE, - SDP_UNSIGNED_TWO_BYTE, - 0x00,//Bluetooth SIG - 0x01 - }; - - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SDP_REG_RSP: - { - T_BTIF_SDP_REG_RSP *p_rsp = &p_msg->p.sdp_reg_rsp; - APP_PRINT_TRACE1("Register SDP record response: cause 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_sdp_reg_req(did_sdp_record); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sdp_reg_req(void *p_buf); - -/** - * btif.h - * - * \brief Send a request to register/deregister a protocol over L2CAP in Bluetooth - * stack. If the request was successfully sent, a message whose type is \ref - * BTIF_MSG_L2C_PROTO_REG_RSP and data is \ref T_BTIF_L2C_PROTO_REG_RSP - * will be received in the callback function registered by \ref btif_register_req. - * The protocol must be registered before creating a L2CAP connection - * or accepting a L2CAP connection request from other devices. - * - * \param[in] psm PSM value of the protocol. - * \param[in] proto_id Protocol ID assigned by upper layer. The protocol ID must be less than 0x10. - * \param[in] action Requested action for the protocol. - * \arg \c 0 Register the protocol into Bluetooth stack. - * \arg \c 1 Deregister the protocol from Bluetoth stack. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_PROTO_REG_RSP: - { - T_BTIF_L2C_PROTO_REG_RSP *p_rsp = &p_msg->p.l2c_proto_reg_rsp; - APP_PRINT_TRACE1("Register protocol response: cause 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_l2c_proto_reg_req(0x17, 0x01, 1); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_l2c_proto_reg_req(uint16_t psm, uint16_t proto_id, uint8_t action); - -/** - * btif.h - * - * \brief Send a request to connect a L2CAP channel with remote device. If the - * request was successfully sent, a message whose type is \ref BTIF_MSG_L2C_CONN_RSP - * and data is \ref T_BTIF_L2C_CONN_RSP will be received in the callback - * function registered by \ref btif_register_req to indicate whether - * the procedure was started successfully. If the procedure was started, - * another message whose type is \ref BTIF_MSG_L2C_CONN_CMPL_INFO and - * data is \ref T_BTIF_L2C_CONN_CMPL_INFO will also be received to tell - * the result of connection establishment. - * - * \param[in] psm PSM value of protocol on the L2CAP channel. The protocol ID and PSM must be registered by \ref btif_l2c_proto_reg_req. - * \param[in] uuid UUID of the protocol on the L2CAP channel. - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] proto_id Protocol ID assigned by upper layer. The protocol ID and PSM must be registered by \ref btif_l2c_proto_reg_req. - * \param[in] mtu_size MTU size of L2CAP channel. - * \param[in] mode_bits L2CAP modes that the channel can be used. Valid values are combinations of \ref BTIF_BR_L2CAP_MODE. - * \param[in] flush_tout Flush timeout value to use for data transmitted on the channel. 0xFFFF for no flush. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_PROTO_REG_RSP: - { - T_BTIF_L2C_PROTO_REG_RSP *p_rsp = &p_msg->p.l2c_proto_reg_rsp; - - if (!p_rsp->cause) - { - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - btif_l2c_conn_req(0x17, 0x0017, 0x01, 672, bd_addr, BTIF_L2C_MODE_BASIC, 0xFFFF); - } - } - break; - - case BTIF_MSG_L2C_CONN_RSP: - { - T_BTIF_L2C_CONN_RSP *p_rsp = &p_msg->p.l2c_conn_rsp; - APP_PRINT_TRACE("L2CAP connect reponse: cause 0x%04x", p_rsp->cause); - } - break; - - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - APP_PRINT_TRACE1("L2CAP channel establish result: cause 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_l2c_proto_reg_req(0x17, 0x01, 1); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_l2c_conn_req(uint16_t psm, uint16_t uuid, uint8_t *bd_addr, uint16_t proto_id, - uint16_t mtu_size, uint8_t mode_bits, uint16_t flush_tout); - -/** - * btif.h - * - * \brief Send a confirmation for L2CAP channel connect indication. If the - * confirmation was successfully sent and confirm cause is \ref BTIF_L2C_CONN_ACCEPT, - * a message whose type is \ref BTIF_MSG_L2C_CONN_CMPL_INFO and data is - * \ref T_BTIF_L2C_CONN_CMPL_INFO will be received in the callback - * function registered by \ref btif_register_req to tell the channel - * establish result. The function can only be used when receive \ref - * BTIF_MSG_L2C_CONN_IND message in the callback function. - * - * \param[in] cause Confirm cause for L2CAP channel connection request. \ref BTIF_L2C_CONN_ACCEPT to accept the connection, otherwise reject. - * \param[in] cid Local CID received in \ref BTIF_MSG_L2C_CONN_IND. - * \param[in] mtu_size MTU size of L2CAP channel. - * \param[in] mode_bits L2CAP modes that the channel can be used. Valid values are combinations of \ref BTIF_BR_L2CAP_MODE. - * \param[in] flush_tout Flush timeout value to use for data transmitted on the channel. 0xFFFF for no flush. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_IND: - { - T_BTIF_L2C_CONN_IND *p_ind = &p_msg->p.l2c_conn_ind; - - btif_l2c_conn_cfm(BTIF_L2C_CONN_ACCEPT, p_ind->cid, 672, BTIF_L2C_MODE_BASIC, 0xFFFF); - } - break; - - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - APP_PRINT_TRACE1("L2CAP channel establish result: cause 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_l2c_conn_cfm(T_BTIF_L2C_CONN_CAUSE cause, uint16_t cid, uint16_t mtu_size, - uint8_t mode_bits, uint16_t flush_tout); - -/** - * btif.h - * - * \brief Get buffer from Bluetooth stack to put in L2CAP data which will be sent to remote device. - * - * \param[in] size Length of L2CAP data. - * \param[in] offset Offset of real L2CAP data in the buffer. Offset value can be get from \ref BTIF_MSG_L2C_CONN_CMPL_INFO message. - * \param[in] ack Whether need an ack when the buffer was released. If set to true, \ref BTIF_MSG_L2C_DATA_RSP message will be - * received in the callback function registered by \ref btif_register_req. - * - * \return The address of the allocated buffer. If the address in NULL, the buffer was get failed. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - - if (!p_info->cause) - { - uint8_t *p_buffer = btif_get_l2c_buf(330, p_info->ds_data_offset, false); - - if (p_buffer) - { - // ... - // Fill in the buffer with SCO data - // ... - - btif_l2c_data_req(p_buffer, p_info->ds_data_offset, p_info->cid, 330, false); - } - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -void *btif_get_l2c_buf(uint16_t size, uint16_t offset, bool ack); - -/** - * btif.h - * - * \brief Send a request to send L2CAP data to remote device. - * - * \param[in] p_buf Address of L2CAP data buffer which is allocated by \ref btif_get_l2c_buf. - * \param[in] offset Offset of real L2CAP data in the buffer. Offset value can be get from \ref BTIF_MSG_L2C_CONN_CMPL_INFO message. - * \param[in] cid Local CID. The value can be get from \ref BTIF_MSG_L2C_CONN_CMPL_INFO message. - * \param[in] length Length of real L2CAP data. - * \param[in] auto_flush Whether the L2CAP data can be flushed or not. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - - if (!p_info->cause) - { - uint8_t *p_buffer = btif_get_l2c_buf(330, p_info->ds_data_offset, false); - - if (p_buffer) - { - // ... - // Fill in the buffer with SCO data - // ... - - btif_l2c_data_req(p_buffer, p_info->ds_data_offset, p_info->cid, 330, false); - } - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_l2c_data_req(void *p_buf, uint16_t offset, uint16_t cid, - uint16_t length, bool auto_flush); - -/** - * btif.h - * - * \brief Send a request to disconnect a L2CAP channel. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_L2C_DISCONN_RSP - * and data is \ref T_BTIF_L2C_DISCONN_RSP will be received in the callback - * function registered by \ref btif_register_req. - * - * \param[in] cid Local CID. The value can be get from \ref BTIF_MSG_L2C_CONN_CMPL_INFO message. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - - if (!p_info->cause) - { - btif_l2c_disconn_req(p_info->cid); - } - } - break; - - case BTIF_MSG_L2C_DISCONN_RSP: - { - T_BTIF_L2C_DISCONN_RSP *p_rsp = &p_msg->p.l2c_disconn_rsp; - - APP_PRINT_TRACE1("L2CAP channel disconnect response: status 0x%04x", - p_rsp->cause); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_l2c_disconn_req(uint16_t cid); - -/** - * btif.h - * - * \brief Send a confirmation for L2CAP channel disconnect indication. The - * function can only be used when receive \ref BTIF_MSG_L2C_DISCONN_IND - * message in the callback function registered by \ref btif_register_req. - * - * \param[in] cid Local CID. The value can be get from \ref BTIF_MSG_L2C_DISCONN_IND message. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_DISCONN_IND: - { - T_BTIF_L2C_DISCONN_IND *p_ind = &p_msg->p.l2c_disconn_ind; - btif_l2c_disconn_cfm(p_ind->cid); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_l2c_disconn_cfm(uint16_t cid); - -/** - * btif.h - * - * \brief Send a request to register/deregister a security entry over L2CAP. - * The security will be used when establishing a L2CAP channel. If the - * request was successfully sent, a message whose type is \ref BTIF_MSG_L2C_SEC_REG_RSP - * and data is \ref T_BTIF_L2C_SEC_REG_RSP will be received in the callback - * function registered by \ref btif_register_req. - * - * \param active Register/Deregister the security entry. - * \param psm PSM value for protocol. - * \param server_chann Local server channel number for RFCOMM, for other protocols set to 0. - * \param uuid UUID for profiles over rfcomm or UUID for other protocols except RFCOMM. - * \param requirement Security requirement of the entry. Valid values are combinations of \ref BTIF_BR_SEC. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_SEC_REG_RSP: - { - T_BTIF_L2C_SEC_REG_RSP *p_rsp = &p_msg->p.l2c_sec_reg_rsp; - APP_PRINT_TRACE1("Register L2CAP security entry response: cause 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - btif_l2c_sec_reg_req(1, 0x17, 0, 0x17, BTIF_BR_SEC_AUTHEN | BTIF_BR_SEC_MITM | BTIF_BR_SEC_ENCRYPT); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_l2c_sec_reg_req(uint8_t active, uint16_t psm, uint16_t server_chann, - uint16_t uuid, uint8_t requirement); - -/** - * btif.h - * - * \brief Send a request to start authentication for a profile on RFCOMM channel. - * If the request was successfully sent, a message whose type is \ref - * BTIF_MSG_RFC_AUTHEN_RSP and data is \ref T_BTIF_RFC_AUTHEN_RSP will - * be received in the callback function registered by \ref btif_register_req. - * - * \param bd_addr Bluetooth address of remote device. - * \param cid L2CAP local CID. - * \param dlci DLCI value for the RFCOMM channel. - * \param uuid UUID for profiles over rfcomm. - * \param outgoing Direction of the profile over rfcomm channel. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_RFC_AUTHEN_RSP: - { - T_BTIF_RFC_AUTHEN_RSP *p_rsp = &p_msg->p.rfc_authen_rsp; - APP_PRINT_TRACE1("RFCOMM authentication response: cause 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // Connect profile over RFCOMM. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - btif_rfc_authen_req(bd_addr, 0x40, 0x12, 0x111E, 0); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_rfc_authen_req(uint8_t *bd_addr, uint16_t cid, uint16_t dlci, - uint16_t uuid, uint8_t outgoing); - -/** - * btif.h - * - * \brief Send a request to create a SCO/eSCO connection. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_SCO_CONN_RSP - * and data is \ref T_BTIF_SCO_CONN_RSP will be received in the callback - * function registered by \ref btif_register_req to indicate whether - * the procedure was started successfully. If the procedure was started, - * another message whose type is \ref BTIF_MSG_SCO_CONN_CMPL_INFO and - * data is \ref T_BTIF_SCO_CONN_CMPL_INFO will also be received to tell - * the result of connection establishment. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] tx_bandwidth Transmit bandwidth in octets per second. - * \param[in] rx_bandwidth Receive bandwidth in octets per second. - * \param[in] max_latency A value in milliseconds representing upper limit of the sum of the synchronous interval. Valid between 0x0004 to 0xFFFE. - * \param[in] voice_setting Voice setting bitmap. - * \param[in] retrans_effort Retransmit effort. - * \arg \c 0x00 No retransmissions. - * \arg \c 0x01 At least one retransmission, optimize for power consumption. - * \arg \c 0x02 At least one retransmission, optimize for link quality. - * \arg \c 0xFF Don't care. - * \param[in] packet_type Transmit packet type. Valid values are combinations of \ref BTIF_BR_SCO_PKT_TYPE. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SCO_CONN_RSP: - { - T_BTIF_SCO_CONN_RSP *p_rsp = &p_msg->p.sco_conn_rsp; - APP_PRINT_TRACE1("SCO connect response: cause 0x%04x", p_rsp->cause); - } - break; - - case BTIF_MSG_SCO_CONN_CMPL_INFO: - { - T_BTIF_SCO_CONN_CMPL_INFO *p_info = &p_msg->p.sco_conn_cmpl_info; - APP_PRINT_TRACE1("SCO connection establish result: cause 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - uint8_t bd_addr[6] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; - btif_sco_conn_req(bd_addr, 8000, 8000, 7, 0x0360, 0, BTIF_PKT_TYPE_EV3 | BTIF_PKT_TYPE_EV4 | BTIF_PKT_TYPE_EV5); - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sco_conn_req(uint8_t *bd_addr, uint32_t tx_bandwidth, uint32_t rx_bandwidth, - uint16_t max_latency, uint16_t voice_setting, uint8_t retrans_effort, uint16_t packet_type); - -/** - * btif.h - * - * \brief Send a confirmation for SCO/eSCO connect indication. If the confirmation - * was successfully sent and confirm cause is \ref BTIF_CAUSE_ACCEPT, - * a message whose type is \ref BTIF_MSG_SCO_CONN_CMPL_INFO and data is - * \ref T_BTIF_SCO_CONN_CMPL_INFO will be received in the callback - * function registered by \ref btif_register_req to tell the connection - * establish result. The function can only be used when receive \ref - * BTIF_MSG_SCO_CONN_IND message in the callback function. - * - * \param[in] bd_addr Bluetooth address of remote device. - * \param[in] tx_bandwidth Transmit bandwidth in octets per second. - * \param[in] rx_bandwidth Receive bandwidth in octets per second. - * \param[in] max_latency A value in milliseconds representing upper limit of the sum of the synchronous interval. Valid between 0x0004 to 0xFFFE. - * \param[in] voice_setting Voice setting bitmap. - * \param[in] retrans_effort Retransmit effort. - * \arg \c 0x00 No retransmissions. - * \arg \c 0x01 At least one retransmission, optimize for power consumption. - * \arg \c 0x02 At least one retransmission, optimize for link quality. - * \arg \c 0xFF Don't care. - * \param[in] packet_type Transmit packet type. Valid values are combinations of \ref BTIF_BR_SCO_PKT_TYPE. - * \param[in] cause Confirm cause for SCO connection request. \ref BTIF_CAUSE_ACCEPT to accept the connection, otherwise reject. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SCO_CONN_IND: - { - T_BTIF_SCO_CONN_IND *p_ind = &p_msg->p.sco_conn_ind; - - btif_sco_conn_cfm(p_ind->bd_addr, 8000, 8000, 13, 0x0363, 1, - BTIF_PKT_TYPE_EV3 | BTIF_PKT_TYPE_EV4 | BTIF_PKT_TYPE_EV5, - BTIF_CAUSE_ACCEPT); - } - break; - - case BTIF_MSG_SCO_CONN_CMPL_INFO: - { - T_BTIF_SCO_CONN_CMPL_INFO *p_info = &p_msg->p.sco_conn_cmpl_info; - APP_PRINT_TRACE1("SCO connection establish result: cause 0x%04x", p_info->cause); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sco_conn_cfm(uint8_t *bd_addr, uint32_t tx_bandwidth, uint32_t rx_bandwidth, - uint16_t max_latency, uint16_t voice_setting, uint8_t retrans_effort, - uint16_t packet_type, T_BTIF_CAUSE cause); - -/** - * btif.h - * - * \brief Get buffer from Bluetooth stack to put in SCO data which will be sent to remote device. - * - * \param[in] len Length of SCO data to put into the buffer. - * - * \return The address of the allocated buffer. If the address in NULL, the - * buffer was get failed. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SCO_CONN_CMPL_INFO: - { - T_BTIF_SCO_CONN_CMPL_INFO *p_info = &p_msg->p.sco_conn_cmpl_info; - - if (!p_info->cause) - { - uint8_t *p_buffer = btif_sco_buffer_get(60); - - if (p_buffer) - { - // ... - // Fill in the buffer with SCO data - // ... - - btif_sco_data_req(p_info->handle, p_buffer, 60); - } - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -void *btif_sco_buffer_get(uint8_t len); - -/** - * btif.h - * - * \brief Send a request to send SCO data to remote device. - * - * \param[in] handle Connection handle of the SCO/eSCO link. - * \param[in] p_buf Address of SCO data buffer which is get by \ref btif_sco_buffer_get. - * \param[in] len Length of SCO data buffer. Must match the one in \ref btif_sco_buffer_get. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SCO_CONN_CMPL_INFO: - { - T_BTIF_SCO_CONN_CMPL_INFO *p_info = &p_msg->p.sco_conn_cmpl_info; - - if (!p_info->cause) - { - uint8_t *p_buffer = btif_sco_buffer_get(60); - - if (p_buffer) - { - // ... - // Fill in the buffer with SCO data - // ... - - btif_sco_data_req(p_info->handle, p_buffer, 60); - } - } - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sco_data_req(uint16_t handle, void *p_buf, uint8_t len); - -/** - * btif.h - * - * \brief Send a confirmation for SCO data indication. The function can - * only be used when receive \ref BTIF_MSG_SCO_DATA_IND message in the - * callback function registered by \ref btif_register_req. - * - * \param[in] p_buf Address of SCO data buffer. Must be same as that in \ref BTIF_MSG_SCO_DATA_IND message. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SCO_DATA_IND: - { - T_BTIF_SCO_DATA_IND *p_ind = &p_msg->p.sco_data_ind; - btif_sco_data_cfm(p_ind->p_buf); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sco_data_cfm(uint8_t *p_buf); - -/** - * btif.h - * - * \brief Send a request to disconnect a SCO/eSCO connection. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_SCO_DISCONN_RSP - * and data is \ref T_BTIF_SCO_DISCONN_RSP will be received in the callback - * function registered by \ref btif_register_req. - * - * \param[in] handle Connection handle of the SCO/eSCO link. The handle can be get in \ref T_BTIF_SCO_CONN_CMPL_INFO message. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SCO_CONN_CMPL_INFO: - { - T_BTIF_SCO_CONN_CMPL_INFO *p_info = &p_msg->p.sco_conn_cmpl_info; - - if (!p_info->cause) - { - btif_sco_disconn_req(p_info->handle); - } - } - break; - - case BTIF_MSG_SCO_DISCONN_RSP: - { - T_BTIF_SCO_DISCONN_RSP *p_rsp = &p_msg->p.sco_disconn_rsp; - - APP_PRINT_TRACE2("SCO disconnect response: status 0x%04x, reason 0x%04x", - p_rsp->cause, p_rsp->reason); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sco_disconn_req(uint16_t handle); - -/** - * btif.h - * - * \brief Send a confirmation for SCO/eSCO disconnect indication. The function - * can only be used when receive \ref BTIF_MSG_SCO_DISCONN_IND message - * in the callback function registered by \ref btif_register_req. - * - * \param[in] handle Connection handle of the SCO/eSCO link. - * - * \return The status of sending the confirmation. - * \retval true The confirmation was successfully sent. - * \retval false The confirmation was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_SCO_DISCONN_IND: - { - T_BTIF_SCO_DISCONN_IND *p_ind = &p_msg->p.sco_disconn_ind; - btif_sco_disconn_cfm(p_ind->handle); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_sco_disconn_cfm(uint16_t handle); - -/** - * btif.h - * - * \brief Send a request to disconnect an ACL link. If the request was - * successfully sent, a message whose type is \ref BTIF_MSG_ACL_DISCONN_RSP - * and data is \ref T_BTIF_ACL_DISCONN_RSP will be received in the callback - * function registered by \ref btif_register_req. If the ACL link was - * successfully disconnected, \ref BTIF_MSG_ACL_STATUS_INFO message will - * also be received with ACL status as \ref BTIF_ACL_CONN_DISCONN in the - * message data. To disconnect an ACL link, it must be connected, - * which can be sure by receiving \ref BTIF_MSG_ACL_STATUS_INFO message - * with ACL status as \ref BTIF_ACL_CONN_SUCCESS in the message data. - * - * \param[in] bd_addr Bluetooth address of remote device. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_SUCCESS: - btif_acl_disconn_req(p_info->bd_addr); - break; - - case BTIF_ACL_CONN_DISCONN: - APP_PRINT_TRACE0("ACL link disconnected"); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_ACL_DISCONN_RSP: - { - T_BTIF_ACL_DISCONN_RSP *p_rsp = &p_msg->p.acl_disconn_rsp; - APP_PRINT_TRACE2("ACL link disconnect response: status 0x%04x, reason 0x%04x", - p_rsp->cause, p_rsp->reason); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_acl_disconn_req(uint8_t *bd_addr); - -/** - * btif.h - * - * \brief Send a request to specify Quality of Service parameters for an ACL - * link. If the request was successfully sent, a message whose type is - * \ref BTIF_MSG_SETUP_QOS_RSP and data is \ref T_BTIF_SETUP_QOS_RSP - * will be received in the callback function registered by \ref btif_register_req. - * To set the QOS of an ACL link, the link must be connected, which - * can be sure by receiving \ref BTIF_MSG_ACL_STATUS_INFO message - * with ACL status as \ref BTIF_ACL_CONN_SUCCESS in the message data. - * - * \param[in] handle Connection handle of the link, which can be get by \ref BTIF_MSG_ACL_STATUS_INFO message with ACL status as \ref BTIF_ACL_CONN_SUCCESS. - * \param[in] flags Reserved for feature use. - * \param[in] type Service type. - * \arg \c 0 No traffic. - * \arg \c 1 Best effort. - * \arg \c 2 Guaranteed. - * \param[in] token_rate Token rate in octets per second. - * \param[in] peak_bandwdith Peak bandwidth in octets per second. - * \param[in] latency Latency in microseconds. - * \param[in] delay_variation Delay variation in microseconds. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_ACL_STATUS_INFO: - { - T_BTIF_ACL_STATUS_INFO *p_info = &p_msg->p.acl_status_info; - - switch (p_info->status) - { - case BTIF_ACL_CONN_SUCCESS: - legacy_send_setup_qos_req(p_info->p.conn_success.handle, 0, - QOS_GUARANTEED, 11250, 0, 10000 * 2, 0); - break; - - default: - break; - } - } - break; - - case BTIF_MSG_SETUP_QOS_RSP: - { - T_BTIF_SETUP_QOS_RSP *p_rsp = &p_msg->p.setup_qos_rsp; - APP_PRINT_TRACE1("Setup QOS response: status 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_setup_qos_req(uint16_t handle, uint8_t flags, uint8_t type, uint32_t token_rate, - uint32_t peak_bandwdith, uint32_t latency, uint32_t delay_variation); - -/** - * btif.h - * - * \brief Send a request to set local channel into busy/idle state in L2CAP - * ERTM mode. If the request was successfully sent, a message whose type - * is \ref BTIF_MSG_L2C_SET_LOCAL_BUSY_RSP and data is \ref T_BTIF_L2C_SET_LOCAL_BUSY_RSP - * will be received in the callback function registered by \ref btif_register_req. - * - * \param[in] cid Local CID. The value can be get from \ref BTIF_MSG_L2C_CONN_CMPL_INFO message. - * \param[in] busy Set local to busy state or not. - * \arg \c true Set local to busy state. - * \arg \c false Set local to idle state. - * - * \return The status of sending the request. - * \retval true The request was successfully sent. - * \retval false The request was failed to sent. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - - if (!p_info->cause) - { - btif_set_l2c_local_busy_req(p_info->cid, true); - } - - } - break; - - case BTIF_MSG_L2C_SET_LOCAL_BUSY_RSP: - { - T_BTIF_L2C_SET_LOCAL_BUSY_RSP *p_rsp = &p_msg->p.l2c_set_local_busy_rsp; - APP_PRINT_TRACE1("Set local busy state response: status 0x%04x", p_rsp->cause); - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_set_l2c_local_busy_req(uint16_t cid, bool busy); - -/** - * btif.h - * - * \brief Select reject mode used in L2CAP ERTM mode. - * - * \param[in] mode Reject mode used in L2CAP ERTM mode. Valid values are \ref BTIF_BR_L2CAP_REJ_MODE. - * - * \return The status of selecting reject mode. - * \retval true Reject mode was successfully set. - * \retval false Reject mode was failed to set. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - - if (!p_info->cause) - { - btif_set_l2c_rej_mode(BTIF_L2C_ERTM_REJ); - } - - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_set_l2c_rej_mode(uint8_t mode); - -/** - * btif.h - * - * \brief Enable/Disable FCS usage in L2CAP ERTM mode. - * - * \param[in] flag FCS usage flag in L2CAP ERTM mode. - * \arg \c 1 Prefer to use FCS in L2CAP ERTM mode. - * \arg \c 0 Do not use FCS in L2CAP ERTM mode. - * - * \return The status of setting FCS usage. - * \retval true FCS usage was successfully set. - * \retval false RFCS usage was failed to set. - * - * Example usage - \code{.c} - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - - if (!p_info->cause) - { - btif_set_l2c_fcs(1); - } - - } - break; - - default: - break; - } - } - \endcode - * - * \ingroup BTIF - */ -bool btif_set_l2c_fcs(uint8_t flag); - -/** - * btif.h - * - * \brief Get total number for L2CAP buffer which will send \ref BTIF_MSG_L2C_DATA_RSP - * when released. This is mainly used for data flow control from upper - * layer to Bluetooth stack. - * - * \param[in] None. - * - * \return Total number for L2CAP buffer which will send \ref BTIF_MSG_L2C_DATA_RSP when released. - * - * Example usage - \code{.c} - uint8_t data_quota; - - void app_handle_btif_msg(T_BTIF_UP_MSG *p_msg) - { - switch (p_msg->command) - { - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - T_BTIF_L2C_CONN_CMPL_INFO *p_info = &p_msg->p.l2c_conn_cmpl_info; - uint8_t i; - - if (!p_info->cause) - { - for (i = 0; i < data_quota; i++) - { - // ... - // Get a L2CAP buffer with ack flag set to true. - // Fill the buffer and send it. - // ... - } - } - - } - break; - - case BTIF_MSG_L2C_CONN_CMPL_INFO: - { - // ... - // Get a L2CAP buffer with ack flag set to true. - // Fill the buffer and send it. - // ... - } - break; - - default: - break; - } - } - - void test(void) - { - // ... - // Create app task. - // Register callback function. - // ... - - data_quota = btif_get_l2c_data_quota(); - } - \endcode - * - * \ingroup BTIF - */ -uint8_t btif_get_l2c_data_quota(void); - -bool btif_lt_addr_set_req(uint8_t lt_addr); - -bool btif_lt_addr_del_req(uint8_t lt_addr); - -bool btif_sync_train_param_set_req(uint16_t min_interval, uint16_t max_interval, - uint32_t sync_train_tout, uint8_t srv_data); - -bool btif_sync_train_req(void); - -bool btif_sync_train_rcv_req(uint8_t *bd_addr, uint16_t sync_scan_tout, - uint16_t sync_scan_window, uint16_t sync_scan_interval); - -bool btif_csb_set_req(uint8_t enable, uint8_t lt_addr, uint8_t lpo_allowed, uint16_t pkt_type, - uint16_t min_interval, uint16_t max_interval, uint16_t csb_supv_tout); - -bool btif_csb_rcv_set_req(uint8_t enable, uint8_t *bd_addr, uint8_t lt_addr, uint16_t interval, - uint32_t clk_offset, uint32_t next_broadcast_clk, uint16_t csb_supv_tout, - uint8_t remote_timing_acc, uint8_t skip, uint16_t pkt_type, uint8_t *afh_chann_map); - -bool btif_csb_data_req(uint8_t lt_addr, void *p_data, uint16_t length); - -#ifdef __cplusplus -} -#endif - -#endif /* _BTIF_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_common_api.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_common_api.h deleted file mode 100644 index c3c2ae59..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_common_api.h +++ /dev/null @@ -1,190 +0,0 @@ -#ifndef _HRP_BTIF_COMMON_API_H_ -#define _HRP_BTIF_COMMON_API_H_ - -#include -#include -#include - -typedef struct -{ - uint32_t cod; - uint8_t name[BTIF_NAME_LENGTH]; -} T_BTIF_DEV_CFG_DEV; - -typedef struct -{ - uint16_t vendor_id; - uint16_t vendor_id_src; - uint16_t product_id; - uint16_t product_version; -} T_BTIF_DEV_CFG_DID_EIR; - -typedef struct -{ - uint8_t *p_data; -} T_BTIF_DEV_CFG_EXT_EIR; - -typedef struct -{ - T_BTIF_BR_PAGE_SCAN_TYPE scan_type; - uint16_t interval; - uint16_t window; - uint16_t page_tout; -} T_BTIF_DEV_CFG_PAGE_SCAN; - -typedef struct -{ - T_BTIF_BR_INQUIRY_SCAN_TYPE scan_type; - uint16_t interval; - uint16_t window; -} T_BTIF_DEV_CFG_INQUIRY_SCAN; - -typedef struct -{ - T_BTIF_BR_INQUIRY_MODE mode; -} T_BTIF_DEV_CFG_INQUIRY_MODE; - -typedef struct -{ - uint16_t policy; - uint16_t supv_tout; -} T_BTIF_DEV_CFG_LINK_POLICY; - -typedef struct -{ - int16_t tx_power; -} T_BTIF_DEV_CFG_MAX_TX_POWER; - -typedef struct -{ - T_BTIF_BT_MODE mode; -} T_BTIF_DEV_CFG_BT_MODE; - -typedef struct -{ - uint8_t role; -} T_BTIF_DEV_CFG_ACCEPT_ROLE; - -typedef struct -{ - uint32_t fixed_value; -} T_BTIF_DEV_CFG_PASSKEY_VALUE; - -typedef struct -{ - T_BTIF_DEV_CFG_OPCODE op; - union - { - T_BTIF_DEV_CFG_DEV dev; - T_BTIF_DEV_CFG_DID_EIR did; - T_BTIF_DEV_CFG_EXT_EIR ext_eir; - T_BTIF_DEV_CFG_PAGE_SCAN page_scan; - T_BTIF_DEV_CFG_INQUIRY_SCAN inquiry_scan; - T_BTIF_DEV_CFG_INQUIRY_MODE inquiry_mode; - T_BTIF_DEV_CFG_LINK_POLICY link_policy; - - T_BTIF_DEV_CFG_BT_MODE bt_mode; - T_BTIF_DEV_CFG_ACCEPT_ROLE accept_role; - } p; -} T_BTIF_DEV_CFG_SET_REQ; - -typedef struct -{ - uint8_t bd_addr[6]; - uint8_t conn_type; /* 0: BREDR ACL; 1: SCO; 2: LE */ - bool is_high_priority; -} T_BTIF_ACL_PRIORITY_SET_REQ; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; -} T_BTIF_READ_RSSI_REQ; - -typedef struct -{ - uint16_t command; - uint8_t param_len; - uint8_t param[1]; -} T_BTIF_VENDOR_CMD_REQ; - -typedef struct -{ - bool enable; - uint16_t requirements; - T_BTIF_IOCAP io_capabilities; - bool oob_present; -} T_BTIF_PAIRABLE_MODE_SET_REQ; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_CAUSE cause; -} T_BTIF_USER_PASSKEY_REQ_CFM; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint32_t passkey; - T_BTIF_CAUSE cause; -} T_BTIF_USER_PASSKEY_REQ_REPLY_REQ; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_KEY_TYPE key_type; - T_BTIF_CAUSE cause; -} T_BTIF_AUTHEN_RESULT_CFM; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint8_t key_len; - uint8_t link_key[28]; - T_BTIF_KEY_TYPE key_type; - T_BTIF_CAUSE cause; -} T_BTIF_AUTHEN_KEY_REQ_CFM; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_CAUSE cause; -} T_BTIF_USER_CFM_REQ_CFM; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_KEYPRESS_NOTIF_TYPE event_type; -} T_BTIF_KEYPRESS_NOTIF_REQ; - -void hrp_register_req(uint16_t len, uint8_t *p_param_list); - -void hrp_release_req(uint16_t len, uint8_t *p_param_list); - -void hrp_dev_cfg_req(uint16_t len, uint8_t *p_param_list); - - -void hrp_read_rssi_req(uint16_t len, uint8_t *p_param_list); - -void hrp_vendor_cmd_req(uint16_t len, uint8_t *p_param_list); - -void hrp_pairable_mode_set_req(uint16_t len, uint8_t *p_param_list); - -void hrp_user_passkey_req_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_user_passkey_req_reply_req(uint16_t len, uint8_t *p_param_list); - -void hrp_authen_result_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_authen_key_req_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_user_cfm_req_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_keypress_notif_req(uint16_t len, uint8_t *p_param_list); -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_entry.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_entry.h deleted file mode 100644 index 81cc91ff..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_entry.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _HRP_BTIF_ENTRY_H_ -#define _HRP_BTIF_ENTRY_H_ - -#include -#include -#include - -typedef enum -{ - HRP_BTIF_CMD_GROUP_STACK = 0, - HRP_BTIF_CMD_GROUP_SYSTEM = 1, -} HRP_BTIF_CMD_GROUP; - -typedef struct _GattDevInfo -{ - uint16_t le_ds_pool_id; - uint16_t le_ds_data_offset; - uint8_t le_ds_credits; -} T_GATT_DEV_INFO; - - -typedef struct -{ - uint8_t *p_srv_handle; - void *p_service; - bool is_used; - uint8_t self_idx; - uint16_t nbr_of_attrib; - uint16_t database_length; - uint16_t receive_length; - uint32_t host_service; -} T_GATT_SRV_TABLE; - -typedef void (* P_HRP_BTIF_HANDLER)(uint16_t len, uint8_t *p_param); - -void hrp_btif_handle_req(uint8_t cmd_group, uint16_t cmd_index, uint16_t param_list_len, - uint8_t *p_param_list); -void hrp_btif_handle_msg(T_BTIF_UP_MSG *pMsg); - -//const extern P_HRP_BTIF_HANDLER hrp_btif_handle_bredr[]; -//const extern P_HRP_BTIF_HANDLER hrp_btif_handle_ble[]; - - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_le_api.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_le_api.h deleted file mode 100644 index 5ec0e6eb..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_le_api.h +++ /dev/null @@ -1,758 +0,0 @@ -#ifndef _HRP_BTIF_LE_API_H_ -#define _HRP_BTIF_LE_API_H_ - -#include -#include -#include - -typedef enum -{ - BTIF_ApplicationDefined = 0, /**< application provides services */ - BTIF_ServiceDIS, /**< Device Information service */ - BTIF_ServiceGLS, /**< Glucose service */ - BTIF_ServiceBAS, /**< Battery service */ - BTIF_ServiceCTS, /**< Current Time service */ - BTIF_ServiceNDCS, /**< Next DST Change service */ - BTIF_ServiceRTUS, /**< Reference Time Update service */ - BTIF_ServiceBLS, /**< Blood Pressure service */ - BTIF_ServiceHRS, /**< Heart Rate service */ - - /* the following services are not (yet) available as built-in services: */ - BTIF_ServiceCGM, /**< Continous Glucose Monitor service */ - BTIF_ServiceBMS, /**< Bond Management service */ - BTIF_ServiceQUL, /**< Qualification test service */ - BTIF_ServiceTST /**< Test service */ -} GATT_SRV_ID; - -void *hrp_gatt_srv_get(GATT_SRV_ID serviceID, uint16_t *pNbrOfAttrib); -typedef struct -{ - uint8_t bd_addr[6]; - uint8_t data_c[16]; - T_BTIF_CAUSE cause; - T_BTIF_REMOTE_ADDR_TYPE addr_type; -} T_BTIF_REMOTE_OOB_REQ_CFM; -typedef struct -{ - uint16_t num_attr; - void *p_srv; -} T_BTIF_GATT_SRV_REG_REQ; - -typedef struct -{ - void *p_srv_handle; - void *p_req_handle; - T_BTIF_GATT_PDU_TYPE type; - uint16_t link_id; - uint16_t attr_index; - uint16_t attr_len; - uint16_t gap; - uint8_t data[1]; -} T_BTIF_GATT_ATTR_UPDATE_REQ; - -typedef struct -{ - void *p_srv_handle; - void *p_req_handle; - uint16_t link_id; - uint16_t attr_index; -} T_BTIF_GATT_ATTR_UPDATE_STATUS_CFM; - -typedef struct -{ - void *p_srv_handle; - uint16_t link_id; - uint16_t cause; - uint16_t attr_index; - uint16_t attr_len; - uint16_t gap; - uint8_t data[1]; -} T_BTIF_GATT_ATTR_READ_CFM; - -typedef struct -{ - uint16_t link_id; - void *p_srv_handle; - uint16_t cause; - uint16_t attr_index; -} T_BTIF_GATT_ATTR_WRITE_REQ_CFM; - -typedef struct -{ - void *p_srv_handle; - uint16_t link_id; - uint16_t cause; - uint16_t attr_index; - uint16_t attr_len; - uint16_t gap; - uint8_t data[1]; -} T_BTIF_GATT_ATTR_PREP_WRITE_CFM; - -typedef struct -{ - uint16_t link_id; - uint16_t cause; - uint16_t handle; -} T_BTIF_GATT_ATTR_EXEC_WRITE_CFM; - -typedef struct -{ - uint16_t link_id; - T_BTIF_GATT_DISCOVERY_TYPE type; - uint16_t start_handle; - uint16_t end_handle; - uint16_t uuid16; - uint8_t uuid128[16]; -} T_BTIF_GATT_DISCOVERY_REQ; - -typedef struct -{ - uint16_t link_id; - T_BTIF_GATT_DISCOVERY_TYPE type; - uint16_t start_handle; - uint16_t end_handle; -} T_BTIF_GATT_DISCOVERY_CFM; - -typedef struct -{ - uint16_t link_id; - T_BTIF_GATT_READ_TYPE read_type; - uint16_t read_offset; - uint16_t start_handle; - uint16_t end_handle; - uint16_t uuid16; - uint8_t uuid128[16]; -} T_BTIF_GATT_ATTR_READ_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t num_handle; - uint16_t handles[11]; -} T_BTIF_GATT_ATTR_READ_MULTI_REQ; - -typedef struct -{ - uint16_t link_id; - uint8_t write_type; - uint16_t attr_handle; - uint16_t attr_len; /**< attrib. value length */ - uint16_t write_offset; /**< write offset in attribute */ - uint16_t gap; /**< offset of attrib. value in data[] */ - uint8_t data[1]; -} T_BTIF_GATT_ATTR_WRITE_REQ; -typedef struct -{ - uint16_t link_id; - uint8_t flags; -} T_BTIF_GATT_ATTR_EXEC_WRITE_REQ; - -typedef struct -{ - uint16_t link_id; -} T_BTIF_GATT_ATTR_CFM; - -typedef struct -{ - uint16_t link_id; - uint16_t requirements; - uint8_t min_key_size; -} T_BTIF_GATT_SECURITY_REQ; - -typedef struct -{ - T_BTIF_GATT_STORE_OPCODE op; - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - uint8_t data_len; - uint8_t *p_data; - T_BTIF_CAUSE cause; -} T_BTIF_GATT_SERVER_STORE_CFM; - -typedef struct -{ - bool use_ext_conn; - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_LOCAL_ADDR_TYPE local_addr_type; - uint8_t init_phys; - uint16_t scan_timeout; - T_BTIF_LE_CONN_REQ_PARAM conn_req_param[BTIF_LE_MAX_INIT_PHYS_NUM]; -} T_BTIF_LE_CONN_REQ; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_CAUSE cause; -} T_BTIF_LE_CONN_CFM; - -typedef struct -{ - uint16_t link_id; - T_BTIF_CAUSE cause; -} T_BTIF_LE_DISCONN_REQ; - -typedef struct -{ - uint16_t link_id; -} T_BTIF_LE_DISCONN_CFM; - -typedef struct -{ - T_BTIF_LE_ADV_MODE adv_mode; -} T_BTIF_LE_ADV_REQ; - -typedef struct -{ - T_BTIF_LE_ADV_TYPE adv_type; - T_BTIF_LE_ADV_FILTER_POLICY filter_policy; - uint8_t chann_map; - uint16_t min_interval; - uint16_t max_interval; - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_LOCAL_ADDR_TYPE local_addr_type; -} T_BTIF_LE_ADV_PARAM_SET_REQ; - -typedef struct -{ - T_BTIF_LE_ADV_DATA_TYPE data_type; - uint8_t data_len; - uint8_t *p_data; -} T_BTIF_LE_ADV_DATA_SET_REQ; - -typedef struct -{ - T_BTIF_LE_SCAN_MODE mode; - T_BTIF_LE_SCAN_FILTER_DUPLICATES filter_duplicates; -} T_BTIF_LE_SCAN_REQ; - -typedef struct -{ - T_BTIF_LE_SCAN_TYPE type; - uint16_t interval; - uint16_t window; - T_BTIF_LE_SCAN_FILTER_POLICY filter_policy; - T_BTIF_LOCAL_ADDR_TYPE local_addr_type; -} T_BTIF_LE_SCAN_PARAM_SET_REQ; - -typedef struct -{ - T_BTIF_LE_WHITE_LIST_OP operation; - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; -} T_BTIF_LE_MODIFY_WHITE_LIST_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t min_interval; - uint16_t max_interval; - uint16_t latency; - uint16_t supv_tout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} T_BTIF_LE_CONN_UPDATE_REQ; - -typedef struct -{ - uint16_t link_id; - T_BTIF_CAUSE cause; -} T_BTIF_LE_CONN_UPDATE_CFM; - -typedef struct -{ - uint16_t link_id; - uint16_t min_interval; - uint16_t max_interval; - uint16_t latency; - uint16_t supv_tout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} T_BTIF_LE_CONN_PARAM_REQ_REPLY_REQ; - -typedef struct -{ - uint16_t link_id; - uint8_t reason; -} T_BTIF_LE_CONN_PARAM_REQ_NEG_REPLY_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t le_psm; - uint16_t mtu; - uint16_t init_credits; - uint16_t credits_threshold; -} T_BTIF_LE_CREDIT_BASED_CONN_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t mtu; - uint16_t init_credits; - uint16_t credits_threshold; - T_BTIF_L2C_LE_CONN_STATUS cause; -} T_BTIF_LE_CREDIT_BASED_CONN_CFM; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; -} T_BTIF_LE_CREDIT_BASED_DISCONN_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; -} T_BTIF_LE_CREDIT_BASED_DISCONN_CFM; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t credits; -} T_BTIF_LE_SEND_CREDIT_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - uint16_t len; - uint16_t gap; - uint8_t data[1]; -} T_BTIF_LE_CREDIT_BASED_DATA_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t channel; - T_BTIF_CAUSE cause; -} T_BTIF_LE_CREDIT_BASED_DATA_CFM; - -typedef struct -{ - uint16_t le_psm; - bool active; - T_BTIF_LE_SECURITY_MODE mode; - uint8_t key_size; -} T_BTIF_LE_CREDIT_BASED_SECURITY_REG_REQ; - -typedef struct -{ - uint16_t le_psm; - uint8_t action; -} T_BTIF_LE_CREDIT_BASED_PSM_REG_REQ; - -typedef struct -{ - uint8_t channel_map[5]; -} T_BTIF_LE_SET_CHANN_CLASSIF_REQ; - -typedef struct -{ - uint16_t link_id; -} T_BTIF_LE_READ_CHANN_MAP_REQ; - -typedef struct -{ - uint8_t rx_chann; -} T_BTIF_LE_RECEIVER_TEST_REQ; - -typedef struct -{ - uint8_t tx_chann; - uint8_t data_len; - uint8_t pkt_pl; -} T_BTIF_LE_TRANSMITTER_TEST_REQ; - -typedef struct -{ - uint8_t random_addr[6]; -} T_BTIF_LE_SET_RAND_ADDR_REQ; - -typedef struct -{ - uint16_t tx_oct; - uint16_t tx_time; -} T_BTIF_LE_WRITE_DEFAULT_DATA_LEN_REQ; - -typedef struct -{ - uint16_t link_id; - uint16_t tx_oct; - uint16_t tx_time; -} T_BTIF_LE_SET_DATA_LEN_REQ; - -typedef struct -{ - T_BTIF_LE_RESOLVING_LIST_OP operation; - T_BTIF_IDENT_ADDR_TYPE peer_ident_addr_type; - uint8_t peer_ident_addr[6]; - uint8_t peer_irk[16]; - uint8_t local_irk[16]; -} T_BTIF_LE_MODIFY_RESOLV_LIST_REQ; - -typedef struct -{ - T_BTIF_IDENT_ADDR_TYPE peer_ident_addr_type; - uint8_t peer_ident_addr[6]; -} T_BTIF_LE_READ_PEER_RESOLV_ADDR_REQ; - -typedef struct -{ - T_BTIF_IDENT_ADDR_TYPE peer_ident_addr_type; - uint8_t peer_ident_addr[6]; -} T_BTIF_LE_READ_LOCAL_RESOLV_ADDR_REQ; - -typedef struct -{ - uint8_t enable; -} T_BTIF_LE_SET_RESOLUTION_ENABLE_REQ; - -typedef struct -{ - uint16_t timeout; -} T_BTIF_LE_SET_RESOLV_PRIV_ADDR_TOUT_REQ; - -typedef struct -{ - bool generate; - uint8_t local_irk[16]; -} T_BTIF_LE_CONFIG_LOCAL_IRK_REQ; - -typedef struct -{ - T_BTIF_IDENT_ADDR_TYPE peer_ident_addr_type; - uint8_t peer_ident_addr[6]; - T_BTIF_LE_PRIVACY_MODE privacy_mode; -} T_BTIF_LE_SET_PRIVACY_MODE_REQ; - -typedef struct -{ - uint8_t adv_handle; - uint8_t rand_addr[6]; -} T_BTIF_LE_SET_ADV_SET_RAND_ADDR_REQ; - -typedef struct -{ - uint8_t adv_handle; - uint16_t adv_event_prop; - uint32_t prim_adv_interval_min; - uint32_t prim_adv_interval_max; - uint8_t prim_adv_chann_map; - T_BTIF_LOCAL_ADDR_TYPE own_addr_type; - T_BTIF_REMOTE_ADDR_TYPE peer_addr_type; - uint8_t peer_addr[6]; - T_BTIF_LE_ADV_FILTER_POLICY filter_policy; - uint8_t tx_power; - T_BTIF_LE_PRIM_ADV_PHY_TYPE prim_adv_phy; - uint8_t secondary_adv_max_skip; - T_BTIF_LE_PHY_TYPE secondary_adv_phy; - uint8_t adv_sid; - T_BTIF_LE_SCAN_REQ_NOTIFY_TYPE scan_req_notif_enable; -} T_BTIF_LE_EXT_ADV_PARAM_SET_REQ; - -typedef struct -{ - T_BTIF_LE_EXT_ADV_DATA_TYPE data_type; - uint8_t adv_handle; - T_BTIF_LE_ADV_FRAG_OP_TYPE op; - T_BTIF_LE_ADV_FRAG_PREFERENCE_TYPE frag_preference; - uint8_t len; - uint8_t *p_data; -} T_BTIF_LE_EXT_ADV_DATA_SET_REQ; - -typedef struct -{ - T_BTIF_LE_EXT_ADV_MODE mode; - uint8_t num_of_sets; - T_BTIF_LE_EXT_ADV_SET_PARAM adv_set_param[BTIF_LE_MAX_EXTENDED_ADV_SETS_NUM]; -} T_BTIF_LE_EXT_ADV_ENABLE_REQ; - -typedef struct -{ - T_BTIF_LOCAL_ADDR_TYPE local_addr_type; - T_BTIF_LE_SCAN_FILTER_POLICY filter_policy; - uint8_t scan_phys; - T_BTIF_LE_EXT_SCAN_PARAM scan_param[BTIF_LE_MAX_EXTENDED_SCAN_PHY_NUM]; -} T_BTIF_LE_EXT_SCAN_PARAM_SET_REQ; - -typedef struct -{ - T_BTIF_LE_SCAN_MODE mode; - T_BTIF_LE_SCAN_FILTER_DUPLICATES filter_duplicates; - uint16_t duration; - uint16_t period; -} T_BTIF_LE_EXT_SCAN_REQ; - -typedef struct -{ - uint8_t all_phys; - uint8_t tx_phys; - uint8_t rx_phys; -} T_BTIF_LE_SET_DEFAULT_PHY_REQ; - -typedef struct -{ - uint16_t link_id; - uint8_t all_phys; - uint8_t tx_phys; - uint8_t rx_phys; - T_BTIF_LE_PHY_OPTIONS phy_options; -} T_BTIF_LE_SET_PHY_REQ; - -typedef struct -{ - uint8_t rx_chann; - uint8_t phy; - uint8_t modulation_index; -} T_BTIF_LE_ENHANCED_RECEIVER_TEST_REQ; - -typedef struct -{ - uint8_t tx_chann; - uint8_t data_len; - uint8_t pkt_pl; - uint8_t phy; -} T_BTIF_LE_ENHANCED_TRANSMITTER_TEST_REQ; - -typedef struct -{ - T_BTIF_LE_PERIODIC_ADV_LIST_OP op; - uint8_t advertiser_addr_type; - uint8_t advertiser_addr[6]; - uint8_t adv_sid; -} T_BTIF_LE_MODIFY_PERIODIC_ADV_LIST_REQ; - -typedef struct -{ - int8_t rf_tx_path_compensation; - int8_t rf_rx_path_compensation; -} T_BTIF_LE_WRITE_RF_PATH_COMPENSATION_REQ; - -typedef struct -{ - T_BTIF_LE_ADV_SET_OP operation; - uint8_t adv_handle; -} T_BTIF_LE_MODIFY_ADV_SET_REQ; - -typedef struct -{ - uint8_t adv_handle; - uint16_t adv_interval_min; - uint16_t adv_interval_max; - uint16_t adv_prop; -} T_BTIF_LE_SET_PERIODIC_ADV_PARAM_REQ; - -typedef struct -{ - uint8_t adv_handle; - T_BTIF_LE_ADV_FRAG_OP_TYPE op; - uint8_t data_len; - uint8_t *p_data; -} T_BTIF_LE_SET_PERIODIC_ADV_DATA_REQ; - -typedef struct -{ - T_BTIF_LE_PERIODIC_ADV_MODE mode; - uint8_t adv_handle; -} T_BTIF_LE_SET_PERIODIC_ADV_ENABLE_REQ; - -typedef struct -{ - uint8_t filter_policy; - uint8_t adv_sid; - uint8_t adv_addr_type; - uint8_t adv_add[6]; - uint16_t skip; - uint16_t sync_timeout; - uint16_t unused; -} T_BTIF_LE_PERIODIC_ADV_CREATE_SYNC_REQ; - -typedef struct -{ - uint16_t sync_handle; -} T_BTIF_LE_PERIODIC_ADV_TERMINATE_SYNC_REQ; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_CAUSE cause; -} T_BTIF_JUST_WORK_REQ_CFM; - -typedef struct -{ - uint8_t bd_addr[6]; - T_BTIF_REMOTE_ADDR_TYPE remote_addr_type; - T_BTIF_CAUSE cause; -} T_BTIF_PASSKEY_NOTIF_CFM; - -void hrp_remote_oob_req_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_srv_reg_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_update_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_update_status_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_read_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_write_req_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_prep_write_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_exec_write_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_discovery_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_discovery_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_read_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_read_multi_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_write_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_prep_write_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_exec_write_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_attr_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_security_req(uint16_t len, uint8_t *p_param_list); - -void hrp_gatt_server_store_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_le_conn_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_conn_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_le_disconn_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_disconn_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_le_adv_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_adv_param_set_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_adv_data_set_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_scan_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_scan_param_set_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_modify_white_list_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_conn_update_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_conn_update_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_le_conn_param_req_reply_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_conn_param_req_neg_reply_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_conn_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_conn_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_disconn_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_disconn_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_le_send_credit_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_data_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_data_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_security_reg_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_credit_based_psm_reg_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_chann_classif_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_read_chann_map_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_receiver_test_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_transmitter_test_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_test_end_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_read_adv_tx_power_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_rand_addr_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_read_max_data_len_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_read_default_data_len_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_write_default_data_len_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_data_len_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_modify_resolv_list_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_read_peer_resolv_addr_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_read_local_resolv_addr_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_resolution_enable_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_resolv_priv_addr_tout_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_config_local_irk_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_privacy_mode_req(uint16_t len, uint8_t *p_param_list); -#if F_BT_LE_5_0_AE_ADV_SUPPORT -void hrp_le_set_adv_set_rand_addr_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_ext_adv_param_set_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_ext_adv_data_set_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_ext_adv_enable_req(uint16_t len, uint8_t *p_param_list); -#endif -#if F_BT_LE_5_0_AE_SCAN_SUPPORT -void hrp_le_ext_scan_param_set_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_ext_scan_req(uint16_t len, uint8_t *p_param_list); -#endif -void hrp_le_set_default_phy_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_phy_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_enhanced_receiver_test_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_enhanced_transmitter_test_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_modify_periodic_adv_list_req(uint16_t len, uint8_t *p_param_list); -#if F_BT_LE_5_0_RF_PATH_SUPPORT -void hrp_le_read_rf_path_compensation_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_write_rf_path_compensation_req(uint16_t len, uint8_t *p_param_list); -#endif -#if F_BT_LE_5_0_AE_ADV_SUPPORT -void hrp_le_modify_adv_set_req(uint16_t len, uint8_t *p_param_list); -#endif -void hrp_le_set_periodic_adv_param_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_periodic_adv_data_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_set_periodic_adv_enable_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_periodic_adv_create_sync_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_periodic_adv_create_sync_cancel_req(uint16_t len, uint8_t *p_param_list); - -void hrp_le_periodic_adv_terminate_sync_req(uint16_t len, uint8_t *p_param_list); -#if F_BT_LE_5_0_AE_ADV_SUPPORT -void hrp_le_enable_ext_adv_mode_req(uint16_t len, uint8_t *p_param_list); -#endif -void hrp_just_work_req_cfm(uint16_t len, uint8_t *p_param_list); - -void hrp_user_passkey_notif_cfm(uint16_t len, uint8_t *p_param_list); -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_system_api.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_system_api.h deleted file mode 100644 index cb01cd98..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/btif/hrp_btif_system_api.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef _HRP_BTIF_SYSTEM_API_H_ -#define _HRP_BTIF_SYSTEM_API_H_ - -#include -#include - -typedef enum -{ - HRP_SYSTEM_RESET_REQ = 0, - HRP_SYSTEM_RESET_RSP = 1, - - HRP_SYSTEM_INIT_RSP = 3, - HRP_SYSTEM_L2C_DATA_TEST_CMPL_INFO = 5, - HRP_SYSTEM_LE_CFG_PASSKEY_VALUE_RSP = 7, - HRP_SYSTEM_EVENT_ACK = 8, - HRP_SYSTEM_CMD_ACK = 9, - - HRP_SYSTEM_ENABLE_DLPS_RSP = 0x0B, - HRP_SYSTEM_READ_DLPS_COUNT_REQ = 0x0C, - HRP_SYSTEM_READ_DLPS_COUNT_RSP = 0x0D, - -} HRP_SYSTEM_CMD_ENTRY; - -typedef enum -{ - HRP_SYSTEM_COMMAND_COMPLETE = 0, - HRP_SYSTEM_COMMAND_DISALLOW = 1, - HRP_SYSTEM_UNKNOWN_COMMAND = 2, -} HRP_SYSTEM_CMD_STATUS; - -typedef struct -{ - uint16_t tx_cid; - uint16_t tx_data_offset; - uint16_t tx_length; - uint16_t tx_total_count; /*if tx_total_count > 0, send data*/ - uint8_t tx_next_byte; - uint16_t tx_max_credits; - - uint16_t tx_available_credits; - uint16_t tx_sent_count; - - uint16_t rx_cid; - uint16_t rx_length; - uint16_t rx_total_count; /*if rx_total_count > 0, receive data*/ - uint8_t rx_next_byte; - - uint16_t rx_rcved_count; - - bool is_testing; - - //uint32_t tx_start_timestamp; - //uint32_t tx_stop_timestamp; - //uint32_t rx_start_timestamp; - //uint32_t rx_stop_timestamp; -} T_L2C_DATA_TRANS; - -typedef struct -{ - uint16_t tx_cid; - uint16_t tx_data_offset; - uint16_t tx_length; - uint16_t tx_total_count; /*if tx_total_count > 0, send data*/ - uint16_t tx_max_credits; - - uint16_t rx_cid; - uint16_t rx_length; - uint16_t rx_total_count; /*if rx_total_count > 0, receive data*/ - - uint8_t tx_next_byte; - uint8_t rx_next_byte; - -} T_L2C_DATA_TEST_REQ; - -typedef struct -{ - uint32_t leFixedDisplayValue; - -} T_LE_CFG_PASSKEY_VALUE; - - - -void hrp_system_send_cmd_ack(uint8_t cmd_group, uint16_t cmd_index, HRP_SYSTEM_CMD_STATUS status); - -void hrp_btif_system_reset(uint16_t len, uint8_t *p_param_list); - -void hrp_btif_system_init(uint16_t len, uint8_t *p_param_list); - - -void hrp_btif_system_le_cfg_passkey_value(uint16_t len, uint8_t *p_param_list); - -void hrp_btif_system_event_ack(uint16_t len, uint8_t *p_param_list); - -void hrp_btif_system_enable_dlps_req(uint16_t len, uint8_t *p_param_list); - -void hrp_btif_system_read_dlps_count_req(uint16_t len, uint8_t *p_param_list); - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/complete_ble_client.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/complete_ble_client.h deleted file mode 100644 index dbb8f421..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/complete_ble_client.h +++ /dev/null @@ -1,333 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file complete_ble_client.h - * @brief Head file for using Simple BLE Client. - * @details Simple BLE data structs and external functions declaration. - * @author jane - * @date 2016-02-18 - * @version v0.1 - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _COMPLETE_BLE_CLIENT_H_ -#define _COMPLETE_BLE_CLIENT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include - -/** @addtogroup PROFILE_API Profile APIs - * @{ - */ - -/** @addtogroup Bluetooth_Clients Bluetooth Clients - * @{ - */ - -/** @defgroup SIMP_Client Simple Ble service client - * @brief Simple BLE service client - * @details - Simple BLE Profile is a customized BLE-based Profile. Simple ble service please refer to @ref SIMP_Service . - * @{ - */ -/*============================================================================* - * Macros - *============================================================================*/ -/** @defgroup SIMP_Client_Exported_Macros SIMP Client Exported Macros - * @brief - * @{ - */ - -/** @defgroup SIMP_UUIDs1 SIMP UUIDs - * @brief Simple BLE Profile UUID definitions - * @{ - */ -#define GATT_UUID_SIMPLE_PROFILE 0xA00A -#define GATT_UUID_CHAR_SIMPLE_V1_READ 0xB001 -#define GATT_UUID_CHAR_SIMPLE_V2_WRITE 0xB002 -#define GATT_UUID_CHAR_SIMPLE_V3_NOTIFY 0xB003 -#define GATT_UUID_CHAR_SIMPLE_V4_INDICATE 0xB004 -#define GATT_UUID_CHAR_SIMPLE_V6_WRITE_LONG 0xB006 -#define GATT_UUID_CHAR_SIMPLE_V7_READ_LONG 0xB007 -#define GATT_UUID_CHAR_SIMPLE_V8 0xB008 -/** @} End of SIMP_UUIDs */ - -/** @brief Define links number. range: 0-4 */ -#define SIMP_MAX_LINKS 4 -/** End of SIMP_Client_Exported_Macros - * @} - */ - - -/*============================================================================* - * Types - *============================================================================*/ -/** @defgroup SIMP_Client_Exported_Types SIMP Client Exported Types - * @brief - * @{ - */ - -/** @brief SIMP client handle type*/ -typedef enum -{ - HDL_SIMBLE_SRV_START, //!< start handle of simple ble service - HDL_SIMBLE_SRV_END, //!< end handle of simple ble service - HDL_SIMBLE_V1_READ, //!< V1 read characteristic value handle - HDL_SIMBLE_V2_WRITE, //!< V2 write characteristic value handle - HDL_SIMBLE_V3_NOTIFY, //!< V3 notify characteristic value handle - HDL_SIMBLE_V3_NOTIFY_CCCD, //!< V3 notify characteristic CCCD handle - HDL_SIMBLE_V4_INDICATE, //!< V4 indicate characteristic value handle - HDL_SIMBLE_V4_INDICATE_CCCD, //!< V4 indicate characteristic CCCD handle - HDL_SIMBLE_V6_WRITE_LONG, // V6 write long value handle - HDL_SIMBLE_V7_READ_LONG, // V7 read long value handle - HDL_SIMBLE_V8, // V3 notify value handle - HDL_SIMBLE_V8_CCCD, // V3 notify CCCD handle - HDL_SIMBLE_CACHE_LEN //!< handle cache length -} T_SIMP_HANDLE_TYPE; - -/** @brief SIMP client discovery state*/ -typedef enum -{ - DISC_SIMP_IDLE, - DISC_SIMP_START, - DISC_SIMP_DONE, - DISC_SIMP_FAILED -} T_SIMP_DISC_STATE; - -/** @brief SIMP client read type*/ -typedef enum -{ - SIMP_READ_V1_READ, - SIMP_READ_V3_NOTIFY_CCCD, - SIMP_READ_V4_INDICATE_CCCD, - SIMP_READ_V7_READ_LONG = 4, - SIMP_READ_V8_CCCD = 5, -} T_SIMP_READ_TYPE; - -/** @brief SIMP client read value*/ -typedef struct -{ - uint16_t value_size; - uint8_t *p_value; -} T_SIMP_READ_VALUE; - -/** @brief SIMP client read data*/ -typedef union -{ - T_SIMP_READ_VALUE v1_read; - bool v3_notify_cccd; - bool v4_indicate_cccd; - uint16_t v8_notify_ind_cccd; - T_SIMP_READ_VALUE v7_read; -} T_SIMP_READ_DATA; - -/** @brief SIMP client read result*/ -typedef struct -{ - T_SIMP_READ_TYPE type; - T_SIMP_READ_DATA data; - uint16_t cause; -} T_SIMP_READ_RESULT; - - -/** @brief SIMP client write type*/ -typedef enum -{ - SIMP_WRITE_V2_WRITE, - SIMP_WRITE_V3_NOTIFY_CCCD, - SIMP_WRITE_V4_INDICATE_CCCD, - SIMP_WRITE_V6_WRITE_LONG, - SIMP_WRITE_V8_CCCD, -} T_SIMP_WRTIE_TYPE; - -/** @brief SIMP client write result*/ -typedef struct -{ - T_SIMP_WRTIE_TYPE type; - uint16_t cause; -} T_SIMP_WRITE_RESULT; - -/** @brief SIMP client notif/ind receive type*/ -typedef enum -{ - SIMP_V3_NOTIFY, - SIMP_V4_INDICATE, - SIMP_V8_NOTIFY, - SIMP_V8_INDICATE, -} T_SIMP_NOTIF_IND_TYPE; - -/** @brief SIMP client notif/ind receive data*/ -typedef struct -{ - uint16_t value_size; - uint8_t *p_value; -} T_SIMP_NOTIF_IND_VALUE; - -/** @brief SIMP client notif/ind receive content*/ -typedef struct -{ - T_SIMP_NOTIF_IND_TYPE type; - T_SIMP_NOTIF_IND_VALUE data; -} T_SIMP_NOTIF_IND_DATA; - -/** @brief SIMP client callback type*/ -typedef enum -{ - SIMP_CLIENT_CB_TYPE_DISC_STATE, //!< Discovery procedure state, done or pending. - SIMP_CLIENT_CB_TYPE_READ_RESULT, //!< Read request's result data, responsed from server. - SIMP_CLIENT_CB_TYPE_WRITE_RESULT, //!< Write request result, success or fail. - SIMP_CLIENT_CB_TYPE_NOTIF_IND_RESULT, //!< Notification or indication data received from server. - SIMP_CLIENT_CB_TYPE_INVALID //!< Invalid callback type, no practical usage. -} T_SIMP_CLIENT_CB_TYPE; - -/** @brief SIMP client callback content*/ -typedef union -{ - T_SIMP_DISC_STATE disc_state; - T_SIMP_READ_RESULT read_result; - T_SIMP_WRITE_RESULT write_result; - T_SIMP_NOTIF_IND_DATA notif_ind_data; -} T_SIMP_CLIENT_CB_CONTENT; - -/** @brief SIMP client callback data*/ -typedef struct -{ - T_SIMP_CLIENT_CB_TYPE cb_type; - T_SIMP_CLIENT_CB_CONTENT cb_content; -} T_SIMP_CLIENT_CB_DATA; - -/** End of SIMP_Client_Exported_Types * @} */ - -/** @defgroup SIMP_Client_Exported_Functions SIMP Client Exported Functions - * @{ - */ - -/** - * @brief Add simple ble service client to application. - * @param[in] app_cb pointer of app callback function to handle specific client module data. - * @param[in] link_num initialize link num. - * @return Client ID of the specific client module. - * @retval 0xff failed. - * @retval other success. - * - * Example usage - * \code{.c} - void app_le_profile_init(void) - { - client_init(1); - simple_ble_client_id = simp_ble_add_client(app_client_callback, APP_MAX_LINKS); - } - * \endcode - */ -T_CLIENT_ID simp_ble_add_client(P_FUN_GENERAL_APP_CB app_cb, uint8_t link_num); - -/** - * @brief Used by application, to start the discovery procedure of Simple BLE server. - * @param[in] conn_id connection ID. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_start_discovery(uint8_t conn_id); - -/** - * @brief Used by application, to read data from server by using handles. - * @param[in] conn_id connection ID. - * @param[in] read_type one of characteristic that has the readable property. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_read_by_handle(uint8_t conn_id, T_SIMP_READ_TYPE read_type); - -/** - * @brief Used by application, to read data from server by using UUIDs. - * @param[in] conn_id connection ID. - * @param[in] read_type one of characteristic that has the readable property. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_read_by_uuid(uint8_t conn_id, T_SIMP_READ_TYPE read_type); - -/** - * @brief Used by application, to write data of V2 write Characteristic. - * @param[in] conn_id connection ID. - * @param[in] length write data length - * @param[in] p_value point the value to write - * @param[in] type write type. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_write_v2_char(uint8_t conn_id, uint16_t length, uint8_t *p_value, - T_GATT_WRITE_TYPE type); - -/** - * @brief Used by application, to send write request to peer server's V6 Long Write Characteristic. - * @param conn_id: connection ID. - * @param length: value length. - * @param p_value: value point. - * @retval true--send request to upper stack success. - * false--send request to upper stack failed. - */ -bool simp_ble_client_write_v6_char(uint8_t conn_id, uint16_t length, uint8_t *p_value); -/** - * @brief Used by application, to enable or disable the notification of peer server's V3 Notify Characteristic. - * @param[in] conn_id connection ID. - * @param[in] notify 0--disable the notification, 1--enable the notification. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_set_v3_notify(uint8_t conn_id, bool notify); - -/** - * @brief Used by application, to enable or disable the indication of peer server's V4 Indicate Characteristic. - * @param[in] conn_id connection ID. - * @param[in] ind 0--disable the indication, 1--enable the indication. - * @retval true send request to upper stack success. - * @retval false send request to upper stack failed. - */ -bool simp_ble_client_set_v4_ind(uint8_t conn_id, bool ind); - -bool simp_ble_client_set_v8_cccd(uint8_t conn_id, uint16_t cccd_bits); - - - - -/** - * @brief Used by application, to get handle cache. - * @param[in] conn_id connection ID. - * @param[in] p_hdl_cache pointer of the handle cache table - * @param[in] len the length of handle cache table - * @retval true success. - * @retval false failed. - */ -bool simp_ble_client_get_hdl_cache(uint8_t conn_id, uint16_t *p_hdl_cache, uint8_t len); - -/** - * @brief Used by application, to set handle cache. - * @param[in] conn_id connection ID. - * @param[in] p_hdl_cache pointer of the handle cache table - * @param[in] len the length of handle cache table - * @retval true success. - * @retval false failed. - */ -bool simp_ble_client_set_hdl_cache(uint8_t conn_id, uint16_t *p_hdl_cache, uint8_t len); -#endif -/** @} End of SIMP_Client_Exported_Functions */ - -/** @} End of SIMP_Client */ - -/** @} End of Bluetooth_Clients */ - -/** @} End of PROFILE_API */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SIMPLE_BLE_CLIENT_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/complete_ble_service.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/complete_ble_service.h deleted file mode 100644 index d9c3644f..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/complete_ble_service.h +++ /dev/null @@ -1,255 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file complete_ble_service.h - * @brief Demonstration of how to implement a self-definition service. - * @details Demonstration of different kinds of service interfaces. - * @author - * @date - * @version - * ************************************************************************************* - */ - -/* Define to prevent recursive inclusion */ -#ifndef _COMPLETE_BLE_SERVICE_H_ -#define _COMPLETE_BLE_SERVICE_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Add Includes here */ -#include -#include - -/** @addtogroup PROFILE_API Profile APIs - * @{ - */ - - -/** @addtogroup Bluetooth_Services Bluetooth Services - * @{ - */ - -/** @defgroup SIMP_Service Simple Ble Service - * @brief Simple BLE service - * @{ - */ -/*============================================================================* - * Macros - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Macros SIMP Service Exported Macros - * @brief - * @{ - */ - -/** @defgroup SIMP_Service_Application_Parameters SIMP Service Application Parameters - * @brief Type of parameters set/got from application. - * @{ - */ -typedef enum -{ - SIMPLE_BLE_SERVICE_PARAM_V1_READ_CHAR_VAL = 0x01, - SIMPLE_BLE_SERVICE_PARAM_V7_LEN = 0x02, -} T_SIMP_PARAM_TYPE; - -/** @} */ - - - -/** @defgroup SIMP_Service_Upstream_Message SIMP Service Upstream Message - * @brief Upstream message used to inform application. - * @{ - */ -/** @brief Index of each characteristic in Demo Profile service database. */ -#define SIMPLE_BLE_SERVICE_CHAR_V1_READ_INDEX 0x02 -#define SIMPLE_BLE_SERVICE_CHAR_V2_WRITE_INDEX 0x05 -#define SIMPLE_BLE_SERVICE_CHAR_V3_NOTIFY_INDEX 0x07 -#define SIMPLE_BLE_SERVICE_CHAR_V4_INDICATE_INDEX 0x0a -#define SIMPLE_BLE_SERVICE_CHAR_NOTIFY_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V3_NOTIFY_INDEX + 1) -#define SIMPLE_BLE_SERVICE_CHAR_INDICATE_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V4_INDICATE_INDEX + 1) -#define SIMPLE_BLE_SERVICE_CHAR_V6_WRITE_INDEX 0xd -#define SIMPLE_BLE_SERVICE_CHAR_V7_READ_LONG_INDEX 0xf -#define SIMPLE_BLE_SERVICE_CHAR_V8_NOTIFY_INDICATE_INDEX 0x11 -#define SIMPLE_BLE_SERVICE_CHAR_V8_CCCD_INDEX (SIMPLE_BLE_SERVICE_CHAR_V8_NOTIFY_INDICATE_INDEX + 1) - -/** @defgroup SIMP_Service_Read_Info SIMP Service Read Info - * @brief Parameter for reading characteristic value. - * @{ - */ -#define SIMP_READ_V1 1 -#define SIMP_READ_V7 2 -/** @} */ - -/** @defgroup SIMP_Service_Write_Info SIMP Service Write Info - * @brief Parameter for writing characteristic value. - * @{ - */ -#define SIMP_WRITE_V2 1 -#define SIMP_WRITE_V6 2 -/** @} */ - -/** @defgroup SIMP_Service_Notify_Indicate_Info SIMP Service Notify Indicate Info - * @brief Parameter for enable or disable notification or indication. - * @{ - */ -#define SIMP_NOTIFY_INDICATE_V3_ENABLE 1 -#define SIMP_NOTIFY_INDICATE_V3_DISABLE 2 -#define SIMP_NOTIFY_INDICATE_V4_ENABLE 3 -#define SIMP_NOTIFY_INDICATE_V4_DISABLE 4 -#define SIMP_NOTIFY_INDICATE_V8_NOTIFY_ENABLE 7 -#define SIMP_NOTIFY_INDICATE_V8_INDICATE_ENABLE 8 -#define SIMP_NOTIFY_INDICATE_V8_NOTIFY_INDICATE_ENABLE 9 -#define SIMP_NOTIFY_INDICATE_V8_DISABLE 10 -/** @} */ - -#define SIMP_READ_V7_MAX_LEN 300 - -/** @} End of SIMP_Service_Upstream_Message */ - - - -/** @} End of SIMP_Service_Exported_Macros */ -/*============================================================================* - * Types - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Types SIMP Service Exported Types - * @brief - * @{ - */ - -/** @defgroup TSIMP_WRITE_MSG TSIMP_WRITE_MSG - * @brief Simple BLE service written msg to application. - * @{ - */ -typedef struct -{ - uint8_t opcode; //!< ref: @ref SIMP_Control_Point_OpCodes, @ref SIMP_Service_Write_Info - T_WRITE_TYPE write_type; - uint16_t len; - uint8_t *p_value; -} TSIMP_WRITE_MSG; -/** @} End of TSIMP_WRITE_MSG */ - - -/** @defgroup TSIMP_UPSTREAM_MSG_DATA TSIMP_UPSTREAM_MSG_DATA - * @brief Simple BLE service callback message content. - * @{ - */ -typedef union -{ - uint8_t notification_indification_index; //!< ref: @ref SIMP_Service_Notify_Indicate_Info - uint8_t read_value_index; //!< ref: @ref SIMP_Service_Read_Info - TSIMP_WRITE_MSG write; -} TSIMP_UPSTREAM_MSG_DATA; -/** @} End of TSIMP_UPSTREAM_MSG_DATA */ - -/** @defgroup TSIMP_CALLBACK_DATA TSIMP_CALLBACK_DATA - * @brief Simple BLE service data to inform application. - * @{ - */ -typedef struct -{ - uint8_t conn_id; - T_SERVICE_CALLBACK_TYPE msg_type; - TSIMP_UPSTREAM_MSG_DATA msg_data; -} TSIMP_CALLBACK_DATA; -/** @} End of TSIMP_CALLBACK_DATA */ - -/** @} End of SIMP_Service_Exported_Types */ -/*============================================================================* - * Functions - *============================================================================*/ -/** @defgroup SIMP_Service_Exported_Functions SIMP Service Exported Functions - * @brief - * @{ - */ - -/** - * @brief add Simple BLE service to application. - * - * @param[in] p_func pointer of app callback function called by profile. - * @return service ID auto generated by profile layer. - */ -T_SERVER_ID simp_ble_service_add_service(void *p_func); - -/** - * @brief Set service related data from application. - * - * @param[in] param_type parameter type to set. - * @param[in] len value length to be set. - * @param[in] p_value value to set. - * @return parameter set result. - * @retval 0 false - * @retval 1 true - */ -bool simp_ble_service_set_parameter(T_SIMP_PARAM_TYPE param_type, uint16_t len, void *p_value); - -/** - * @brief send notification of simple notify characteristic value. - * - * @param[in] conn_id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_send_v3_notify(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** - * @brief send indication of simple indicate characteristic value. - * - * @param[in] conn_id connection id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_send_v4_indicate(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** - * @brief send notification of simple notify characteristic value. - * - * @param[in] conn_id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_simple_v8_notify(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, - uint16_t length); - -/** - * @brief send indication of simple indicate characteristic value. - * - * @param[in] conn_id connection id - * @param[in] service_id service ID of service. - * @param[in] p_value characteristic value to notify - * @param[in] length characteristic value length to notify - * @return notification action result - * @retval 1 true - * @retval 0 false - */ -bool simp_ble_service_simple_v8_indicate(uint8_t conn_id, T_SERVER_ID service_id, - void *p_value, uint16_t length); -/** @} End of SIMP_Service_Exported_Functions */ - -/** @} End of SIMP_Service */ - -/** @} End of Bluetooth_Services */ - -/** @} End of PROFILE_API */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SIMPLE_BLE_SERVICE_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_gap_le.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_gap_le.h deleted file mode 100644 index 45474493..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_gap_le.h +++ /dev/null @@ -1,198 +0,0 @@ -#ifndef _HRP_GAP_LE_H_ -#define _HRP_GAP_LE_H_ - - -#include "gap_le.h" -#include "gap_bond_le.h" -#include -#include - -#if F_BT_LE_GATT_CLIENT_SUPPORT -#include "gaps_client.h" -#include -#endif -#include -#if F_BT_LE_PRIVACY_SUPPORT -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define HRP_MAX_LE_LINKS 4 -#define HRP_MAX_EVE_PARAM_LEN 100 - - -typedef enum -{ - HRP_GAP_MSG_LE_RESULT = 0x00, - HRP_GAP_MSG_LE_MODIFY_WHITE_LIST = 0x01, - HRP_GAP_MSG_LE_SET_RAND_ADDR = 0x02, - HRP_GAP_MSG_LE_SET_HOST_CHANN_CLASSIF = 0x03, - HRP_GAP_MSG_LE_VENDOR_ONE_SHOT_ADV = 0x04, - - HRP_GAP_MSG_LE_READ_RSSI = 0x10, - HRP_GAP_MSG_LE_READ_CHANN_MAP, - HRP_GAP_MSG_LE_DISABLE_SLAVE_LATENCY, - HRP_GAP_MSG_LE_SET_DATA_LEN, - HRP_GAP_MSG_LE_DATA_LEN_CHANGE_INFO, - HRP_GAP_MSG_LE_CONN_UPDATE_IND, - HRP_GAP_MSG_LE_CREATE_CONN_IND, - HRP_GAP_MSG_LE_PHY_UPDATE_INFO, - HRP_GAP_MSG_LE_UPDATE_PASSED_CHANN_MAP, - - HRP_GAP_MSG_LE_REMOTE_FEATS_INFO, - - - - HRP_GAP_MSG_LE_BOND_MODIFY_INFO = 0x20, - HRP_GAP_MSG_LE_KEYPRESS_NOTIFY, - HRP_GAP_MSG_LE_KEYPRESS_NOTIFY_INFO, - HRP_GAP_MSG_LE_GATT_SIGNED_STATUS_INFO, - - - HRP_GAP_MSG_LE_SCAN_INFO = 0x30, - HRP_GAP_MSG_LE_DIRECT_ADV_INFO, - - HRP_GAP_MSG_LE_ADV_UPDATE_PARAM = 0x40, - HRP_GAP_MSG_LE_ADV_READ_TX_POWER, - - HRP_GAP_MSG_LE_EXT_ADV_REPORT_INFO = 0x50, - - HRP_GAP_MSG_LE_EXT_ADV_START_SETTING = 0x60, - HRP_GAP_MSG_LE_EXT_ADV_REMOVE_SET, - HRP_GAP_MSG_LE_EXT_ADV_CLEAR_SET, - HRP_GAP_MSG_LE_EXT_ADV_ENABLE, - HRP_GAP_MSG_LE_EXT_ADV_DISABLE, - HRP_GAP_MSG_LE_SCAN_REQ_RECEIVED_INFO, - HRP_GAP_MSG_LE_EXT_ADV_STATE_CHANGE, - - - HRP_GAP_MSG_LE_PRIVACY_RESOLUTION_STATUS_INFO = 0x70, - HRP_GAP_MSG_LE_PRIVACY_SET_RESOLV_PRIV_ADDR_TIMEOUT, //0x71 - HRP_GAP_MSG_LE_PRIVACY_MODIFY_RESOLV_LIST, //0x72 - - HRP_GAP_MSG_LE_PRIVACY_READ_PEER_RESOLV_ADDR, //0x73 - HRP_GAP_MSG_LE_PRIVACY_READ_LOCAL_RESOLV_ADDR, //0x74 - HRP_GAP_MSG_LE_PRIVACY_SET_MODE, //0x75 - - - - HRP_GAP_MSG_LE_VENDOR_ADV_3_DATA_ENABLE = 0xA0, - HRP_GAP_MSG_LE_VENDOR_ADV_3_DATA_SET, //0xA1 - HRP_GAP_MSG_LE_SET_LPS_BOOTUP_ACTIVE_TIME, //0xA2 - HRP_GAP_MSG_LE_CHECK_LPS_WAKEUP_TIME_RSP, //0xA3 - - - HRP_GAP_MSG_LE_DEV_STATE_CHANGE = 0xB1, - HRP_GAP_MSG_LE_CONN_STATE_CHANGE, - HRP_GAP_MSG_LE_CONN_PARAM_UPDATE, - HRP_GAP_MSG_LE_CONN_MTU_INFO, - HRP_GAP_MSG_LE_AUTHEN_STATE_CHANGE, - HRP_GAP_MSG_LE_BOND_PASSKEY_DISPLAY, - HRP_GAP_MSG_LE_BOND_PASSKEY_INPUT, - - HRP_GAP_MSG_LE_BOND_OOB_INPUT, - HRP_GAP_MSG_LE_BOND_USER_CONFIRMATION, - HRP_GAP_MSG_LE_BOND_JUST_WORK, - - HRP_GAP_MSG_LE_GEN_RAND_ADDR_RSP = 0xC0, - - HRP_GAP_MSG_LE_CBC_CHANN_STATE = 0xC1, - HRP_GAP_MSG_LE_CBC_REG_PSM = 0xC2, - HRP_GAP_MSG_LE_CBC_SET_PSM_SECURITY = 0xC3, - HRP_GAP_MSG_LE_CBC_SEND_DATA = 0xC4, - HRP_GAP_MSG_LE_CBC_RECEIVE_DATA = 0xC5, - HRP_GAP_MSG_LE_CBC_MTU_INFO = 0xC6, - - -} T_PROFILE_GAP_LE_MSG_INDEX; - - -typedef enum -{ - HRP_PROFILE_EVT_GENERAL_RESULT = 0x00, - - HRP_PROFILE_EVT_SRV_REG_COMPLETE = 0x01, - - HRP_PROFILE_EVT_SRV_SEND_DATA_COMPLETE, - - HRP_PROFILE_EVT_CLIENT_DISC_STATE = 0x10, - - HRP_PROFILE_EVT_CLIENT_DISC_RESULT, - - -} T_PROFILE_LE_GENERAL_MSG_INDEX; - - -typedef enum -{ - NONE = 0x0000, -//server mask - SIMPLE_BLE_SERVICE = 0x01, - - SIMPLE_BLE_ADD_SERVICE = 0x10, - -//client mask - SIMPLE_BLE_CLIENT = 0x30, - - -} T_HRP_PROFILE_LE_MASK; - -#if F_BT_LE_GATT_CLIENT_SUPPORT -extern T_CLIENT_ID gaps_client_id; /**< Simple ble service client id*/ -extern T_CLIENT_ID simple_ble_client_id; /**< gap service client id*/ -#endif -extern T_SERVER_ID simp_srv_id; /**< Simple ble service id*/ - -T_APP_RESULT hrp_profile_callback(T_SERVER_ID service_id, void *p_data); -#if F_BT_LE_GATT_CLIENT_SUPPORT -T_APP_RESULT hrp_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); - -extern void hrp_profile_client_gaps_callback(T_GAPS_CLIENT_CB_DATA *p_gaps_cb_data); -extern void hrp_profile_server_simp_ble_callback(TSIMP_CALLBACK_DATA *p_simp_cb_data); -extern void hrp_profile_client_simp_ble_callback(T_SIMP_CLIENT_CB_DATA *p_simp_client_cb_data); -#endif -T_GAP_CAUSE hrp_gap_le_set_param(uint8_t type, uint8_t len, void *p_value); - -void hrp_gap_le_init(uint16_t le_profile_sever_mask, uint16_t le_profile_client_mask); - -void hrp_gap_le_server_init(uint16_t le_profile_sever_mask); - -void hrp_gap_le_client_init(uint16_t le_profile_client_mask); - -void hrp_gap_le_handle_io_msg(T_IO_MSG io_msg); - -void hrp_app_handle_gap_le_msg(T_IO_MSG *p_io_msg); - -void hrp_app_handle_dev_state_evt(T_GAP_DEV_STATE new_state); -void hrp_gap_le_check_lps_wakeup_time_handler(void *pxTimer); -void hrp_gap_le_check_lps_event_to_app(void *pxTimer); - -T_GAP_CAUSE hrp_le_set_gap_param(uint16_t type, uint8_t len, void *p_value); -T_GAP_CAUSE hrp_le_set_bond_param(uint16_t type, uint8_t len, void *p_value); -T_GAP_CAUSE hrp_le_set_scan_param(uint16_t type, uint8_t len, void *p_value); -T_GAP_CAUSE hrp_le_set_adv_param(uint16_t type, uint8_t len, void *p_value); -T_GAP_CAUSE hrp_le_set_privacy_param(uint16_t type, uint8_t len, void *p_value); -/* hrp_profile_system_api.c */ -void hrp_profile_handle_initCmplete(uint8_t initiated_mode); - -#if F_BT_LE_4_1_CBC_SUPPORT -T_APP_RESULT hrp_credit_based_conn_callback(uint8_t cbc_type, void *p_cbc_data); -#endif - -#if F_BT_LE_PRIVACY_SUPPORT -void app_privacy_callback(T_PRIVACY_CB_TYPE type, T_PRIVACY_CB_DATA cb_data); -#endif - -extern T_GAP_CAUSE le_adv_read_tx_power(void); -extern T_GAP_CAUSE le_adv_update_param(void); -extern T_GAP_CAUSE le_adv_stop(void); -extern T_GAP_CAUSE le_adv_start(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _HRP_GAP_LE_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_entry.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_entry.h deleted file mode 100644 index 0b858e73..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_entry.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef _HRP_PROFILE_ENTRY_H_ -#define _HRP_PROFILE_ENTRY_H_ - -#include -#include -#include -//#include - -#define MAX_PROFILE_CMD_INDEX 10 -typedef enum -{ - HRP_PROFILE_CMD_GROUP_SYSTEM = 0x0f, - HRP_PROFILE_CMD_GROUP_GAP = 1, - HRP_PROFILE_CMD_GROUP_A2DP = 2, - HRP_PROFILE_CMD_GROUP_AVRCP = 3, - HRP_PROFILE_CMD_GROUP_HFP = 4, - HRP_PROFILE_CMD_GROUP_SPP = 5, - - HRP_PROFILE_CMD_GROUP_GAP_LEGACY = 0x10, - HRP_PROFILE_CMD_GROUP_EVENT_GAP_LEGACY = 0x11, - - HRP_PROFILE_CMD_GROUP_LE = 0x21, - - HRP_PROFILE_CMD_GROUP_EVENT_SYS = 0x4f, - HRP_PROFILE_CMD_GROUP_EVENT_GAP = 0x41, - HRP_PROFILE_CMD_GROUP_EVENT_A2DP = 0x42, - HRP_PROFILE_CMD_GROUP_EVENT_AVRCP = 0x43, - HRP_PROFILE_CMD_GROUP_EVENT_HFP = 0x44, - HRP_PROFILE_CMD_GROUP_EVENT_SPP = 0X45, - - HRP_PROFILE_CMD_GROUP_EVENT_LE = 0X61, - - HRP_PROFILE_CMD_GROUP_EVENT_GENERAL_ID = 0x65, - - HRP_PROFILE_CMD_GROUP_SIMP_BLE = 0X70, - HRP_PROFILE_CMD_GROUP_GAPS_CLIENT = 0X71, - - HRP_PROFILE_CMD_GROUP_EVENT_SIMP_BLE = 0X80, - HRP_PROFILE_CMD_GROUP_EVENT_GAPS_CLIENT = 0X81, - -} HRP_PROFILE_CMD_GROUP; - -typedef enum -{ - HRP_PROFILE_SYSTEM_COMMAND_COMPLETE = 0, - HRP_PROFILE_SYSTEM_COMMAND_DISALLOW = 1, - HRP_PROFILE_SYSTEM_UNKNOWN_COMMAND = 2, -} HRP_PROFILE_SYSTEM_CMD_STATUS; - -typedef enum -{ - PROFILE_SYSTEM_CMD_RESULT = 1, - PROFILE_SYSTEM_RESET_COMPLETE = 2, - PROFILE_SYSTEM_INIT_COMPLETE = 3, - PROFILE_SYSTEM_SET_GAP_PARAM_RSP = 4, - PROFILE_SYSTEM_SET_PAIRABLE_MODE_RSP = 5, - PROFILE_SYSTEM_ENABLE_DLPS_RSP = 6, - - PROFILE_SYSTEM_EVENT_ACK = 7, - PROFILE_SYSTEM_CMD_ACK = 8, - -} PROFILE_SYSTEM_CMD_ENTRY; - -void hrp_profile_handle_req(uint8_t cmd_group, uint16_t cmd_index, uint16_t param_list_len, - uint8_t *p_param_list); - -extern void (*(hrp_profile_handle_system[]))(uint16_t len, uint8_t *p_param_list) ; -extern void (*(hrp_profile_handle_gap[]))(uint16_t len, uint8_t *p_param_list); -extern void (*(hrp_profile_handle_a2dp[]))(uint16_t len, uint8_t *p_param_list); -extern void (*(hrp_profile_handle_avrcp[]))(uint16_t len, uint8_t *p_param_list); -extern void (*(hrp_profile_handle_hfp[]))(uint16_t len, uint8_t *p_param_list); -extern void (*(hrp_profile_handle_spp[]))(uint16_t len, uint8_t *p_param_list); -extern void (*(hrp_gap_legacy_cmd_table[]))(uint16_t len, uint8_t *p_param_list); - -extern void (*(hrp_profile_handle_gap_le[]))(uint16_t len, uint8_t *p_param_list); -extern void (*(hrp_profile_handle_simp_ble[]))(uint16_t len, uint8_t *p_param_list); -extern void (*(hrp_profile_handle_gaps_client[]))(uint16_t len, uint8_t *p_param_list); - - -/*--------------------------------------------------------------------------*/ -//============utils=====================// -void hrp_profile_evet(uint8_t cmd_group, uint16_t cmd_index, uint16_t param_list_len, - uint8_t *p_param_list); -void hrp_profile_commit_buf(uint8_t *destbuf, int *pos, void *srcbuf, int length); -void hrp_profile_fetch_buf(void *destbuf, uint16_t *pos, void *srcbuf, int length); - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_le_simple_ble.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_le_simple_ble.h deleted file mode 100644 index 12504fa5..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_le_simple_ble.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef _HRP_PROFILE_SIMPLE_BLE_H_ -#define _HRP_PROFILE_SIMPLE_BLE_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#include "complete_ble_service.h" -#include "complete_ble_client.h" - -typedef enum -{ - HRP_SIMP_BLE_CMD_RESULT = 0x01, - - HRP_SIMP_CLIENT_CB_TYPE_DISC_STATE, //02 - HRP_SIMP_READ_V1_READ, //03 - HRP_SIMP_READ_V3_NOTIFY_CCCD, //04 - - HRP_SIMP_READ_V4_INDICATE_CCCD, //05 - HRP_SIMP_READ_V8_CCCD, //06 - - HRP_SIMP_READ_V7_READ_LONG, //07 - - HRP_SIMP_WRITE_V2_WRITE, //08 - HRP_SIMP_WRITE_V3_NOTIFY_CCCD, //09 - - HRP_SIMP_WRITE_V4_INDICATE_CCCD, //0x0a - - HRP_SIMP_WRITE_V6_WRITE_LONG, //0x0b - - HRP_SIMP_WRITE_V8_CCCD, //0x0c - - HRP_SIMP_V3_NOTIFY, //0x0d - HRP_SIMP_V4_INDICATE, //0x0e - HRP_SIMP_V8_INDICATE, //0x0f - HRP_SIMP_V8_NOTIFY, //0x10 - - HRP_SIMP_GET_HDL_CACHE_RSP, //0x11 - - - HRP_SERVICE_CALLBACK_TYPE_INDIFICATION_NOTIFICATION = 0x30, - HRP_SERVICE_CALLBACK_TYPE_READ_CHAR_VALUE = 0x31, - HRP_SERVICE_CALLBACK_TYPE_WRITE_CHAR_VALUE, - - -} T_PROFILE_SIMP_BLE_MSG_INDEX; - -typedef enum -{ - HRP_GAPS_CLIENT_CMD_RESULT = 0x01, - HRP_GAPS_CLIENT_CB_TYPE_DISC_STATE, - - HRP_GAPS_READ_DEVICE_NAME, - HRP_GAPS_READ_APPEARANCE, - HRP_GAPS_READ_CENTRAL_ADDR_RESOLUTION, - -} T_PROFILE_GAPS_CLIENT_MSG_INDEX; - -void hrp_profile_server_simp_ble_callback(TSIMP_CALLBACK_DATA *p_simp_cb_data); -#if F_BT_LE_GATT_CLIENT_SUPPORT -void hrp_profile_client_simp_ble_callback(T_SIMP_CLIENT_CB_DATA *p_simp_client_cb_data); -#endif -#ifdef __cplusplus -} -#endif - -#endif /* _HRP_PROFILE_SIMPLE_BLE_SERVICE_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_system_api.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_system_api.h deleted file mode 100644 index cc90bf4b..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap/hrp_profile_system_api.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _HRP_PROFILE_SYSTEM_API_H_ -#define _HRP_PROFILE_SYSTEM_API_H_ - -#include -#include -#include - -#define GAP_DATA_TYPE_LEN 2 -typedef enum -{ - GAP_PARAM_TYPE_LE = 0, - GAP_PARAM_TYPE_LE_BOND = 1, - GAP_PARAM_TYPE_LE_SCAN = 2, - GAP_PARAM_TYPE_LE_PRIVACY = 3, - GAP_PARAM_TYPE_LE_ADV = 4, - - GAP_PARAM_TYPE_LEGACY = 0x10, - GAP_PARAM_TYPE_LEGACY_BOND = 0x11, - - GAP_PARAM_TYPE_COMMON = 0x20, - -} T_HRP_GAP_PARAM_TYPE; - -typedef enum -{ - LE_SET_PARAM_TYPE_GAP = 0, - LE_SET_PARAM_TYPE_BOND = 1, - LE_SET_PARAM_TYPE_SCAN = 2, - LE_SET_PARAM_TYPE_PRIVACY = 3, - LE_SET_PARAM_TYPE_ADV = 4, -} T_HRP_LE_SET_PARAM_TYPE; -typedef enum -{ - LE_GET_PARAM_TYPE_GAP = 0, - LE_GET_PARAM_TYPE_BOND = 1, - LE_GET_PARAM_TYPE_SCAN = 2, - LE_GET_PARAM_TYPE_PRIVACY = 3, - LE_GET_PARAM_TYPE_ADV = 4, - -} T_HRP_LE_GET_PARAM_TYPE; - - - - -typedef enum -{ - HRP_GAP_LEGACY = 1, - HRP_GAP_LE = 2, -} T_HRP_GAP_SUPPORT_MODE; - - - -typedef enum -{ - PROFILE_SYS_CMD_SUCESS = 0X00, - PROFILE_SYS_CMD_FAIL = 0X01, - PROFILE_SYS_CMD_UNSUPPORT = 0X02, - PROFILE_SYS_CMD_TRYAGAIN = 0X04, - PROFILE_SYS_CMD_EXEFAIL = 0X05, - PROFILE_SYS_CMD_INVALID_PARAM = 0x06, - PROFILE_SYS_CMD_INVALID_STATE = 0x07, -} PROFILE_SYS_CAUSE; - - - -void hrp_profile_system_send_cmd_ack(uint8_t cmd_group, uint16_t cmd_index, - HRP_PROFILE_SYSTEM_CMD_STATUS status); - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_api.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_api.h deleted file mode 100644 index 82a4e5d9..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_api.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _HRP_GAP_BLE_API_H_ -#define _HRP_GAP_BLE_API_H_ - -#include -#include -#include - -void hrp_gap_ble_handle_adv_0000_perf_config_req(uint16_t len, uint8_t *p_param_list); -void hrp_gap_ble_handle_adv_0000_perf_start_req(uint16_t len, uint8_t *p_param_list); - - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_cmd_table.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_cmd_table.h deleted file mode 100644 index ecee7ef8..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_cmd_table.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _HRP_GAP_BLE_CMD_TABLE_H_ -#define _HRP_GAP_BLE_CMD_TABLE_H_ - -#include -//#include - -typedef enum _HRP_GAP_BLE_CMD_GROUP_INDEX -{ - HRP_GAP_BLE_CMD_GROUP_ADV = 0, - HRP_GAP_BLE_CMD_GROUP_SCAN = 1, - HRP_GAP_BLE_CMD_GROUP_CONN = 2, - HRP_GAP_BLE_CMD_GROUP_PAIR = 3 - -} HRP_GAP_BLE_CMD_GROUP_INDEX; - -typedef enum _HRP_GAP_BLE_CMD_GROUP_ADV_INDEX -{ - HRP_GAP_BLE_CMD_ADV_0000_PERFOAMANCE_CONFIG_REQ = 0, - HRP_GAP_BLE_CMD_ADV_0000_PERFOAMANCE_CONFIG_RSP, - HRP_GAP_BLE_CMD_ADV_0000_PERFOAMANCE_START_REQ, - HRP_GAP_BLE_CMD_ADV_0000_PERFOAMANCE_START_RSP, - HRP_GAP_BLE_CMD_ADV_0000_PERFOAMANCE_CMPL_INFO, - - HRP_GAP_BLE_CMD_ADV_0001_STRESS_START_STOP_CONFIG_REQ, - HRP_GAP_BLE_CMD_ADV_0001_STRESS_START_STOP_CONFIG_RSP, - HRP_GAP_BLE_CMD_ADV_0001_STRESS_START_STOP_START_REQ, - HRP_GAP_BLE_CMD_ADV_0001_STRESS_START_STOP_START_RSP, - HRP_GAP_BLE_CMD_ADV_0001_STRESS_START_STOP_CMPL_INFO - -} HRP_GAP_BLE_CMD_GROUP_ADV_INDEX; - - -typedef enum _HRP_GAP_BLE_CMD_GROUP_SCAN_INDEX -{ - HRP_GAP_BLE_CMD_SCAN_0000_PERFOAMANCE_CONFIG_REQ = 0, - HRP_GAP_BLE_CMD_SCAN_0000_PERFOAMANCE_CONFIG_RSP, - HRP_GAP_BLE_CMD_SCAN_0000_PERFOAMANCE_START_REQ, - HRP_GAP_BLE_CMD_SCAN_0000_PERFOAMANCE_START_RSP, - HRP_GAP_BLE_CMD_SCAN_0000_PERFOAMANCE_CMPL_INFO, - - HRP_GAP_BLE_CMD_SCAN_0001_STRESS_START_STOP_CONFIG_REQ, - HRP_GAP_BLE_CMD_SCAN_0001_STRESS_START_STOP_CONFIG_RSP, - HRP_GAP_BLE_CMD_SCAN_0001_STRESS_START_STOP_START_REQ, - HRP_GAP_BLE_CMD_SCAN_0001_STRESS_START_STOP_START_RSP, - HRP_GAP_BLE_CMD_SCAN_0001_STRESS_START_STOP_CMPL_INFO, - -} HRP_GAP_BLE_CMD_GROUP_SCAN_INDEX; - -//add more here - - -void hrp_gap_ble_handle_req(uint8_t cmd_group, uint8_t cmd_index, uint16_t len, - uint8_t *p_param_list); - - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_msg.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_msg.h deleted file mode 100644 index 7a6319f9..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_msg.h +++ /dev/null @@ -1,21 +0,0 @@ - -#ifndef _HRP_GAP_BLE_MSG_H_ -#define _HRP_GAP_BLE_MSG_H_ - -#include -//#include - - -#include "hrp.h" -#include -#include "hrp_gap_ble_api.h" -//#include -#include "hrp_gap_ble_cmd_table.h" - -void hrp_gap_ble_handle_adv_0000_perf_config_rsp(uint16_t len, uint8_t *p_param_list); -void hrp_gap_ble_handle_adv_0000_perf_start_rsp(uint16_t len, uint8_t *p_param_list); -void hrp_gap_ble_handle_adv_0000_perf_cmpl_info(uint16_t len, uint8_t *p_param_list); - - - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_utils.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_utils.h deleted file mode 100644 index c6034dd4..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/gap_ble/hrp_gap_ble_utils.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _HRP_GAP_BLE_UTILS_H_ -#define _HRP_GAP_BLE_UTILS_H_ - -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -bool hrp_gap_ble_send_adv_0000_perf_config_rsp(PLTPLib pLTPLib, uint8_t copmsk, uint8_t *pOpt, - uint16_t cause); -bool hrp_gap_ble_send_adv_0000_perf_start_rsp(PLTPLib pLTPLib, uint8_t copmsk, uint8_t *pOpt, - uint16_t cause); -bool hrp_gap_ble_send_adv_0000_perf_cmpl_info(PLTPLib pLTPLib, uint8_t copmsk, uint8_t *pOpt, - uint16_t cause); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/lps/hrp_dlps.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/lps/hrp_dlps.h deleted file mode 100644 index 4a72f948..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/lps/hrp_dlps.h +++ /dev/null @@ -1,43 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************** -* @file hrp_dlps.h -* @brief Hrp dlps reference api. -* @details -* @author jane -* @date 2016-02-18 -* @version v0.1 -********************************************************************************************************* -*/ -#ifndef _HRP_DLPS_H_ -#define _HRP_DLPS_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -typedef enum -{ - HRP_DLPS_STATUS_IDLE = 0, - HRP_DLPS_STATUS_INITIATED = 1, - HRP_DLPS_STATUS_ACTIVED = 2, - HRP_DLPS_STATUS_PAUSED = 3 -} HRP_DLPS_STATUS; - -extern HRP_DLPS_STATUS hrp_dlps_status; -extern uint32_t enter_dlps_count; - -extern bool hrp_dlps_active_dlps(bool active); -extern void hrp_dlps_allow_enter(bool enter); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/platform/wdt_reset.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/platform/wdt_reset.h deleted file mode 100644 index 71e6af2d..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/platform/wdt_reset.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _WDT_RESET_H_ -#define _WDT_RESET_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -//#define AMEBAD_BOARD - -void wdt_reset(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _WDT_RESET_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_bas.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_bas.h deleted file mode 100644 index 4a5affa0..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_bas.h +++ /dev/null @@ -1,49 +0,0 @@ -/** -******************************************************************************************************** -Copyright (c) 2015, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file Gattsvc_bas.h -* @brief GATT built-in BAS (Battery Service) -* @details -* -* @author gordon -* @date 2015-07-09 -* @version v0.1 -*/ - -#ifndef __GATTSVC_BAS_H -#define __GATTSVC_BAS_H - -#ifndef __GATT_H -#include -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** service definition */ - -extern const T_ATTRIB_APPL gatt_svc_bas[]; - -extern const int gatt_svc_bas_size; -extern const int gatt_svc_bas_nbr_of_attrib; - -/** BAS Battery Service */ -#define GATT_UUID_BATTERY 0x180F - -#define GATT_UUID_CHAR_BAS_LEVEL 0x2A19 -/** attribute indices signaled to GATT server application. */ -/** do NOT change these values !!!! */ - -#define GATT_SVC_BAS_BATTERY_LEVEL_INDEX 2 /**< battery level value */ - - -#ifdef __cplusplus -} -#endif - -#endif /**< __GATTSVC_BAS_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_cts.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_cts.h deleted file mode 100644 index c362c701..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_cts.h +++ /dev/null @@ -1,51 +0,0 @@ -/** -******************************************************************************************************** -Copyright (c) 2015, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file Gattsvc_cts.h -* @brief GATT built-in GLS (Current Time Service) -* @details -* -* @author gordon -* @date 2015-07-09 -* @version v0.1 -*/ - -#ifndef __GATTSVC_CTS_H -#define __GATTSVC_CTS_H - -#ifndef __GATT_H -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - -/** service definition */ - -extern const T_ATTRIB_APPL gatt_svc_cts[]; - -extern const int gatt_svc_cts_size; -extern const int gatt_svc_cts_nbr_of_attrib; - -/** CTS Current Time Service */ -#define GATT_UUID_CURRENT_TIME 0x1805 - -#define GATT_UUID_CHAR_CTS_CURRENT_TIME 0x2A2B -#define GATT_UUID_CHAR_CTS_LOCAL_TIME_INFO 0x2A0F -#define GATT_UUID_CHAR_CTS_REF_TIME_INFO 0x2A14 -/** attribute indices signaled to GATT server application. */ -/** do NOT change these values !!!! */ - -#define GATT_SVC_CTS_CURRENT_TIME_INDEX 2 /**< Current Time value */ -#define GATT_SVC_CTS_LOCAL_TIME_INFO_INDEX 5 /**< Local Time Information value */ -#define GATT_SVC_CTS_REF_TIME_INFO_INDEX 7 /**< Reference Time Information value */ - - -#ifdef __cplusplus -} -#endif - -#endif /**< __GATTSVC_CTS_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_dis.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_dis.h deleted file mode 100644 index c8305703..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_dis.h +++ /dev/null @@ -1,56 +0,0 @@ -/** -******************************************************************************************************** -Copyright (c) 2015, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file gattsvc_dis.h -* @brief device information service -* @details -* -* @author gordon -* @date 2015-07-13 -* @version v0.1 -*/ - - -#ifndef __GATTSVC_DIS_H -#define __GATTSVC_DIS_H - -#ifndef __GATT_H -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - -/** service definition */ -extern const T_ATTRIB_APPL gatt_svc_dis[]; - -extern const int gatt_svc_dis_size; -extern const int gatt_svc_dis_nbr_of_attrib; - -#define GATT_UUID_DEVICE_INFORMATION_SERVICE 0x180A - -#define GATT_UUID_CHAR_SYSTEM_ID 0x2A23 -#define GATT_UUID_CHAR_MODEL_NUMBER 0x2A24 -#define GATT_UUID_CHAR_SERIAL_NUMBER 0x2A25 -#define GATT_UUID_CHAR_FIRMWARE_REVISION 0x2A26 -#define GATT_UUID_CHAR_HARDWARE_REVISION 0x2A27 -#define GATT_UUID_CHAR_SOFTWARE_REVISION 0x2A28 -#define GATT_UUID_CHAR_MANUFACTURER_NAME 0x2A29 -#define GATT_UUID_CHAR_IEEE_CERTIF_DATA_LIST 0x2A2A -#define GATT_UUID_CHAR_PNP_ID 0x2A50 -/** attribute indices signaled to GATT server application. */ -/** do NOT change these values !!!! */ - -#define GATT_SVC_DIS_SYSTEM_ID_INDEX 2 /**< index of System ID value */ -#define GATT_SVC_DIS_MANUFACTURER_NAME_INDEX 4 /**< index of Manufacturer Name value */ -#define GATT_SVC_DIS_MODEL_NUMBER_INDEX 6 /**< index of Model Number value */ - - -#ifdef __cplusplus -} -#endif - -#endif /**< __GATTSVC_DIS_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_gls.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_gls.h deleted file mode 100644 index 5770a0fd..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_gls.h +++ /dev/null @@ -1,53 +0,0 @@ -/** -******************************************************************************************************** -Copyright (c) 2015, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file Gattsvc_gls.h -* @brief GATT built-in GLS (Glucose Service) -* @details -* -* @author gordon -* @date 2015-07-13 -* @version v0.1 -*/ - -#ifndef __GATTSVC_GLS_H -#define __GATTSVC_GLS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/** service definition */ -extern const T_ATTRIB_APPL gatt_svc_gls[]; - -extern const int gatt_svc_gls_size; -extern const int gatt_svc_gls_nbr_of_attrib; - -/** GLC Glucose Service */ -#define GATT_UUID_GLUCOSE 0x1808 - -#define GATT_UUID_CHAR_GLS_MEASUREMENT 0x2A18 -#define GATT_UUID_CHAR_GLS_MEASUREMENT_CTXT 0x2A34 -#define GATT_UUID_CHAR_GLS_FEATURES 0x2A51 -#define GATT_UUID_CHAR_GLS_RACP 0x2A52 -/** attribute indices signaled to GATT server application. */ -/** do NOT change these values !!!! */ - -#define GATT_SVC_GLS_MEASUREMENT_INDEX 2 /**< index measurement value */ -#define GATT_SVC_GLS_MEASUREMENT_CCCD_INDEX 3 /**< index of CCCD */ -#define GATT_SVC_GLS_MEASUREMENT_CTXT_INDEX 5 /**< index measurement context value */ -#define GATT_SVC_GLS_MEASUREMENT_CTXT_CCCD_INDEX 6 /**< index of CCCD */ -#define GATT_SVC_GLS_FEATURE_INDEX 8 /**< index of feature value */ -#define GATT_SVC_GLS_RACP_INDEX 10 /**< index of RACP value */ -#define GATT_SVC_GLS_RACP_CCCD_INDEX 11 /**< index of CCCD */ - - -#ifdef __cplusplus -} -#endif - -#endif /**< __GATTSVC_GLS_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_ndcs.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_ndcs.h deleted file mode 100644 index e496d0a4..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_ndcs.h +++ /dev/null @@ -1,43 +0,0 @@ -/** -******************************************************************************************************** -Copyright (c) 2015, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file Gattsvc_ndcs.h -* @brief GATT built-in NDCS (Next DST (Daylight Saving Time) Change Service) -* @details -* -* @author gordon -* @date 2015-07-09 -* @version v0.1 -*/ - -#ifndef __GATTSVC_NDCS_H -#define __GATTSVC_NDCS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/** service definition */ -extern const T_ATTRIB_APPL gatt_svc_ndcs[]; - -extern const int gatt_svc_ndcs_size; -extern const int gatt_svc_ndcs_nbr_of_attrib; -/** NDCS Next DST Change Service */ -#define GATT_UUID_NEXT_DST_CHANGE 0x1807 - -#define GATT_UUID_CHAR_NDCS_TIME_WITH_DST 0x2A11 -/** attribute indices signaled to GATT server application. */ -/** do NOT change these values !!!! */ - -#define GATT_SVC_NDCS_TIME_WITH_DST_INDEX 2 /**< Time with DST value */ - - -#ifdef __cplusplus -} -#endif - -#endif /**< __GATTSVC_NDCS_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_rtus.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_rtus.h deleted file mode 100644 index c1f61aa6..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/service/gattsvc_rtus.h +++ /dev/null @@ -1,47 +0,0 @@ -/** -******************************************************************************************************** -Copyright (c) 2015, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file Gattsvc_rtus.h -* @brief GATT built-in RTUS (Reference Time Update Service) -* @details -* -* @author gordon -* @date 2015-07-09 -* @version v0.1 -*/ - -#ifndef __GATTSVC_RTUS_H -#define __GATTSVC_RTUS_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** service definition */ -extern const T_ATTRIB_APPL gatt_svc_rtus[]; - -extern const int gatt_svc_rtus_size; -extern const int gatt_svc_rtus_nbr_of_attrib; - -/** RTUS Reference Time Update Service */ -#define GATT_UUID_REFERENCE_TIME_UPDATE 0x1806 - -#define GATT_UUID_CHAR_RTUS_CONTROL_POINT 0x2A16 -#define GATT_UUID_CHAR_RTUS_STATE 0x2A17 -/** attribute indices signaled to GATT server application. */ -/** do NOT change these values !!!! */ - -#define GATT_SVC_RTUS_CONTROL_POINT_INDEX 2 /**< Time UpdateControl Point value */ -#define GATT_SVC_RTUS_STATE_INDEX 4 /**< Time Update State value */ - - -#ifdef __cplusplus -} -#endif - -#endif /**< __GATTSVC_RTUS_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/storage/gap_storage_le_int.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/storage/gap_storage_le_int.h deleted file mode 100644 index b9f4850c..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/storage/gap_storage_le_int.h +++ /dev/null @@ -1,47 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file flash_key_mgr_le_int.h -* @brief key storage function. -* @details -* @author jane -* @date 2016-02-18 -* @version v0.1 -* ********************************************************************************************************* -*/ - -#ifndef FLASH_KEY_MGR_LE_INT_H -#define FLASH_KEY_MGR_LE_INT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include -#include - -void le_key_init(void); -uint8_t le_get_key(P_LE_KEY_ENTRY p_entry, T_BTIF_KEY_TYPE key_type, uint8_t *key); -bool le_save_key(P_LE_KEY_ENTRY p_entry, T_BTIF_KEY_TYPE key_type, uint8_t key_length, - uint8_t *key); -bool le_update_remote_bd(P_LE_KEY_ENTRY p_entry, uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE bd_type); -P_LE_KEY_ENTRY le_allocate_key_entry(uint8_t *bd_addr, T_BTIF_REMOTE_ADDR_TYPE bd_type); -void le_clear_all_keys(void); -void le_delete_bond(P_LE_KEY_ENTRY p_entry); - -bool le_get_cccd_data(P_LE_KEY_ENTRY p_entry, P_LE_CCCD p_data); -bool le_save_cccd_data(P_LE_KEY_ENTRY p_entry, P_LE_CCCD p_data); -bool le_add_cccd_data(P_LE_KEY_ENTRY p_entry, uint8_t add_size, uint8_t offset, uint8_t *p_data); - - -P_LE_KEY_ENTRY le_find_entry_by_aes(uint8_t *unresolved_addr, uint8_t addr_type); -bool le_check_local_resolved_address(uint8_t *unresolved_addr, uint8_t *local_irk); - -#ifdef __cplusplus -} -#endif - -#endif /* FLASH_KEY_MGR_LE_INT_H */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/uart/btltp_uart.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/uart/btltp_uart.h deleted file mode 100644 index c953da8d..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/hrp/uart/btltp_uart.h +++ /dev/null @@ -1,30 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2014, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************* -* @file aci_low_power.h -* @brief low power handle when using ACI. -* @details none. -* @author tifnan -* @date 2014-11-19 -* @version v0.1 -* ********************************************************************************************************* -*/ - -#ifndef _BTLTP_UART_BB3_H_ -#define _BTLTP_UART_BB3_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -void TxAssistTask(void *pParameters); -void ltpPeripheralInit(void); -void ltpStartTransmit(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _BTLTP_UART_BB3_H_ */ - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/app_flags.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/app_flags.h deleted file mode 100644 index 84c38749..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/app_flags.h +++ /dev/null @@ -1,26 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file app_flags.h - * @brief This file is used to config app functions. - * @author jane - * @date 2017-06-06 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _APP_FLAGS_H_ -#define _APP_FLAGS_H_ - -#define APP_TEST_BT_TRACE 1 -#define APP_TEST_RANDOM 1 -#define APP_TEST_OSIF 1 -#define APP_TEST_HCI_TP 1 -#define APP_TEST_FTL 1 -#define APP_TEST_FTL_COUNT 3 - - -#endif diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/app_task.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/app_task.h deleted file mode 100644 index 8dfcd2ac..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/app_task.h +++ /dev/null @@ -1,27 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file app_task.h - * @brief Routines to create App task and handle events & messages - * @author jane - * @date 2017-06-02 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ -#ifndef _APP_TASK_H_ -#define _APP_TASK_H_ - -extern void driver_init(void); - -/** - * @brief Initialize App task - * @return void - */ -void app_task_init(void); - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/bt_types.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/bt_types.h deleted file mode 100644 index 327a120e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/bt_types.h +++ /dev/null @@ -1,702 +0,0 @@ -/** - * Copyright (c) 2017, Realtek Semiconductor Corporation. All rights reserved. - */ - -#ifndef _BT_TYPES_H_ -#define _BT_TYPES_H_ - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \defgroup BTTYPES BT Types - * - * \brief Defines BT related macros for the upper layers. - * - */ - - -/** - * bt_types.h - * - * \name BT_LE_LOCAL_SUPPORTED_FEATURES - * \brief BT LE Local Supported Features definitions. - * \anchor BT_LE_LOCAL_SUPPORTED_FEATURES - */ -/** - * \ingroup BTTYPES - */ -#define LE_SUPPORT_FEATURES_MASK_ARRAY_INDEX0 0 - -#define LE_SUPPORT_FEATURES_ENCRYPTION_MASK_BIT ((uint8_t)0x01) -#define LE_SUPPORT_FEATURES_CONNPARA_REQ_PROC_MASK_BIT ((uint8_t)0x02) -#define LE_SUPPORT_FEATURES_EXTENDED_REJECTION_IND_MASK_BIT ((uint8_t)0x04) -#define LE_SUPPORT_FEATURES_SLAVE_INITIATED_FEATURE_EXCHANGE_MASK_BIT ((uint8_t)0x08) -#define LE_SUPPORT_FEATURES_LE_PING_MASK_BIT ((uint8_t)0x10) -#define LE_SUPPORT_FEATURES_LE_DATA_LENGTH_EXTENSION_MASK_BIT ((uint8_t)0x20) -#define LE_SUPPORT_FEATURES_LL_PRIVACY_MASK_BIT ((uint8_t)0x40) -#define LE_SUPPORT_FEATURES_EXTENDED_SCANNER_FILTER_POLICY_MASK_BIT ((uint8_t)0x80) - -#define LE_SUPPORT_FEATURES_MASK_ARRAY_INDEX1 1 - -#define LE_SUPPORT_FEATURES_LE_2M_MASK_BIT ((uint8_t)0x01) -#define LE_SUPPORT_FEATURES_STABLE_MODULATION_INDEX_TX_MASK_BIT ((uint8_t)0x02) -#define LE_SUPPORT_FEATURES_STABLE_MODULATION_INDEX_RX_MASK_BIT ((uint8_t)0x04) -#define LE_SUPPORT_FEATURES_LE_CODED_PHY_MASK_BIT ((uint8_t)0x08) -#define LE_SUPPORT_FEATURES_LE_EXTENDED_ADV_BIT ((uint8_t)0x10) -#define LE_SUPPORT_FEATURES_LE_PERIODIC_ADV_MASK_BIT ((uint8_t)0x20) -#define LE_SUPPORT_FEATURES_CSA2_BIT ((uint8_t)0x40) -#define LE_SUPPORT_FEATURES_LE_POWER_CLASS1_MASK_BIT ((uint8_t)0x80) - -#define LE_SUPPORT_FEATURES_MASK_ARRAY_INDEX2 2 - -#define LE_SUPPORT_FEATURES_MIN_NUM_USED_CHANNEL_MASK_BIT ((uint8_t)0x01) - -/** - * bt_types.h - * - * \name BT_STACK_MODULE_ERROR - * \brief BT stack module error code mask. - * \anchor BT_STACK_MODULE_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define GAP_ERR 0x0000 -#define HCI_ERR 0x0100 -#define L2C_ERR 0x0200 -#define SDP_ERR 0x0300 -#define ATT_ERR 0x0400 -#define SM_ERR 0x0500 - -#define GATT_ERR 0x0C00 -#define APP_ERR 0x0D00 - -/** - * bt_types.h - * - * \name BT_HCI_ERROR - * \brief BT hci error code definitions. - * \anchor BT_HCI_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define HCI_SUCCESS 0x00 -#define HCI_ERR_UNKNOWN_CMD 0x01 -#define HCI_ERR_UNKNOWN_CONN_ID 0x02 -#define HCI_ERR_HARDWARE_FAIL 0x03 -#define HCI_ERR_PAGE_TIMEOUT 0x04 -#define HCI_ERR_AUTHEN_FAIL 0x05 -#define HCI_ERR_KEY_MISSING 0x06 -#define HCI_ERR_MEMORY_FULL 0x07 -#define HCI_ERR_CONN_TIMEOUT 0x08 -#define HCI_ERR_MAX_NUM_CONN 0x09 -#define HCI_ERR_MAX_NUM_SCO_CONN 0x0A /* 10 */ -#define HCI_ERR_ACL_CONN_EXIST 0x0B /* 11 */ -#define HCI_ERR_CMD_DISALLOWED 0x0C /* 12 */ -#define HCI_ERR_REJECT_LIMITED_RESOURCE 0x0D /* 13 */ -#define HCI_ERR_REJECT_SECURITY_REASON 0x0E /* 14 */ -#define HCI_ERR_REJECT_UNACCEPTABLE_ADDR 0x0F /* 15 */ -#define HCI_ERR_HOST_TIMEOUT 0x10 /* 16 */ -#define HCI_ERR_UNSUPPORTED_PARAM 0x11 /* 17 */ -#define HCI_ERR_INVALID_PARAM 0x12 /* 18 */ -#define HCI_ERR_REMOTE_USER_TERMINATE 0x13 /* 19 */ -#define HCI_ERR_REMOTE_LOW_RESOURCE 0x14 /* 20 */ -#define HCI_ERR_REMOTE_POWER_OFF 0x15 /* 21 */ -#define HCI_ERR_LOCAL_HOST_TERMINATE 0x16 /* 22 */ -#define HCI_ERR_REPEATED_ATTEMPTS 0x17 /* 23 */ -#define HCI_ERR_PARING_NOT_ALLOWED 0x18 /* 24 */ -#define HCI_ERR_UNKNOWN_LMP_PDU 0x19 /* 25 */ -#define HCI_ERR_UNSUPPORTED_REMOTE_FEAT 0x1A /* 26 */ -#define HCI_ERR_SCO_OFFSET_REJECTED 0x1B /* 27 */ -#define HCI_ERR_SCO_INTERVAL_REJECTED 0x1C /* 28 */ -#define HCI_ERR_SCO_AIR_MODE_REJECTED 0x1D /* 29 */ -#define HCI_ERR_INVALID_LMP_PARAM 0x1E /* 30 */ -#define HCI_ERR_UNSPECIFIED_ERROR 0x1F /* 31 */ -#define HCI_ERR_UNSUPPORTED_LMP_PARAM 0x20 /* 32 */ -#define HCI_ERR_ROLE_CHANGE_NOT_ALLOWED 0x21 /* 33 */ -#define HCI_ERR_LMP_RESPONSE_TIMEOUT 0x22 /* 34 */ -#define HCI_ERR_LMP_ERROR_TRANS_COLLISION 0x23 /* 35 */ -#define HCI_ERR_LMP_PDU_NOT_ALLOWED 0x24 /* 36 */ -#define HCI_ERR_ENCRYPT_MODE_NOT_ACCEPTABLE 0x25 /* 37 */ -#define HCI_ERR_UNIT_KEY_USED 0x26 /* 38 */ -#define HCI_ERR_QOS_NOT_SUPPORTED 0x27 /* 39 */ -#define HCI_ERR_INSTANT_PASSED 0x28 /* 40 */ -#define HCI_ERR_PAIR_UNIT_KEY_NOT_SUPPORT 0x29 /* 41 */ -#define HCI_ERR_DIFF_TRANS_COLLISION 0x2A /* 42 */ -#define HCI_ERR_QOS_UNACCEPTABLE_PARAM 0x2C /* 44 */ -#define HCI_ERR_QOS_REJECT 0x2D /* 45 */ -#define HCI_ERR_CHANN_ASSESS_NOT_SUPPORT 0x2E /* 46 */ -#define HCI_ERR_INSUFFICIENT_SECURITY 0x2F /* 47 */ -#define HCI_ERR_PARAM_OUT_OF_RANGE 0x30 /* 48 */ -#define HCI_ERR_ROLE_SWITCH_PANDING 0x32 /* 50 */ -#define HCI_ERR_RESERVED_SLOT_VIOLATION 0x34 /* 52 */ -#define HCI_ERR_ROLE_SWITCH_FAILED 0x35 /* 53 */ -#define HCI_ERR_EXT_INQUIRY_RSP_TOO_LARGE 0x36 /* 54 */ -#define HCI_ERR_SSP_NOT_SUPPORTED_BY_HOST 0x37 /* 55 */ -#define HCI_ERR_HOST_BUSY_PAIRING 0x38 /* 56 */ -#define HCI_ERR_REJECT_NO_SUITABLE_CHANN 0x39 /* 57 */ -#define HCI_ERR_CONTROLLER_BUSY 0x3A /* 58 */ -#define HCI_ERR_UNACCEPTABLE_CONN_INTERVAL 0x3B /* 59 */ -#define HCI_ERR_DIRECTED_ADV_TIMEOUT 0x3C /* 60 */ -#define HCI_ERR_MIC_FAILURE 0x3D /* 61 */ -#define HCI_ERR_FAIL_TO_ESTABLISH_CONN 0x3E /* 62 */ -#define HCI_ERR_MAC_CONN_FAIL 0x3F /* 63 */ -#define HCI_ERR_COARSE_CLOCK_ADJUST_REJECTED 0x40 -#define HCI_ERR_TYPE0_SUBMAP_NOT_DEFINED 0x41 -#define HCI_ERR_UNKNOWN_ADVERTISING_IDENTIFIER 0x42 -#define HCI_ERR_LIMIT_REACHED 0x43 -#define HCI_ERR_OPERATION_CANCELLED_BY_HOST 0x44 - -/* hci local error code */ -#define HCI_ERR_INVALID_ADDR 0x64 /* 100 */ -#define HCI_ERR_TIMEOUT 0x65 /* 101 */ -#define HCI_ERR_OUT_OF_SYNC 0x66 /* 102 */ -#define HCI_ERR_NO_DESCRIPTOR 0x67 /* 103 */ -#define HCI_ERR_NO_MEMORY 0x68 - -/** - * bt_types.h - * - * \name BT_L2CAP_ERROR - * \brief BT l2cap error code definitions. - * \anchor BT_L2CAP_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define L2C_SUCCESS 0x00 - -#define L2C_CONN_ACCEPT 0x0000 -#define L2C_CONN_RSP_PENDING 0x0001 -#define L2C_CONN_RSP_INVALID_PSM 0x0002 -#define L2C_CONN_RSP_SECURITY_BLOCK 0x0003 -#define L2C_CONN_RSP_NO_RESOURCE 0x0004 -#define L2C_CONN_RSP_INVALID_PARAM 0x0005 -#define L2C_CONN_RSP_INVALID_SOURCE_CID 0x0006 -#define L2C_CONN_RSP_SOURCE_CID_ALLOCATED 0x0007 - -/* requset cmd reject reasons */ -#define L2C_CMD_REJ_NOT_UNDERSTOOD 0x0000 -#define L2C_CMD_REJ_SIGNAL_MTU_EXCEEDED 0x0001 -#define L2C_CMD_REJ_INVALID_CID_IN_REQ 0x0002 - -/* config response result codes */ -#define L2C_CFG_RSP_SUCCESS 0x0000 -#define L2C_CFG_RSP_UNACCEPTABLE_PARAMS 0x0001 -#define L2C_CFG_RSP_REJECTED 0x0002 -#define L2C_CFG_RSP_UNKNOWN_OPTIONS 0x0003 -#define L2C_CFG_RSP_PENDING 0x0004 -#define L2C_CFG_RSP_FLOW_SPEC_REJECTED 0x0005 - -#define L2C_LE_CREDIT_CONN_SUCCESS 0x0000 -#define L2C_LE_CREDIT_RSP_PSM_NOT_SUPPORTED 0x0002 -#define L2C_LE_CREDIT_RSP_NO_RESOURCES 0x0004 -#define L2C_LE_CREDIT_RSP_INSUFFICIENT_AUTHEN 0x0005 -#define L2C_LE_CREDIT_RSP_INSUFFICIENT_AUTHOR 0x0006 -#define L2C_LE_CREDIT_RSP_INSUFFICIENT_ENCRYP_KEY_SIZE 0x0007 -#define L2C_LE_CREDIT_RSP_INSUFFICIENT_ENCRYP 0x0008 -#define L2C_LE_CREDIT_RSP_INVALID_SOURCE_CID 0x0009 -#define L2C_LE_CREDIT_RSP_SOURCE_CID_ALREADY_ALLOC 0x000A - -/* status for connection updata response */ -#define L2C_LE_CONN_UPDATE_ACCEPT 0x0000 -#define L2C_LE_CONN_UPDATE_RSP_REJECT 0x0001 -#define L2C_LE_CONN_UPDATE_RSP_TOUT 0x0002 - -/* l2cap error code */ -#define L2C_ERR_REJ_BASE 0x0010 -#define L2C_ERR_CFG_BASE 0x0020 -#define L2C_ERR_LE_CREDIT_BASE 0x0030 -#define L2C_ERR_LE_CONN_UPDATE_BASE 0x0040 -#define L2C_ERR_VND_BASE 0x00F0 - -#define L2C_ERR_PENDING L2C_CONN_RSP_PENDING -#define L2C_ERR_INVALID_PSM L2C_CONN_RSP_INVALID_PSM -#define L2C_ERR_SECURITY_BLOCK L2C_CONN_RSP_SECURITY_BLOCK -#define L2C_ERR_NO_RESOURCE L2C_CONN_RSP_NO_RESOURCE -#define L2C_ERR_INVALID_PARAM L2C_CONN_RSP_INVALID_PARAM -#define L2C_ERR_INVALID_SOURCE_CID L2C_CONN_RSP_INVALID_SOURCE_CID -#define L2C_ERR_SOURCE_CID_ALLOCATED L2C_CONN_RSP_SOURCE_CID_ALLOCATED - -#define L2C_ERR_CMD_NOT_UNDERSTOOD (L2C_ERR_REJ_BASE + L2C_CMD_REJ_NOT_UNDERSTOOD) -#define L2C_ERR_SIGNAL_MTU_EXCEEDED (L2C_ERR_REJ_BASE + L2C_CMD_REJ_SIGNAL_MTU_EXCEEDED) -#define L2C_ERR_INVALID_CID_IN_REQ (L2C_ERR_REJ_BASE + L2C_CMD_REJ_INVALID_CID_IN_REQ) - -#define L2C_ERR_CFG_UNACCEPTABLE_PARAM (L2C_ERR_CFG_BASE + L2C_CFG_RSP_UNACCEPTABLE_PARAMS) -#define L2C_ERR_CFG_REJECTED (L2C_ERR_CFG_BASE + L2C_CFG_RSP_REJECTED) -#define L2C_ERR_CFG_UNKNOWN_OPTIONS (L2C_ERR_CFG_BASE + L2C_CFG_RSP_UNKNOWN_OPTIONS) -#define L2C_ERR_CFG_PENDING (L2C_ERR_CFG_BASE + L2C_CFG_RSP_PENDING) -#define L2C_ERR_CFG_FLOW_SPEC_REJECTED (L2C_ERR_CFG_BASE + L2C_CFG_RSP_FLOW_SPEC_REJECTED) - -#define L2C_ERR_LE_CREDIT_PSM_NOT_SUPPORTED (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_PSM_NOT_SUPPORTED) -#define L2C_ERR_LE_CREDIT_NO_RESOURCES (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_NO_RESOURCES) -#define L2C_ERR_LE_CREDIT_INSUFFICIENT_AUTHEN (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_INSUFFICIENT_AUTHEN) -#define L2C_ERR_LE_CREDIT_INSUFFICIENT_AUTHOR (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_INSUFFICIENT_AUTHOR) -#define L2C_ERR_LE_CREDIT_INSUFFICIENT_ENCRYP_KEY_SIZE (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_INSUFFICIENT_ENCRYP_KEY_SIZE) -#define L2C_ERR_LE_CREDIT_INSUFFICIENT_ENCRYP (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_INSUFFICIENT_ENCRYP) -#define L2C_ERR_LE_CREDIT_INVALID_SOURCE_CID (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_INVALID_SOURCE_CID) -#define L2C_ERR_LE_CREDIT_SOURCE_CID_ALREADY_ALLOC (L2C_ERR_LE_CREDIT_BASE + L2C_LE_CREDIT_RSP_SOURCE_CID_ALREADY_ALLOC) - -#define L2C_ERR_LE_CONN_PARAM_UPDATE_REJECT (L2C_ERR_LE_CONN_UPDATE_BASE + L2C_LE_CONN_UPDATE_RSP_REJECT) -#define L2C_ERR_LE_CONN_PARAM_UPDATE_TOUT (L2C_ERR_LE_CONN_UPDATE_BASE + L2C_LE_CONN_UPDATE_RSP_TOUT) - -#define L2C_ERR_VND_CREDITS_EXCEED (L2C_ERR_VND_BASE + 0x00) -#define L2C_ERR_VND_INVAILD_PDU (L2C_ERR_VND_BASE + 0x01) -#define L2C_ERR_VND_CREDITS_LACK (L2C_ERR_VND_BASE + 0x02) -#define L2C_ERR_VND_NO_MEMORY (L2C_ERR_VND_BASE + 0x03) -#define L2C_ERR_VND_INVALID_STATE (L2C_ERR_VND_BASE + 0x04) -#define L2C_ERR_VND_INVALID_RX_SEQ (L2C_ERR_VND_BASE + 0x05) -#define L2C_ERR_VND_TIMEOUT (L2C_ERR_VND_BASE + 0x06) -#define L2C_ERR_VND_INVALID_MODE (L2C_ERR_VND_BASE + 0x07) -#define L2C_ERR_VND_REMOTE_DISCONNECT (L2C_ERR_VND_BASE + 0x08) - -/** - * bt_types.h - * - * \name BT_ATT_ERROR - * \brief BT att error code definitions. - * \anchor BT_ATT_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define ATT_SUCCESS 0 /**< internal value .. */ -#define ATT_ERR_INVALID_HANDLE 0x01 /**< Attribute handle value given was not valid on this attribute server */ -#define ATT_ERR_READ_NOT_PERMITTED 0x02 /**< Attribute cannot be read */ -#define ATT_ERR_WRITE_NOT_PERMITTED 0x03 /**< Attribute cannot be written */ -#define ATT_ERR_INVALID_PDU 0x04 /**< The attribute PDU was invalid */ -#define ATT_ERR_INSUFFICIENT_AUTHEN 0x05 /**< The attribute requires authentication before it can be read or written */ -#define ATT_ERR_UNSUPPORTED_REQ 0x06 /**< Attribute server doesn't support the request received from the attribute client */ -#define ATT_ERR_INVALID_OFFSET 0x07 /**< Offset specified was past the end of the attribute */ -#define ATT_ERR_INSUFFICIENT_AUTHOR 0x08 /**< The attribute requires an authorization before it can be read or written */ -#define ATT_ERR_PREP_QUEUE_FULL 0x09 /**< Too many prepare writes have been queued */ -#define ATT_ERR_ATTR_NOT_FOUND 0x0A /**< No attribute found within the given attribute handle range */ -#define ATT_ERR_ATTR_NOT_LONG 0x0B /**< Attribute cannot be read or written using the Read Blob Request or Prepare Write Request */ -#define ATT_ERR_INSUFFICIENT_KEY_SIZE 0x0C /**< The Encryption Key Size used for encrypting this link is insufficient */ -#define ATT_ERR_INVALID_VALUE_SIZE 0x0D /**< The attribute value length is invalid for the operation */ -#define ATT_ERR_UNLIKELY 0x0E /**< The attribute request that was requested has encountered an error that was very unlikely, and therefore could not be completed as requested */ -#define ATT_ERR_INSUFFICIENT_ENCRYPT 0x0F /**< The attribute requires encryption before it can be read or written */ -#define ATT_ERR_UNSUPPORTED_GROUP_TYPE 0x10 /**< The attribute type is not a supported grouping attribute as defined by a higher layer specification */ -#define ATT_ERR_INSUFFICIENT_RESOURCES 0x11 /**< Insufficient Resources to complete the request */ - -/* profile dependent application error codes >= 0x80: */ -#define ATT_ERR_MIN_APPLIC_CODE 0x80 /**< minimal application error code */ -#define ATT_ERR_INVALID_VALUE 0x80 /**< The attribute value is invalid for the operation */ - -/* manufacturer specific error codes that are "missing" in GATT spec. >= 0xC0: */ -#define ATT_ERR_INVALID_CCC_BITS 0xC0 /**< Invalid client char. config. bits */ -#define ATT_ERR_INVALID_SIGNED_COUNT 0xC1 /**< Invalid sign count */ -#define ATT_ERR_INVALID_SIGNED_MAC_FAILED 0xC2 /**< Invalid sign mac value */ - -/* error codes common to various profiles (see "CSS v2.pdf"), >= 0xE0 */ -#define ATT_ERR_CCCD_IMPROPERLY_CONFIGURED 0xFD /**< CCCD improperly configured */ -#define ATT_ERR_PROC_ALREADY_IN_PROGRESS 0xFE /**< Procedure Already in Progress */ -#define ATT_ERR_OUT_OF_RANGE 0xFF /**< Client Characteristic Configuration Descriptor Improperly Configured */ - -/** - * bt_types.h - * - * \name BT_GATT_ERROR - * \brief BT gatt error code definitions. - * \anchor BT_GATT_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define GATT_SUCCESS 0x00 -#define GATT_ERR_OUT_OF_RESOURCE 0x01 -#define GATT_ERR_UNSUPPORTED 0x02 -#define GATT_ERR_INVALID_ROLE 0x03 -#define GATT_ERR_INVALID_STATE 0x04 -#define GATT_ERR_INVALID_CODING 0x05 -#define GATT_ERR_INVALID_HANDLE 0x06 -#define GATT_ERR_INVALID_PARAM 0x07 -#define GATT_ERR_INTERNAL 0x08 -#define GATT_ERR_NOT_ALLOWED 0x09 -#define GATT_ERR_NOTIF_IND_NOT_CFG 0x0A -#define GATT_ERR_NOTIF_IND_CFG 0x0B -#define GATT_ERR_NOTIF_IND_CONF_PD 0x0C -#define GATT_ERR_TIMEOUT 0x0D -#define GATT_ERR_LINK_DEACTIVATED 0x0E -#define GATT_ERR_NOT_AUTHENTICATED 0x0F -#define GATT_ERR_NOT_ENCRYPTED 0x10 -#define GATT_ERR_PROC_FAIL 0x11 - -/* sm error code */ -#define SM_SUCCESS 0x00 -/* SMP_OP_PAIRING_FAILED causes */ -#define SMP_ERR_SUCCESS 0x00 -#define SMP_ERR_PASSKEY_ENTRY_FAIL 0x01 -#define SMP_ERR_OOB_NOT_AVAIABLE 0x02 -#define SMP_ERR_AUTHEN_REQUIREMENTS 0x03 -#define SMP_ERR_CFM_VALUE_FAILED 0x04 -#define SMP_ERR_PAIRING_NOT_SUPPORTED 0x05 -#define SMP_ERR_ENCRYPTION_KEY_SIZE 0x06 -#define SMP_ERR_CMD_NOT_SUPPORTED 0x07 -#define SMP_ERR_UNSPECIFIED_REASON 0x08 -#define SMP_ERR_REPEATED_ATTEMPTS 0x09 -#define SMP_ERR_INVALID_PARAM 0x0A -#define SMP_ERR_DHKEY_CHECK_FAILED 0x0B -#define SMP_ERR_NUMERIC_COMPARISION_FAIL 0x0C -#define SMP_ERR_BREDR_PAIRING_IN_PROGRESS 0x0D -#define SMP_ERR_CRS_TRANS_KEY_GEN_NOT_ALLOW 0x0E - -#define SM_ERR_NO_ENTRY 0xE1 -#define SM_ERR_DB_FULL 0xE2 -#define SM_ERR_INVALID_PARAM 0xE3 -#define SM_ERR_INSUFFICIENT_LINK_KEY 0xE4 -#define SM_ERR_LE_ADDR_NOT_RESOLVED 0xE5 -#define SM_ERR_INVALID_STATE 0xE6 -#define SM_ERR_NO_RESOURCE 0xE7 -#define SM_ERR_LINK_KEY_MISSING 0xE8 -#define SM_ERR_DISCONNECT 0xE9 -#define SM_ERR_PARING_NOT_ALLOWED 0xEA -#define SM_ERR_KEY_SAVE_FAILED 0xEB -#define SM_ERR_TIMEOUT 0xEC -#define SM_ERR_UNKNOWN 0xED -#define SM_ERR_VENDOR 0xEF - -/** - * bt_types.h - * - * \name BT_BTIF_ERROR - * \brief BT btif error code definitions. - * \anchor BT_BTIF_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define BTIF_ERR 0x0000 -#define BTIF_SUCCESS 0x00 -#define BTIF_ACCEPT 0x01 -#define BTIF_ERR_REJECT 0x02 -#define BTIF_ERR_NO_RESOURCE 0x03 -#define BTIF_ERR_INVALID_PARAM 0x04 -#define BTIF_ERR_INVALID_STATE 0x05 -#define BTIF_ERR_CONN_DISCONNECT 0x06 -#define BTIF_ERR_CONN_LOST 0x07 -#define BTIF_ERR_AUTHEN_FAIL 0x08 -#define BTIF_ERR_INIT_TOUT 0x09 -#define BTIF_ERR_INIT_OUT_OF_SYNC 0x0A -#define BTIF_ERR_INIT_HARDWARE_ERROR 0x0B -#define BTIF_ERR_LOWER_LAYER_ERROR 0x0C -#define BTIF_ERR_ADDR_NOT_RESOLVED 0x0D -#define BTIF_ERR_TOUT 0x0E - -#define BTIF_ERR_UNSPECIFIED 0xFD -#define BTIF_ERR_NOT_SUPPORTED 0xFE - -/** - * bt_types.h - * - * \name BT_GAP_ERROR - * \brief BT GAP error code definitions. - * \anchor BT_GAP_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define GAP_SUCCESS 0x00 -#define GAP_ACCEPT 0x01 -#define GAP_ERR_REJECT 0x02 -#define GAP_ERR_NO_RESOURCE 0x03 -#define GAP_ERR_INVALID_PARAM 0x04 -#define GAP_ERR_INVALID_STATE 0x05 -#define GAP_ERR_CONN_DISCONNECT 0x06 -#define GAP_ERR_CONN_LOST 0x07 -#define GAP_ERR_AUTHEN_FAIL 0x08 -#define GAP_ERR_INIT_TOUT 0x09 -#define GAP_ERR_INIT_OUT_OF_SYNC 0x0A -#define GAP_ERR_INIT_HARDWARE_ERROR 0x0B -#define GAP_ERR_LOWER_LAYER_ERROR 0x0C -#define GAP_ERR_ADDR_NOT_RESOLVED 0x0D -#define GAP_ERR_TOUT 0x0E - -#define GAP_ERR_SW_RESET 0xFC -#define GAP_ERR_UNSPECIFIED 0xFD -#define GAP_ERR_NOT_SUPPORTED 0xFE - -/** - * bt_types.h - * - * \name BT_APP_ERROR - * \brief BT APP error code definitions. - * \anchor BT_APP_ERROR - */ -/** - * \ingroup BTTYPES - */ -#define APP_SUCCESS 0x00 -#define APP_ERR_PENDING 0x01 -#define APP_ERR_ACCEPT 0x03 -#define APP_ERR_REJECT 0x04 -#define APP_ERR_NOT_RELEASE 0x05 - -/** - * bt_types.h - * - * \name BT_BYTE_ORDER - * \brief BT buffer/array byte-order utility macros. - * \anchor BT_BYTE_ORDER - */ -/** - * \ingroup BTTYPES - */ -/** Calculate integer bit count of b'1 */ -#define INT_BIT_COUNT(integer, count) { \ - count = 0; \ - while (integer) \ - { \ - count++; \ - integer &= integer - 1; \ - } \ - } - -/** Stream skip len */ -#define STREAM_SKIP_LEN(s, len) { \ - s += len; \ - } - -/** Stream to array */ -#define STREAM_TO_ARRAY(a, s, len) { \ - uint32_t ii; \ - for (ii = 0; ii < len; ii++) \ - { \ - *((uint8_t *)(a) + ii) = *s++; \ - } \ - } - -/** Array to stream */ -#define ARRAY_TO_STREAM(s, a, len) { \ - uint32_t ii; \ - for (ii = 0; ii < len; ii++) \ - { \ - *s++ = *((uint8_t *)(a) + ii); \ - } \ - } - -/** Little Endian stream to uint8 */ -#define LE_STREAM_TO_UINT8(u8, s) { \ - u8 = (uint8_t)(*s); \ - s += 1; \ - } - -/** Little Endian stream to uint16 */ -#define LE_STREAM_TO_UINT16(u16, s) { \ - u16 = ((uint16_t)(*(s + 0)) << 0) + \ - ((uint16_t)(*(s + 1)) << 8); \ - s += 2; \ - } - -/** Little Endian stream to uint24 */ -#define LE_STREAM_TO_UINT24(u24, s) { \ - u24 = ((uint32_t)(*(s + 0)) << 0) + \ - ((uint32_t)(*(s + 1)) << 8) + \ - ((uint32_t)(*(s + 2)) << 16); \ - s += 3; \ - } - -/** Little Endian stream to uint32 */ -#define LE_STREAM_TO_UINT32(u32, s) { \ - u32 = ((uint32_t)(*(s + 0)) << 0) + \ - ((uint32_t)(*(s + 1)) << 8) + \ - ((uint32_t)(*(s + 2)) << 16) + \ - ((uint32_t)(*(s + 3)) << 24); \ - s += 4; \ - } - -/** Little Endian uint8 to stream */ -#define LE_UINT8_TO_STREAM(s, u8) { \ - *s++ = (uint8_t)(u8); \ - } - -/** Little Endian uint16 to stream */ -#define LE_UINT16_TO_STREAM(s, u16) { \ - *s++ = (uint8_t)((u16) >> 0); \ - *s++ = (uint8_t)((u16) >> 8); \ - } - -/** Little Endian uint24 to stream */ -#define LE_UINT24_TO_STREAM(s, u24) { \ - *s++ = (uint8_t)((u24) >> 0); \ - *s++ = (uint8_t)((u24) >> 8); \ - *s++ = (uint8_t)((u24) >> 16); \ - } - -/** Little Endian uint32 to stream */ -#define LE_UINT32_TO_STREAM(s, u32) { \ - *s++ = (uint8_t)((u32) >> 0); \ - *s++ = (uint8_t)((u32) >> 8); \ - *s++ = (uint8_t)((u32) >> 16); \ - *s++ = (uint8_t)((u32) >> 24); \ - } - -/** Little Endian array to uint8 */ -#define LE_ARRAY_TO_UINT8(u8, a) { \ - u8 = (uint8_t)(*(a + 0)); \ - } - -/** Little Endian array to uint16 */ -#define LE_ARRAY_TO_UINT16(u16, a) { \ - u16 = ((uint16_t)(*(a + 0)) << 0) + \ - ((uint16_t)(*(a + 1)) << 8); \ - } - -/** Little Endian array to uint24 */ -#define LE_ARRAY_TO_UINT24(u24, a) { \ - u24 = ((uint32_t)(*(a + 0)) << 0) + \ - ((uint32_t)(*(a + 1)) << 8) + \ - ((uint32_t)(*(a + 2)) << 16); \ - } - -/** Little Endian array to uint32 */ -#define LE_ARRAY_TO_UINT32(u32, a) { \ - u32 = ((uint32_t)(*(a + 0)) << 0) + \ - ((uint32_t)(*(a + 1)) << 8) + \ - ((uint32_t)(*(a + 2)) << 16) + \ - ((uint32_t)(*(a + 3)) << 24); \ - } - -/** Little Endian uint8 to array */ -#define LE_UINT8_TO_ARRAY(a, u8) { \ - *((uint8_t *)(a) + 0) = (uint8_t)(u8); \ - } - -/** Little Endian uint16 to array */ -#define LE_UINT16_TO_ARRAY(a, u16) { \ - *((uint8_t *)(a) + 0) = (uint8_t)((u16) >> 0); \ - *((uint8_t *)(a) + 1) = (uint8_t)((u16) >> 8); \ - } - -/** Little Endian uint24 to array */ -#define LE_UINT24_TO_ARRAY(a, u24) { \ - *((uint8_t *)(a) + 0) = (uint8_t)((u24) >> 0); \ - *((uint8_t *)(a) + 1) = (uint8_t)((u24) >> 8); \ - *((uint8_t *)(a) + 2) = (uint8_t)((u24) >> 16); \ - } - -/** Little Endian uint32 to array */ -#define LE_UINT32_TO_ARRAY(a, u32) { \ - *((uint8_t *)(a) + 0) = (uint8_t)((u32) >> 0); \ - *((uint8_t *)(a) + 1) = (uint8_t)((u32) >> 8); \ - *((uint8_t *)(a) + 2) = (uint8_t)((u32) >> 16); \ - *((uint8_t *)(a) + 3) = (uint8_t)((u32) >> 24); \ - } - -/** Big Endian stream to uint8 */ -#define BE_STREAM_TO_UINT8(u8, s) { \ - u8 = (uint8_t)(*(s + 0)); \ - s += 1; \ - } - -/** Big Endian stream to uint16 */ -#define BE_STREAM_TO_UINT16(u16, s) { \ - u16 = ((uint16_t)(*(s + 0)) << 8) + \ - ((uint16_t)(*(s + 1)) << 0); \ - s += 2; \ - } - -/** Big Endian stream to uint24 */ -#define BE_STREAM_TO_UINT24(u24, s) { \ - u24 = ((uint32_t)(*(s + 0)) << 16) + \ - ((uint32_t)(*(s + 1)) << 8) + \ - ((uint32_t)(*(s + 2)) << 0); \ - s += 3; \ - } - -/** Big Endian stream to uint32 */ -#define BE_STREAM_TO_UINT32(u32, s) { \ - u32 = ((uint32_t)(*(s + 0)) << 24) + \ - ((uint32_t)(*(s + 1)) << 16) + \ - ((uint32_t)(*(s + 2)) << 8) + \ - ((uint32_t)(*(s + 3)) << 0); \ - s += 4; \ - } - -/** Big Endian uint8 to stream */ -#define BE_UINT8_TO_STREAM(s, u8) { \ - *s++ = (uint8_t)(u8); \ - } - -/** Big Endian uint16 to stream */ -#define BE_UINT16_TO_STREAM(s, u16) { \ - *s++ = (uint8_t)((u16) >> 8); \ - *s++ = (uint8_t)((u16) >> 0); \ - } - -/** Big Endian uint24 to stream */ -#define BE_UINT24_TO_STREAM(s, u24) { \ - *s++ = (uint8_t)((u24) >> 16); \ - *s++ = (uint8_t)((u24) >> 8); \ - *s++ = (uint8_t)((u24) >> 0); \ - } - -/** Big Endian uint32 to stream */ -#define BE_UINT32_TO_STREAM(s, u32) { \ - *s++ = (uint8_t)((u32) >> 24); \ - *s++ = (uint8_t)((u32) >> 16); \ - *s++ = (uint8_t)((u32) >> 8); \ - *s++ = (uint8_t)((u32) >> 0); \ - } - -/** Big Endian array to uint8 */ -#define BE_ARRAY_TO_UINT8(u8, a) { \ - u8 = (uint8_t)(*(a + 0)); \ - } - -/** Big Endian array to uint16 */ -#define BE_ARRAY_TO_UINT16(u16, a) { \ - u16 = ((uint16_t)(*(a + 0)) << 8) + \ - ((uint16_t)(*(a + 1)) << 0); \ - } - -/** Big Endian array to uint24 */ -#define BE_ARRAY_TO_UINT24(u24, a) { \ - u24 = ((uint32_t)(*(a + 0)) << 16) + \ - ((uint32_t)(*(a + 1)) << 8) + \ - ((uint32_t)(*(a + 2)) << 0); \ - } - -/** Big Endian array to uint32 */ -#define BE_ARRAY_TO_UINT32(u32, a) { \ - u32 = ((uint32_t)(*(a + 0)) << 24) + \ - ((uint32_t)(*(a + 1)) << 16) + \ - ((uint32_t)(*(a + 2)) << 8) + \ - ((uint32_t)(*(a + 3)) << 0); \ - } - -/** Big Endian uint8 to array */ -#define BE_UINT8_TO_ARRAY(a, u8) { \ - *((uint8_t *)(a) + 0) = (uint8_t)(u8); \ - } - -/** Big Endian uint16 to array */ -#define BE_UINT16_TO_ARRAY(a, u16) { \ - *((uint8_t *)(a) + 0) = (uint8_t)((u16) >> 8); \ - *((uint8_t *)(a) + 1) = (uint8_t)((u16) >> 0); \ - } - -/** Big Endian uint24 to array */ -#define BE_UINT24_TO_ARRAY(a, u24) { \ - *((uint8_t *)(a) + 0) = (uint8_t)((u24) >> 16); \ - *((uint8_t *)(a) + 1) = (uint8_t)((u24) >> 8); \ - *((uint8_t *)(a) + 2) = (uint8_t)((u24) >> 0); \ - } - -/** Big Endian uint32 to array */ -#define BE_UINT32_TO_ARRAY(a, u32) { \ - *((uint8_t *)(a) + 0) = (uint8_t)((u32) >> 24); \ - *((uint8_t *)(a) + 1) = (uint8_t)((u32) >> 16); \ - *((uint8_t *)(a) + 2) = (uint8_t)((u32) >> 8); \ - *((uint8_t *)(a) + 3) = (uint8_t)((u32) >> 0); \ - } - -#ifdef __cplusplus -} -#endif - -#endif /* _BT_TYPES_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/hci_if.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/hci_if.h deleted file mode 100644 index 521991fc..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/hci_if.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2015, Realsil Semiconductor Corporation. All rights reserved. - */ - -#ifndef _HCI_IF_H_ -#define _HCI_IF_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - HCI_IF_EVT_OPENED, /* hci I/F open completed */ - HCI_IF_EVT_CLOSED, /* hci I/F close completed */ - HCI_IF_EVT_DATA_IND, /* hci I/F rx data indicated */ - HCI_IF_EVT_DATA_XMIT, /* hci I/F tx data transmitted */ - HCI_IF_EVT_ERROR, /* hci I/F error occurred */ -} T_HCI_IF_EVT; - -typedef bool (*P_HCI_IF_CALLBACK)(T_HCI_IF_EVT evt, bool status, uint8_t *p_buf, uint32_t len); - -bool hci_if_open(P_HCI_IF_CALLBACK p_callback); - -bool hci_if_close(void); - -bool hci_if_write(uint8_t *p_buf, uint32_t len); - -bool hci_if_confirm(uint8_t *p_buf); - - -#ifdef __cplusplus -} -#endif - -#endif /* _HCI_IF_H_ */ diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/porting_test_app.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/porting_test_app.h deleted file mode 100644 index cb73d55e..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/app/porting_test/porting_test_app.h +++ /dev/null @@ -1,35 +0,0 @@ -/** -***************************************************************************************** -* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. -***************************************************************************************** - * @file peripheral_app.h - * @brief This file handles BLE peripheral application routines. - * @author jane - * @date 2017-06-06 - * @version v1.0 - ************************************************************************************** - * @attention - *

© COPYRIGHT 2017 Realtek Semiconductor Corporation

- ************************************************************************************** - */ - -#ifndef _PERIPHERAL_APP__ -#define _PERIPHERAL_APP__ - -#ifdef __cplusplus -extern "C" { -#endif -/*============================================================================* - * Header Files - *============================================================================*/ -#include - -void app_handle_io_msg(T_IO_MSG io_msg); -void app_send_msg(uint16_t sub_type); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/mcu/module/data_uart_cmd/data_uart.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/mcu/module/data_uart_cmd/data_uart.h deleted file mode 100644 index 20d8c875..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/mcu/module/data_uart_cmd/data_uart.h +++ /dev/null @@ -1,100 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************** -* @file data_uart.h -* @brief Data uart operations for testing multilink. -* @details Data uart init and print data through data uart. -* @author jane -* @date 2016-02-18 -* @version v0.1 -********************************************************************************************************* -*/ -#ifndef _DATA_UART_H_ -#define _DATA_UART_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** @defgroup DATA_UART_CMD Data Uart Command Module - * @brief Application uses this module to receive user command and send infomation through data uart. - * @{ - */ -/** @defgroup DATA_UART_APIs Data Uart Interface - * @{ - */ -/*============================================================================* - * Functions - *============================================================================*/ -/** @defgroup DATA_UART_APIs_Exported_Functions Data Uart Interface Exported Functions - * @{ - */ -/** - * @brief Initializes the Data UART. - * - * When data uart receives data, data uart will send an event IO_UART_MSG_TYPE to evt_queue_handle and send the data to io_queue_handle. - * @param[in] event_queue_handle Event queue handle which is created by APP. - * @param[in] io_queue_handle IO message queue handle which is created by APP. - * @return void - * - * Example usage - * \code{.c} - void app_main_task(void *p_param) - { - char event; - - os_msg_queue_create(&io_queue_handle, MAX_NUMBER_OF_IO_MESSAGE, sizeof(T_IO_MSG)); - os_msg_queue_create(&evt_queue_handle, MAX_NUMBER_OF_EVENT_MESSAGE, sizeof(unsigned char)); - - gap_start_bt_stack(evt_queue_handle, io_queue_handle, MAX_NUMBER_OF_GAP_MESSAGE); - - data_uart_init(evt_queue_handle, io_queue_handle); - ...... - } - void app_handle_io_msg(T_IO_MSG io_msg) - { - uint16_t msg_type = io_msg.type; - uint8_t rx_char; - - switch (msg_type) - { - case IO_MSG_TYPE_UART: - // We handle user command informations from Data UART in this branch. - rx_char = (uint8_t)io_msg.subtype; - user_cmd_collect(&user_cmd_if, &rx_char, sizeof(rx_char), user_cmd_table); - break; - default: - break; - } - } - * \endcode - */ -void data_uart_init(void *event_queue_handle, void *io_queue_handle); - -/** - * @brief Print the trace information through data uart. - * @param[in] fmt Print parameters. - * @return void - * - * Example usage - * \code{.c} - void test(void) - { - data_uart_print("GAP scan stop\r\n"); - } - * \endcode - */ -void data_uart_print(char *fmt, ...); -/** End of DATA_UART_APIs_Exported_Functions - * @} - */ - -/** @} */ /* End of group DATA_UART_APIs */ -/** @} */ /* End of group DATA_UART_CMD */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/mcu/module/data_uart_cmd/user_cmd_parse.h b/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/mcu/module/data_uart_cmd/user_cmd_parse.h deleted file mode 100644 index 7188982c..00000000 --- a/Arduino_package/hardware/system/component/common/bluetooth/realtek/sdk/src/mcu/module/data_uart_cmd/user_cmd_parse.h +++ /dev/null @@ -1,202 +0,0 @@ -/** -********************************************************************************************************* -* Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. -********************************************************************************************************** -* @file user_cmd_parse.h -* @brief Parse user command from lower Data UART data. -* @details Structure of command parse results. -* @author -* @date 2016-02-18 -* @version v0.1 -********************************************************************************************************* -*/ -#ifndef __USER_CMD_PARSE_CMD_H -#define __USER_CMD_PARSE_CMD_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -/** @defgroup DATA_UART_CMD Data Uart Command Module - * @{ - */ -/** @defgroup USER_CMD_PARSE User Command Parse Module - * @{ - */ -/*============================================================================* - * Micros - *============================================================================*/ -/** @defgroup USER_CMD_PARSE_Exported_Micros User Command Parse Module Exported Micros - @brief command parse related macros. - * @{ - */ - -#define USER_CMD_MAX_COMMAND_LINE 70 /**< max. length of command line in bytes */ -#define USER_CMD_MAX_HISTORY_LINE 3 /**< max. num of history command line */ -#define USER_CMD_MAX_PARAMETERS 8 /**< max. number of parameters that the parser will scan */ -/** End of USER_CMD_PARSE_Exported_Micros - * @} - */ - - -/*============================================================================* - * Types - *============================================================================*/ -/** @defgroup USER_CMD_PARSE_Exported_Types User Command Parse Module Exported Types - * @{ - */ - -/** -* @brief Data UART command parse result. -* -* This is the structure where the command line parser puts its result. -*/ -typedef enum -{ - RESULT_SUCESS, //!< Operation success. - RESULT_GAP_CAUSE_ALREADY_IN_REQ = 0x01,//!< Operation already in progress. - RESULT_GAP_CAUSE_INVALID_STATE = 0x02,//!< Invalid state. - RESULT_GAP_CAUSE_INVALID_PARAM = 0x03,//!< Invalid parameter. - RESULT_GAP_CAUSE_NON_CONN = 0x04,//!< No connection establishment. - RESULT_GAP_CAUSE_NOT_FIND_IRK = 0x05,//!< IRK not found. - RESULT_GAP_CAUSE_ERROR_CREDITS = 0x06,//!< Credits error. - RESULT_GAP_CAUSE_SEND_REQ_FAILED = 0x07,//!< Send Request failed. - RESULT_GAP_CAUSE_NO_RESOURCE = 0x08,//!< No resource. - RESULT_GAP_CAUSE_INVALID_PDU_SIZE = 0x09,//!< Invalid PDU size. - RESULT_GAP_CAUSE_NOT_FIND = 0x0a,//!< Not Found. - RESULT_GAP_CAUSE_CONN_LIMIT = 0x0b,//!< Connection reachs limited count. - - RESULT_ERR = 0x20, - RESULT_CMD_EMPTY_LINE = 0x21, - RESULT_CMD_NOT_FOUND = 0x22, - RESULT_CMD_ERR_PARAM = 0x23, - RESULT_CMD_ERR_PARAM_NUM = 0x24, - RESULT_CMD_OUT_OF_RANGE = 0x25, - RESULT_CMD_NOT_SUPPORT = 0x26, - RESULT_GAP_CAUSE_ERROR_UNKNOWN = 0xFF,//!< Unknown error. -} T_USER_CMD_PARSE_RESULT; - -/** - * @brief Data UART command parse value. - * - * This is the structure where the command line parser puts its values. - */ -typedef struct -{ - char *p_cmd; /**< pointer to command */ - int32_t param_count; /**< number of found parameters */ - uint32_t dw_param[USER_CMD_MAX_PARAMETERS]; /**< automatically parsed parameters */ - char *p_param[USER_CMD_MAX_PARAMETERS]; /**< automatically parsed parameters */ -} T_USER_CMD_PARSED_VALUE; - -/** @brief Command interface. */ -typedef struct -{ - char cmdline_buf[USER_CMD_MAX_COMMAND_LINE + 2]; - uint8_t cmd_cur; - uint8_t cmd_history[USER_CMD_MAX_HISTORY_LINE][USER_CMD_MAX_COMMAND_LINE + 2]; - uint8_t cmd_history_len[USER_CMD_MAX_HISTORY_LINE]; - uint8_t history_head; - uint8_t history_tail; - uint8_t history_cur; - int32_t accum_cmd_len; /**< accumulated length of command */ -} T_USER_CMD_IF; - -/** @brief Prototype of functions that can be called from command table. */ -typedef T_USER_CMD_PARSE_RESULT(*T_USER_CMD_FUNC)(T_USER_CMD_PARSED_VALUE *p_parse_value); - -/** - * @brief Command table entry. - * - */ -typedef struct -{ - char *p_cmd; - char *p_option; - char *p_help; - T_USER_CMD_FUNC func; -} T_USER_CMD_TABLE_ENTRY; -/** End of USER_CMD_PARSE_Exported_Types - * @} - */ - -/*============================================================================* - * Functions - *============================================================================*/ -/** @defgroup USER_CMD_PARSE_Exported_Functions User Command Parse Module Exported Functions - * @{ - */ - -/** - * @brief Initiate command interface structure - * @param[in] p_user_cmd_if Store parsed commands. - * @param[in] project_name Initiate project name. - * @return void - * - * Example usage - * \code{.c} - void app_main_task(void *p_param) - { - char event; - - os_msg_queue_create(&io_queue_handle, MAX_NUMBER_OF_IO_MESSAGE, sizeof(T_IO_MSG)); - os_msg_queue_create(&evt_queue_handle, MAX_NUMBER_OF_EVENT_MESSAGE, sizeof(unsigned char)); - - gap_start_bt_stack(evt_queue_handle, io_queue_handle, MAX_NUMBER_OF_GAP_MESSAGE); - - data_uart_init(evt_queue_handle, io_queue_handle); - user_cmd_init(&user_cmd_if, "central"); - ...... - } - * \endcode - */ -void user_cmd_init(T_USER_CMD_IF *p_user_cmd_if, char *project_name); - -/** - * @brief Collect command characters. - * - * @param[in] p_user_cmd_if Store parsed commands. - * @param[in] p_data Data to be parsed. - * @param[in] len Length of data to be command parsed. - * @param[in] p_cmd_table Command table to execute function. - * @return Command collect result. - * @retval 1 true. - * @retval 0 false. - * - * Example usage - * \code{.c} - void app_handle_io_msg(T_IO_MSG io_msg) - { - uint16_t msg_type = io_msg.type; - uint8_t rx_char; - - switch (msg_type) - { - case IO_MSG_TYPE_UART: - // We handle user command informations from Data UART in this branch. - rx_char = (uint8_t)io_msg.subtype; - user_cmd_collect(&user_cmd_if, &rx_char, sizeof(rx_char), user_cmd_table); - break; - default: - break; - } - } - * \endcode - */ -bool user_cmd_collect(T_USER_CMD_IF *p_user_cmd_if, uint8_t *p_data, int32_t len, - const T_USER_CMD_TABLE_ENTRY *p_cmd_table); -/** End of USER_CMD_PARSE_Exported_Functions - * @} - */ - -/** @} */ /* End of group USER_CMD_PARSE */ -/** @} */ /* End of group DATA_UART_CMD */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __USER_CMD_PARSE_CMD_H */ - diff --git a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/autoconf.h b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/autoconf.h index cb13c711..fb8978ce 100644 --- a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/autoconf.h +++ b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/autoconf.h @@ -224,7 +224,9 @@ #endif #define CONFIG_PMKSA_CACHING - +#ifdef CONFIG_PMKSA_CACHING +//#define CONFIG_PMKSA_CACHING_RECONNECT +#endif /* For WPA3 */ #define CONFIG_IEEE80211W #define CONFIG_SAE_SUPPORT @@ -333,6 +335,10 @@ /* For AP_MODE */ #define CONFIG_AP_MODE +//#define UAPSD +#ifdef UAPSD +#define TX_CHECK_DSEC_ALWAYS +#endif extern unsigned char g_user_ap_sta_num; #define USER_AP_STA_NUM g_user_ap_sta_num #if (CONFIG_PLATFORM_AMEBA_X == 1) diff --git a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/wifi_constants.h b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/wifi_constants.h index 46813d29..cf11a6b0 100644 --- a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/wifi_constants.h +++ b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/include/wifi_constants.h @@ -520,7 +520,8 @@ typedef unsigned long rtw_wps_type_t; enum { RTW_NETWORK_B = 1, RTW_NETWORK_BG = 3, - RTW_NETWORK_BGN = 11 + RTW_NETWORK_BGN = 11, + RTW_NETWORK_ABGN = 31 }; typedef unsigned long rtw_network_mode_t; diff --git a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/core/option/rtw_opt_rf_para_rtl8721d.c b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/core/option/rtw_opt_rf_para_rtl8721d.c index 18018a83..a8fa49ab 100644 --- a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/core/option/rtw_opt_rf_para_rtl8721d.c +++ b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/core/option/rtw_opt_rf_para_rtl8721d.c @@ -117,9 +117,15 @@ enum odm_pw_lmt_rfpath_type { ******************************************************************************/ #ifndef SUPPORT_B_CUT const u32 array_mp_8721d_radioa[] = { - 0x00E, 0x00000022, + 0x00E, 0x00000024, 0x00F, 0x00000029, + 0x84000000, 0x00000000, 0x40000000, 0x00000000, + 0x057, 0x0009C522, + 0x95000000, 0x00000000, 0x40000000, 0x00000000, + 0x057, 0x0009C522, + 0xA0000000, 0x00000000, 0x057, 0x0009F522, + 0xB0000000, 0x00000000, 0x078, 0x000015D5, 0x082, 0x000115A8, 0x0C0, 0x00038144, @@ -127,6 +133,551 @@ const u32 array_mp_8721d_radioa[] = { 0x0A5, 0x000E700C, 0x0A1, 0x00005604, 0x000, 0x00010000, + 0x84000000, 0x00000000, 0x40000000, 0x00000000, + 0x0EE, 0x00010000, + 0x033, 0x00000040, + 0x03F, 0x00000627, + 0x033, 0x00000041, + 0x03F, 0x0000062A, + 0x033, 0x00000042, + 0x03F, 0x0000062D, + 0x033, 0x00000043, + 0x03F, 0x0000066A, + 0x033, 0x00000044, + 0x03F, 0x0000066D, + 0x033, 0x00000045, + 0x03F, 0x00000CC8, + 0x033, 0x00000046, + 0x03F, 0x00000CCB, + 0x033, 0x00000047, + 0x03F, 0x00000CCE, + 0x033, 0x00000048, + 0x03F, 0x00000EEF, + 0x033, 0x00000049, + 0x03F, 0x00000EF2, + 0x033, 0x0000004A, + 0x03F, 0x00000EF5, + 0x033, 0x00000060, + 0x03F, 0x00000225, + 0x033, 0x00000061, + 0x03F, 0x00000228, + 0x033, 0x00000062, + 0x03F, 0x0000022B, + 0x033, 0x00000063, + 0x03F, 0x00000663, + 0x033, 0x00000064, + 0x03F, 0x00000E28, + 0x033, 0x00000065, + 0x03F, 0x00000E2B, + 0x033, 0x00000066, + 0x03F, 0x00000EE3, + 0x033, 0x00000067, + 0x03F, 0x00000EE6, + 0x033, 0x00000068, + 0x03F, 0x00000EE9, + 0x033, 0x00000069, + 0x03F, 0x00000EEC, + 0x033, 0x0000006A, + 0x03F, 0x00000EEF, + 0x033, 0x00000000, + 0x03F, 0x00000268, + 0x033, 0x00000001, + 0x03F, 0x0000026B, + 0x033, 0x00000002, + 0x03F, 0x0000064B, + 0x033, 0x00000003, + 0x03F, 0x0000064E, + 0x033, 0x00000004, + 0x03F, 0x00000A4E, + 0x033, 0x00000005, + 0x03F, 0x00000ACA, + 0x033, 0x00000006, + 0x03F, 0x00000ACD, + 0x033, 0x00000007, + 0x03F, 0x00000AD0, + 0x033, 0x00000008, + 0x03F, 0x00000EF0, + 0x033, 0x00000009, + 0x03F, 0x00000EF3, + 0x033, 0x0000000A, + 0x03F, 0x00000EF6, + 0x033, 0x00000020, + 0x03F, 0x00000608, + 0x033, 0x00000021, + 0x03F, 0x00000625, + 0x033, 0x00000022, + 0x03F, 0x00000628, + 0x033, 0x00000023, + 0x03F, 0x00000665, + 0x033, 0x00000024, + 0x03F, 0x00000668, + 0x033, 0x00000025, + 0x03F, 0x00000E66, + 0x033, 0x00000026, + 0x03F, 0x00000E69, + 0x033, 0x00000027, + 0x03F, 0x00000E6C, + 0x033, 0x00000028, + 0x03F, 0x00000EE9, + 0x033, 0x00000029, + 0x03F, 0x00000EEC, + 0x033, 0x0000002A, + 0x03F, 0x00000EEF, + 0x0EE, 0x00000000, + 0x95000000, 0x00000000, 0x40000000, 0x00000000, + 0x0EE, 0x00010000, + 0x033, 0x00000040, + 0x03F, 0x00000627, + 0x033, 0x00000041, + 0x03F, 0x0000062A, + 0x033, 0x00000042, + 0x03F, 0x0000062D, + 0x033, 0x00000043, + 0x03F, 0x0000066A, + 0x033, 0x00000044, + 0x03F, 0x0000066D, + 0x033, 0x00000045, + 0x03F, 0x00000CC8, + 0x033, 0x00000046, + 0x03F, 0x00000CCB, + 0x033, 0x00000047, + 0x03F, 0x00000CCE, + 0x033, 0x00000048, + 0x03F, 0x00000EEF, + 0x033, 0x00000049, + 0x03F, 0x00000EF2, + 0x033, 0x0000004A, + 0x03F, 0x00000EF5, + 0x033, 0x00000060, + 0x03F, 0x00000225, + 0x033, 0x00000061, + 0x03F, 0x00000228, + 0x033, 0x00000062, + 0x03F, 0x0000022B, + 0x033, 0x00000063, + 0x03F, 0x00000663, + 0x033, 0x00000064, + 0x03F, 0x00000E28, + 0x033, 0x00000065, + 0x03F, 0x00000E2B, + 0x033, 0x00000066, + 0x03F, 0x00000EE3, + 0x033, 0x00000067, + 0x03F, 0x00000EE6, + 0x033, 0x00000068, + 0x03F, 0x00000EE9, + 0x033, 0x00000069, + 0x03F, 0x00000EEC, + 0x033, 0x0000006A, + 0x03F, 0x00000EEF, + 0x033, 0x00000000, + 0x03F, 0x00000268, + 0x033, 0x00000001, + 0x03F, 0x0000026B, + 0x033, 0x00000002, + 0x03F, 0x0000064B, + 0x033, 0x00000003, + 0x03F, 0x0000064E, + 0x033, 0x00000004, + 0x03F, 0x00000A4E, + 0x033, 0x00000005, + 0x03F, 0x00000ACA, + 0x033, 0x00000006, + 0x03F, 0x00000ACD, + 0x033, 0x00000007, + 0x03F, 0x00000AD0, + 0x033, 0x00000008, + 0x03F, 0x00000EF0, + 0x033, 0x00000009, + 0x03F, 0x00000EF3, + 0x033, 0x0000000A, + 0x03F, 0x00000EF6, + 0x033, 0x00000020, + 0x03F, 0x00000608, + 0x033, 0x00000021, + 0x03F, 0x00000625, + 0x033, 0x00000022, + 0x03F, 0x00000628, + 0x033, 0x00000023, + 0x03F, 0x00000665, + 0x033, 0x00000024, + 0x03F, 0x00000668, + 0x033, 0x00000025, + 0x03F, 0x00000E66, + 0x033, 0x00000026, + 0x03F, 0x00000E69, + 0x033, 0x00000027, + 0x03F, 0x00000E6C, + 0x033, 0x00000028, + 0x03F, 0x00000EE9, + 0x033, 0x00000029, + 0x03F, 0x00000EEC, + 0x033, 0x0000002A, + 0x03F, 0x00000EEF, + 0x0EE, 0x00000000, + 0xA0000000, 0x00000000, + 0x0EE, 0x00010000, + 0x033, 0x00000040, + 0x03F, 0x00000628, + 0x033, 0x00000041, + 0x03F, 0x0000062B, + 0x033, 0x00000042, + 0x03F, 0x0000062E, + 0x033, 0x00000043, + 0x03F, 0x0000066B, + 0x033, 0x00000044, + 0x03F, 0x0000066E, + 0x033, 0x00000045, + 0x03F, 0x00000CC9, + 0x033, 0x00000046, + 0x03F, 0x00000CCC, + 0x033, 0x00000047, + 0x03F, 0x00000CCF, + 0x033, 0x00000048, + 0x03F, 0x00000EF0, + 0x033, 0x00000049, + 0x03F, 0x00000EF3, + 0x033, 0x0000004A, + 0x03F, 0x00000EF6, + 0x033, 0x00000060, + 0x03F, 0x00000226, + 0x033, 0x00000061, + 0x03F, 0x00000229, + 0x033, 0x00000062, + 0x03F, 0x0000022C, + 0x033, 0x00000063, + 0x03F, 0x00000664, + 0x033, 0x00000064, + 0x03F, 0x00000E29, + 0x033, 0x00000065, + 0x03F, 0x00000E2C, + 0x033, 0x00000066, + 0x03F, 0x00000EE4, + 0x033, 0x00000067, + 0x03F, 0x00000EE7, + 0x033, 0x00000068, + 0x03F, 0x00000EEA, + 0x033, 0x00000069, + 0x03F, 0x00000EED, + 0x033, 0x0000006A, + 0x03F, 0x00000EF0, + 0x033, 0x00000000, + 0x03F, 0x00000267, + 0x033, 0x00000001, + 0x03F, 0x0000026A, + 0x033, 0x00000002, + 0x03F, 0x0000064A, + 0x033, 0x00000003, + 0x03F, 0x0000064D, + 0x033, 0x00000004, + 0x03F, 0x00000A4D, + 0x033, 0x00000005, + 0x03F, 0x00000AC9, + 0x033, 0x00000006, + 0x03F, 0x00000ACC, + 0x033, 0x00000007, + 0x03F, 0x00000ACF, + 0x033, 0x00000008, + 0x03F, 0x00000EEF, + 0x033, 0x00000009, + 0x03F, 0x00000EF2, + 0x033, 0x0000000A, + 0x03F, 0x00000EF5, + 0x033, 0x00000020, + 0x03F, 0x00000607, + 0x033, 0x00000021, + 0x03F, 0x00000624, + 0x033, 0x00000022, + 0x03F, 0x00000627, + 0x033, 0x00000023, + 0x03F, 0x00000664, + 0x033, 0x00000024, + 0x03F, 0x00000667, + 0x033, 0x00000025, + 0x03F, 0x00000E65, + 0x033, 0x00000026, + 0x03F, 0x00000E68, + 0x033, 0x00000027, + 0x03F, 0x00000E6B, + 0x033, 0x00000028, + 0x03F, 0x00000EE8, + 0x033, 0x00000029, + 0x03F, 0x00000EEB, + 0x033, 0x0000002A, + 0x03F, 0x00000EEE, + 0x0EE, 0x00000000, + 0xB0000000, 0x00000000, + 0x84000000, 0x00000000, 0x40000000, 0x00000000, + 0x0EE, 0x00010000, + 0x033, 0x00000240, + 0x03F, 0x00000443, + 0x033, 0x00000241, + 0x03F, 0x00000446, + 0x033, 0x00000242, + 0x03F, 0x00000449, + 0x033, 0x00000243, + 0x03F, 0x0000044C, + 0x033, 0x00000244, + 0x03F, 0x00000CA4, + 0x033, 0x00000245, + 0x03F, 0x00000CA7, + 0x033, 0x00000246, + 0x03F, 0x00000EE6, + 0x033, 0x00000247, + 0x03F, 0x00000EE9, + 0x033, 0x00000248, + 0x03F, 0x00000EEC, + 0x033, 0x00000249, + 0x03F, 0x00000EEF, + 0x033, 0x0000024A, + 0x03F, 0x00000EF2, + 0x033, 0x000002C0, + 0x03F, 0x0000022C, + 0x033, 0x000002C1, + 0x03F, 0x00000627, + 0x033, 0x000002C2, + 0x03F, 0x0000062A, + 0x033, 0x000002C3, + 0x03F, 0x00000667, + 0x033, 0x000002C4, + 0x03F, 0x00000688, + 0x033, 0x000002C5, + 0x03F, 0x000006E7, + 0x033, 0x000002C6, + 0x03F, 0x00000EE7, + 0x033, 0x000002C7, + 0x03F, 0x00000EEA, + 0x033, 0x000002C8, + 0x03F, 0x00000EED, + 0x033, 0x000002C9, + 0x03F, 0x00000EF0, + 0x033, 0x000002CA, + 0x03F, 0x00000EF3, + 0x033, 0x00000340, + 0x03F, 0x0000022A, + 0x033, 0x00000341, + 0x03F, 0x00000625, + 0x033, 0x00000342, + 0x03F, 0x00000628, + 0x033, 0x00000343, + 0x03F, 0x00000665, + 0x033, 0x00000344, + 0x03F, 0x00000686, + 0x033, 0x00000345, + 0x03F, 0x000006E5, + 0x033, 0x00000346, + 0x03F, 0x00000EE6, + 0x033, 0x00000347, + 0x03F, 0x00000EE9, + 0x033, 0x00000348, + 0x03F, 0x00000EEC, + 0x033, 0x00000349, + 0x03F, 0x00000EEF, + 0x033, 0x0000034A, + 0x03F, 0x00000EF2, + 0x033, 0x00000200, + 0x03F, 0x00000622, + 0x033, 0x00000201, + 0x03F, 0x00000625, + 0x033, 0x00000202, + 0x03F, 0x00000628, + 0x033, 0x00000203, + 0x03F, 0x00000665, + 0x033, 0x00000204, + 0x03F, 0x00000C49, + 0x033, 0x00000205, + 0x03F, 0x00000C4C, + 0x033, 0x00000206, + 0x03F, 0x00000EE6, + 0x033, 0x00000207, + 0x03F, 0x00000EE9, + 0x033, 0x00000208, + 0x03F, 0x00000EEC, + 0x033, 0x00000209, + 0x03F, 0x00000EEF, + 0x033, 0x0000020A, + 0x03F, 0x00000EF2, + 0x033, 0x00000280, + 0x03F, 0x00000247, + 0x033, 0x00000281, + 0x03F, 0x00000642, + 0x033, 0x00000282, + 0x03F, 0x00000645, + 0x033, 0x00000283, + 0x03F, 0x00000648, + 0x033, 0x00000284, + 0x03F, 0x00000A4B, + 0x033, 0x00000285, + 0x03F, 0x00000A4E, + 0x033, 0x00000286, + 0x03F, 0x00000EE6, + 0x033, 0x00000287, + 0x03F, 0x00000EE9, + 0x033, 0x00000288, + 0x03F, 0x00000EEC, + 0x033, 0x00000289, + 0x03F, 0x00000EEF, + 0x033, 0x0000028A, + 0x03F, 0x00000EF2, + 0x033, 0x00000300, + 0x03F, 0x0000022A, + 0x033, 0x00000301, + 0x03F, 0x0000022D, + 0x033, 0x00000302, + 0x03F, 0x00000645, + 0x033, 0x00000303, + 0x03F, 0x00000648, + 0x033, 0x00000304, + 0x03F, 0x0000064B, + 0x033, 0x00000305, + 0x03F, 0x00000EC5, + 0x033, 0x00000306, + 0x03F, 0x00000EE7, + 0x033, 0x00000307, + 0x03F, 0x00000EEA, + 0x033, 0x00000308, + 0x03F, 0x00000EED, + 0x033, 0x00000309, + 0x03F, 0x00000EF0, + 0x033, 0x0000030A, + 0x03F, 0x00000EF3, + 0x0EE, 0x00000000, + 0x95000000, 0x00000000, 0x40000000, 0x00000000, + 0x0EE, 0x00010000, + 0x033, 0x00000240, + 0x03F, 0x00000443, + 0x033, 0x00000241, + 0x03F, 0x00000446, + 0x033, 0x00000242, + 0x03F, 0x00000449, + 0x033, 0x00000243, + 0x03F, 0x0000044C, + 0x033, 0x00000244, + 0x03F, 0x00000CA4, + 0x033, 0x00000245, + 0x03F, 0x00000CA7, + 0x033, 0x00000246, + 0x03F, 0x00000EE6, + 0x033, 0x00000247, + 0x03F, 0x00000EE9, + 0x033, 0x00000248, + 0x03F, 0x00000EEC, + 0x033, 0x00000249, + 0x03F, 0x00000EEF, + 0x033, 0x0000024A, + 0x03F, 0x00000EF2, + 0x033, 0x000002C0, + 0x03F, 0x0000022C, + 0x033, 0x000002C1, + 0x03F, 0x00000627, + 0x033, 0x000002C2, + 0x03F, 0x0000062A, + 0x033, 0x000002C3, + 0x03F, 0x00000667, + 0x033, 0x000002C4, + 0x03F, 0x00000688, + 0x033, 0x000002C5, + 0x03F, 0x000006E7, + 0x033, 0x000002C6, + 0x03F, 0x00000EE7, + 0x033, 0x000002C7, + 0x03F, 0x00000EEA, + 0x033, 0x000002C8, + 0x03F, 0x00000EED, + 0x033, 0x000002C9, + 0x03F, 0x00000EF0, + 0x033, 0x000002CA, + 0x03F, 0x00000EF3, + 0x033, 0x00000340, + 0x03F, 0x0000022A, + 0x033, 0x00000341, + 0x03F, 0x00000625, + 0x033, 0x00000342, + 0x03F, 0x00000628, + 0x033, 0x00000343, + 0x03F, 0x00000665, + 0x033, 0x00000344, + 0x03F, 0x00000686, + 0x033, 0x00000345, + 0x03F, 0x000006E5, + 0x033, 0x00000346, + 0x03F, 0x00000EE6, + 0x033, 0x00000347, + 0x03F, 0x00000EE9, + 0x033, 0x00000348, + 0x03F, 0x00000EEC, + 0x033, 0x00000349, + 0x03F, 0x00000EEF, + 0x033, 0x0000034A, + 0x03F, 0x00000EF2, + 0x033, 0x00000200, + 0x03F, 0x00000622, + 0x033, 0x00000201, + 0x03F, 0x00000625, + 0x033, 0x00000202, + 0x03F, 0x00000628, + 0x033, 0x00000203, + 0x03F, 0x00000665, + 0x033, 0x00000204, + 0x03F, 0x00000C49, + 0x033, 0x00000205, + 0x03F, 0x00000C4C, + 0x033, 0x00000206, + 0x03F, 0x00000EE6, + 0x033, 0x00000207, + 0x03F, 0x00000EE9, + 0x033, 0x00000208, + 0x03F, 0x00000EEC, + 0x033, 0x00000209, + 0x03F, 0x00000EEF, + 0x033, 0x0000020A, + 0x03F, 0x00000EF2, + 0x033, 0x00000280, + 0x03F, 0x00000247, + 0x033, 0x00000281, + 0x03F, 0x00000642, + 0x033, 0x00000282, + 0x03F, 0x00000645, + 0x033, 0x00000283, + 0x03F, 0x00000648, + 0x033, 0x00000284, + 0x03F, 0x00000A4B, + 0x033, 0x00000285, + 0x03F, 0x00000A4E, + 0x033, 0x00000286, + 0x03F, 0x00000EE6, + 0x033, 0x00000287, + 0x03F, 0x00000EE9, + 0x033, 0x00000288, + 0x03F, 0x00000EEC, + 0x033, 0x00000289, + 0x03F, 0x00000EEF, + 0x033, 0x0000028A, + 0x03F, 0x00000EF2, + 0x033, 0x00000300, + 0x03F, 0x0000022A, + 0x033, 0x00000301, + 0x03F, 0x0000022D, + 0x033, 0x00000302, + 0x03F, 0x00000645, + 0x033, 0x00000303, + 0x03F, 0x00000648, + 0x033, 0x00000304, + 0x03F, 0x0000064B, + 0x033, 0x00000305, + 0x03F, 0x00000EC5, + 0x033, 0x00000306, + 0x03F, 0x00000EE7, + 0x033, 0x00000307, + 0x03F, 0x00000EEA, + 0x033, 0x00000308, + 0x03F, 0x00000EED, + 0x033, 0x00000309, + 0x03F, 0x00000EF0, + 0x033, 0x0000030A, + 0x03F, 0x00000EF3, + 0x0EE, 0x00000000, + 0xA0000000, 0x00000000, 0x0EE, 0x00010000, 0x033, 0x00000240, 0x03F, 0x00000444, @@ -261,6 +812,7 @@ const u32 array_mp_8721d_radioa[] = { 0x033, 0x0000030A, 0x03F, 0x00000EF3, 0x0EE, 0x00000000, + 0xB0000000, 0x00000000, 0x0EE, 0x00008000, 0x033, 0x00000020, 0x03F, 0x00055077, diff --git a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/osdep/wlan_intf.h b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/osdep/wlan_intf.h index 9caa2fb1..7644b9df 100644 --- a/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/osdep/wlan_intf.h +++ b/Arduino_package/hardware/system/component/common/drivers/wlan/realtek/src/osdep/wlan_intf.h @@ -85,6 +85,7 @@ int rltk_wlan_change_channel_plan(unsigned char channel_plan); int rltk_coex_ble_scan_duty_update( unsigned char duty); int rltk_coex_set_wlan_slot_random(unsigned char temp); int rltk_coex_set_wlan_slot_preempting(unsigned char bitmask); +int rltk_coex_set_wlan_lps_coex(unsigned char enable); unsigned char rltk_wlan_ap_compatibility_is_enable(unsigned int bitmap); void rltk_wlan_enable_proassocaite(unsigned char enable); void rltk_wlan_enable_check_bcn_info(unsigned char enable); diff --git a/Arduino_package/hardware/system/component/common/mbed/targets/hal/rtl8721d/i2c_api.c b/Arduino_package/hardware/system/component/common/mbed/targets/hal/rtl8721d/i2c_api.c index fea4f0b9..094bbb17 100644 --- a/Arduino_package/hardware/system/component/common/mbed/targets/hal/rtl8721d/i2c_api.c +++ b/Arduino_package/hardware/system/component/common/mbed/targets/hal/rtl8721d/i2c_api.c @@ -1,885 +1,1463 @@ -/** mbed Microcontroller Library - ****************************************************************************** - * @file i2c_api.c - * @author - * @version V1.0.0 - * @date 2016-08-01 - * @brief This file provides mbed API for I2C. - ****************************************************************************** - * @attention - * - * This module is a confidential and proprietary property of RealTek and - * possession or use of this module requires written permission of RealTek. - * - * Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. - ****************************************************************************** - */ -#include "objects.h" -#include "PinNames.h" -#include "i2c_api.h" - -#include "pinmap.h" - -// See I2CSlave.h -#define NoData 0 // the slave has not been addressed -#define ReadAddressed 1 // the master has requested a read from this slave (slave = transmitter) -#define WriteGeneral 2 // the master is writing to all slave -#define WriteAddressed 3 // the master is writing to this slave (slave = receiver) - -static uint16_t i2c_target_addr[2]; -extern u32 ConfigDebugErr; -extern u32 ConfigDebuginfo; -I2C_InitTypeDef I2CInitDat[2]; -static u32 restart_enable = 0; -static u32 master_addr_retry = 1; - -/** @addtogroup AmebaD_Mbed_API - * @{ - */ - -/** @defgroup MBED_I2C - * @brief MBED_I2C driver modules. - * @{ - */ - -/** @defgroup MBED_I2C_Exported_Functions MBED_I2C Exported Functions - * @{ - */ -void i2c_send_restart(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u8 restart); - -/** - * @brief Read data with special length in master mode through the I2Cx peripheral under in-house IP. - * @param I2Cx: where I2Cx can be I2C0_DEV. - * @param pBuf: point to the buffer to hold the received data. - * @param len: the length of data that to be received. - * @note deal with condition that master send address while slave no ack - * @retval the length of data read. - */ -u32 I2C_MasterRead_Patch(I2C_TypeDef *I2Cx, u8* pBuf, u32 len) -{ - u32 cnt = 0; - /* Check the parameters */ - assert_param(IS_I2C_ALL_PERIPH(I2Cx)); - - /* read in the DR register the data to be received */ - for(cnt = 0; cnt < len; cnt++) { - if(cnt >= len - 1) { - /* generate stop singal */ - I2Cx->IC_DATA_CMD = 0x0003 << 8; - } else { - I2Cx->IC_DATA_CMD = 0x0001 << 8; - } - /* wait for I2C_FLAG_RFNE flag */ - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_RFNE)) == 0) { - if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { - DBG_8195A(" TX_ABRT\n"); - I2C_ClearAllINT(I2Cx); - return cnt; - } - } - *pBuf++ = (u8)I2Cx->IC_DATA_CMD; - } - return cnt; -} - -/** - * @brief Write data with special length in master mode through the I2Cx peripheral under in-house IP. - * @param I2Cx: where I2Cx can be I2C0_DEV. - * @param pBuf: point to the data to be transmitted. - * @param len: the length of data that send. - * @note deal with condition that master send address while slave no ack - * @retval the length of data send. - */ -u32 I2C_MasterWrite_Patch(I2C_TypeDef *I2Cx, u8* pBuf, u32 len) -{ - u32 cnt = 0; - /* Check the parameters */ - assert_param(IS_I2C_ALL_PERIPH(I2Cx)); - - /* Write in the DR register the data to be sent */ - for(cnt = 0; cnt < len; cnt++) - { - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFNF)) == 0); - - if(cnt >= len - 1) - { - /*generate stop signal*/ - I2Cx->IC_DATA_CMD = (*pBuf++) | (1 << 9); - } - else - { - I2Cx->IC_DATA_CMD = (*pBuf++); - } - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFE)) == 0) { - if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { - DBG_8195A(" TX_ABRT= %x\n",I2Cx->IC_TX_ABRT_SOURCE); - I2C_ClearAllINT(I2Cx); - return cnt; - } - } - } - return cnt; -} - -/** - * @brief Read data with special length in master mode through the I2Cx peripheral under in-house IP. - * @param I2Cx: where I2Cx can be I2C0_DEV . - * @param pBuf: point to the buffer to hold the received data. - * @param len: the length of data that to be received. - * @param timeout_ms: specifies timeout time, unit is ms. - * @retval the length of data read. - */ -int I2C_MasterRead_TimeOut(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u32 timeout_ms) -{ - int cnt = 0; - u32 InTimeoutCount = 0; - - /* Check the parameters */ - assert_param(IS_I2C_ALL_PERIPH(I2Cx)); - - /* read in the DR register the data to be received */ - for(cnt = 0; cnt < len; cnt++) { - InTimeoutCount = timeout_ms*500; - - if(cnt >= len - 1) { - /* generate stop singal */ - I2Cx->IC_DATA_CMD = 0x0003 << 8; - } else { - I2Cx->IC_DATA_CMD = 0x0001 << 8; - } - - /* wait for I2C_FLAG_RFNE flag */ - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_RFNE)) == 0) { - if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { - DBG_8195A(" TX_ABRT\n"); - I2C_ClearAllINT(I2Cx); - return cnt; - } - - DelayUs(2); - - if (InTimeoutCount == 0) { - DBG_8195A("MasterRead_TimeOut\n"); - return cnt; - } - InTimeoutCount--; - } - - *pBuf++ = (u8)I2Cx->IC_DATA_CMD; - } - - return cnt; -} - -/** - * @brief Write data with special length in master mode through the I2Cx peripheral under in-house IP. - * @param I2Cx: where I2Cx can be I2C0_DEV. - * @param pBuf: point to the data to be transmitted. - * @param len: the length of data that to be received. - * @param timeout_ms: specifies timeout time, unit is ms. - * @retval the length of data send. - */ -int I2C_MasterWrite_TimeOut(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u32 timeout_ms) -{ - int cnt = 0; - u32 InTimeoutCount = 0; - - /* Check the parameters */ - assert_param(IS_I2C_ALL_PERIPH(I2Cx)); - - /* Write in the DR register the data to be sent */ - for(cnt = 0; cnt < len; cnt++) - { - InTimeoutCount = timeout_ms*500; - - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFNF)) == 0); - - if(cnt >= len - 1) - { - /*generate stop signal*/ - I2Cx->IC_DATA_CMD = (*pBuf++) | (1 << 9); - } - else - { - I2Cx->IC_DATA_CMD = (*pBuf++); - } - - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFE)) == 0) { - if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { - DBG_8195A(" TX_ABRT\n"); - I2C_ClearAllINT(I2Cx); - return cnt; - } - - DelayUs(2); - - if (InTimeoutCount == 0) { - DBG_8195A("MasterWrite_TimeOut\n"); - return cnt; - } - InTimeoutCount--; - } - } - - return cnt; -} - -/** - * @brief Master sends single byte through the I2Cx peripheral to detect slave device. - * @param obj: i2c object defined in application software. - * @param address: the address of slave that to be detected. - * @param timeout_ms: specifies timeout time, unit is ms. - * @retval Slave ack condition: - * - 0: Slave available - * - -1: Slave not available - */ -int I2C_MasterSendNullData_TimeOut(I2C_TypeDef *I2Cx, int address, u32 timeout_ms) -{ - u8 I2CTemp = (u8)(address<<1); - I2C_MasterSendNullData(I2Cx, &I2CTemp, 0, 1, 0); - - DelayMs(timeout_ms); - - if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { - I2C_ClearAllINT(I2Cx); - - /* Wait for i2c enter trap state from trap_stop state*/ - DelayUs(100); - I2C_Cmd(I2Cx, DISABLE); - I2C_Cmd(I2Cx, ENABLE); - - return -1; - } - return 0; -} -/** - * @brief Get i2c index according to the SDA PinName. - * @param sda: SDA PinName according to pinmux spec. - * @retval i2c index: - * - 0: I2C0 Device - */ -static uint32_t -i2c_index_get(PinName sda) -{ - if ((sda == _PA_26) || (sda == _PB_6) || (sda == _PB_0)) { - return 0; - } else { - assert_param(0); - } - return 2; -} - -/** - * @brief Initializes the I2C device, include clock/function/I2C registers. - * @param obj: i2c object defined in application software. - * @param sda: SDA PinName according to pinmux spec. - * @param scl: SCL PinName according to pinmux spec. - * @retval none - */ -void i2c_init(i2c_t *obj, PinName sda, PinName scl) -{ - uint32_t i2c_idx = i2c_index_get(sda); - - //ConfigDebugErr &= (~(_DBG_I2C_|_DBG_GDMA_)); - //ConfigDebugInfo&= (~(_DBG_I2C_|_DBG_GDMA_)); - - DBG_8195A("i2c_idx:%x\n",i2c_idx); - - obj->i2c_idx = i2c_idx; - obj->I2Cx = I2C_DEV_TABLE[i2c_idx].I2Cx; - - /* Set I2C Device Number */ - I2CInitDat[obj->i2c_idx].I2CIdx = i2c_idx; - - /* Load I2C default value */ - I2C_StructInit(&I2CInitDat[obj->i2c_idx]); - - /* Assign I2C Pin Mux */ - I2CInitDat[obj->i2c_idx].I2CMaster = I2C_MASTER_MODE; - I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_SS_MODE; - I2CInitDat[obj->i2c_idx].I2CClk = 100; - I2CInitDat[obj->i2c_idx].I2CAckAddr = 0; - - /* Init I2C now */ - //if(I2CInitDat[obj->i2c_idx].I2CIdx == 0) { - //RCC_PeriphClockCmd(APBPeriph_I2C0, APBPeriph_I2C0_CLOCK, DISABLE); - //RCC_PeriphClockCmd(APBPeriph_I2C0, APBPeriph_I2C0_CLOCK, ENABLE); - //} else { - //RCC_PeriphClockCmd(APBPeriph_I2C1, APBPeriph_I2C1_CLOCK, DISABLE); - //RCC_PeriphClockCmd(APBPeriph_I2C1, APBPeriph_I2C1_CLOCK, ENABLE); - //} - - /* I2C Pin Mux Initialization */ - Pinmux_Config(sda, PINMUX_FUNCTION_I2C); - Pinmux_Config(scl, PINMUX_FUNCTION_I2C); - - PAD_PullCtrl(sda, GPIO_PuPd_UP); - PAD_PullCtrl(scl, GPIO_PuPd_UP); - /* I2C HAL Initialization */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - - /* I2C Enable Module */ - I2C_Cmd(obj->I2Cx, ENABLE); -} - -/** - * @brief Set i2c frequency. - * @param obj: i2c object defined in application software. - * @param hz: i2c clock(unit is Hz). - * @retval none - */ -void i2c_frequency(i2c_t *obj, int hz) -{ - uint16_t i2c_default_clk = (uint16_t) I2CInitDat[obj->i2c_idx].I2CClk; - uint16_t i2c_user_clk = (uint16_t) (hz/1000); - - if (i2c_default_clk != i2c_user_clk) { - /* Deinit I2C first */ - i2c_reset(obj); - if (i2c_user_clk <= 100) { - I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_SS_MODE; - } - else if ((i2c_user_clk > 100) && (i2c_user_clk <= 400)) { - I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_FS_MODE; - } - else if (i2c_user_clk > 400) { - I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_HS_MODE; - } - else { - I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_SS_MODE; - } - - /* Load the user defined I2C clock */ - I2CInitDat[obj->i2c_idx].I2CClk = i2c_user_clk; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } -} - -/** - * @brief Start i2c device. - * @param obj: i2c object defined in application software. - * @retval 0 - */ -inline int i2c_start(i2c_t *obj) -{ - /* To avoid gcc warnings */ - ( void ) obj; - - return 0; -} - -/** - * @brief Stop i2c device. - * @param obj: i2c object defined in application software. - * @retval 0 - */ -inline int i2c_stop(i2c_t *obj) -{ - /* To avoid gcc warnings */ - ( void ) obj; - return 0; -} - -/** - * @brief I2C master read in poll mode. - * @param obj: i2c object defined in application software. - * @param address: slave address which will be transmitted. - * @param data: point to the buffer to hold the received data. - * @param length: the length of data that to be received. - * @param stop: specifies whether a STOP is issued after all the bytes are received. - * @param timeout_ms: specifies timeout time, unit is ms. - * @retval the length of data received. If the retval less than the data length that want to be received, this transfer is not success. - */ -int i2c_read_timeout(i2c_t *obj, int address, char *data, int length, int stop, int timeout_ms) -{ - /* To avoid gcc warnings */ - ( void ) stop; - - if (i2c_target_addr[obj->i2c_idx] != address) { - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C target slave address */ - i2c_target_addr[obj->i2c_idx] = address; - I2CInitDat[obj->i2c_idx].I2CAckAddr = address; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } - - return (I2C_MasterRead_TimeOut(obj->I2Cx, (unsigned char*)data, length,timeout_ms)); - -} - -/** - * @brief I2C master wite in poll mode. - * @param obj: i2c object defined in application software. - * @param address: slave address which will be transmitted. - * @param data: point to the buffer to hold the received data. - * @param length: the length of data that to be received. - * @param stop: specifies whether a STOP is issued after all the bytes are written. - * @param timeout_ms: specifies timeout time, unit is ms. - * @note If the length equal to zero, will call I2C_MasterSendNullData_TimeOut() - * @retval the length of data written. If the retval less than the data length that want to be sent, this transfer is not success. - */ -int i2c_write_timeout(i2c_t *obj, int address, char *data, int length, int stop, int timeout_ms) -{ - /* To avoid gcc warnings */ - ( void ) stop; - - if (i2c_target_addr[obj->i2c_idx] != address) { - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C target slave address */ - i2c_target_addr[obj->i2c_idx] = address; - I2CInitDat[obj->i2c_idx].I2CAckAddr = address; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } - - if(!length) { - return (I2C_MasterSendNullData_TimeOut(obj->I2Cx, address, timeout_ms)); - } - - return (I2C_MasterWrite_TimeOut(obj->I2Cx, (unsigned char*)data, length,timeout_ms)); -} - -/** - * @brief I2C master read in poll mode. - * @param obj: i2c object defined in application software. - * @param address: slave address which will be transmitted. - * @param data: point to the buffer to hold the received data. - * @param length: the length of data that to be received. - * @param stop: specifies whether a STOP is issued after all the bytes are received. - * @retval the length of data received. - */ -int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) -{ - /* To avoid gcc warnings */ - ( void ) stop; - - if (i2c_target_addr[obj->i2c_idx] != address) { - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C target slave address */ - i2c_target_addr[obj->i2c_idx] = address; - I2CInitDat[obj->i2c_idx].I2CAckAddr = address; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } - - if (!master_addr_retry) { - I2C_MasterRead(obj->I2Cx, (unsigned char*)data, length); - } else { - while (0 == I2C_MasterRead_Patch(obj->I2Cx, (unsigned char*)data, length)) { - /* Wait for i2c enter trap state from trap_stop state*/ - DelayUs(100); - - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C target slave address */ - i2c_target_addr[obj->i2c_idx] = address; - I2CInitDat[obj->i2c_idx].I2CAckAddr = address; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } - } - - return length; -} - -/** - * @brief I2C master write in poll mode. - * @param obj: i2c object defined in application software. - * @param address: slave address which will be transmitted. - * @param data: point to the data to be sent. - * @param length: the length of data that to be sent. - * @param stop: specifies whether a STOP is issued after all the bytes are sent. - * @retval the length of data send. - */ -int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) -{ - if (i2c_target_addr[obj->i2c_idx] != address) { - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C target slave address */ - i2c_target_addr[obj->i2c_idx] = address; - I2CInitDat[obj->i2c_idx].I2CAckAddr = address; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } - - if ((!restart_enable) |(1==stop)) { - return (I2C_MasterWrite_Patch(obj->I2Cx, (unsigned char*)data, length)); - } else { - i2c_send_restart(obj->I2Cx, (unsigned char*)data, length, 1); - } - return length; -} - -/** - * @brief I2C master send data and read data in poll mode. - * @param obj: i2c object defined in application software. - * @param address: slave address which will be transmitted. - * @param pWriteBuf: point to the data to be sent. - * @param Writelen: the length of data that to be sent. - * @param pReadBuf: point to the buffer to hold the received data. - * @param Readlen: the length of data that to be received. - * @retval the length of data received. - */ -int i2c_repeatread(i2c_t *obj, int address, uint8_t *pWriteBuf, int Writelen, uint8_t *pReadBuf, int Readlen) -{ - u8 cnt = 0; - - if (i2c_target_addr[obj->i2c_idx] != address) { - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C target slave address */ - i2c_target_addr[obj->i2c_idx] = address; - I2CInitDat[obj->i2c_idx].I2CAckAddr = address; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } - - /* write in the DR register the data to be sent */ - for(cnt = 0; cnt < Writelen; cnt++) - { - while((I2C_CheckFlagState(obj->I2Cx, BIT_IC_STATUS_TFNF)) == 0); - - if(cnt >= Writelen - 1) - { - /*generate stop signal*/ - obj->I2Cx->IC_DATA_CMD = (*pWriteBuf++) | (1 << 10); - } - else - { - obj->I2Cx->IC_DATA_CMD = (*pWriteBuf++); - } - } - /*Wait I2C TX FIFO not full*/ - while((I2C_CheckFlagState(obj->I2Cx, BIT_IC_STATUS_TFNF)) == 0); - - I2C_MasterRead(obj->I2Cx, pReadBuf, Readlen); - - return Readlen; -} - -/** - * @brief I2C master restart after all bytes are sent. - * @param I2Cx: where I2Cx can be I2C0_DEV to select the I2C peripheral. - * @param pBuf: point to the data to be sent. - * @param len: the length of data that to be sent. - * @param restart: specifies whether a RESTART is issued after all the bytes are sent. - * @retval none - */ -void i2c_send_restart(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u8 restart) -{ - u32 cnt = 0; - - /* Check the parameters */ - assert_param(IS_I2C_ALL_PERIPH(I2Cx)); - - /* Write in the DR register the data to be sent */ - for(cnt = 0; cnt < len; cnt++) - { - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFNF)) == 0); - - if(cnt >= len - 1) - { - /*generate restart signal*/ - I2Cx->IC_DATA_CMD = (*pBuf++) | (restart << 10); - } - else - { - I2Cx->IC_DATA_CMD = (*pBuf++); - } - } - - while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFE)) == 0); -} - -/** - * @brief I2C master receive single byte. - * @param obj: i2c object defined in application software. - * @param last: hold the received data. - * @retval the data that received. - */ -int i2c_byte_read(i2c_t *obj, int last) -{ - /* To avoid gcc warnings */ - ( void ) last; - - uint8_t i2cdatlocal; - - I2C_MasterRead(obj->I2Cx, &i2cdatlocal, 1); - - return (int)i2cdatlocal; -} - -/** - * @brief I2C master send single byte. - * @param obj: i2c object defined in application software. - * @param data: the data to be sent. - * @retval result. - */ -int i2c_byte_write(i2c_t *obj, int data) -{ - uint8_t i2cdatlocal = data; - - I2C_MasterWrite(obj->I2Cx, &i2cdatlocal, 1); - - return 1; -} - -/** - * @brief Deinitializes the I2C device - * @param obj: i2c object defined in application software. - * @retval none - */ -void i2c_reset(i2c_t *obj) -{ - /* Deinit I2C directly */ - /* I2C HAL DeInitialization */ - I2C_Cmd(obj->I2Cx, DISABLE); -} - -/** - * @brief Enable i2c master RESTART function - * @param obj: i2c object defined in application software. - * @retval none - */ -void i2c_restart_enable(i2c_t *obj) -{ - uint32_t i2cen; - - if (obj->I2Cx->IC_ENABLE & BIT_CTRL_IC_ENABLE) { - I2C_Cmd(obj->I2Cx, DISABLE); - i2cen = 1; - } - - obj->I2Cx->IC_CON |= BIT_CTRL_IC_CON_IC_RESTART_EN; - - if (i2cen) { - I2C_Cmd(obj->I2Cx, ENABLE); - } - - restart_enable = 1; -} - -/** - * @brief Disable i2c Master RESTART function - * @param obj: i2c object defined in application software. - * @retval none - */ -void i2c_restart_disable(i2c_t *obj) -{ - uint32_t i2cen; - - if (obj->I2Cx->IC_ENABLE & BIT_CTRL_IC_ENABLE) { - I2C_Cmd(obj->I2Cx, DISABLE); - i2cen = 1; - } - - obj->I2Cx->IC_CON &= ~BIT_CTRL_IC_CON_IC_RESTART_EN; - - if (i2cen) { - I2C_Cmd(obj->I2Cx, ENABLE); - } - - restart_enable = 0; -} - -/** - * @brief Enable/Disable i2c Device - * @param obj: i2c object defined in application software. - * @param enable: this parameter can be one of the following values: - * @arg 0 disable - * @arg 1 enable - * @retval result - */ -int i2c_enable_control(i2c_t *obj, int enable) -{ - if (enable) { - I2C_Cmd(obj->I2Cx, ENABLE); - } else { - I2C_Cmd(obj->I2Cx, DISABLE); - } - return 0; -} - -//#if DEVICE_I2CSLAVE -/** - * @brief Set i2c slave address. - * @param obj: i2c object defined in application software. - * @param idx: i2c index, this parameter can be : - * @arg 0: I2C0 Device - * @param address: slave address. - * @param mask: the mask of address - * @retval none - */ -void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) -{ - /* To avoid gcc warnings */ - ( void ) idx; - ( void ) mask; - - uint16_t i2c_default_addr = (uint16_t) I2CInitDat[obj->i2c_idx].I2CAckAddr; - uint16_t i2c_user_addr = (uint16_t) address; - - if (i2c_default_addr != i2c_user_addr) { - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C clock */ - I2CInitDat[obj->i2c_idx].I2CAckAddr = i2c_user_addr; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); - } -} - -/** - * @brief Set i2c device to be slave. - * @param obj: i2c object defined in application software. - * @param enable_slave: enable slave function, this parameter can be one of the following values: - * @arg 0 disable - * @arg 1 enable - * @retval none - */ -void i2c_slave_mode(i2c_t *obj, int enable_slave) -{ - /* Deinit I2C first */ - i2c_reset(obj); - - /* Load the user defined I2C clock */ - I2CInitDat[obj->i2c_idx].I2CMaster = I2C_MASTER_MODE; - if (enable_slave) - I2CInitDat[obj->i2c_idx].I2CMaster = I2C_SLAVE_MODE; - - /* Init I2C now */ - I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); - I2C_Cmd(obj->I2Cx, ENABLE); -} - -/** - * @brief Get i2c slave state. - * @param obj: i2c object defined in application software. - * @retval the state of i2c slave. - */ -int i2c_slave_receive(i2c_t *obj) -{ - u32 I2CLocalTemp = I2C_GetRawINT(obj->I2Cx); - - if (I2CLocalTemp & BIT_IC_RAW_INTR_STAT_GEN_CALL) { - return WriteGeneral; - } - else if (I2CLocalTemp & BIT_IC_RAW_INTR_STAT_RD_REQ) { - return ReadAddressed; - } - - if (I2C_CheckFlagState(obj->I2Cx, BIT_IC_STATUS_RFNE)) { - return WriteAddressed; - } - return 0; -} - -/** - * @brief I2C slave read in poll mode. - * @param obj: i2c object defined in application software. - * @param data: point to the buffer to hold the received data. - * @param length: the length of data that to be received. - * @retval the length of data received. - */ -int i2c_slave_read(i2c_t *obj, char *data, int length) -{ - I2C_SlaveRead(obj->I2Cx, (unsigned char*)data, length); - - return length; -} - -/** - * @brief I2C slave write in poll mode. - * @param obj: i2c object defined in application software. - * @param data: point to the data to be sent. - * @param length: the length of data that to be sent. - * @retval result. - */ -int i2c_slave_write(i2c_t *obj, const char *data, int length) -{ - I2C_SlaveWrite(obj->I2Cx, (unsigned char*)data, length); - return 1; -} - -/** - * @brief Set/clear i2c slave RD_REQ interrupt mask. - * @param obj: i2c object defined in application software. - * @param set: set or clear for read request. - * @retval result. - */ -int i2c_slave_set_for_rd_req(i2c_t *obj, int set) -{ - if (set) { - I2C_INTConfig(obj->I2Cx, BIT_IC_INTR_MASK_M_RD_REQ, ENABLE); - } else { - I2C_INTConfig(obj->I2Cx, BIT_IC_INTR_MASK_M_RD_REQ, DISABLE); - } - - return _TRUE; -} - -/** - * @brief Set/clear i2c slave NAK or ACK data part in transfer. - * @param obj: i2c object defined in application software. - * @param set_nak: set or clear for data NAK. - * @retval result. - */ -int i2c_slave_set_for_data_nak(i2c_t *obj, int set_nak) -{ - I2C_TypeDef * I2Cx = obj->I2Cx; - u32 temp; - - while (1) { - temp = I2Cx->IC_STATUS; - - if ((BIT_IC_STATUS_SLV_ACTIVITY & temp) == 0) { - break; - } - } - - I2Cx->IC_SLV_DATA_NACK_ONLY = set_nak; - return 0; -} -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -//#endif // CONFIG_I2C_SLAVE_EN -/******************* (C) COPYRIGHT 2016 Realtek Semiconductor *****END OF FILE****/ +/** mbed Microcontroller Library + ****************************************************************************** + * @file i2c_api.c + * @author + * @version V1.0.0 + * @date 2016-08-01 + * @brief This file provides mbed API for I2C. + ****************************************************************************** + * @attention + * + * This module is a confidential and proprietary property of RealTek and + * possession or use of this module requires written permission of RealTek. + * + * Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. + ****************************************************************************** + */ +#include "objects.h" +#include "PinNames.h" +#include "i2c_api.h" + +#include "pinmap.h" + +// See I2CSlave.h +#define NoData 0 // the slave has not been addressed +#define ReadAddressed 1 // the master has requested a read from this slave (slave = transmitter) +#define WriteGeneral 2 // the master is writing to all slave +#define WriteAddressed 3 // the master is writing to this slave (slave = receiver) + +static uint16_t i2c_target_addr[2]; +extern u32 ConfigDebugErr; +extern u32 ConfigDebuginfo; +I2C_InitTypeDef I2CInitDat[2]; +static u32 restart_enable = 0; +static u32 master_addr_retry = 1; + +static u8 i2c_sel; //0: i2c 1:usi_i2c +static uint16_t usi_i2c_target_addr[2]; +USI_I2C_InitTypeDef USI_I2CInitDat[2]; + +/** @addtogroup AmebaD_Mbed_API + * @{ + */ + +/** @defgroup MBED_I2C + * @brief MBED_I2C driver modules. + * @{ + */ + +/** @defgroup MBED_I2C_Exported_Functions MBED_I2C Exported Functions + * @{ + */ +void i2c_send_restart(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u8 restart); +void usi_i2c_send_restart(USI_TypeDef *USI_I2Cx, u8* pBuf, u8 len, u8 restart); +/** + * @brief Read data with special length in master mode through the I2Cx peripheral under in-house IP. + * @param I2Cx: where I2Cx can be I2C0_DEV. + * @param pBuf: point to the buffer to hold the received data. + * @param len: the length of data that to be received. + * @note deal with condition that master send address while slave no ack + * @retval the length of data read. + */ +u32 I2C_MasterRead_Patch(I2C_TypeDef *I2Cx, u8* pBuf, u32 len) +{ + u32 cnt = 0; + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + /* read in the DR register the data to be received */ + for(cnt = 0; cnt < len; cnt++) { + if(cnt >= len - 1) { + /* generate stop singal */ + I2Cx->IC_DATA_CMD = 0x0003 << 8; + } else { + I2Cx->IC_DATA_CMD = 0x0001 << 8; + } + /* wait for I2C_FLAG_RFNE flag */ + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_RFNE)) == 0) { + if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { + DBG_8195A(" TX_ABRT\n"); + I2C_ClearAllINT(I2Cx); + return cnt; + } + } + *pBuf++ = (u8)I2Cx->IC_DATA_CMD; + } + return cnt; +} + +/** + * @brief Write data with special length in master mode through the I2Cx peripheral under in-house IP. + * @param I2Cx: where I2Cx can be I2C0_DEV. + * @param pBuf: point to the data to be transmitted. + * @param len: the length of data that send. + * @note deal with condition that master send address while slave no ack + * @retval the length of data send. + */ +u32 I2C_MasterWrite_Patch(I2C_TypeDef *I2Cx, u8* pBuf, u32 len) +{ + u32 cnt = 0; + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + /* Write in the DR register the data to be sent */ + for(cnt = 0; cnt < len; cnt++) + { + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFNF)) == 0); + + if(cnt >= len - 1) + { + /*generate stop signal*/ + I2Cx->IC_DATA_CMD = (*pBuf++) | (1 << 9); + } + else + { + I2Cx->IC_DATA_CMD = (*pBuf++); + } + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFE)) == 0) { + if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { + DBG_8195A(" TX_ABRT= %x\n",I2Cx->IC_TX_ABRT_SOURCE); + I2C_ClearAllINT(I2Cx); + return cnt; + } + } + } + return cnt; +} + +/** + * @brief Read data with special length in master mode through the I2Cx peripheral under in-house IP. + * @param I2Cx: where I2Cx can be I2C0_DEV . + * @param pBuf: point to the buffer to hold the received data. + * @param len: the length of data that to be received. + * @param timeout_ms: specifies timeout time, unit is ms. + * @retval the length of data read. + */ +int I2C_MasterRead_TimeOut(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u32 timeout_ms) +{ + int cnt = 0; + u32 InTimeoutCount = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + /* read in the DR register the data to be received */ + for(cnt = 0; cnt < len; cnt++) { + InTimeoutCount = timeout_ms*500; + + if(cnt >= len - 1) { + /* generate stop singal */ + I2Cx->IC_DATA_CMD = 0x0003 << 8; + } else { + I2Cx->IC_DATA_CMD = 0x0001 << 8; + } + + /* wait for I2C_FLAG_RFNE flag */ + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_RFNE)) == 0) { + if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { + DBG_8195A(" TX_ABRT\n"); + I2C_ClearAllINT(I2Cx); + return cnt; + } + + DelayUs(2); + + if (InTimeoutCount == 0) { + DBG_8195A("MasterRead_TimeOut\n"); + return cnt; + } + InTimeoutCount--; + } + + *pBuf++ = (u8)I2Cx->IC_DATA_CMD; + } + + return cnt; +} + +/** + * @brief Write data with special length in master mode through the I2Cx peripheral under in-house IP. + * @param I2Cx: where I2Cx can be I2C0_DEV. + * @param pBuf: point to the data to be transmitted. + * @param len: the length of data that to be received. + * @param timeout_ms: specifies timeout time, unit is ms. + * @retval the length of data send. + */ +int I2C_MasterWrite_TimeOut(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u32 timeout_ms) +{ + int cnt = 0; + u32 InTimeoutCount = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + /* Write in the DR register the data to be sent */ + for(cnt = 0; cnt < len; cnt++) + { + InTimeoutCount = timeout_ms*500; + + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFNF)) == 0); + + if(cnt >= len - 1) + { + /*generate stop signal*/ + I2Cx->IC_DATA_CMD = (*pBuf++) | (1 << 9); + } + else + { + I2Cx->IC_DATA_CMD = (*pBuf++); + } + + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFE)) == 0) { + if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { + DBG_8195A(" TX_ABRT\n"); + I2C_ClearAllINT(I2Cx); + return cnt; + } + + DelayUs(2); + + if (InTimeoutCount == 0) { + DBG_8195A("MasterWrite_TimeOut\n"); + return cnt; + } + InTimeoutCount--; + } + } + + return cnt; +} + +/** + * @brief Master sends single byte through the I2Cx peripheral to detect slave device. + * @param obj: i2c object defined in application software. + * @param address: the address of slave that to be detected. + * @param timeout_ms: specifies timeout time, unit is ms. + * @retval Slave ack condition: + * - 0: Slave available + * - -1: Slave not available + */ +int I2C_MasterSendNullData_TimeOut(I2C_TypeDef *I2Cx, int address, u32 timeout_ms) +{ + u8 I2CTemp = (u8)(address<<1); + I2C_MasterSendNullData(I2Cx, &I2CTemp, 0, 1, 0); + + DelayMs(timeout_ms); + + if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { + I2C_ClearAllINT(I2Cx); + + /* Wait for i2c enter trap state from trap_stop state*/ + DelayUs(100); + I2C_Cmd(I2Cx, DISABLE); + I2C_Cmd(I2Cx, ENABLE); + + return -1; + } + return 0; +} + +u8 USI_I2C_MasterRead_Patch(USI_TypeDef *USI_I2Cx, u8* pBuf, u8 len) +{ + u8 cnt = 0; + /* Check the parameters */ + assert_param(IS_USI_I2C_ALL_PERIPH(USI_I2Cx)); + + /* read in the DR register the data to be received */ + for(cnt = 0; cnt < len; cnt++) { + if(cnt >= len - 1) { + /* generate stop singal */ + USI_I2Cx->TX_FIFO_WRITE = 0x0003 << 8; + } else { + USI_I2Cx->TX_FIFO_WRITE = 0x0001 << 8; + } + /* wait for USI_I2C_FLAG_RFNE flag */ + + while((USI_I2Cx->RX_FIFO_STATUS&USI_RXFIFO_EMPTY) != 0){ + if(USI_I2C_GetRawINT(USI_I2Cx) & USI_I2C_TX_ABRT_RSTS) { + DBG_8195A(" TX_ABRT\n"); + USI_I2C_ClearAllINT(USI_I2Cx); + return cnt; + } + } + *pBuf++ = (u8)USI_I2Cx->RX_FIFO_READ; + } + return cnt; +} + +/** + * @brief Write data with special length in master mode through the USI_I2Cx peripheral under in-house IP. + * @param USI_I2Cx: where USI_I2Cx can be USI0_DEV. + * @param pBuf: point to the data to be transmitted. + * @param len: the length of data that send. + * @note deal with condition that master send address while slave no ack + * @retval the length of data send. + */ +u8 USI_I2C_MasterWrite_Patch(USI_TypeDef *USI_I2Cx, u8* pBuf, u8 len) +{ + u8 cnt = 0; + /* Check the parameters */ + assert_param(IS_USI_I2C_ALL_PERIPH(USI_I2Cx)); + + /* Write in the DR register the data to be sent */ + for(cnt = 0; cnt < len; cnt++) + { + while(USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_FULL != 0); + + if(cnt >= len - 1) + { + /*generate stop signal*/ + USI_I2Cx->TX_FIFO_WRITE= (*pBuf++) | (1 << 9); + } + else + { + USI_I2Cx->TX_FIFO_WRITE= (*pBuf++); + } + + while(USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_EMPTY == 0){ + if(USI_I2C_GetRawINT(USI_I2Cx) & USI_I2C_TX_ABRT_RSTS) { + DBG_8195A(" TX_ABRT= %x\n",USI_I2Cx->I2C_TX_ABRT_SOURCE); + USI_I2C_ClearAllINT(USI_I2Cx); + return cnt; + } + } + } + return cnt; +} + +/** + * @brief Read data with special length in master mode through the USI_I2Cx peripheral under in-house IP. + * @param USI_I2Cx: where USI_I2Cx can be USI0_DEV . + * @param pBuf: point to the buffer to hold the received data. + * @param len: the length of data that to be received. + * @param timeout_ms: specifies timeout time, unit is ms. + * @retval the length of data read. + */ +int USI_I2C_MasterRead_TimeOut(USI_TypeDef *USI_I2Cx, u8* pBuf, u8 len, u32 timeout_ms) +{ + int cnt = 0; + u32 InTimeoutCount = 0; + + /* Check the parameters */ + assert_param(IS_USI_I2C_ALL_PERIPH(USI_I2Cx)); + + /* read in the DR register the data to be received */ + for(cnt = 0; cnt < len; cnt++) { + InTimeoutCount = timeout_ms*500; + + if(cnt >= len - 1) { + /* generate stop singal */ + USI_I2Cx->TX_FIFO_WRITE= 0x0003 << 8; + } else { + USI_I2Cx->TX_FIFO_WRITE= 0x0001 << 8; + } + + /* wait for USI_I2C_FLAG_RFNE flag */ + while(USI_I2Cx->RX_FIFO_STATUS&USI_RXFIFO_EMPTY != 0){ + if(USI_I2C_GetRawINT(USI_I2Cx) & USI_I2C_TX_ABRT_RSTS) { + DBG_8195A(" TX_ABRT\n"); + USI_I2C_ClearAllINT(USI_I2Cx); + return cnt; + } + + DelayUs(2); + + if (InTimeoutCount == 0) { + DBG_8195A("MasterRead_TimeOut\n"); + return cnt; + } + InTimeoutCount--; + } + + *pBuf++ = (u8)USI_I2Cx->RX_FIFO_READ; + } + + return cnt; +} + +/** + * @brief Write data with special length in master mode through the USI_I2Cx peripheral under in-house IP. + * @param USI_I2Cx: where USI_I2Cx can be USI0_DEV. + * @param pBuf: point to the data to be transmitted. + * @param len: the length of data that to be received. + * @param timeout_ms: specifies timeout time, unit is ms. + * @retval the length of data send. + */ +int USI_I2C_MasterWrite_TimeOut(USI_TypeDef *USI_I2Cx, u8* pBuf, u8 len, u32 timeout_ms) +{ + int cnt = 0; + u32 InTimeoutCount = 0; + + /* Check the parameters */ + assert_param(IS_USI_I2C_ALL_PERIPH(USI_I2Cx)); + + /* Write in the DR register the data to be sent */ + for(cnt = 0; cnt < len; cnt++) + { + InTimeoutCount = timeout_ms*500; + + while(USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_FULL != 0); + + if(cnt >= len - 1) + { + /*generate stop signal*/ + USI_I2Cx->TX_FIFO_WRITE= (*pBuf++) | (1 << 9); + } + else + { + USI_I2Cx->TX_FIFO_WRITE= (*pBuf++); + } + while(USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_EMPTY == 0){ + if(USI_I2C_GetRawINT(USI_I2Cx) & USI_I2C_TX_ABRT_RSTS) { + DBG_8195A(" TX_ABRT\n"); + USI_I2C_ClearAllINT(USI_I2Cx); + return cnt; + } + + DelayUs(2); + + if (InTimeoutCount == 0) { + DBG_8195A("MasterWrite_TimeOut\n"); + return cnt; + } + InTimeoutCount--; + } + } + + return cnt; +} + +/** + * @brief Master sends single byte through the USI_I2Cx peripheral to detect slave device. + * @param obj: usi_i2c object defined in application software. + * @param address: the address of slave that to be detected. + * @param timeout_ms: specifies timeout time, unit is ms. + * @retval Slave ack condition: + * - 0: Slave available + * - -1: Slave not available + */ +int USI_I2C_MasterSendNullData_TimeOut(USI_TypeDef *USI_I2Cx, int address, u32 timeout_ms) +{ + u8 USI_I2CTemp = (u8)(address<<1); + USI_I2C_MasterSendNullData(USI_I2Cx, &USI_I2CTemp, 0, 1, 0); + + DelayMs(timeout_ms); + + if(USI_I2C_GetRawINT(USI_I2Cx) & USI_I2C_TX_ABRT_RSTS) { + USI_I2C_ClearAllINT(USI_I2Cx); + + /* Wait for usi_i2c enter trap state from trap_stop state*/ + DelayUs(100); + USI_I2C_Cmd(USI_I2Cx, DISABLE); + USI_I2C_Cmd(USI_I2Cx, ENABLE); + + return -1; + } + return 0; +} + +static void i2c_usi_sel(PinName sda) +{ + if ((sda == _PA_26) || (sda == _PB_6) || (sda == _PB_0)) { + i2c_sel = 0; + }else if((sda == _PA_24) || (sda == _PB_21)|| (sda == _PB_25)){ + i2c_sel = 1; + } +} + +/** + * @brief Get i2c index according to the SDA PinName. + * @param sda: SDA PinName according to pinmux spec. + * @retval i2c index: + * - 0: I2C0 Device + */ +static uint32_t +i2c_index_get(PinName sda) +{ + if(i2c_sel ==0){ + if ((sda == _PA_26) || (sda == _PB_6) || (sda == _PB_0)) { + return 0; + } else { + assert_param(0); + } + }else{ + if ((sda == _PA_24) || (sda == _PB_21)|| (sda == _PB_25)) { + return 0; + } else { + assert_param(0); + } + } + return 2; +} + +/** + * @brief Initializes the I2C device, include clock/function/I2C registers. + * @param obj: i2c object defined in application software. + * @param sda: SDA PinName according to pinmux spec. + * @param scl: SCL PinName according to pinmux spec. + * @retval none + */ +void i2c_init(i2c_t *obj, PinName sda, PinName scl) +{ + i2c_usi_sel(sda); + uint32_t i2c_idx = i2c_index_get(sda); + + //ConfigDebugErr &= (~(_DBG_I2C_|_DBG_GDMA_)); + //ConfigDebugInfo&= (~(_DBG_I2C_|_DBG_GDMA_)); + + DBG_8195A("i2c_idx:%x\n",i2c_idx); + + if(i2c_sel == 0){ + obj->i2c_idx = i2c_idx; + obj->I2Cx = I2C_DEV_TABLE[i2c_idx].I2Cx; + + /* Set I2C Device Number */ + I2CInitDat[obj->i2c_idx].I2CIdx = i2c_idx; + + /* Load I2C default value */ + I2C_StructInit(&I2CInitDat[obj->i2c_idx]); + + /* Assign I2C Pin Mux */ + I2CInitDat[obj->i2c_idx].I2CMaster = I2C_MASTER_MODE; + I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_SS_MODE; + I2CInitDat[obj->i2c_idx].I2CClk = 100; + I2CInitDat[obj->i2c_idx].I2CAckAddr = 0; + + /* Init I2C now */ + //if(I2CInitDat[obj->i2c_idx].I2CIdx == 0) { + //RCC_PeriphClockCmd(APBPeriph_I2C0, APBPeriph_I2C0_CLOCK, DISABLE); + //RCC_PeriphClockCmd(APBPeriph_I2C0, APBPeriph_I2C0_CLOCK, ENABLE); + //} else { + //RCC_PeriphClockCmd(APBPeriph_I2C1, APBPeriph_I2C1_CLOCK, DISABLE); + //RCC_PeriphClockCmd(APBPeriph_I2C1, APBPeriph_I2C1_CLOCK, ENABLE); + //} + + /* I2C Pin Mux Initialization */ + Pinmux_Config(sda, PINMUX_FUNCTION_I2C); + Pinmux_Config(scl, PINMUX_FUNCTION_I2C); + + PAD_PullCtrl(sda, GPIO_PuPd_UP); + PAD_PullCtrl(scl, GPIO_PuPd_UP); + /* I2C HAL Initialization */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + + /* I2C Enable Module */ + I2C_Cmd(obj->I2Cx, ENABLE); + + }else{ + obj->usi_i2c_idx = i2c_idx; + obj->USI_I2Cx = USI_DEV_TABLE[i2c_idx].USIx; + + /* Set USI_I2C Device Number */ + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CIdx = i2c_idx; + + /* Load USI_I2C default value */ + USI_I2C_StructInit(&USI_I2CInitDat[obj->usi_i2c_idx]); + + /* Assign USI_I2C Pin Mux */ + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CMaster = USI_I2C_MASTER_MODE; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CSpdMod = USI_I2C_SS_MODE; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CClk = 100; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = 0; + + /* USI_I2C Pin Mux Initialization */ + Pinmux_Config(sda, PINMUX_FUNCTION_I2C); + Pinmux_Config(scl, PINMUX_FUNCTION_I2C); + + PAD_PullCtrl(sda, GPIO_PuPd_UP); + PAD_PullCtrl(scl, GPIO_PuPd_UP); + /* USI_I2C HAL Initialization */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + + /* USI_I2C Enable Module */ + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } +} + +/** + * @brief Set i2c frequency. + * @param obj: i2c object defined in application software. + * @param hz: i2c clock(unit is Hz). + * @retval none + */ +void i2c_frequency(i2c_t *obj, int hz) +{ + if(i2c_sel == 0){ + uint16_t i2c_default_clk = (uint16_t) I2CInitDat[obj->i2c_idx].I2CClk; + uint16_t i2c_user_clk = (uint16_t) (hz/1000); + + if (i2c_default_clk != i2c_user_clk) { + /* Deinit I2C first */ + i2c_reset(obj); + if (i2c_user_clk <= 100) { + I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_SS_MODE; + } + else if ((i2c_user_clk > 100) && (i2c_user_clk <= 400)) { + I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_FS_MODE; + } + else if (i2c_user_clk > 400) { + I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_HS_MODE; + } + else { + I2CInitDat[obj->i2c_idx].I2CSpdMod = I2C_SS_MODE; + } + + /* Load the user defined I2C clock */ + I2CInitDat[obj->i2c_idx].I2CClk = i2c_user_clk; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + }else{ + uint16_t usi_i2c_default_clk = (uint16_t) USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CClk; + uint16_t usi_i2c_user_clk = (uint16_t) (hz/1000); + + if (usi_i2c_default_clk != usi_i2c_user_clk) { + /* Deinit USI_I2C first */ + i2c_reset(obj); + if (usi_i2c_user_clk <= 100) { + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CSpdMod = USI_I2C_SS_MODE; + } + else if ((usi_i2c_user_clk > 100) && (usi_i2c_user_clk <= 400)) { + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CSpdMod = USI_I2C_FS_MODE; + } + else if (usi_i2c_user_clk > 400) { + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CSpdMod = USI_I2C_HS_MODE; + } + else { + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CSpdMod = USI_I2C_SS_MODE; + } + DBG_8195A("usi_i2c_user_clk:%d\n",usi_i2c_user_clk); + /* Load the user defined USI_I2C clock */ + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CClk = usi_i2c_user_clk; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + } +} + +/** + * @brief Start i2c device. + * @param obj: i2c object defined in application software. + * @retval 0 + */ +inline int i2c_start(i2c_t *obj) +{ + /* To avoid gcc warnings */ + ( void ) obj; + + return 0; +} + +/** + * @brief Stop i2c device. + * @param obj: i2c object defined in application software. + * @retval 0 + */ +inline int i2c_stop(i2c_t *obj) +{ + /* To avoid gcc warnings */ + ( void ) obj; + return 0; +} + +/** + * @brief I2C master read in poll mode. + * @param obj: i2c object defined in application software. + * @param address: slave address which will be transmitted. + * @param data: point to the buffer to hold the received data. + * @param length: the length of data that to be received. + * @param stop: specifies whether a STOP is issued after all the bytes are received. + * @param timeout_ms: specifies timeout time, unit is ms. + * @retval the length of data received. If the retval less than the data length that want to be received, this transfer is not success. + */ +int i2c_read_timeout(i2c_t *obj, int address, char *data, int length, int stop, int timeout_ms) +{ + /* To avoid gcc warnings */ + ( void ) stop; + + if(i2c_sel == 0){ + if (i2c_target_addr[obj->i2c_idx] != address) { + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C target slave address */ + i2c_target_addr[obj->i2c_idx] = address; + I2CInitDat[obj->i2c_idx].I2CAckAddr = address; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + + return (I2C_MasterRead_TimeOut(obj->I2Cx, (unsigned char*)data, length,timeout_ms)); + }else{ + if (usi_i2c_target_addr[obj->usi_i2c_idx] != address) { + /* Deinit USI_I2C first */ + usi_i2c_reset(obj); + + /* Load the user defined USI_I2C target slave address */ + usi_i2c_target_addr[obj->usi_i2c_idx] = address; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = address; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + + return (USI_I2C_MasterRead_TimeOut(obj->USI_I2Cx, (unsigned char*)data, length,timeout_ms)); + } + +} + +/** + * @brief I2C master wite in poll mode. + * @param obj: i2c object defined in application software. + * @param address: slave address which will be transmitted. + * @param data: point to the buffer to hold the received data. + * @param length: the length of data that to be received. + * @param stop: specifies whether a STOP is issued after all the bytes are written. + * @param timeout_ms: specifies timeout time, unit is ms. + * @note If the length equal to zero, will call I2C_MasterSendNullData_TimeOut() + * @retval the length of data written. If the retval less than the data length that want to be sent, this transfer is not success. + */ +int i2c_write_timeout(i2c_t *obj, int address, char *data, int length, int stop, int timeout_ms) +{ + /* To avoid gcc warnings */ + ( void ) stop; + + if(i2c_sel == 0){ + if (i2c_target_addr[obj->i2c_idx] != address) { + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C target slave address */ + i2c_target_addr[obj->i2c_idx] = address; + I2CInitDat[obj->i2c_idx].I2CAckAddr = address; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + + if(!length) { + return (I2C_MasterSendNullData_TimeOut(obj->I2Cx, address, timeout_ms)); + } + + return (I2C_MasterWrite_TimeOut(obj->I2Cx, (unsigned char*)data, length,timeout_ms)); + }else{ + if (usi_i2c_target_addr[obj->usi_i2c_idx] != address) { + /* Deinit USI_I2C first */ + usi_i2c_reset(obj); + + /* Load the user defined USI_I2C target slave address */ + usi_i2c_target_addr[obj->usi_i2c_idx] = address; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = address; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + + if(!length) { + return (USI_I2C_MasterSendNullData_TimeOut(obj->USI_I2Cx, address, timeout_ms)); + } + + return (USI_I2C_MasterWrite_TimeOut(obj->USI_I2Cx, (unsigned char*)data, length,timeout_ms)); + } +} + +/** + * @brief I2C master read in poll mode. + * @param obj: i2c object defined in application software. + * @param address: slave address which will be transmitted. + * @param data: point to the buffer to hold the received data. + * @param length: the length of data that to be received. + * @param stop: specifies whether a STOP is issued after all the bytes are received. + * @retval the length of data received. + */ +int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) +{ + /* To avoid gcc warnings */ + ( void ) stop; + + if(i2c_sel == 0){ + if (i2c_target_addr[obj->i2c_idx] != address) { + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C target slave address */ + i2c_target_addr[obj->i2c_idx] = address; + I2CInitDat[obj->i2c_idx].I2CAckAddr = address; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + + if (!master_addr_retry) { + I2C_MasterRead(obj->I2Cx, (unsigned char*)data, length); + } else { + while (0 == I2C_MasterRead_Patch(obj->I2Cx, (unsigned char*)data, length)) { + /* Wait for i2c enter trap state from trap_stop state*/ + DelayUs(100); + + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C target slave address */ + i2c_target_addr[obj->i2c_idx] = address; + I2CInitDat[obj->i2c_idx].I2CAckAddr = address; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + } + return length; + }else{ + if (usi_i2c_target_addr[obj->usi_i2c_idx] != address) { + /* Deinit USI_I2C first */ + i2c_reset(obj); + + /* Load the user defined USI_I2C target slave address */ + usi_i2c_target_addr[obj->usi_i2c_idx] = address; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = address; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + + if (!master_addr_retry) { + USI_I2C_MasterRead(obj->USI_I2Cx, (unsigned char*)data, length); + } else { + while (0 == USI_I2C_MasterRead_Patch(obj->USI_I2Cx, (unsigned char*)data, length)) { + /* Wait for usi_i2c enter trap state from trap_stop state*/ + DelayUs(100); + /* Deinit USI_I2C first */ + i2c_reset(obj); + + /* Load the user defined USI_I2C target slave address */ + usi_i2c_target_addr[obj->usi_i2c_idx] = address; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = address; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + } + return length; + } +} + +/** + * @brief I2C master write in poll mode. + * @param obj: i2c object defined in application software. + * @param address: slave address which will be transmitted. + * @param data: point to the data to be sent. + * @param length: the length of data that to be sent. + * @param stop: specifies whether a STOP is issued after all the bytes are sent. + * @retval the length of data send. + */ +int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) +{ + if(i2c_sel == 0){ + if (i2c_target_addr[obj->i2c_idx] != address) { + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C target slave address */ + i2c_target_addr[obj->i2c_idx] = address; + I2CInitDat[obj->i2c_idx].I2CAckAddr = address; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + + if ((!restart_enable) |(1==stop)) { + return (I2C_MasterWrite_Patch(obj->I2Cx, (unsigned char*)data, length)); + } else { + i2c_send_restart(obj->I2Cx, (unsigned char*)data, length, 1); + } + return length; + }else{ + if (usi_i2c_target_addr[obj->usi_i2c_idx] != address) { + /* Deinit USI_I2C first */ + i2c_reset(obj); + + /* Load the user defined USI_I2C target slave address */ + usi_i2c_target_addr[obj->usi_i2c_idx] = address; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = address; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + + if ((!restart_enable) |(1==stop)) { + return (USI_I2C_MasterWrite_Patch(obj->USI_I2Cx, (unsigned char*)data, length)); + } else { + usi_i2c_send_restart(obj->USI_I2Cx, (unsigned char*)data, length, 1); + } + return length; + } +} + +/** + * @brief I2C master send data and read data in poll mode. + * @param obj: i2c object defined in application software. + * @param address: slave address which will be transmitted. + * @param pWriteBuf: point to the data to be sent. + * @param Writelen: the length of data that to be sent. + * @param pReadBuf: point to the buffer to hold the received data. + * @param Readlen: the length of data that to be received. + * @retval the length of data received. + */ +int i2c_repeatread(i2c_t *obj, int address, uint8_t *pWriteBuf, int Writelen, uint8_t *pReadBuf, int Readlen) +{ + u8 cnt = 0; + + if(i2c_sel == 0){ + if (i2c_target_addr[obj->i2c_idx] != address) { + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C target slave address */ + i2c_target_addr[obj->i2c_idx] = address; + I2CInitDat[obj->i2c_idx].I2CAckAddr = address; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + + /* write in the DR register the data to be sent */ + for(cnt = 0; cnt < Writelen; cnt++) + { + while((I2C_CheckFlagState(obj->I2Cx, BIT_IC_STATUS_TFNF)) == 0); + + if(cnt >= Writelen - 1) + { + /*generate stop signal*/ + obj->I2Cx->IC_DATA_CMD = (*pWriteBuf++) | (1 << 10); + } + else + { + obj->I2Cx->IC_DATA_CMD = (*pWriteBuf++); + } + } + /*Wait I2C TX FIFO not full*/ + while((I2C_CheckFlagState(obj->I2Cx, BIT_IC_STATUS_TFNF)) == 0); + + I2C_MasterRead(obj->I2Cx, pReadBuf, Readlen); + + return Readlen; + }else{ + if (usi_i2c_target_addr[obj->usi_i2c_idx] != address) { + /* Deinit USI_I2C first */ + usi_i2c_reset(obj); + + /* Load the user defined USI_I2C target slave address */ + usi_i2c_target_addr[obj->usi_i2c_idx] = address; + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = address; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + + /* write in the DR register the data to be sent */ + for(cnt = 0; cnt < Writelen; cnt++) + { + while(obj->USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_FULL != 0); + + if(cnt >= Writelen - 1) + { + /*generate stop signal*/ + obj->USI_I2Cx->TX_FIFO_WRITE= (*pWriteBuf++) | (1 << 10); + } + else + { + obj->USI_I2Cx->TX_FIFO_WRITE= (*pWriteBuf++); + } + } + /*Wait USI_I2C TX FIFO not full*/ + while(obj->USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_FULL != 0); + + USI_I2C_MasterRead(obj->USI_I2Cx, pReadBuf, Readlen); + + return Readlen; + + } +} + +/** + * @brief I2C master restart after all bytes are sent. + * @param I2Cx: where I2Cx can be I2C0_DEV to select the I2C peripheral. + * @param pBuf: point to the data to be sent. + * @param len: the length of data that to be sent. + * @param restart: specifies whether a RESTART is issued after all the bytes are sent. + * @retval none + */ +void i2c_send_restart(I2C_TypeDef *I2Cx, u8* pBuf, u32 len, u8 restart) +{ + u32 cnt = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + /* Write in the DR register the data to be sent */ + for(cnt = 0; cnt < len; cnt++) + { + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFNF)) == 0); + + if(cnt >= len - 1){ + /*generate restart signal*/ + I2Cx->IC_DATA_CMD = (*pBuf++) | (restart << 10); + }else{ + I2Cx->IC_DATA_CMD = (*pBuf++); + } + } + + while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_TFE)) == 0); +} + +/** + * @brief I2C master restart after all bytes are sent. + * @param I2Cx: where I2Cx can be USI0_DEV to select the I2C peripheral. + * @param pBuf: point to the data to be sent. + * @param len: the length of data that to be sent. + * @param restart: specifies whether a RESTART is issued after all the bytes are sent. + * @retval none + */ +void usi_i2c_send_restart(USI_TypeDef *USI_I2Cx, u8* pBuf, u8 len, u8 restart) +{ + u8 cnt = 0; + + /* Check the parameters */ + assert_param(IS_USI_I2C_ALL_PERIPH(USI_I2Cx)); + + /* Write in the DR register the data to be sent */ + for(cnt = 0; cnt < len; cnt++) + { + while(USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_FULL != 0); + + if(cnt >= len - 1) + { + /*generate restart signal*/ + USI_I2Cx->TX_FIFO_WRITE = (*pBuf++) | (restart << 10); + } + else + { + USI_I2Cx->TX_FIFO_WRITE = (*pBuf++); + } + } + while(USI_I2Cx->TX_FIFO_STATUS&USI_TXFIFO_EMPTY == 0); +} + +/** + * @brief I2C master receive single byte. + * @param obj: i2c object defined in application software. + * @param last: hold the received data. + * @retval the data that received. + */ +int i2c_byte_read(i2c_t *obj, int last) +{ + /* To avoid gcc warnings */ + ( void ) last; + + uint8_t i2cdatlocal; + + if(i2c_sel == 0){ + I2C_MasterRead(obj->I2Cx, &i2cdatlocal, 1); + }else{ + USI_I2C_MasterRead(obj->USI_I2Cx, &i2cdatlocal, 1); + } + + return (int)i2cdatlocal; +} + +/** + * @brief I2C master send single byte. + * @param obj: i2c object defined in application software. + * @param data: the data to be sent. + * @retval result. + */ +int i2c_byte_write(i2c_t *obj, int data) +{ + uint8_t i2cdatlocal = data; + + if(i2c_sel == 0){ + I2C_MasterWrite(obj->I2Cx, &i2cdatlocal, 1); + }else{ + USI_I2C_MasterRead(obj->USI_I2Cx, &i2cdatlocal, 1); + } + + return 1; +} + +/** + * @brief Deinitializes the I2C device + * @param obj: i2c object defined in application software. + * @retval none + */ +void i2c_reset(i2c_t *obj) +{ + /* Deinit I2C directly */ + /* I2C HAL DeInitialization */ + if(i2c_sel == 0){ + I2C_Cmd(obj->I2Cx, DISABLE); + }else{ + USI_I2C_Cmd(obj->USI_I2Cx, DISABLE); + } +} + +/** + * @brief Enable i2c master RESTART function + * @param obj: i2c object defined in application software. + * @retval none + */ +void i2c_restart_enable(i2c_t *obj) +{ + if(i2c_sel == 0){ + uint32_t i2cen; + + if (obj->I2Cx->IC_ENABLE & BIT_CTRL_IC_ENABLE) { + I2C_Cmd(obj->I2Cx, DISABLE); + i2cen = 1; + } + + obj->I2Cx->IC_CON |= BIT_CTRL_IC_CON_IC_RESTART_EN; + + if (i2cen) { + I2C_Cmd(obj->I2Cx, ENABLE); + } + + restart_enable = 1; + }else{ + uint32_t usi_i2cen; + + if (obj->USI_I2Cx->I2C_ENABLE & USI_I2C_ENABLE) { + USI_I2C_Cmd(obj->USI_I2Cx, DISABLE); + usi_i2cen = 1; + } + + obj->USI_I2Cx->I2C_CTRL|= USI_I2C_RESTART_EN; + + if (usi_i2cen) { + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + + restart_enable = 1; + } +} + +/** + * @brief Disable i2c Master RESTART function + * @param obj: i2c object defined in application software. + * @retval none + */ +void i2c_restart_disable(i2c_t *obj) +{ + if(i2c_sel == 0){ + uint32_t i2cen; + + if (obj->I2Cx->IC_ENABLE & BIT_CTRL_IC_ENABLE) { + I2C_Cmd(obj->I2Cx, DISABLE); + i2cen = 1; + } + + obj->I2Cx->IC_CON &= ~BIT_CTRL_IC_CON_IC_RESTART_EN; + + if (i2cen) { + I2C_Cmd(obj->I2Cx, ENABLE); + } + + restart_enable = 0; + }else{ + uint32_t usi_i2cen; + + if (obj->USI_I2Cx->I2C_ENABLE & USI_I2C_ENABLE) { + USI_I2C_Cmd(obj->USI_I2Cx, DISABLE); + usi_i2cen = 1; + } + + obj->USI_I2Cx->I2C_CTRL &= ~USI_I2C_RESTART_EN; + + if (usi_i2cen) { + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + + restart_enable = 0; + } +} + +/** + * @brief Enable/Disable i2c Device + * @param obj: i2c object defined in application software. + * @param enable: this parameter can be one of the following values: + * @arg 0 disable + * @arg 1 enable + * @retval result + */ +int i2c_enable_control(i2c_t *obj, int enable) +{ + if(i2c_sel == 0){ + if (enable) { + I2C_Cmd(obj->I2Cx, ENABLE); + } else { + I2C_Cmd(obj->I2Cx, DISABLE); + } + }else{ + if (enable) { + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } else { + USI_I2C_Cmd(obj->USI_I2Cx, DISABLE); + } + } + return 0; +} + +//#if DEVICE_I2CSLAVE +/** + * @brief Set i2c slave address. + * @param obj: i2c object defined in application software. + * @param idx: i2c index, this parameter can be : + * @arg 0: I2C0 Device + * @param address: slave address. + * @param mask: the mask of address + * @retval none + */ +void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) +{ + /* To avoid gcc warnings */ + ( void ) idx; + ( void ) mask; + + if(i2c_sel == 0){ + uint16_t i2c_default_addr = (uint16_t) I2CInitDat[obj->i2c_idx].I2CAckAddr; + uint16_t i2c_user_addr = (uint16_t) address; + + if (i2c_default_addr != i2c_user_addr) { + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C clock */ + I2CInitDat[obj->i2c_idx].I2CAckAddr = i2c_user_addr; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + } + }else{ + uint16_t usi_i2c_default_addr = (uint16_t) USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr; + uint16_t usi_i2c_user_addr = (uint16_t) address; + + if (usi_i2c_default_addr != usi_i2c_user_addr) { + /* Deinit USI_I2C first */ + i2c_reset(obj); + + /* Load the user defined USI_I2C clock */ + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CAckAddr = usi_i2c_user_addr; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } + } +} + +/** + * @brief Set i2c device to be slave. + * @param obj: i2c object defined in application software. + * @param enable_slave: enable slave function, this parameter can be one of the following values: + * @arg 0 disable + * @arg 1 enable + * @retval none + */ +void i2c_slave_mode(i2c_t *obj, int enable_slave) +{ + if(i2c_sel == 0){ + /* Deinit I2C first */ + i2c_reset(obj); + + /* Load the user defined I2C clock */ + I2CInitDat[obj->i2c_idx].I2CMaster = I2C_MASTER_MODE; + if (enable_slave) + I2CInitDat[obj->i2c_idx].I2CMaster = I2C_SLAVE_MODE; + + /* Init I2C now */ + I2C_Init(obj->I2Cx, &I2CInitDat[obj->i2c_idx]); + I2C_Cmd(obj->I2Cx, ENABLE); + }else{ + /* Deinit USI_I2C first */ + i2c_reset(obj); + + /* Load the user defined USI_I2C clock */ + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CMaster = USI_I2C_MASTER_MODE; + if (enable_slave) + USI_I2CInitDat[obj->usi_i2c_idx].USI_I2CMaster = USI_I2C_SLAVE_MODE; + + /* Init USI_I2C now */ + USI_I2C_Init(obj->USI_I2Cx, &USI_I2CInitDat[obj->usi_i2c_idx]); + USI_I2C_Cmd(obj->USI_I2Cx, ENABLE); + } +} + +/** + * @brief Get i2c slave state. + * @param obj: i2c object defined in application software. + * @retval the state of i2c slave. + */ +int i2c_slave_receive(i2c_t *obj) +{ + if(i2c_sel == 0){ + u32 I2CLocalTemp = I2C_GetRawINT(obj->I2Cx); + + if (I2CLocalTemp & BIT_IC_RAW_INTR_STAT_GEN_CALL) { + return WriteGeneral; + } + else if (I2CLocalTemp & BIT_IC_RAW_INTR_STAT_RD_REQ) { + return ReadAddressed; + } + + if (I2C_CheckFlagState(obj->I2Cx, BIT_IC_STATUS_RFNE)) { + return WriteAddressed; + } + return 0; + }else{ + u32 USI_I2CLocalTemp = USI_I2C_GetRawINT(obj->USI_I2Cx); + + if (USI_I2CLocalTemp & USI_I2C_GEN_CALL_RSTS) { + return WriteGeneral; + } + else if (USI_I2CLocalTemp & USI_I2C_RD_REQ_RSTS) { + return ReadAddressed; + } + + if (obj->USI_I2Cx->RX_FIFO_STATUS&USI_RXFIFO_EMPTY != 0) { + return WriteAddressed; + } + return 0; + } +} + +/** + * @brief I2C slave read in poll mode. + * @param obj: i2c object defined in application software. + * @param data: point to the buffer to hold the received data. + * @param length: the length of data that to be received. + * @retval the length of data received. + */ +int i2c_slave_read(i2c_t *obj, char *data, int length) +{ + if(i2c_sel == 0) + I2C_SlaveRead(obj->I2Cx, (unsigned char*)data, length); + else + USI_I2C_SlaveRead(obj->USI_I2Cx, (unsigned char*)data, length); + + return length; +} + +/** + * @brief I2C slave write in poll mode. + * @param obj: i2c object defined in application software. + * @param data: point to the data to be sent. + * @param length: the length of data that to be sent. + * @retval result. + */ +int i2c_slave_write(i2c_t *obj, const char *data, int length) +{ + if(i2c_sel == 0) + I2C_SlaveWrite(obj->I2Cx, (unsigned char*)data, length); + else + USI_I2C_SlaveWrite(obj->USI_I2Cx, (unsigned char*)data, length); + return 1; +} + +/** + * @brief Set/clear i2c slave RD_REQ interrupt mask. + * @param obj: i2c object defined in application software. + * @param set: set or clear for read request. + * @retval result. + */ +int i2c_slave_set_for_rd_req(i2c_t *obj, int set) +{ + if(i2c_sel == 0){ + if (set) { + I2C_INTConfig(obj->I2Cx, BIT_IC_INTR_MASK_M_RD_REQ, ENABLE); + } else { + I2C_INTConfig(obj->I2Cx, BIT_IC_INTR_MASK_M_RD_REQ, DISABLE); + } + }else{ + if (set) { + USI_I2C_INTConfig(obj->USI_I2Cx, USI_I2C_RD_REQ_INTER_EN, ENABLE); + } else { + USI_I2C_INTConfig(obj->USI_I2Cx, USI_I2C_RD_REQ_INTER_EN, DISABLE); + } + } + + return _TRUE; +} + +/** + * @brief Set/clear i2c slave NAK or ACK data part in transfer. + * @param obj: i2c object defined in application software. + * @param set_nak: set or clear for data NAK. + * @retval result. + */ +int i2c_slave_set_for_data_nak(i2c_t *obj, int set_nak) +{ + if(i2c_sel == 0){ + I2C_TypeDef * I2Cx = obj->I2Cx; + u32 temp; + + while (1) { + temp = I2Cx->IC_STATUS; + + if ((BIT_IC_STATUS_SLV_ACTIVITY & temp) == 0) { + break; + } + } + + I2Cx->IC_SLV_DATA_NACK_ONLY = set_nak; + return 0; + }else{ + USI_TypeDef * USI_I2Cx = obj->USI_I2Cx; + u32 temp; + + while (1) { + temp = USI_I2Cx->I2C_STATUS; + + if ((USI_I2C_SLV_ACTIVITY & temp) == 0) { + break; + } + } + + if(0 == set_nak){ + USI_I2Cx->I2C_SLV_ACK_CTRL &= (~USI_I2C_SLV_DATA_NACK_ONLY); + }else{ + USI_I2Cx->I2C_SLV_ACK_CTRL &= (USI_I2C_SLV_DATA_NACK_ONLY); + } + return 0; + } +} +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +//#endif // CONFIG_I2C_SLAVE_EN +/******************* (C) COPYRIGHT 2016 Realtek Semiconductor *****END OF FILE****/ diff --git a/Arduino_package/hardware/system/component/common/network/httpc/httpc.h b/Arduino_package/hardware/system/component/common/network/httpc/httpc.h index a7800f0a..1fe93d53 100644 --- a/Arduino_package/hardware/system/component/common/network/httpc/httpc.h +++ b/Arduino_package/hardware/system/component/common/network/httpc/httpc.h @@ -143,6 +143,14 @@ void httpc_enable_ignore_content_len(struct httpc_conn *conn); */ void httpc_set_http_1_0_request_used(uint8_t used); +/** + * @brief This function is used to set the maximum handling header size in httpc_response_read_header() + The default maximum size of http header is 1024 Bytes + * @param[in] size: the maximum size of http header + * @return None + */ +void httpc_set_header_size(size_t size); + /** * @brief This function is used to free memory allocated by httpc API, such as httpc_response_get_header_field(). * @param[in] ptr: pointer to memory to be deallocated diff --git a/Arduino_package/hardware/system/component/common/network/httpc/httpc_tls.c b/Arduino_package/hardware/system/component/common/network/httpc/httpc_tls.c index 9e1d9c97..2bd23f43 100644 --- a/Arduino_package/hardware/system/component/common/network/httpc/httpc_tls.c +++ b/Arduino_package/hardware/system/component/common/network/httpc/httpc_tls.c @@ -199,7 +199,11 @@ void *httpc_tls_new(int *sock, char *client_cert, char *client_key, char *ca_cer goto exit; } +#if CONFIG_MBEDTLS_VERSION3 == 1 + if((ret = mbedtls_pk_parse_key(&tls->key, (const unsigned char *) client_key, strlen(client_key) + 1, NULL, 0, rtw_get_random_bytes_f_rng, (void*)1 )) != 0) { +#else if((ret = mbedtls_pk_parse_key(&tls->key, (const unsigned char *) client_key, strlen(client_key) + 1, NULL, 0)) != 0) { +#endif printf("\n[HTTPC] ERROR: mbedtls_pk_parse_key %d\n", ret); ret = -1; goto exit; diff --git a/Arduino_package/hardware/system/component/common/network/httpd/httpd.h b/Arduino_package/hardware/system/component/common/network/httpd/httpd.h index 0fd10a72..eaee3067 100644 --- a/Arduino_package/hardware/system/component/common/network/httpd/httpd.h +++ b/Arduino_package/hardware/system/component/common/network/httpd/httpd.h @@ -160,6 +160,14 @@ int httpd_setup_cert(const char *server_cert, const char *server_key, const char */ int httpd_setup_user_password(char *user, char *password); +/** + * @brief This function is used to set the maximum handling header size in httpd_request_read_header() + The default maximum size of http header is 1024 Bytes + * @param[in] size: the maximum size of http header + * @return None + */ +void httpd_set_header_size(size_t size); + /** * @brief This function is used to free memory allocated by httpd API, such as httpd_request_get_header_field() and httpd_request_get_query_key(). * @param[in] ptr: pointer to memory to be deallocated diff --git a/Arduino_package/hardware/system/component/common/network/httpd/httpd_tls.c b/Arduino_package/hardware/system/component/common/network/httpd/httpd_tls.c index 208bad16..dfc40106 100644 --- a/Arduino_package/hardware/system/component/common/network/httpd/httpd_tls.c +++ b/Arduino_package/hardware/system/component/common/network/httpd/httpd_tls.c @@ -145,7 +145,11 @@ int httpd_tls_setup_init(const char *server_cert, const char *server_key, const goto exit; } +#if CONFIG_MBEDTLS_VERSION3 == 1 + if((ret = mbedtls_pk_parse_key(&httpd_key, (const unsigned char *) server_key, strlen(server_key) + 1, NULL, 0, rtw_get_random_bytes_f_rng, (void*)1 )) != 0) { +#else if((ret = mbedtls_pk_parse_key(&httpd_key, (const unsigned char *) server_key, strlen(server_key) + 1, NULL, 0)) != 0) { +#endif printf("\n[HTTPD] ERROR: mbedtls_pk_parse_key %d\n", ret); ret = -1; goto exit; diff --git a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/port/realtek/freertos/bridgeif_sdio.c b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/port/realtek/freertos/bridgeif_sdio.c index 4c1644be..2b4435f8 100644 --- a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/port/realtek/freertos/bridgeif_sdio.c +++ b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/port/realtek/freertos/bridgeif_sdio.c @@ -350,7 +350,7 @@ bridgeif_output(struct netif *netif, struct pbuf *p) return err; } -#include "linux_list.h" +#include "dlist.h" #define __TCP_NAT_RULE_NUMS 8 #define __UDP_NAT_RULE_NUMS 16 @@ -1417,7 +1417,7 @@ bridgeif_input(struct pbuf *p, struct netif *netif) bridgeif_validate_recv_packet(p, pattrib); if (pattrib->protocol == lwip_htons(ETH_P_IPV6)) { pbuf_free(p); - pbuf_free(pattrib); + free(pattrib); return ERR_VAL; } pattrib->port_idx = port->port_num; @@ -1443,7 +1443,7 @@ bridgeif_input(struct pbuf *p, struct netif *netif) dst->addr[0],dst->addr[1],dst->addr[2],dst->addr[3],dst->addr[4],dst->addr[5]); #endif pbuf_free(p); - pbuf_free(pattrib); + free(pattrib); return ERR_VAL; } } @@ -1517,12 +1517,16 @@ bridgeif_input(struct pbuf *p, struct netif *netif) q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_POOL); if (q == NULL) { LWIP_DEBUGF(BRIDGEIF_FW_DEBUG, ("%s,pbuf alloc failed!\n",__func__)); + + free(pattrib); return ERR_VAL; } if(ERR_OK != pbuf_copy(q, p)) { LWIP_DEBUGF(BRIDGEIF_FW_DEBUG, ("%s,pbuf copy failed!\n",__func__)); pbuf_free(q); + + free(pattrib); return ERR_VAL; } @@ -1563,6 +1567,8 @@ bridgeif_input(struct pbuf *p, struct netif *netif) #else /* yes, send to cpu port only */ LWIP_DEBUGF(BRIDGEIF_FW_DEBUG, ("br -> input(%p)\n", (void *)p)); + + free(pattrib); return br->netif->input(p, br->netif); #endif } diff --git a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/api/netdb.c b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/api/netdb.c index ccd9586f..6be30b2f 100644 --- a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/api/netdb.c +++ b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/api/netdb.c @@ -74,6 +74,9 @@ int h_errno; #define HOSTENT_STORAGE static #endif /* LWIP_DNS_API_STATIC_HOSTENT */ +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ +extern struct dns_table_entry dns_table[DNS_TABLE_SIZE]; +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ /** * Returns an entry containing addresses of address family AF_INET * for the host with name name. @@ -93,7 +96,11 @@ lwip_gethostbyname(const char *name) HOSTENT_STORAGE struct hostent s_hostent; HOSTENT_STORAGE char *s_aliases; HOSTENT_STORAGE ip_addr_t s_hostent_addr; +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ + HOSTENT_STORAGE ip_addr_t *s_phostent_addr[DNS_MAX_IP_ENTRIES]; +#else HOSTENT_STORAGE ip_addr_t *s_phostent_addr[2]; +#endif HOSTENT_STORAGE char s_hostname[DNS_MAX_NAME_LENGTH + 1]; /* query host IP address */ @@ -105,9 +112,21 @@ lwip_gethostbyname(const char *name) } /* fill hostent */ +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ + int i=0, j=0; + for (i = 0; i < DNS_TABLE_SIZE; ++i) { + if ((dns_table[i].state == DNS_STATES_DONE) && + (lwip_strnicmp(name, dns_table[i].name, sizeof(dns_table[i].name)) == 0)) { + for (j = 0; j < dns_table[i].dns_ip_entries; j++) + s_phostent_addr[j] = &dns_table[i].ipaddr[j]; + } + } + s_phostent_addr[j] = NULL; +#else s_hostent_addr = addr; s_phostent_addr[0] = &s_hostent_addr; s_phostent_addr[1] = NULL; +#endif strncpy(s_hostname, name, DNS_MAX_NAME_LENGTH); s_hostname[DNS_MAX_NAME_LENGTH] = 0; s_hostent.h_name = s_hostname; diff --git a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/core/dns.c b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/core/dns.c index 12c6f16f..0d31866b 100644 --- a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/core/dns.c +++ b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/core/dns.c @@ -219,6 +219,7 @@ typedef enum { DNS_STATE_DONE = 3 } dns_state_enum_t; +#if !LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ /** DNS table entry */ struct dns_table_entry { u32_t ttl; @@ -240,6 +241,7 @@ struct dns_table_entry { u8_t is_mdns; #endif }; +#endif /* !(LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP) */ /** DNS request table entry: used when dns_gehostbyname cannot answer the * request from the DNS table */ @@ -299,7 +301,11 @@ static struct udp_pcb *dns_pcbs[DNS_MAX_SOURCE_PORTS]; static u8_t dns_last_pcb_idx; #endif static u8_t dns_seqno; +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ +struct dns_table_entry dns_table[DNS_TABLE_SIZE]; +#else static struct dns_table_entry dns_table[DNS_TABLE_SIZE]; +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ static struct dns_req_entry dns_requests[DNS_MAX_REQUESTS]; static ip_addr_t dns_servers[DNS_MAX_SERVERS]; @@ -620,6 +626,19 @@ dns_lookup(const char *name, ip_addr_t *addr LWIP_DNS_ADDRTYPE_ARG(u8_t dns_addr /* Walk through name list, return entry if found. If not, return NULL. */ for (i = 0; i < DNS_TABLE_SIZE; ++i) { +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ + if ((dns_table[i].state == DNS_STATE_DONE) && + (lwip_strnicmp(name, dns_table[i].name, sizeof(dns_table[i].name)) == 0) && + LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, dns_table[i].ipaddr[0])) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_lookup: \"%s\": found = ", name)); + ip_addr_debug_print(DNS_DEBUG, &(dns_table[i].ipaddr[0])); + LWIP_DEBUGF(DNS_DEBUG, ("\n")); + if (addr) { + ip_addr_copy(*addr, dns_table[i].ipaddr[0]); + } + return ERR_OK; + } +#else if ((dns_table[i].state == DNS_STATE_DONE) && (lwip_strnicmp(name, dns_table[i].name, sizeof(dns_table[i].name)) == 0) && LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, dns_table[i].ipaddr)) { @@ -631,6 +650,7 @@ dns_lookup(const char *name, ip_addr_t *addr LWIP_DNS_ADDRTYPE_ARG(u8_t dns_addr } return ERR_OK; } +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ } return ERR_ARG; @@ -1139,6 +1159,9 @@ dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, struct dns_answer ans; struct dns_query qry; u16_t nquestions, nanswers; +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ + u8_t ip_entry = 0; +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(pcb); @@ -1236,11 +1259,17 @@ dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, if (pbuf_copy_partial(p, &ip4addr, sizeof(ip4_addr_t), res_idx) != sizeof(ip4_addr_t)) { goto memerr; /* ignore this packet */ } +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ + if (ip_entry < DNS_MAX_IP_ENTRIES) { + ip_addr_copy_from_ip4(dns_table[i].ipaddr[ip_entry], ip4addr); + } +#else ip_addr_copy_from_ip4(dns_table[i].ipaddr, ip4addr); pbuf_free(p); /* handle correct response */ dns_correct_response(i, lwip_ntohl(ans.ttl)); return; +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ } } #endif /* LWIP_IPV4 */ @@ -1255,21 +1284,40 @@ dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, if (pbuf_copy_partial(p, &ip6addr, sizeof(ip6_addr_t), res_idx) != sizeof(ip6_addr_t)) { goto memerr; /* ignore this packet */ } +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ + if (ip_entry < DNS_MAX_IP_ENTRIES) { + ip_addr_copy_from_ip6(dns_table[i].ipaddr[ip_entry], ip6addr); + } +#else ip_addr_copy_from_ip6(dns_table[i].ipaddr, ip6addr); pbuf_free(p); /* handle correct response */ dns_correct_response(i, lwip_ntohl(ans.ttl)); return; +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ } } #endif /* LWIP_IPV6 */ } +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ + --nanswers; + ip_entry++; + if((nanswers == 0) || (ip_entry >= DNS_MAX_IP_ENTRIES)) { + dns_table[i].dns_ip_entries = ip_entry; + pbuf_free(p); + /* handle correct response */ + dns_correct_response(i, lwip_ntohl(ans.ttl)); + return; + } +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ /* skip this answer */ if ((int)(res_idx + lwip_htons(ans.len)) > 0xFFFF) { goto memerr; /* ignore this packet */ } res_idx += lwip_htons(ans.len); +#if !LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ --nanswers; +#endif /* !(LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP) */ } #if LWIP_IPV4 && LWIP_IPV6 if ((entry->reqaddrtype == LWIP_DNS_ADDRTYPE_IPV4_IPV6) || diff --git a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/include/lwip/dns.h b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/include/lwip/dns.h index c470ba15..b748e705 100644 --- a/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/include/lwip/dns.h +++ b/Arduino_package/hardware/system/component/common/network/lwip/lwip_v2.0.2/src/include/lwip/dns.h @@ -92,6 +92,36 @@ extern const ip_addr_t dns_mquery_v4group; extern const ip_addr_t dns_mquery_v6group; #endif /* LWIP_IPV6 */ +#if LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP /* Added by Realtek */ +#define DNS_MAX_IP_ENTRIES 5 +#define DNS_STATES_DONE 3 + +/** DNS table entry */ +struct dns_table_entry { + u32_t ttl; + ip_addr_t ipaddr[DNS_MAX_IP_ENTRIES]; + u8_t dns_ip_entries; + u16_t txid; + u8_t state; + u8_t server_idx; + u8_t tmr; + u8_t retries; + u8_t seqno; +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) + u8_t pcb_idx; +#endif + char name[DNS_MAX_NAME_LENGTH]; +#if LWIP_IPV4 && LWIP_IPV6 + u8_t reqaddrtype; +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + u8_t is_mdns; +#endif +}; + +extern struct dns_table_entry dns_table[DNS_TABLE_SIZE]; +#endif /* LWIP_DNS_SUPPORT_RECV_MULTIPLE_IP */ + /** Callback which is invoked when a hostname is found. * A function of this type must be implemented by the application using the DNS resolver. * @param name pointer to the name that was looked up. diff --git a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/config_rsa.h b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/config_rsa.h index a1f40581..cedb244a 100644 --- a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/config_rsa.h +++ b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/config_rsa.h @@ -1043,7 +1043,7 @@ * * Comment this macro to disable 1/n-1 record splitting. */ -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING +#define MBEDTLS_SSL_CBC_RECORD_SPLITTING // some old version servers do not support this feature /** * \def MBEDTLS_SSL_RENEGOTIATION diff --git a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/gcm.h b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/gcm.h index 1b77aaed..923d17e6 100644 --- a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/gcm.h +++ b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/include/mbedtls/gcm.h @@ -50,6 +50,10 @@ typedef struct { unsigned char y[16]; /*!< Y working value */ unsigned char buf[16]; /*!< buf working value */ int mode; /*!< Encrypt or Decrypt */ +#ifdef RTL_HW_CRYPTO + unsigned int keybytes; + unsigned char key[32]; +#endif } mbedtls_gcm_context; diff --git a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher.c b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher.c index a8834386..bf1d2b1e 100644 --- a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher.c +++ b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher.c @@ -56,6 +56,8 @@ #define mbedtls_free free #endif +#include "device_lock.h" + #if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) #define MBEDTLS_CIPHER_MODE_STREAM #endif @@ -849,6 +851,18 @@ int mbedtls_cipher_auth_encrypt( mbedtls_cipher_context_t *ctx, if( MBEDTLS_MODE_GCM == ctx->cipher_info->mode ) { *olen = ilen; +#ifdef RTL_HW_CRYPTO + if(rom_ssl_ram_map.use_hw_crypto_func) + { + device_mutex_lock(RT_DEV_LOCK_CRYPTO); + int ret = mbedtls_gcm_crypt_and_tag( ctx->cipher_ctx, MBEDTLS_GCM_ENCRYPT, ilen, + iv, iv_len, ad, ad_len, input, output, + tag_len, tag ); + device_mutex_unlock(RT_DEV_LOCK_CRYPTO); + return ret; + } +#endif + return( mbedtls_gcm_crypt_and_tag( ctx->cipher_ctx, MBEDTLS_GCM_ENCRYPT, ilen, iv, iv_len, ad, ad_len, input, output, tag_len, tag ) ); diff --git a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher_wrap.c b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher_wrap.c index 1d1f9454..234c9c6e 100644 --- a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher_wrap.c +++ b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/cipher_wrap.c @@ -394,6 +394,15 @@ static const mbedtls_cipher_info_t aes_256_ctr_info = { static int gcm_aes_setkey_wrap( void *ctx, const unsigned char *key, unsigned int key_bitlen ) { +#ifdef RTL_HW_CRYPTO + if(rom_ssl_ram_map.use_hw_crypto_func) + { + device_mutex_lock(RT_DEV_LOCK_CRYPTO); + int ret = mbedtls_gcm_setkey( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_AES, key, key_bitlen ); + device_mutex_unlock(RT_DEV_LOCK_CRYPTO); + return ret; + } +#endif return mbedtls_gcm_setkey( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_AES, key, key_bitlen ); } diff --git a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/gcm.c b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/gcm.c index f1210c52..eb048c1f 100644 --- a/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/gcm.c +++ b/Arduino_package/hardware/system/component/common/network/ssl/mbedtls-2.4.0/library/gcm.c @@ -163,31 +163,49 @@ int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx, const unsigned char *key, unsigned int keybits ) { - int ret; - const mbedtls_cipher_info_t *cipher_info; + int ret; + const mbedtls_cipher_info_t *cipher_info; + + +#ifdef RTL_HW_CRYPTO + if(rom_ssl_ram_map.use_hw_crypto_func){ + switch(keybits) + { + case 128: ctx->keybytes = 16; break; + case 192: ctx->keybytes = 24; break; + case 256: ctx->keybytes = 32; break; + default : return(MBEDTLS_ERR_GCM_BAD_INPUT); + } + memcpy(ctx->key, key, ctx->keybytes); + + return 0; + } +#endif +#ifdef SUPPORT_HW_SW_CRYPTO + else{ + cipher_info = mbedtls_cipher_info_from_values( cipher, keybits, MBEDTLS_MODE_ECB ); + if( cipher_info == NULL ) + return( MBEDTLS_ERR_GCM_BAD_INPUT ); - cipher_info = mbedtls_cipher_info_from_values( cipher, keybits, MBEDTLS_MODE_ECB ); - if( cipher_info == NULL ) - return( MBEDTLS_ERR_GCM_BAD_INPUT ); + if( cipher_info->block_size != 16 ) + return( MBEDTLS_ERR_GCM_BAD_INPUT ); - if( cipher_info->block_size != 16 ) - return( MBEDTLS_ERR_GCM_BAD_INPUT ); + mbedtls_cipher_free( &ctx->cipher_ctx ); - mbedtls_cipher_free( &ctx->cipher_ctx ); + if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 ) + return( ret ); - if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 ) - return( ret ); + if( ( ret = mbedtls_cipher_setkey( &ctx->cipher_ctx, key, keybits, MBEDTLS_ENCRYPT ) ) != 0 ) + { + return( ret ); + } - if( ( ret = mbedtls_cipher_setkey( &ctx->cipher_ctx, key, keybits, - MBEDTLS_ENCRYPT ) ) != 0 ) - { - return( ret ); - } - - if( ( ret = gcm_gen_table( ctx ) ) != 0 ) - return( ret ); + if( ( ret = gcm_gen_table( ctx ) ) != 0 ) + return( ret ); + } +#endif - return( 0 ); + return( 0 ); } /* @@ -450,18 +468,41 @@ int mbedtls_gcm_crypt_and_tag( mbedtls_gcm_context *ctx, size_t tag_len, unsigned char *tag ) { - int ret; - - if( ( ret = mbedtls_gcm_starts( ctx, mode, iv, iv_len, add, add_len ) ) != 0 ) - return( ret ); - - if( ( ret = mbedtls_gcm_update( ctx, length, input, output ) ) != 0 ) - return( ret ); + int ret; + +#ifdef RTL_HW_CRYPTO + if(rom_ssl_ram_map.use_hw_crypto_func) + { + + if((ret = rom_ssl_ram_map.hw_crypto_aes_gcm_init( ctx->key, ctx->keybytes)) != 0 ){ + return( ret ); + } + + if(mode == MBEDTLS_GCM_ENCRYPT){ + if((ret = rom_ssl_ram_map.hw_crypto_aes_gcm_encrypt( input, length, iv, add, add_len, output, tag)) != 0 ){ + return( ret ); + } + } + else if(mode == MBEDTLS_GCM_DECRYPT){ + if((ret = rom_ssl_ram_map.hw_crypto_aes_gcm_decrypt( input, length, iv, add, add_len, output, tag)) != 0 ){ + return( ret ); + } + } + } +#endif +#ifdef SUPPORT_HW_SW_CRYPTO + else{ + if( ( ret = mbedtls_gcm_starts( ctx, mode, iv, iv_len, add, add_len ) ) != 0 ) + return( ret ); - if( ( ret = mbedtls_gcm_finish( ctx, tag, tag_len ) ) != 0 ) - return( ret ); + if( ( ret = mbedtls_gcm_update( ctx, length, input, output ) ) != 0 ) + return( ret ); - return( 0 ); + if( ( ret = mbedtls_gcm_finish( ctx, tag, tag_len ) ) != 0 ) + return( ret ); + } +#endif + return( 0 ); } int mbedtls_gcm_auth_decrypt( mbedtls_gcm_context *ctx, diff --git a/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/rom/rom_ssl_ram_map.h b/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/rom/rom_ssl_ram_map.h index fae2bd5d..41d0eba0 100644 --- a/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/rom/rom_ssl_ram_map.h +++ b/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/rom/rom_ssl_ram_map.h @@ -28,6 +28,15 @@ struct _rom_ssl_ram_map { const u8* message, const u32 msglen, const u8* iv, const u32 ivlen, u8* pResult); + int (*hw_crypto_aes_gcm_init)(const u8* key, const u32 keylen); + int (*hw_crypto_aes_gcm_encrypt)( + const u8* message, const u32 msglen, + const u8* iv, const u8 *aad, const u32 aadlen, + u8* pResult, u8* pTag); + int (*hw_crypto_aes_gcm_decrypt)( + const u8* message, const u32 msglen, + const u8* iv, const u8 *aad, const u32 aadlen, + u8* pResult, u8* pTag); //DES HW CRYPTO int (*hw_crypto_des_cbc_init)(const u8* key, const u32 keylen); @@ -78,6 +87,15 @@ struct _rom_mbedtls_ram_map { const u8* message, const u32 msglen, const u8* iv, const u32 ivlen, u8* pResult); + int (*hw_crypto_aes_gcm_init)(const u8* key, const u32 keylen); + int (*hw_crypto_aes_gcm_encrypt)( + const u8* message, const u32 msglen, + const u8* iv, const u8 *aad, const u32 aadlen, + u8* pResult, u8* pTag); + int (*hw_crypto_aes_gcm_decrypt)( + const u8* message, const u32 msglen, + const u8* iv, const u8 *aad, const u32 aadlen, + u8* pResult, u8* pTag); //DES HW CRYPTO int (*hw_crypto_des_cbc_init)(const u8* key, const u32 keylen); diff --git a/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/ssl_ram_map.c b/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/ssl_ram_map.c index 442861e2..28e28a4d 100644 --- a/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/ssl_ram_map.c +++ b/Arduino_package/hardware/system/component/common/network/ssl/ssl_ram_map/ssl_ram_map.c @@ -45,6 +45,15 @@ extern int rtl_crypto_3des_cbc_encrypt( IN const u8* message, IN const u32 msglen, IN const u8* iv, IN const u32 ivlen, OUT u8* pResult); +extern int rtl_crypto_aes_gcm_init(IN const u8* key, IN const u32 keylen); +extern int rtl_crypto_aes_gcm_encrypt( + IN const u8* message, IN const u32 msglen, + IN const u8* iv, IN const u8 *aad, IN const u32 aadlen, + OUT u8* pResult, OUT u8* pTag); +extern int rtl_crypto_aes_gcm_decrypt( + IN const u8* message, IN const u32 msglen, + IN const u8* iv, IN const u8 *aad, IN const u32 aadlen, + OUT u8* pResult, OUT u8* pTag); int platform_set_malloc_free( void * (*malloc_func)( size_t ), void (*free_func)( void * ) ) @@ -62,6 +71,10 @@ int platform_set_malloc_free( void * (*malloc_func)( size_t ), rom_ssl_ram_map.hw_crypto_aes_cbc_decrypt = rtl_crypto_aes_cbc_decrypt; rom_ssl_ram_map.hw_crypto_aes_cbc_encrypt = rtl_crypto_aes_cbc_encrypt; + rom_ssl_ram_map.hw_crypto_aes_gcm_init = rtl_crypto_aes_gcm_init; + rom_ssl_ram_map.hw_crypto_aes_gcm_encrypt = rtl_crypto_aes_gcm_encrypt; + rom_ssl_ram_map.hw_crypto_aes_gcm_decrypt = rtl_crypto_aes_gcm_decrypt; + #if !defined(CONFIG_PLATFORM_8710C) //DES HW CRYPTO rom_ssl_ram_map.hw_crypto_des_cbc_init = rtl_crypto_des_cbc_init; diff --git a/Arduino_package/hardware/system/component/common/network/websocket/wsserver_tls.c b/Arduino_package/hardware/system/component/common/network/websocket/wsserver_tls.c index ea62d3ab..37a1f567 100644 --- a/Arduino_package/hardware/system/component/common/network/websocket/wsserver_tls.c +++ b/Arduino_package/hardware/system/component/common/network/websocket/wsserver_tls.c @@ -150,7 +150,11 @@ int ws_server_tls_setup_init(const char *server_cert, const char *server_key, co goto exit; } +#if CONFIG_MBEDTLS_VERSION3 == 1 + if((ret = mbedtls_pk_parse_key(&wss_key, (const unsigned char *) server_key, strlen(server_key) + 1, NULL, 0, rtw_get_random_bytes_f_rng, (void*)1 )) != 0) { +#else if((ret = mbedtls_pk_parse_key(&wss_key, (const unsigned char *) server_key, strlen(server_key) + 1, NULL, 0)) != 0) { +#endif printf("\n[WS_SERVER] ERROR: mbedtls_pk_parse_key %d\n", ret); ret = -1; goto exit; diff --git a/Arduino_package/hardware/system/component/common/utilities/ssl_client.c b/Arduino_package/hardware/system/component/common/utilities/ssl_client.c index 69930a68..19924fc8 100644 --- a/Arduino_package/hardware/system/component/common/utilities/ssl_client.c +++ b/Arduino_package/hardware/system/component/common/utilities/ssl_client.c @@ -248,12 +248,20 @@ void cmd_ssl_client(int argc, char **argv) #elif CONFIG_USE_MBEDTLS /* CONFIG_USE_POLARSSL */ +#if defined(CONFIG_MBEDTLS_VERSION3) && (CONFIG_MBEDTLS_VERSION3 == 1) +#include "mbedtls/build_info.h" +#include "psa/crypto_types.h" +#include "psa/crypto_values.h" +#include "mbedtls/x509.h" +#else #include "mbedtls/config.h" +#endif #include "mbedtls/platform.h" #include "mbedtls/net_sockets.h" #include "mbedtls/ssl.h" #include "mbedtls/error.h" #include "mbedtls/debug.h" +#include "mbedtls/version.h" #if defined(configENABLE_TRUSTZONE) && (configENABLE_TRUSTZONE == 1) && defined(CONFIG_SSL_CLIENT_PRIVATE_IN_TZ) && (CONFIG_SSL_CLIENT_PRIVATE_IN_TZ == 1) #include "device_lock.h" @@ -499,13 +507,249 @@ static void ssl_client(void *param) *((int *) param) = ret; } +#define SERVER_NAME "www.google.com" +#define GTSR1_CA_PEM \ +"-----BEGIN CERTIFICATE-----\r\n" \ +"MIIFVzCCAz+gAwIBAgINAgPlk28xsBNJiGuiFzANBgkqhkiG9w0BAQwFADBHMQsw\r\n" \ +"CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU\r\n" \ +"MBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw\r\n" \ +"MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp\r\n" \ +"Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUA\r\n" \ +"A4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaMf/vo\r\n" \ +"27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vXmX7w\r\n" \ +"Cl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7zUjw\r\n" \ +"TcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0Pfybl\r\n" \ +"qAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtcvfaH\r\n" \ +"szVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4Zor8\r\n" \ +"Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zqkUspzBmk\r\n" \ +"MiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOORc92\r\n" \ +"wO1AK/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYWk70p\r\n" \ +"aDPvOmbsB4om3xPXV2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+DVrN\r\n" \ +"VjzRlwW5y0vtOUucxD/SVRNuJLDWcfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgFlQID\r\n" \ +"AQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E\r\n" \ +"FgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEMBQADggIBAJ+qQibb\r\n" \ +"C5u+/x6Wki4+omVKapi6Ist9wTrYggoGxval3sBOh2Z5ofmmWJyq+bXmYOfg6LEe\r\n" \ +"QkEzCzc9zolwFcq1JKjPa7XSQCGYzyI0zzvFIoTgxQ6KfF2I5DUkzps+GlQebtuy\r\n" \ +"h6f88/qBVRRiClmpIgUxPoLW7ttXNLwzldMXG+gnoot7TiYaelpkttGsN/H9oPM4\r\n" \ +"7HLwEXWdyzRSjeZ2axfG34arJ45JK3VmgRAhpuo+9K4l/3wV3s6MJT/KYnAK9y8J\r\n" \ +"ZgfIPxz88NtFMN9iiMG1D53Dn0reWVlHxYciNuaCp+0KueIHoI17eko8cdLiA6Ef\r\n" \ +"MgfdG+RCzgwARWGAtQsgWSl4vflVy2PFPEz0tv/bal8xa5meLMFrUKTX5hgUvYU/\r\n" \ +"Z6tGn6D/Qqc6f1zLXbBwHSs09dR2CQzreExZBfMzQsNhFRAbd03OIozUhfJFfbdT\r\n" \ +"6u9AWpQKXCBfTkBdYiJ23//OYb2MI3jSNwLgjt7RETeJ9r/tSQdirpLsQBqvFAnZ\r\n" \ +"0E6yove+7u7Y/9waLd64NnHi/Hm3lCXRSHNboTXns5lndcEZOitHTtNCjv0xyBZm\r\n" \ +"2tIMPNuzjsmhDYAPexZ3FL//2wmUspO8IFgV6dtxQ/PeEMMA3KgqlbbC1j+Qa3bb\r\n" \ +"bP6MvPJwNQzcmRk13NfIRmPVNnGuV/u3gm3c\r\n" \ +"-----END CERTIFICATE-----\r\n" +const unsigned char gtsr1_pem[] = GTSR1_CA_PEM; + +#if defined(CONFIG_MBEDTLS_VERSION3) && (CONFIG_MBEDTLS_VERSION3 == 1) +static void ssl_client_TLS13(void *param) +{ + printf("\n\r START example %s", __FUNCTION__); + int retry_count = 0; + int ret = 0; + int len, written, frags; + mbedtls_net_context server_fd; + unsigned char buf[1024]; + const char *pers = "ssl_client"; + + mbedtls_ssl_context ssl; + mbedtls_ssl_config conf; + uint32_t flags; + mbedtls_x509_crt cacert; + +#if defined(MBEDTLS_DEBUG_C) + mbedtls_debug_set_threshold(DEBUG_LEVEL); +#endif + + psa_status_t status; + status = psa_crypto_init(); + if( status != 0 ) { + printf("\r\n psa_crypto_init status = %d", status); + mbedtls_psa_crypto_free( ); + } + + /* + * Make sure memory references are valid. + */ + mbedtls_net_init( &server_fd ); + mbedtls_ssl_init( &ssl ); + mbedtls_ssl_config_init( &conf ); + mbedtls_x509_crt_init( &cacert ); + + /* + * 1. Load the trusted CA + */ + printf( "\n\r . Loading the CA root certificate ..." ); + ret = mbedtls_x509_crt_parse( &cacert, gtsr1_pem, sizeof(gtsr1_pem) ); + if( ret < 0 ) { + printf( " failed\n ! mbedtls_x509_crt_parse returned -0x%x\n\n", + (unsigned int) -ret ); + goto exit; + } + printf( " ok\n" ); + + /* + * 2. Setup stuff + */ + printf( "\n\r . Setting up the SSL/TLS structure..." ); + if( ( ret = mbedtls_ssl_config_defaults( &conf, + MBEDTLS_SSL_IS_CLIENT, + MBEDTLS_SSL_TRANSPORT_STREAM, + MBEDTLS_SSL_PRESET_DEFAULT ) ) != 0 ) { + printf( " failed\n ! mbedtls_ssl_config_defaults returned -0x%x\n\n", (unsigned int) -ret ); + goto exit; + } + + mbedtls_ssl_conf_rng( &conf, my_random, NULL ); + mbedtls_ssl_conf_dbg( &conf, my_debug, NULL ); + mbedtls_ssl_conf_read_timeout( &conf, 0 ); + mbedtls_ssl_conf_session_tickets( &conf, MBEDTLS_SSL_SESSION_TICKETS_ENABLED ); + mbedtls_ssl_conf_tls13_key_exchange_modes( &conf, MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_ALL ); + mbedtls_ssl_conf_renegotiation( &conf, MBEDTLS_SSL_RENEGOTIATION_DISABLED ); + mbedtls_ssl_conf_ca_chain( &conf, &cacert, NULL ); + mbedtls_ssl_conf_min_version( &conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_4 ); + mbedtls_ssl_conf_max_version( &conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_4 ); + + if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) { + printf( " failed\n ! mbedtls_ssl_setup returned -0x%x\n\n", (unsigned int) -ret ); + goto exit; + } + if( ( ret = mbedtls_ssl_set_hostname( &ssl, SERVER_NAME ) ) != 0 ) { + printf( " failed\n ! mbedtls_ssl_set_hostname returned %d\n\n", ret ); + goto exit; + } + mbedtls_ssl_set_bio(&ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL); + printf( " ok\n" ); + + /* + * 3. Start the connection + */ + printf("\n\r . Connecting to tcp/%s/%s...", SERVER_NAME, SERVER_PORT); + if( ( ret = mbedtls_net_connect( &server_fd, + SERVER_NAME, SERVER_PORT, MBEDTLS_NET_PROTO_TCP) ) != 0 ) { + printf( " failed\n ! mbedtls_net_connect returned -0x%x\n\n", (unsigned int) -ret ); + goto exit; + } + ret = mbedtls_net_set_block( &server_fd ); + if ( ret != 0 ) { + printf( " failed\n ! net_set_(non)block() returned -0x%x\n\n", (unsigned int) -ret ); + goto exit; + } + printf( " ok\n" ); + + /* + * 4. Handshake + */ + printf( "\n\r . Performing the SSL/TLS handshake..." ); + while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) { + if( ret != MBEDTLS_ERR_SSL_WANT_READ && + ret != MBEDTLS_ERR_SSL_WANT_WRITE && + ret != MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS ) { + printf( " failed\n ! mbedtls_ssl_handshake returned -0x%x\n", (unsigned int) -ret ); + goto exit; + } + } + printf( " ok\n [ Protocol is %s ]\n [ Ciphersuite is %s ]\n", + mbedtls_ssl_get_version( &ssl ), + mbedtls_ssl_get_ciphersuite( &ssl ) ); + + /* + * 5. Verify the server certificate + */ + printf( "\n\r . Verifying peer X.509 certificate..." ); + if( ( flags = mbedtls_ssl_get_verify_result( &ssl ) ) != 0 ) + printf( " server sertificate failed\n" ); + else + printf( " ok\n" ); + + /* + * 6. Write the GET request + */ + printf("\n\r > Write to server:"); + + len = sprintf((char *) buf, GET_REQUEST); + + while((ret = mbedtls_ssl_write(&ssl, buf, len)) <= 0) { + if(ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { + printf(" failed\n\r ! mbedtls_ssl_write returned %d\n", ret); + goto exit; + } + } + + len = ret; + printf(" %d bytes written\n\n%s", len, (char *) buf); + + /* + * 7. Read the HTTP response + */ + printf(" < Read from server:" ); + + do { + len = sizeof(buf) - 1; + memset(buf, 0, sizeof(buf)); + ret = mbedtls_ssl_read(&ssl, buf, len); + + if(ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) + continue; + + if(ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) + break; + + if(ret < 0) { + printf(" failed\n ! mbedtls_ssl_read returned %d\n", ret); + break; + } + + if(ret == 0) { + printf("\n\nEOF\n\n"); + break; + } + + len = ret; + printf(" %d bytes read\n\n%s", len, (char *) buf); + } + while(1); + + mbedtls_ssl_close_notify(&ssl); + printf( " ok\n" ); + +exit: + printf( "\r\n EXIT \r\n" ); + mbedtls_net_free( &server_fd ); + mbedtls_ssl_free( &ssl ); + mbedtls_ssl_config_free( &conf ); + mbedtls_x509_crt_free( &cacert ); + +exit1: + if(is_task) { +#if defined(INCLUDE_uxTaskGetStackHighWaterMark) && (INCLUDE_uxTaskGetStackHighWaterMark == 1) + printf("\n\rMin available stack size of %s = %d * %d bytes\n\r", __FUNCTION__, uxTaskGetStackHighWaterMark(NULL), sizeof(portBASE_TYPE)); +#endif + + if(min_heap_size > 0) + printf("\n\rMin available heap size = %d bytes during %s\n\r", min_heap_size, __FUNCTION__); + + vTaskDelete(NULL); + } + + if(param != NULL) + *((int *) param) = ret; +} +#endif + void start_ssl_client(void) { is_task = 1; //strcpy(server_host, SERVER_HOST); +#if defined(CONFIG_MBEDTLS_VERSION3) && (CONFIG_MBEDTLS_VERSION3 == 1) + if(xTaskCreate(ssl_client_TLS13, "ssl_client_TLS13", STACKSIZE, NULL, tskIDLE_PRIORITY + 1, NULL) != pdPASS) + printf("\n\r%s xTaskCreate failed", __FUNCTION__); +#else if(xTaskCreate(ssl_client, "ssl_client", STACKSIZE, NULL, tskIDLE_PRIORITY + 1, NULL) != pdPASS) printf("\n\r%s xTaskCreate failed", __FUNCTION__); +#endif } void do_ssl_connect(void) diff --git a/Arduino_package/hardware/system/component/common/utilities/ssl_client_ext.c b/Arduino_package/hardware/system/component/common/utilities/ssl_client_ext.c index 9ede6ec1..49915596 100644 --- a/Arduino_package/hardware/system/component/common/utilities/ssl_client_ext.c +++ b/Arduino_package/hardware/system/component/common/utilities/ssl_client_ext.c @@ -1,5 +1,6 @@ #include "FreeRTOS.h" #include "platform_opts.h" +#include #if CONFIG_USE_POLARSSL @@ -186,7 +187,11 @@ int ssl_client_ext_setup(ssl_context *ssl) #elif CONFIG_USE_MBEDTLS /* CONFIG_USE_POLARSSL */ +#if CONFIG_MBEDTLS_VERSION3 == 1 +#include "mbedtls/build_info.h" +#else #include "mbedtls/config.h" +#endif #include "mbedtls/platform.h" #include "mbedtls/ssl.h" @@ -371,8 +376,12 @@ int ssl_client_ext_setup(mbedtls_ssl_config *conf) _clikey_rsa = secure_mbedtls_pk_parse_key(); if(_clikey_rsa == NULL) return -1; +#else +#if CONFIG_MBEDTLS_VERSION3 == 1 + if(mbedtls_pk_parse_key(_clikey_rsa, test_client_key, strlen((char const*)test_client_key) + 1, NULL, 0, rtw_get_random_bytes_f_rng, (void*)1 ) != 0) #else if(mbedtls_pk_parse_key(_clikey_rsa, test_client_key, strlen((char const*)test_client_key) + 1, NULL, 0) != 0) +#endif return -1; #endif diff --git a/Arduino_package/hardware/system/component/os/freertos/freertos_heap5_config.c b/Arduino_package/hardware/system/component/os/freertos/freertos_heap5_config.c index 4ae1ec20..84c47ccb 100644 --- a/Arduino_package/hardware/system/component/os/freertos/freertos_heap5_config.c +++ b/Arduino_package/hardware/system/component/os/freertos/freertos_heap5_config.c @@ -143,8 +143,16 @@ static unsigned char psRAMHeap[configTOTAL_PSRAM_HEAP_SIZE]; #else #include "section_config.h" +#if (defined(configAUDIO_USE_SRAM_FOR_HEAP_REGION) && ( configAUDIO_USE_SRAM_FOR_HEAP_REGION == 1 )) + #define configAUDIO_SRAM_HEAP_SIZE (200*1024) SRAM_BF_DATA_SECTION - static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ]; + static unsigned char sRAMAudioHeap[configAUDIO_SRAM_HEAP_SIZE]; +#else + #define configAUDIO_SRAM_HEAP_SIZE (0) +#endif + + SRAM_BF_DATA_SECTION + static unsigned char ucHeap[ configTOTAL_HEAP_SIZE-configAUDIO_SRAM_HEAP_SIZE ]; HeapRegion_t xHeapRegions[] = { @@ -235,4 +243,15 @@ void os_heap_init(void) #endif #endif vPortDefineHeapRegions( xHeapRegions ); + +#if (defined(configAUDIO_USE_SRAM_FOR_HEAP_REGION) && ( configAUDIO_USE_SRAM_FOR_HEAP_REGION == 1 )) + { + HeapRegion_t xAudioHeapRegions[] = + { + { sRAMAudioHeap, sizeof(sRAMAudioHeap) }, + { NULL, 0 } // Terminates the array. + }; + RtSRAMHeapInit(xAudioHeapRegions); + } +#endif } diff --git a/Arduino_package/hardware/system/component/os/os_dep/include/osdep_service.h b/Arduino_package/hardware/system/component/os/os_dep/include/osdep_service.h index 3d3387b2..36e63ace 100644 --- a/Arduino_package/hardware/system/component/os/os_dep/include/osdep_service.h +++ b/Arduino_package/hardware/system/component/os/os_dep/include/osdep_service.h @@ -956,6 +956,7 @@ u64 rtw_modular64(u64 x, u64 y); * @return 0 */ int rtw_get_random_bytes(void* dst, u32 size); +int rtw_get_random_bytes_f_rng( void *p_rng, unsigned char *output, size_t output_size ); /** * @brief This function gets the available heap size. diff --git a/Arduino_package/hardware/system/component/os/os_dep/osdep_service.c b/Arduino_package/hardware/system/component/os/os_dep/osdep_service.c index ab7a67f4..5b4cf0c2 100644 --- a/Arduino_package/hardware/system/component/os/os_dep/osdep_service.c +++ b/Arduino_package/hardware/system/component/os/os_dep/osdep_service.c @@ -1072,6 +1072,12 @@ int rtw_get_random_bytes(void* dst, u32 size) return 0; } +int rtw_get_random_bytes_f_rng( void *p_rng, unsigned char *output, size_t output_size ) +{ + (void*)p_rng; + return rtw_get_random_bytes(output, output_size); +} + u32 rtw_getFreeHeapSize(void) { if(osdep_service.rtw_getFreeHeapSize) diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/app/monitor/ram/monitor_hp.c b/Arduino_package/hardware/system/component/soc/realtek/amebad/app/monitor/ram/monitor_hp.c index 1e905d77..fe066501 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/app/monitor/ram/monitor_hp.c +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/app/monitor/ram/monitor_hp.c @@ -11,6 +11,7 @@ #include "ameba_soc.h" #include "freertos_pmu.h" #include "rom_map.h" +#include "device_lock.h" KM4SLEEP_ParamDef dsleep_param; @@ -224,13 +225,17 @@ u32 cmd_efuse_protect(u16 argc, u8 *argv[]) EfuseBuf[index] = _2char2hex(DString[index*2], DString[index*2+1]); } + device_mutex_lock(RT_DEV_LOCK_EFUSE); EFUSE_LMAP_WRITE(Addr, Len, (u8 *)(EfuseBuf)); + device_mutex_unlock(RT_DEV_LOCK_EFUSE); } if (_strcmp((const char*)argv[0], "rmap") == 0) { MONITOR_LOG("efuse rmap \n"); + device_mutex_lock(RT_DEV_LOCK_EFUSE); ret = EFUSE_LMAP_READ(EfuseBuf); + device_mutex_unlock(RT_DEV_LOCK_EFUSE); if (ret == _FAIL) { MONITOR_LOG("EFUSE_LogicalMap_Read fail \n"); } @@ -249,7 +254,9 @@ u32 cmd_efuse_protect(u16 argc, u8 *argv[]) for (index = 0; index< EFUSE_REAL_CONTENT_LEN; index++) { if ((index < EFUSE_SECURE_START) || (index > EFUSE_SECURE_END)) { + device_mutex_lock(RT_DEV_LOCK_EFUSE); EFUSE_PMAP_READ8(0, index, EfuseBuf + index, L25EOUTVOLTAGE); + device_mutex_unlock(RT_DEV_LOCK_EFUSE); } else { EfuseBuf[index] = 0xFF; } @@ -293,7 +300,9 @@ u32 cmd_efuse_protect(u16 argc, u8 *argv[]) for (index = 0; index < Len; index++) { MONITOR_LOG("wraw: %x %x \n", Addr + index, EfuseBuf[index]); + device_mutex_lock(RT_DEV_LOCK_EFUSE); EFUSE_PMAP_WRITE8(0, Addr + index, EfuseBuf[index], L25EOUTVOLTAGE); + device_mutex_unlock(RT_DEV_LOCK_EFUSE); } } @@ -310,7 +319,7 @@ CmdCloseUltraLowPower( ( void ) argc; ( void ) argv; - wifi_config.wifi_ultra_low_power = FALSE; + rtk_wifi_config.wifi_ultra_low_power = FALSE; return _TRUE; } diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_efuse.h b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_efuse.h index 3fafe7f1..89f14bc0 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_efuse.h +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_efuse.h @@ -100,6 +100,7 @@ */ #define EFUSE_MAP_LEN_8711B 1024 /*!< logical map len in byte */ #define EFUSE_MAX_SECTION_8711B (EFUSE_MAP_LEN_8711B >> 3) /*!< logical map len in section */ +#define OTP_LMAP_LEN EFUSE_MAP_LEN_8711B #define PGPKT_DATA_SIZE 8 /*!< logical map section len */ /* logical EFUSE User area */ @@ -116,6 +117,7 @@ /* physical EFUSE len */ #define EFUSE_REAL_CONTENT_LEN 512 +#define OTP_REAL_CONTENT_LEN EFUSE_REAL_CONTENT_LEN #define AVAILABLE_EFUSE_ADDR(addr) (addr < EFUSE_REAL_CONTENT_LEN) /* physical EFUSE write forbid */ diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_pmc.h b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_pmc.h index cc51199e..0219bd93 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_pmc.h +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_pmc.h @@ -187,7 +187,7 @@ typedef struct } WIFICFG_TypeDef; extern PSCFG_TypeDef ps_config; -extern WIFICFG_TypeDef wifi_config; +extern WIFICFG_TypeDef rtk_wifi_config; void SOCPS_SetWakeEventAON(u32 Option, u32 NewStatus); void SOCPS_SleepCG_RAM(VOID); diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_syscfg.h b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_syscfg.h index f687b401..8a5e0e6f 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_syscfg.h +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_syscfg.h @@ -125,6 +125,14 @@ * @} */ +typedef enum IC_Version_Definition { + IC_VERSION_0 = 0, + IC_VERSION_1 = 1, + IC_VERSION_2 = 2, + IC_VERSION_3 = 3, + IC_VERSION_4 = 4, +} IC_VERSION_E; + /* Exported functions --------------------------------------------------------*/ /** @defgroup SYSCFG_Exported_Functions SYSCFG Exported Functions * @{ diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_common/rtl8721d_tim.c b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_common/rtl8721d_tim.c index 34ad9c3e..21bdac85 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_common/rtl8721d_tim.c +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_common/rtl8721d_tim.c @@ -315,6 +315,9 @@ void RTIM_CCxInit(RTIM_TypeDef* TIMx, TIM_CCInitTypeDef* TIM_CCInitStruct, u16 T assert_param(IS_TIM_OCPRELOAD_STATE(TIM_CCInitStruct->TIM_OCProtection)); assert_param(IS_TIM_CHANNEL(TIM_Channel)); + u32 Status; + u32 cr_bkp; + /* Reset the CCMR Bit */ TIMx->CCMRx[TIM_Channel] = 0; @@ -328,6 +331,33 @@ void RTIM_CCxInit(RTIM_TypeDef* TIMx, TIM_CCInitTypeDef* TIM_CCInitStruct, u16 T TIMx->CCMRx[TIM_Channel] = (TIM_CCInitStruct->TIM_CCPolarity | TIM_CCInitStruct->TIM_ICPulseMode); } + + /* Backup the value of Control Register */ + cr_bkp = TIMx->CR; + /* URS and UDIS must be 0 before generating UEV by setting UG bit */ + /* ONLY @AmebaD */ + RTIM_UpdateDisableConfig(TIMx, DISABLE); + RTIM_UpdateRequestConfig(TIMx, TIM_UpdateSource_Global); + + /* Generate an update event */ + /* 1) reload the CCRx immediatly */ + /* 2) hardware will clear this bit after reload, about 71.936 us (2*32k cycles) */ + /* 3) UEV will reset counter, and counter will start from 0 */ + /* 4) gen a interrupt if use TIM_UpdateSource_Global */ + TIMx->EGR = TIM_PSCReloadMode_Immediate; + + /* poll EGR UG done */ + while (1) { + if (TIMx->SR & TIM_SR_UG_DONE) { + break; + } + } + + Status = TIMx->SR; + TIMx->SR = Status; + + /* Restore the value of Control Register */ + TIMx->CR = cr_bkp; } /** diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_hp/rtl8721dhp_app_start.c b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_hp/rtl8721dhp_app_start.c index ecd2dffd..565a4374 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_hp/rtl8721dhp_app_start.c +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_hp/rtl8721dhp_app_start.c @@ -42,7 +42,7 @@ void app_section_init(void) u32 app_mpu_nocache_check(u32 mem_addr) { mpu_region_config mpu_cfg; - if (wifi_config.km4_cache_enable) { + if (rtk_wifi_config.km4_cache_enable) { mpu_cfg.region_base = (uint32_t)__ram_nocache_start__; mpu_cfg.region_size = __ram_nocache_end__-__ram_nocache_start__; } else { @@ -62,7 +62,7 @@ u32 app_mpu_nocache_init(void) u32 mpu_entry = 0; mpu_entry = mpu_entry_alloc(); - if (wifi_config.km4_cache_enable) { + if (rtk_wifi_config.km4_cache_enable) { mpu_cfg.region_base = (uint32_t)__ram_nocache_start__; mpu_cfg.region_size = __ram_nocache_end__-__ram_nocache_start__; } else { diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_lp/rtl8721dlp_app_start.c b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_lp/rtl8721dlp_app_start.c index dd81df6f..bfed11ab 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_lp/rtl8721dlp_app_start.c +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/ram_lp/rtl8721dlp_app_start.c @@ -214,11 +214,17 @@ VOID app_pmc_patch(VOID) HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP1_H, 0x202); HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP2_L, 0x1A0048B4); HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP2_H, 0x08088849); - HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP3_L, 0x021A4D4C); - HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP4_L, 0x0080645B); - HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP5_L, 0x121A4C64); - HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP5_H, 0x0805C300); - + if (ICversion <= 0x5) { + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP3_L, 0x021A4D4C); + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP4_L, 0x0080645B); + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP5_L, 0x121A4C64); + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP5_H, 0x0805C300); + } else { + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP3_L, 0x021A4D4D); + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP4_L, 0x0080645C); + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP5_L, 0x121A4C64); + HAL_WRITE32(SYSTEM_CTRL_BASE_LP, REG_SYSON_PMC_PATCH_GRP5_H, 0x0805D300); + } /* SPIC clock source switch patch */ app_load_patch_to_retention(); } diff --git a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/usrcfg/rtl8721d_wificfg.c b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/usrcfg/rtl8721d_wificfg.c index df17b5fb..eb882dba 100644 --- a/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/usrcfg/rtl8721d_wificfg.c +++ b/Arduino_package/hardware/system/component/soc/realtek/amebad/fwlib/usrcfg/rtl8721d_wificfg.c @@ -17,7 +17,7 @@ #include "ameba_soc.h" -WIFICFG_TypeDef wifi_config = +WIFICFG_TypeDef rtk_wifi_config = { .wifi_app_ctrl_tdma = FALSE, .wifi_ultra_low_power = FALSE, /* default is FALSE */ diff --git a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/build_info.h b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/build_info.h index 00091501..549bdb51 100644 --- a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/build_info.h +++ b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/build_info.h @@ -1,6 +1,6 @@ -#define UTS_VERSION "2022/07/05-18:12:16" -#define RTL_FW_COMPILE_TIME "2022/07/05-18:12:16" -#define RTL_FW_COMPILE_DATE "2022/07/05" +#define UTS_VERSION "2022/11/29-16:07:55" +#define RTL_FW_COMPILE_TIME "2022/11/29-16:07:55" +#define RTL_FW_COMPILE_DATE "2022/11/29" #define RTL_FW_COMPILE_BY "zhangzhenwu" #define RTL_FW_COMPILE_HOST "SGSD279634-PC" #define RTL_FW_COMPILE_DOMAIN "realtek-sg.com" diff --git a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_autoconf.h b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_autoconf.h index 7dc7863a..41710625 100644 --- a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_autoconf.h +++ b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_autoconf.h @@ -99,8 +99,8 @@ */ #define CONFIG_BT_EN 1 #define CONFIG_BT 1 -#undef CONFIG_BT_PERIPHERAL -#undef CONFIG_BT_CENTRAL +#define CONFIG_BT_PERIPHERAL 1 +#define CONFIG_BT_CENTRAL 1 #undef CONFIG_BT_SCATTERNET #undef CONFIG_BT_BEACON #define CONFIG_BT_CONFIG 1 @@ -162,10 +162,11 @@ #undef CONFIG_GUI_EN /* - * < Audio Config + * < Audio Config */ #undef CONFIG_AUDIO_EN #undef CONFIG_AUDIO_FWK +#undef CONFIG_MEDIA_PLAYER /* * To set debug msg flag diff --git a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts.h b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts.h index 902c4dcc..11b4c942 100644 --- a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts.h +++ b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts.h @@ -111,6 +111,7 @@ /* For SSL/TLS */ #define CONFIG_USE_POLARSSL 0 #define CONFIG_USE_MBEDTLS 1 +#define CONFIG_MBEDTLS_VERSION3 0 #if ((CONFIG_USE_POLARSSL == 0) && (CONFIG_USE_MBEDTLS == 0)) || ((CONFIG_USE_POLARSSL == 1) && (CONFIG_USE_MBEDTLS == 1)) #undef CONFIG_USE_POLARSSL #define CONFIG_USE_POLARSSL 1 diff --git a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts_bt.h b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts_bt.h index 29d41258..8c4abca1 100644 --- a/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts_bt.h +++ b/Arduino_package/hardware/system/project/realtek_amebaD_va0_example/inc/inc_hp/platform_opts_bt.h @@ -13,10 +13,6 @@ #define CONFIG_BT_CENTRAL 1 #endif -#if defined CONFIG_BT_CENTRAL && CONFIG_BT_CENTRAL -#define CONFIG_BT_USER_COMMAND 0 -#endif - #if ((defined CONFIG_BT_MESH_PROVISIONER && CONFIG_BT_MESH_PROVISIONER) || \ (defined CONFIG_BT_MESH_DEVICE && CONFIG_BT_MESH_DEVICE) || \ (defined CONFIG_BT_MESH_PROVISIONER_MULTIPLE_PROFILE && CONFIG_BT_MESH_PROVISIONER_MULTIPLE_PROFILE) || \ diff --git a/Arduino_package/hardware/variants/ameba_amb25_amb26/linker_scripts/gcc/amebad_img2_is_arduino.ld b/Arduino_package/hardware/variants/ameba_amb25_amb26/linker_scripts/gcc/amebad_img2_is_arduino.ld new file mode 100644 index 00000000..c2e1682a --- /dev/null +++ b/Arduino_package/hardware/variants/ameba_amb25_amb26/linker_scripts/gcc/amebad_img2_is_arduino.ld @@ -0,0 +1,221 @@ +ENTRY(Reset_Handler) + +INCLUDE "rom_symbol_ns.txt" + +MEMORY +{ + IROM (rx) : ORIGIN = 0x10100000, LENGTH = 0x1010A000 - 0x10100000 /* ROM: 40k */ + IROM_NS (rx) : ORIGIN = 0x1010A000, LENGTH = 0x10140000 - 0x1010A000 /* ROM: 216k */ + DROM_NS (rx) : ORIGIN = 0x101C0000, LENGTH = 0x101D4000 - 0x101C0000 /* ROM: 80k */ + DROM (rx) : ORIGIN = 0x101D4000, LENGTH = 0x101D8000 - 0x101D4000 /* ROM: 16k */ + ROMBSS_RAM_COM (rw) : ORIGIN = 0x10000000, LENGTH = 0x10001000 - 0x10000000 /* ROM BSS COMMON(S & NS both used) RAM: 4K */ + ROMBSS_RAM_NS (rw) : ORIGIN = 0x10001000, LENGTH = 0x10002000 - 0x10001000 /* ROM BSS NS RAM: 4K */ + RSVD_RAM_NS (rw) : ORIGIN = 0x10002000, LENGTH = 0x10004000 - 0x10002000 /* RSVD RAM: 8K */ + MSP_RAM_NS (rw) : ORIGIN = 0x10004000, LENGTH = 0x10005000 - 0x10004000 /* MSP_NS RAM: 4K */ + + BD_RAM_NS (rwx) : ORIGIN = 0x10005000, LENGTH = 0x1007C000 - 0x10005000 /* MAIN RAM NS: 456K */ + ROMBSS_RAM_S (rwx) : ORIGIN = 0x1007C000, LENGTH = 0x1007D000 - 0x1007C000 /* ROM BSS RAM S: 4K */ + BOOTLOADER_RAM_S (rwx) : ORIGIN = 0x1007D000, LENGTH = 0x1007F000 - 0x1007D000 /* BOOT Loader RAM: 8K */ + MSP_RAM_S (rwx) : ORIGIN = 0x1007F000, LENGTH = 0x10080000 - 0x1007F000 /* MSP_S RAM: 4k */ + EXTENTION_SRAM (rwx) : ORIGIN = 0x100E0000, LENGTH = 0x10100000 - 0x100E0000 /* EXTENTION SRAM: 128k */ + + PSRAM_NS (rwx) : ORIGIN = 0x02000000 + 0x20, LENGTH = 0x02400000 - 0x02000000 - 0x20 /* PSRAM_NS: 4M */ + + /* Flash */ + KM0_BOOT (rx) : ORIGIN = 0x08000000+0x20, LENGTH = 0x02000-0x20 /* XIPBOOT: 8k, 32 Bytes resvd for header*/ + BACKUP (r) : ORIGIN = 0x08002000, LENGTH = 0x1000 /* BACKUP: 4K system data in flash */ + XIPSYS (r) : ORIGIN = 0x08003000, LENGTH = 0x1000 /* XIPSYS: 4K system data in flash */ + KM4_BOOT (rx) : ORIGIN = 0x08004000+0x20, LENGTH = 0x02000-0x20 /* XIPBOOT: 8k, 32 Bytes resvd for header*/ + KM0_IMG2 (rx) : ORIGIN = 0x0C000000+0x20, LENGTH = 0x02000000-0x20 /* KM0_IMG2: 32MB, 32 Bytes resvd for header, virtual address */ + KM4_IMG2 (rx) : ORIGIN = 0x0E000000+0x20, LENGTH = 0x02000000-0x20 /* KM4_IMG2 OTA1: 32MB, 32 Bytes resvd for header, virtual address */ + BTRACE (rx) : ORIGIN = 0x00800000, LENGTH = 0x00C00000 -0x00800000 /* Bluetooth Trace */ + + /* KM0 RAM*/ + KM0_SRAM (rwx) : ORIGIN = 0x00080000, LENGTH = 0x00090000 - 0x00080000 /* KM0 SRAM: 64k */ + RETENTION_RAM (rwx) : ORIGIN = 0x000C0000, LENGTH = 0x000C0400 - 0x000C0000 /* KM0 Retention SRAM: 1k */ +} + +SECTIONS +{ + .rom.text : { } > IROM_NS + .rom.rodata : { } > DROM_NS + .hal.rom.bss : { } > ROMBSS_RAM_COM + .hal.ns_rom.bss : { } > ROMBSS_RAM_NS + + /* image2: normal image start */ + .ram_image2.entry : + { + __ram_image2_text_start__ = .; + __image2_entry_func__ = .; + KEEP(*(SORT(.image2.entry.data*))) + + __image2_validate_code__ = .; + KEEP(*(.image2.validate.rodata*)) + + } > BD_RAM_NS + + .ram_image2.text : + { + __ram_text_start__ = .; + *(.image2.ram.text*) + *(.image2.net.ram.text*) + __ram_text_end__ = .; + } > BD_RAM_NS + + .ram_image2.data : + { + __data_start__ = .; + *(.data*) + __data_end__ = .; + __ram_image2_text_end__ = .; + . = ALIGN(16); + } > BD_RAM_NS + + .ram_image2.bss : + { + __bss_start__ = .; + *(.bss*) + *(COMMON) + __bss_end__ = .; + } > BD_RAM_NS + + .ram_image2.nocache.data : + { + . = ALIGN (32); + __ram_nocache_start__ = .; + *(.bdsram.data*) + . = ALIGN (32); + __ram_nocache_end__ = .; + } > BD_RAM_NS + + .ram_heap.data : + { + . = ALIGN (32); + *(.bfsram.data*) + end = .; + *(.heap.stdlib*) + . = . + 4096; + __bfsram_end__ = .; + } > BD_RAM_NS + + .xip_image2.text : + { + __flash_text_start__ = .; + + *(.img2_custom_signature*) + + *(.text*) + /* *(.image2.net.ram.text*) */ + *(.rodata*) + + /* Add This for C++ support */ + . = ALIGN(4); + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + __fini_array_end = .; + /*-----------------*/ + + . = ALIGN (4); + __cmd_table_start__ = .; + KEEP(*(.cmd.table.data*)) + __cmd_table_end__ = .; + + __flash_text_end__ = .; + + . = ALIGN (16); + } > KM4_IMG2 + + /* Add This for C++ support */ + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + + } > KM4_IMG2 + + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + __exidx_end = .; +/* end = .; */ + } > KM4_IMG2 + + __wrap_printf = 0x1010a3f5; + __wrap_sprintf = 0x1010a471; + __wrap_strcat = 0x10111635; + __wrap_strchr = 0x10111745; + __wrap_strcmp = 0x10111745; + __wrap_strncmp = 0x101118f9; + __wrap_strlen = 0x10111839; + __wrap_strnlen = 0x10111a05; + __wrap_strncat = 0x1011189d; + __wrap_strpbrk = 0x10111a39; + __wrap_strstr = 0x10111d25; + __wrap_strtok = 0x1011201d; + __wrap_strsep = 0x10111a65; + __wrap_strtoll = 0x10111ffd; + __wrap_strtoul = 0x101122e9; + __wrap_strtoull = 0x10111f3d; + __wrap_atoi = 0x101115e1; + __wrap_strcpy = 0x101117b9; + __wrap_strncpy = 0x1011199d; + __wrap_memset = 0x10110ea1; + __wrap_memcpy = 0x10110d2d; + __wrap_memcmp = 0x10110cc9; + __wrap_memmove = 0x10110dd9; + __wrap_snprintf = 0x1010a49d; + __wrap_malloc = pvPortMalloc; + __wrap_realloc = pvPortReAlloc; + __wrap_free = vPortFree; + + /*-----------------*/ + + .bluetooth_trace.text : + { + __btrace_start__ = .; + *(.BTTRACE) + __btrace_end__ = .; + } > BTRACE + + /* PSRAM_NS image start */ + .psram_image2.text : + { + __psram_image2_text_start__ = .; + *(.psram.text*) + __psram_image2_text_end__ = .; + } > PSRAM_NS + + .psram_image2.data : + { + . = ALIGN (32); + *(.psram.data*) + . = ALIGN (32); + *(.psram.rodata*) + } > PSRAM_NS + + .psram_image2.bss : + { + . = ALIGN (32); + __psram_bss_start__ = .; + *(.psram.bss*) + __psram_bss_end__ = .; + } > PSRAM_NS + + .psram_heap.data : + { + . = ALIGN (32); + *(.psram.heap*) + } > PSRAM_NS +} + +__sram_end__ = ORIGIN(BD_RAM_NS) + LENGTH(BD_RAM_NS); diff --git a/Arduino_package/hardware/variants/awcu488_thingplus/linker_scripts/gcc/rom_symbol_ns.txt b/Arduino_package/hardware/variants/ameba_amb25_amb26/linker_scripts/gcc/rom_symbol_ns.txt similarity index 100% rename from Arduino_package/hardware/variants/awcu488_thingplus/linker_scripts/gcc/rom_symbol_ns.txt rename to Arduino_package/hardware/variants/ameba_amb25_amb26/linker_scripts/gcc/rom_symbol_ns.txt diff --git a/Arduino_package/hardware/variants/awcu488_thingplus/pins_arduino.h b/Arduino_package/hardware/variants/ameba_amb25_amb26/pins_arduino.h similarity index 100% rename from Arduino_package/hardware/variants/awcu488_thingplus/pins_arduino.h rename to Arduino_package/hardware/variants/ameba_amb25_amb26/pins_arduino.h diff --git a/Arduino_package/hardware/variants/ameba_amb25_amb26/variant.cpp b/Arduino_package/hardware/variants/ameba_amb25_amb26/variant.cpp new file mode 100644 index 00000000..e4d18ec9 --- /dev/null +++ b/Arduino_package/hardware/variants/ameba_amb25_amb26/variant.cpp @@ -0,0 +1,87 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* AMB25/AMB26 (RTL8720DF) */ + +#include "variant.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//#include "PinNames.h" +void __libc_init_array(void); + +/* + * Pins descriptions + */ +PinDescription g_APinDescription[TOTAL_GPIO_PIN_NUM]= +{ + {PA_15, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D0 + {PA_14, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D1 + {PA_13, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D2 + {PA_12, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D3 + {PA_30, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D4 + {PA_28, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D5 + {PA_26, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D6 + {PA_25, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D7 + {PA_27, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D8 + {PB_3, TYPE_DIGITAL | TYPE_ANALOG, PIO_GPIO | PIO_GPIO_IRQ | PIO_ADC, MODE_NOT_INITIAL}, // AMB_D9 + {PB_2, TYPE_DIGITAL | TYPE_ANALOG, PIO_GPIO | PIO_GPIO_IRQ | PIO_ADC, MODE_NOT_INITIAL}, // AMB_D10 + {PB_1, TYPE_DIGITAL | TYPE_ANALOG, PIO_GPIO | PIO_GPIO_IRQ | PIO_ADC, MODE_NOT_INITIAL}, // AMB_D11 + {PA_7, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D12 + {PA_8, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D13 + {PB_23, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D14 + {PB_22, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D15 + {PB_19, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D16 + {PB_18, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D17 + {PB_21, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D18 + {PB_20, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D19 +}; + +void *gpio_pin_struct[TOTAL_GPIO_PIN_NUM] = {NULL}; +void *gpio_irq_handler_list[TOTAL_GPIO_PIN_NUM] = {NULL}; + +#ifdef __cplusplus +} // extern C +#endif + +void serialEvent() __attribute__((weak)); +bool Serial_available() __attribute__((weak)); + +// ---------------------------------------------------------------------------- + +void serialEventRun(void) +{ + if (Serial_available && serialEvent && Serial_available()) serialEvent(); +} + +void init(void) +{ + // Initialize C library + __libc_init_array(); +} + +// ---------------------------------------------------------------------------- + +void wait_for_debug(void) { + while (((CoreDebug->DHCSR) & CoreDebug_DHCSR_C_DEBUGEN_Msk) == 0) { + asm("nop"); + } + delay(1000); +} diff --git a/Arduino_package/hardware/variants/ameba_amb25_amb26/variant.h b/Arduino_package/hardware/variants/ameba_amb25_amb26/variant.h new file mode 100644 index 00000000..20982ecd --- /dev/null +++ b/Arduino_package/hardware/variants/ameba_amb25_amb26/variant.h @@ -0,0 +1,123 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* AMB25/AMB26 (RTL8720DF) */ + +#ifndef _VARIANT_ARDUINO_AMEBA_ +#define _VARIANT_ARDUINO_AMEBA_ + +#include "Arduino.h" +#include + +#ifdef __cplusplus +extern "C"{ +#include "PinNames.h" + +#define portOutputRegister(P) ((volatile uint32_t *)(0x48014000 + (P) * 0x400)) +#define portInputRegister(P) ((volatile uint32_t *)(0x48014050 + (P) * 0x400)) +#define portModeRegister(P) ((volatile uint32_t *)(0x48014004 + (P) * 0x400)) + +/* + * Wait until enter debug mode + * + * Check DHCSR(0xE000EDF0) register and hold until bit C_DEBUGEN is set. + * Use this function along with J-LINK or other debug tool + **/ +extern void wait_for_debug(void); +} +#endif + +#define MAIN_THREAD_STACK_SIZE (4096 * 4) + +#define TOTAL_GPIO_PIN_NUM (20) +#define TOTAL_PWM_PIN_NUM (12) + +#define digitalPinToInterrupt(p) (((p) IROM_NS + .rom.rodata : { } > DROM_NS + .hal.rom.bss : { } > ROMBSS_RAM_COM + .hal.ns_rom.bss : { } > ROMBSS_RAM_NS + + /* image2: normal image start */ + .ram_image2.entry : + { + __ram_image2_text_start__ = .; + __image2_entry_func__ = .; + KEEP(*(SORT(.image2.entry.data*))) + + __image2_validate_code__ = .; + KEEP(*(.image2.validate.rodata*)) + + } > BD_RAM_NS + + .ram_image2.text : + { + __ram_text_start__ = .; + *(.image2.ram.text*) + *(.image2.net.ram.text*) + __ram_text_end__ = .; + } > BD_RAM_NS + + .ram_image2.data : + { + __data_start__ = .; + *(.data*) + __data_end__ = .; + __ram_image2_text_end__ = .; + . = ALIGN(16); + } > BD_RAM_NS + + .ram_image2.bss : + { + __bss_start__ = .; + *(.bss*) + *(COMMON) + __bss_end__ = .; + } > BD_RAM_NS + + .ram_image2.nocache.data : + { + . = ALIGN (32); + __ram_nocache_start__ = .; + *(.bdsram.data*) + . = ALIGN (32); + __ram_nocache_end__ = .; + } > BD_RAM_NS + + .ram_heap.data : + { + . = ALIGN (32); + *(.bfsram.data*) + end = .; + *(.heap.stdlib*) + . = . + 4096; + __bfsram_end__ = .; + } > BD_RAM_NS + + .xip_image2.text : + { + __flash_text_start__ = .; + + *(.img2_custom_signature*) + + *(.text*) + /* *(.image2.net.ram.text*) */ + *(.rodata*) + + /* Add This for C++ support */ + . = ALIGN(4); + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + __fini_array_end = .; + /*-----------------*/ + + . = ALIGN (4); + __cmd_table_start__ = .; + KEEP(*(.cmd.table.data*)) + __cmd_table_end__ = .; + + __flash_text_end__ = .; + + . = ALIGN (16); + } > KM4_IMG2 + + /* Add This for C++ support */ + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + + } > KM4_IMG2 + + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + __exidx_end = .; +/* end = .;*/ + } > KM4_IMG2 + + __wrap_printf = 0x1010a3f5; + __wrap_sprintf = 0x1010a471; + __wrap_strcat = 0x10111635; + __wrap_strchr = 0x10111745; + __wrap_strcmp = 0x10111745; + __wrap_strncmp = 0x101118f9; + __wrap_strlen = 0x10111839; + __wrap_strnlen = 0x10111a05; + __wrap_strncat = 0x1011189d; + __wrap_strpbrk = 0x10111a39; + __wrap_strstr = 0x10111d25; + __wrap_strtok = 0x1011201d; + __wrap_strsep = 0x10111a65; + __wrap_strtoll = 0x10111ffd; + __wrap_strtoul = 0x101122e9; + __wrap_strtoull = 0x10111f3d; + __wrap_atoi = 0x101115e1; + __wrap_strcpy = 0x101117b9; + __wrap_strncpy = 0x1011199d; + __wrap_memset = 0x10110ea1; + __wrap_memcpy = 0x10110d2d; + __wrap_memcmp = 0x10110cc9; + __wrap_memmove = 0x10110dd9; + __wrap_snprintf = 0x1010a49d; + __wrap_malloc = pvPortMalloc; + __wrap_realloc = pvPortReAlloc; + __wrap_free = vPortFree; + + /*-----------------*/ + + .bluetooth_trace.text : + { + __btrace_start__ = .; + *(.BTTRACE) + __btrace_end__ = .; + } > BTRACE + + /* PSRAM_NS image start */ + .psram_image2.text : + { + __psram_image2_text_start__ = .; + *(.psram.text*) + __psram_image2_text_end__ = .; + } > PSRAM_NS + + .psram_image2.data : + { + . = ALIGN (32); + *(.psram.data*) + . = ALIGN (32); + *(.psram.rodata*) + } > PSRAM_NS + + .psram_image2.bss : + { + . = ALIGN (32); + __psram_bss_start__ = .; + *(.psram.bss*) + __psram_bss_end__ = .; + } > PSRAM_NS + + .psram_heap.data : + { + . = ALIGN (32); + *(.psram.heap*) + } > PSRAM_NS +} + +__sram_end__ = ORIGIN(BD_RAM_NS) + LENGTH(BD_RAM_NS); diff --git a/Arduino_package/hardware/variants/u-blox_nora-w30/linker_scripts/gcc/rom_symbol_ns.txt b/Arduino_package/hardware/variants/u-blox_nora-w30/linker_scripts/gcc/rom_symbol_ns.txt new file mode 100644 index 00000000..7b539798 --- /dev/null +++ b/Arduino_package/hardware/variants/u-blox_nora-w30/linker_scripts/gcc/rom_symbol_ns.txt @@ -0,0 +1,677 @@ +SECTIONS +{ + __rom_bss_start__ = 0x10000000; + ConfigDebugClose = 0x10000000; + ConfigDebugBuffer = 0x10000004; + ConfigDebugBufferGet = 0x10000008; + ConfigDebug = 0x1000000c; + rand_first = 0x1000001c; + rand_seed = 0x10000020; + RBSS_UDELAY_DIV = 0x10000034; + flash_init_para = 0x10000038; + GDMA_Reg = 0x10000098; + PortA_IrqHandler = 0x1000009c; + PortA_IrqData = 0x1000011c; + PortB_IrqHandler = 0x1000019c; + PortB_IrqData = 0x1000021c; + IPC_IrqHandler = 0x1000029c; + IPC_IrqData = 0x1000031c; + IS_FPGA_VERIF = 0x1000039c; + crypto_engine = 0x100003a0; + __rom_bss_end__ = 0x10000564; + __rom_bss_start_ns__ = 0x10001000; + NewVectorTable = 0x10001000; + UserIrqFunTable = 0x10001140; + UserIrqDataTable = 0x10001240; + mpu_entry_register = 0x10001340; + p_rom_ssl_ram_map = 0x10001348; + rom_ssl_ram_map = 0x1000134c; + __rom_bss_end_ns__ = 0x1000138c; + __rom_bss_start_s__ = 0x1007c000; + __ram_start_table_start__ = 0x1007d000; + STACK_TOP = 0x1007effc; + __vectors_table = 0x1010a000; + Reset_Handler = 0x1010a101; + NMI_Handler = 0x1010a111; + HardFault_Handler = 0x1010a115; + MemManage_Handler = 0x1010a119; + BusFault_Handler = 0x1010a11d; + UsageFault_Handler = 0x1010a121; + SecureFault_Handler = 0x1010a125; + DiagVSprintf = 0x1010a12d; + DiagPrintf = 0x1010a3f5; + DiagPrintfD = 0x1010a445; + DiagSPrintf = 0x1010a471; + DiagSnPrintf = 0x1010a49d; + Rand = 0x1010a765; + Rand_Arc4 = 0x1010a7f1; + RandBytes_Get = 0x1010a825; + io_assert_failed = 0x1010a871; + BKUP_Write = 0x1010a891; + BKUP_Read = 0x1010a8b5; + BKUP_Set = 0x1010a8d5; + BKUP_Clear = 0x1010a8fd; + BOOT_Reason = 0x1010a929; + DelayNop = 0x1010a939; + DelayUs = 0x1010a949; + DelayMs = 0x1010a995; + EFUSEPowerSwitch = 0x1010a9a9; + EFUSERead8 = 0x1010aa31; + EFUSEWrite8 = 0x1010ab1d; + EFUSE_PG_Packet = 0x1010ac21; + EFUSE_LogicalMap_Read = 0x1010ae99; + EFUSE_LogicalMap_Write = 0x1010afad; + FLASH_RxData = 0x1010b195; + FLASH_TxCmd = 0x1010b29d; + FLASH_SW_CS_Control = 0x1010b329; + FLASH_SetSpiMode = 0x1010b37d; + FLASH_RxCmd = 0x1010b415; + FLASH_WaitBusy = 0x1010b479; + FLASH_WriteEn = 0x1010b4f9; + FLASH_TxData256B = 0x1010b51d; + FLASH_TxData12B = 0x1010b60d; + FLASH_SetStatus = 0x1010b6ed; + FLASH_Erase = 0x1010b70d; + FLASH_DeepPowerDown = 0x1010b7b9; + FLASH_SetStatusBits = 0x1010b809; + FLASH_StructInit_Micron = 0x1010b8dd; + FLASH_StructInit_MXIC = 0x1010b98d; + FLASH_StructInit_GD = 0x1010ba39; + FLASH_StructInit = 0x1010baed; + FLASH_Init = 0x1010bba1; + GDMA_StructInit = 0x1010bc25; + GDMA_SetLLP = 0x1010bc45; + GDMA_ClearINTPendingBit = 0x1010bcd9; + GDMA_ClearINT = 0x1010bda5; + GDMA_INTConfig = 0x1010be75; + GDMA_Cmd = 0x1010bf91; + GDMA_Init = 0x1010bff9; + GDMA_ChCleanAutoReload = 0x1010c14d; + GDMA_SetSrcAddr = 0x1010c1d1; + GDMA_GetSrcAddr = 0x1010c221; + GDMA_GetDstAddr = 0x1010c26d; + GDMA_SetDstAddr = 0x1010c2b9; + GDMA_SetBlkSize = 0x1010c309; + GDMA_GetBlkSize = 0x1010c369; + GDMA_ChnlRegister = 0x1010c3b9; + GDMA_ChnlUnRegister = 0x1010c401; + GDMA_ChnlAlloc = 0x1010c43d; + GDMA_ChnlFree = 0x1010c4d9; + GDMA_GetIrqNum = 0x1010c565; + GPIO_INTMode = 0x1010c5a9; + GPIO_INTConfig = 0x1010c641; + GPIO_INTHandler = 0x1010c679; + GPIO_Direction = 0x1010c721; + GPIO_Init = 0x1010c755; + GPIO_DeInit = 0x1010c7e1; + GPIO_ReadDataBit = 0x1010c84d; + GPIO_WriteBit = 0x1010c871; + GPIO_PortDirection = 0x1010c8a1; + GPIO_PortRead = 0x1010c8c5; + GPIO_PortWrite = 0x1010c8d5; + GPIO_UserRegIrq = 0x1010c8ed; + IPC_INTConfig = 0x1010c925; + IPC_IERSet = 0x1010c939; + IPC_IERGet = 0x1010c93d; + IPC_INTRequest = 0x1010c941; + IPC_INTClear = 0x1010c94d; + IPC_INTGet = 0x1010c959; + IPC_CPUID = 0x1010c95d; + IPC_SEMGet = 0x1010c969; + IPC_SEMFree = 0x1010c9b9; + IPC_INTHandler = 0x1010ca21; + IPC_INTUserHandler = 0x1010ca61; + LOGUART_StructInit = 0x1010ca9d; + LOGUART_Init = 0x1010cab5; + LOGUART_PutChar = 0x1010caf5; + LOGUART_GetChar = 0x1010cb29; + LOGUART_Readable = 0x1010cb45; + LOGUART_GetIMR = 0x1010cb59; + LOGUART_SetIMR = 0x1010cb65; + LOGUART_WaitBusy = 0x1010cb71; + LOGUART_SetBaud = 0x1010cb91; + mpu_enable = 0x1010cbd5; + mpu_disable = 0x1010cbed; + mpu_init = 0x1010cc01; + mpu_set_mem_attr = 0x1010cc3d; + mpu_region_cfg = 0x1010ccb1; + mpu_entry_free = 0x1010cdb5; + mpu_entry_alloc = 0x1010cdc1; + RSIP_Cmd = 0x1010cde9; + RSIP_OTF_init = 0x1010ce05; + RSIP_OTF_Cmd = 0x1010ce6d; + RSIP_OTF_Mask = 0x1010ce81; + RSIP_KEY_Request = 0x1010cec9; + RSIP_MMU_Config = 0x1010cf0d; + RSIP_MMU_Cmd = 0x1010cf31; + PAD_DrvStrength = 0x1010cf51; + PAD_PullCtrl = 0x1010cf6d; + PAD_CMD = 0x1010cf99; + Pinmux_Config = 0x1010cfb9; + Pinmux_ConfigGet = 0x1010cfd9; + Pinmux_UartLogCtrl = 0x1010cfe9; + Pinmux_SpicCtrl = 0x1010d03d; + simulation_bit_index = 0x1010d181; + simulation_stage_set = 0x1010d199; + SYSTIMER_Init = 0x1010d1c5; + SYSTIMER_TickGet = 0x1010d215; + SYSTIMER_GetPassTime = 0x1010d225; + RTIM_TimeBaseStructInit = 0x1010d255; + RTIM_Cmd = 0x1010d26d; + RTIM_GetCount = 0x1010d2f5; + RTIM_INTConfig = 0x1010d361; + RTIM_INTClear = 0x1010d3f1; + RTIM_TimeBaseInit = 0x1010d45d; + RTIM_DeInit = 0x1010d595; + RTIM_INTClearPendingBit = 0x1010d611; + RTIM_GetFlagStatus = 0x1010d685; + RTIM_GetINTStatus = 0x1010d75d; + UART_DeInit = 0x1010d83d; + UART_StructInit = 0x1010d845; + UART_BaudParaGetFull = 0x1010d861; + UART_BaudParaGet = 0x1010d899; + UART_SetBaud = 0x1010d8bd; + UART_SetBaudExt = 0x1010d955; + UART_SetRxLevel = 0x1010d9cd; + UART_RxCmd = 0x1010d9f5; + UART_Writable = 0x1010da09; + UART_Readable = 0x1010da11; + UART_CharPut = 0x1010da19; + UART_CharGet = 0x1010da1d; + UART_ReceiveData = 0x1010da25; + UART_SendData = 0x1010da4d; + UART_ReceiveDataTO = 0x1010da75; + UART_SendDataTO = 0x1010dab5; + UART_RxByteCntClear = 0x1010daf5; + UART_RxByteCntGet = 0x1010db01; + UART_BreakCtl = 0x1010db09; + UART_ClearRxFifo = 0x1010db1d; + UART_Init = 0x1010db3d; + UART_ClearTxFifo = 0x1010dbe5; + UART_INTConfig = 0x1010dbf1; + UART_IntStatus = 0x1010dc01; + UART_ModemStatusGet = 0x1010dc05; + UART_LineStatusGet = 0x1010dc09; + UART_WaitBusy = 0x1010dc0d; + rtl_crypto_aes_cbc_init = 0x1010dc31; + rtl_crypto_aes_cbc_encrypt = 0x1010dc81; + rtl_crypto_aes_cbc_decrypt = 0x1010dccd; + rtl_crypto_aes_ecb_init = 0x1010dd19; + rtl_crypto_aes_ecb_encrypt = 0x1010dd69; + rtl_crypto_aes_ecb_decrypt = 0x1010dda1; + rtl_crypto_aes_ctr_init = 0x1010ddd9; + rtl_crypto_aes_ctr_encrypt = 0x1010de29; + rtl_crypto_aes_ctr_decrypt = 0x1010de6d; + rtl_crypto_aes_cfb_init = 0x1010deb1; + rtl_crypto_aes_cfb_encrypt = 0x1010df01; + rtl_crypto_aes_cfb_decrypt = 0x1010df45; + rtl_crypto_aes_ofb_init = 0x1010df89; + rtl_crypto_aes_ofb_encrypt = 0x1010dfdd; + rtl_crypto_aes_ofb_decrypt = 0x1010e021; + rtl_crypto_aes_gcm_init = 0x1010e065; + rtl_crypto_aes_gcm_encrypt = 0x1010e0b9; + rtl_crypto_aes_gcm_decrypt = 0x1010e131; + BOOT_ROM_SignatureCheck = 0x1010e1a9; + BOOT_ROM_FromFlash = 0x1010e281; + BOOT_ROM_InitDebugFlg = 0x1010e38d; + BOOT_ROM_ResetVsr = 0x1010e3a9; + EXT32K_Cmd = 0x1010e4c9; + XTAL_ClkGet = 0x1010e4e9; + CPU_ClkSet = 0x1010e501; + CPU_ClkGet = 0x1010e515; + CRYPTO_MemDump = 0x1010e539; + CRYPTO_RegDump = 0x1010e601; + CRYPTO_CleanCmdOk = 0x1010e7c1; + CRYPTO_ClearAllINT = 0x1010e7f9; + CRYPTO_Reset = 0x1010e829; + CRYPTO_SetSecurityModeAD = 0x1010e86d; + CRYPTO_Init = 0x1010ea49; + CRYPTO_ProcessAD = 0x1010ea6d; + CRYPTO_SendSeqBuf = 0x1010f681; + CRYPTO_CipherInit = 0x1010f799; + CRYPTO_CipherEncryptAD = 0x1010f7b9; + CRYPTO_CipherDecryptAD = 0x1010f7e9; + rtl_crypto_3des_cbc_init = 0x1010f819; + rtl_crypto_3des_cbc_encrypt = 0x1010f869; + rtl_crypto_3des_cbc_decrypt = 0x1010f8b5; + rtl_crypto_3des_ecb_init = 0x1010f901; + rtl_crypto_3des_ecb_encrypt = 0x1010f951; + rtl_crypto_3des_ecb_decrypt = 0x1010f989; + rtl_crypto_3des_cfb_init = 0x1010f9c1; + rtl_crypto_3des_cfb_encrypt = 0x1010fa11; + rtl_crypto_3des_cfb_decrypt = 0x1010fa49; + rtl_crypto_3des_ofb_init = 0x1010fa81; + rtl_crypto_3des_ofb_encrypt = 0x1010fad1; + rtl_crypto_3des_ofb_decrypt = 0x1010fb09; + rtl_crypto_3des_ctr_init = 0x1010fb41; + rtl_crypto_3des_ctr_encrypt = 0x1010fb95; + rtl_crypto_3des_ctr_decrypt = 0x1010fbcd; + rtl_crypto_des_cbc_init = 0x1010fc05; + rtl_crypto_des_cbc_encrypt = 0x1010fc59; + rtl_crypto_des_cbc_decrypt = 0x1010fcb5; + rtl_crypto_des_ecb_init = 0x1010fd11; + rtl_crypto_des_ecb_encrypt = 0x1010fd65; + rtl_crypto_des_ecb_decrypt = 0x1010fd9d; + rtl_crypto_des_cfb_init = 0x1010fdd5; + rtl_crypto_des_cfb_encrypt = 0x1010fe29; + rtl_crypto_des_cfb_decrypt = 0x1010fe61; + rtl_crypto_des_ofb_init = 0x1010fe99; + rtl_crypto_des_ofb_encrypt = 0x1010feed; + rtl_crypto_des_ofb_decrypt = 0x1010ff25; + rtl_crypto_des_ctr_init = 0x1010ff5d; + rtl_crypto_des_ctr_encrypt = 0x1010ffb1; + rtl_crypto_des_ctr_decrypt = 0x1010ffe9; + clear_ns_rom_bss = 0x10110021; + RCC_PeriphClockCmd = 0x10110039; + RCC_PeriphClockSource_RTC = 0x101100d1; + RCC_PeriphClockSource_I2C = 0x1011011d; + RCC_PeriphClockSource_QDEC = 0x1011013d; + RCC_PeriphClockSource_UART = 0x1011015d; + SYSCFG_GetChipInfo = 0x101101d1; + INT_HardFault = 0x101101dd; + INT_MemManage = 0x101101fd; + INT_BusFault = 0x1011021d; + INT_UsageFault = 0x1011023d; + INT_SecureFault = 0x1011025d; + INT_HardFault_C = 0x1011027d; + INT_NMI = 0x1011064d; + irq_table_init = 0x10110795; + irq_enable = 0x101109d1; + irq_disable = 0x101109ed; + irq_set_priority = 0x10110a11; + irq_get_priority = 0x10110a3d; + irq_set_pending = 0x10110a65; + irq_get_pending = 0x10110a81; + irq_clear_pending = 0x10110aa5; + irq_register = 0x10110ac1; + irq_unregister = 0x10110b0d; + _char2num = 0x10110b2d; + _2char2dec = 0x10110b5d; + _2char2hex = 0x10110bd1; + _memchr = 0x10110c39; + _memcmp = 0x10110cc9; + _memcpy = 0x10110d2d; + _memmove = 0x10110dd9; + _memset = 0x10110ea1; + _vsscanf = 0x10110ffd; + _sscanf = 0x101115c1; + _stratoi = 0x101115e1; + _strcat = 0x10111635; + _strchr = 0x10111675; + _strcmp = 0x10111745; + _strcpy = 0x101117b9; + _stricmp = 0x10111805; + _strlen = 0x10111839; + _strncat = 0x1011189d; + _strncmp = 0x101118f9; + _strncpy = 0x1011199d; + _strnlen = 0x10111a05; + _strpbrk = 0x10111a39; + _strsep = 0x10111a65; + _strstr = 0x10111d25; + _strtoull = 0x10111f3d; + _strtoll = 0x10111ffd; + _strtok = 0x1011201d; + __strtok_r = 0x10112029; + _strtok_r = 0x1011208d; + _strtol_r = 0x10112095; + _strtol = 0x101121b1; + _strtoul_r = 0x101121b5; + _strtoul = 0x101122e9; + _strupr = 0x101122ed; + CRYPTO_chacha_20 = 0x10112309; + rom_ed25519_gen_keypair = 0x101125c5; + rom_ed25519_gen_signature = 0x101125c9; + rom_ed25519_verify_signature = 0x101125df; + rom_ed25519_ge_double_scalarmult_vartime = 0x10113e89; + rom_ed25519_ge_frombytes_negate_vartime = 0x10114195; + rom_ed25519_ge_p3_tobytes = 0x10114695; + rom_ed25519_ge_scalarmult_base = 0x101146df; + rom_ed25519_ge_tobytes = 0x10114807; + rom_ed25519_crypto_sign_seed_keypair = 0x10114851; + rom_ed25519_crypto_sign_verify_detached = 0x101148a9; + rom_ed25519_sc_muladd = 0x10114ad5; + rom_ed25519_sc_reduce = 0x1011b265; + rom_ed25519_crypto_sign_detached = 0x1011c6dd; + CRYPTO_poly1305_init = 0x1011ca99; + CRYPTO_poly1305_update = 0x1011cb31; + CRYPTO_poly1305_finish = 0x1011cba7; + rom_sha512_starts = 0x1011cd4d; + rom_sha512_update = 0x1011cd51; + rom_sha512_finish = 0x1011cd55; + rom_sha512 = 0x1011cd59; + rom_sha512_hmac_starts = 0x1011cd5d; + rom_sha512_hmac_update = 0x1011cdf1; + rom_sha512_hmac_finish = 0x1011cdf5; + rom_sha512_hmac_reset = 0x1011ce49; + rom_sha512_hmac = 0x1011ce65; + rom_sha512_hkdf = 0x1011cea1; + curve25519_donna = 0x1011dce5; + mbedtls_aes_init = 0x1011e569; + mbedtls_aes_free = 0x1011e579; + mbedtls_aes_setkey_enc = 0x1011e58d; + mbedtls_aes_setkey_dec = 0x1011e7a5; + mbedtls_aes_encrypt = 0x1011e8c1; + mbedtls_aes_decrypt = 0x1011ecf9; + mbedtls_aes_crypt_ecb = 0x1011f145; + mbedtls_aes_crypt_cbc = 0x1011f1c9; + mbedtls_aes_crypt_cfb128 = 0x1011f3d5; + mbedtls_aes_crypt_cfb8 = 0x1011f44b; + mbedtls_aes_crypt_ctr = 0x1011f4b1; + mbedtls_arc4_init = 0x1011f515; + mbedtls_arc4_free = 0x1011f525; + mbedtls_arc4_setup = 0x1011f539; + mbedtls_arc4_crypt = 0x1011f57f; + mbedtls_asn1_get_len = 0x1011f5c5; + mbedtls_asn1_get_tag = 0x1011f661; + mbedtls_asn1_get_bool = 0x1011f689; + mbedtls_asn1_get_int = 0x1011f6b9; + mbedtls_asn1_get_mpi = 0x1011f6ff; + mbedtls_asn1_get_bitstring = 0x1011f725; + mbedtls_asn1_get_bitstring_null = 0x1011f76d; + mbedtls_asn1_get_sequence_of = 0x1011f795; + mbedtls_asn1_get_alg = 0x1011f81d; + mbedtls_asn1_get_alg_null = 0x1011f8a9; + mbedtls_asn1_free_named_data = 0x1011f8ed; + mbedtls_asn1_free_named_data_list = 0x1011f91d; + mbedtls_asn1_find_named_data = 0x1011f941; + mbedtls_asn1_write_len = 0x1011f96d; + mbedtls_asn1_write_tag = 0x1011fa55; + mbedtls_asn1_write_raw_buffer = 0x1011fa71; + mbedtls_asn1_write_mpi = 0x1011faa1; + mbedtls_asn1_write_null = 0x1011fb13; + mbedtls_asn1_write_oid = 0x1011fb39; + mbedtls_asn1_write_algorithm_identifier = 0x1011fb6d; + mbedtls_asn1_write_bool = 0x1011fbbd; + mbedtls_asn1_write_int = 0x1011fbff; + mbedtls_asn1_write_printable_string = 0x1011fc61; + mbedtls_asn1_write_ia5_string = 0x1011fc95; + mbedtls_asn1_write_bitstring = 0x1011fcc9; + mbedtls_asn1_write_octet_string = 0x1011fd3d; + mbedtls_asn1_store_named_data = 0x1011fd71; + mbedtls_base64_encode = 0x1011fe29; + mbedtls_base64_decode = 0x1011ff2d; + mbedtls_mpi_init = 0x10120b19; + mbedtls_mpi_free = 0x10120b27; + mbedtls_mpi_grow = 0x10120b5d; + mbedtls_mpi_shrink = 0x10120bc1; + mbedtls_mpi_copy = 0x10120c41; + mbedtls_mpi_swap = 0x10120c9d; + mbedtls_mpi_safe_cond_assign = 0x10120cc5; + mbedtls_mpi_safe_cond_swap = 0x10120d31; + mbedtls_mpi_lset = 0x10120db3; + mbedtls_mpi_get_bit = 0x10120df1; + mbedtls_mpi_set_bit = 0x10120e11; + mbedtls_mpi_lsb = 0x10120e61; + mbedtls_mpi_bitlen = 0x10120e93; + mbedtls_mpi_size = 0x10120ed3; + mbedtls_mpi_read_binary = 0x10120edf; + mbedtls_mpi_write_binary = 0x10120f47; + mbedtls_mpi_shift_l = 0x10120f91; + mbedtls_mpi_shift_r = 0x1012102d; + mbedtls_mpi_cmp_abs = 0x101210ab; + mbedtls_mpi_cmp_mpi = 0x101211ed; + mbedtls_mpi_cmp_int = 0x10121277; + mbedtls_mpi_add_abs = 0x101212a3; + mbedtls_mpi_sub_abs = 0x10121357; + mbedtls_mpi_add_mpi = 0x101213d5; + mbedtls_mpi_sub_mpi = 0x10121417; + mbedtls_mpi_add_int = 0x1012145b; + mbedtls_mpi_sub_int = 0x10121487; + mbedtls_mpi_mul_mpi = 0x101214b3; + mbedtls_mpi_mul_int = 0x1012158f; + mbedtls_mpi_read_string = 0x101215a9; + mbedtls_mpi_div_mpi = 0x101216c9; + mbedtls_mpi_div_int = 0x10121aeb; + mbedtls_mpi_mod_mpi = 0x10121b15; + mbedtls_mpi_mod_int = 0x10121b75; + mbedtls_mpi_write_string = 0x10121c15; + mbedtls_mpi_exp_mod = 0x10121d6d; + mbedtls_mpi_gcd = 0x101221a5; + mbedtls_mpi_fill_random = 0x101222af; + mbedtls_mpi_inv_mod = 0x101224f9; + mbedtls_mpi_is_prime = 0x101227b5; + mbedtls_mpi_gen_prime = 0x10122809; + mbedtls_ctr_drbg_init = 0x10122ae9; + mbedtls_ctr_drbg_free = 0x10122af9; + mbedtls_ctr_drbg_set_prediction_resistance = 0x10122b17; + mbedtls_ctr_drbg_set_entropy_len = 0x10122b1b; + mbedtls_ctr_drbg_set_reseed_interval = 0x10122b1f; + mbedtls_ctr_drbg_update = 0x10122b23; + mbedtls_ctr_drbg_reseed = 0x10122b47; + mbedtls_ctr_drbg_seed_entropy_len = 0x10122bc5; + mbedtls_ctr_drbg_seed = 0x10122c19; + mbedtls_ctr_drbg_random_with_add = 0x10122c2b; + mbedtls_ctr_drbg_random = 0x10122cf1; + mbedtls_des_init = 0x10122d11; + mbedtls_des_free = 0x10122d1d; + mbedtls_des3_init = 0x10122d25; + mbedtls_des3_free = 0x10122d35; + mbedtls_des_key_set_parity = 0x10122d3f; + mbedtls_des_key_check_key_parity = 0x10122d59; + mbedtls_des_key_check_weak = 0x10122d7d; + mbedtls_des_setkey = 0x10122da9; + mbedtls_des_setkey_enc = 0x101231bb; + mbedtls_des_setkey_dec = 0x101231e5; + mbedtls_des3_set2key_enc = 0x10123239; + mbedtls_des3_set2key_dec = 0x1012327d; + mbedtls_des3_set3key_enc = 0x101232c1; + mbedtls_des3_set3key_dec = 0x101232fd; + mbedtls_des_crypt_ecb = 0x10123339; + mbedtls_des_crypt_cbc = 0x10123541; + mbedtls_des3_crypt_ecb = 0x10123731; + mbedtls_des3_crypt_cbc = 0x10123b81; + mbedtls_dhm_init = 0x10123e01; + mbedtls_dhm_read_params = 0x10123e0d; + mbedtls_dhm_make_params = 0x10123e59; + mbedtls_dhm_read_public = 0x10123f91; + mbedtls_dhm_make_public = 0x10123fb5; + mbedtls_dhm_calc_secret = 0x1012406d; + mbedtls_dhm_free = 0x1012426d; + mbedtls_dhm_parse_dhm = 0x101242cf; + mbedtls_ecdh_gen_public = 0x101243c1; + mbedtls_ecdh_compute_shared = 0x101243c5; + mbedtls_ecdh_init = 0x10124425; + mbedtls_ecdh_free = 0x10124435; + mbedtls_ecdh_make_params = 0x1012447d; + mbedtls_ecdh_read_params = 0x101244ed; + mbedtls_ecdh_get_params = 0x10124515; + mbedtls_ecdh_make_public = 0x10124561; + mbedtls_ecdh_read_public = 0x101245b1; + mbedtls_ecdh_calc_secret = 0x101245dd; + mbedtls_ecdsa_sign = 0x10124693; + mbedtls_ecdsa_sign_det = 0x10124815; + mbedtls_ecdsa_verify = 0x101248bd; + mbedtls_ecdsa_write_signature = 0x101249f9; + mbedtls_ecdsa_write_signature_det = 0x10124a9d; + mbedtls_ecdsa_read_signature = 0x10124abb; + mbedtls_ecdsa_genkey = 0x10124b55; + mbedtls_ecdsa_from_keypair = 0x10124b83; + mbedtls_ecdsa_init = 0x10124bbb; + mbedtls_ecdsa_free = 0x10124bbf; + mbedtls_ecjpake_init = 0x10124ff5; + mbedtls_ecjpake_free = 0x1012504f; + mbedtls_ecjpake_setup = 0x101250a5; + mbedtls_ecjpake_check = 0x101250e9; + mbedtls_ecjpake_read_round_one = 0x10125109; + mbedtls_ecjpake_write_round_one = 0x10125185; + mbedtls_ecjpake_read_round_two = 0x101252ad; + mbedtls_ecjpake_write_round_two = 0x10125365; + mbedtls_ecjpake_derive_secret = 0x101254a1; + mbedtls_ecp_curve_list = 0x10125de9; + mbedtls_ecp_curve_info_from_grp_id = 0x10125df1; + mbedtls_ecp_curve_info_from_tls_id = 0x10125e0d; + mbedtls_ecp_curve_info_from_name = 0x10125e29; + mbedtls_ecp_point_init = 0x10125e51; + mbedtls_ecp_group_init = 0x10125e71; + mbedtls_ecp_keypair_init = 0x10125e81; + mbedtls_ecp_point_free = 0x10125ea1; + mbedtls_ecp_group_free = 0x10125ec1; + mbedtls_ecp_keypair_free = 0x10125f31; + mbedtls_ecp_copy = 0x10125f51; + mbedtls_ecp_group_copy = 0x10125f7d; + mbedtls_ecp_set_zero = 0x10125f83; + mbedtls_ecp_is_zero = 0x10126839; + mbedtls_ecp_point_cmp = 0x1012684b; + mbedtls_ecp_point_read_string = 0x1012687d; + mbedtls_ecp_point_write_binary = 0x101268a9; + mbedtls_ecp_point_read_binary = 0x1012694d; + mbedtls_ecp_tls_read_point = 0x101269b9; + mbedtls_ecp_tls_write_point = 0x101269e9; + mbedtls_ecp_tls_read_group = 0x10126a19; + mbedtls_ecp_tls_write_group = 0x10126a61; + mbedtls_ecp_check_pubkey = 0x10126a99; + mbedtls_ecp_check_privkey = 0x10126c2d; + mbedtls_ecp_mul = 0x10126c9d; + mbedtls_ecp_muladd = 0x1012726f; + mbedtls_ecp_gen_keypair_base = 0x101272d9; + mbedtls_ecp_gen_keypair = 0x101273d9; + mbedtls_ecp_gen_key = 0x101273f1; + mbedtls_ecp_check_pub_priv = 0x10127419; + mbedtls_ecp_group_load = 0x10128519; + mbedtls_hmac_drbg_init = 0x1012893d; + mbedtls_hmac_drbg_update = 0x10128949; + mbedtls_hmac_drbg_seed_buf = 0x101289e5; + mbedtls_hmac_drbg_reseed = 0x10128a35; + mbedtls_hmac_drbg_seed = 0x10128aad; + mbedtls_hmac_drbg_set_prediction_resistance = 0x10128b1d; + mbedtls_hmac_drbg_set_entropy_len = 0x10128b21; + mbedtls_hmac_drbg_set_reseed_interval = 0x10128b25; + mbedtls_hmac_drbg_random_with_add = 0x10128b29; + mbedtls_hmac_drbg_random = 0x10128bdd; + mbedtls_hmac_drbg_free = 0x10128bed; + mbedtls_md_list = 0x10128c09; + mbedtls_md_info_from_string = 0x10128c11; + mbedtls_md_info_from_type = 0x10128ca9; + mbedtls_md_init = 0x10128ced; + mbedtls_md_free = 0x10128cf9; + mbedtls_md_clone = 0x10128d45; + mbedtls_md_setup = 0x10128d6d; + mbedtls_md_init_ctx = 0x10128db5; + mbedtls_md_starts = 0x10128dbb; + mbedtls_md_update = 0x10128dd5; + mbedtls_md_finish = 0x10128df1; + mbedtls_md = 0x10128e0d; + mbedtls_md_hmac_starts = 0x10128e29; + mbedtls_md_hmac_update = 0x10128eed; + mbedtls_md_hmac_finish = 0x10128f0d; + mbedtls_md_hmac_reset = 0x10128f65; + mbedtls_md_hmac = 0x10128f91; + mbedtls_md_process = 0x10128fe5; + mbedtls_md_get_size = 0x10129001; + mbedtls_md_get_type = 0x10129009; + mbedtls_md_get_name = 0x1012900f; + mbedtls_md5_init = 0x1012917d; + mbedtls_md5_free = 0x10129189; + mbedtls_md5_clone = 0x1012919d; + mbedtls_md5_starts = 0x101291a9; + mbedtls_md5_process = 0x101291d5; + mbedtls_md5_update = 0x101298dd; + mbedtls_md5_finish = 0x101298e3; + mbedtls_md5 = 0x10129995; + mbedtls_oid_get_attr_short_name = 0x101299fd; + mbedtls_oid_get_x509_ext_type = 0x10129a35; + mbedtls_oid_get_extended_key_usage = 0x10129a6d; + mbedtls_oid_get_sig_alg_desc = 0x10129aa5; + mbedtls_oid_get_sig_alg = 0x10129abd; + mbedtls_oid_get_oid_by_sig_alg = 0x10129adb; + mbedtls_oid_get_pk_alg = 0x10129b09; + mbedtls_oid_get_oid_by_pk_alg = 0x10129b41; + mbedtls_oid_get_ec_grp = 0x10129b69; + mbedtls_oid_get_oid_by_ec_grp = 0x10129ba1; + mbedtls_oid_get_cipher_alg = 0x10129bc9; + mbedtls_oid_get_md_alg = 0x10129c01; + mbedtls_oid_get_oid_by_md = 0x10129c39; + mbedtls_oid_get_pkcs12_pbe_alg = 0x10129c61; + mbedtls_pem_init = 0x10129e5f; + mbedtls_pem_read_buffer = 0x10129e6d; + mbedtls_pem_free = 0x1012a161; + mbedtls_pem_write_buffer = 0x1012a185; + mbedtls_pk_init = 0x1012a279; + mbedtls_pk_free = 0x1012a283; + mbedtls_pk_info_from_type = 0x1012a2a5; + mbedtls_pk_setup = 0x1012a2d9; + mbedtls_pk_setup_rsa_alt = 0x1012a305; + mbedtls_pk_can_do = 0x1012a351; + mbedtls_pk_verify = 0x1012a361; + mbedtls_pk_sign = 0x1012a3bd; + mbedtls_pk_decrypt = 0x1012a425; + mbedtls_pk_encrypt = 0x1012a451; + mbedtls_pk_check_pair = 0x1012a47d; + mbedtls_pk_get_bitlen = 0x1012a4bd; + mbedtls_pk_verify_ext = 0x1012a4cd; + mbedtls_pk_debug = 0x1012a585; + mbedtls_pk_get_name = 0x1012a5a9; + mbedtls_pk_get_type = 0x1012a5bd; + mbedtls_pk_write_pubkey = 0x1012aa23; + mbedtls_pk_write_pubkey_der = 0x1012aaad; + mbedtls_pk_write_key_der = 0x1012ab7d; + mbedtls_pk_write_pubkey_pem = 0x1012ad79; + mbedtls_pk_write_key_pem = 0x1012adc1; + mbedtls_rsa_init = 0x1012aecd; + mbedtls_rsa_set_padding = 0x1012aeed; + mbedtls_rsa_check_pubkey = 0x1012aef7; + mbedtls_rsa_check_privkey = 0x1012af4d; + mbedtls_rsa_check_pub_priv = 0x1012b169; + mbedtls_rsa_public = 0x1012b1a1; + mbedtls_rsa_private = 0x1012b20f; + mbedtls_rsa_rsaes_oaep_encrypt = 0x1012b465; + mbedtls_rsa_rsaes_pkcs1_v15_encrypt = 0x1012b58d; + mbedtls_rsa_pkcs1_encrypt = 0x1012b675; + mbedtls_rsa_rsaes_oaep_decrypt = 0x1012b6b5; + mbedtls_rsa_rsaes_pkcs1_v15_decrypt = 0x1012b821; + mbedtls_rsa_pkcs1_decrypt = 0x1012b92d; + mbedtls_rsa_rsassa_pss_sign = 0x1012b975; + mbedtls_rsa_rsassa_pkcs1_v15_sign = 0x1012badd; + mbedtls_rsa_pkcs1_sign = 0x1012bc85; + mbedtls_rsa_rsassa_pss_verify_ext = 0x1012bcc9; + mbedtls_rsa_rsassa_pss_verify = 0x1012be75; + mbedtls_rsa_rsassa_pkcs1_v15_verify = 0x1012bea7; + mbedtls_rsa_pkcs1_verify = 0x1012c009; + mbedtls_rsa_free = 0x1012c04d; + mbedtls_rsa_gen_key = 0x1012c0bb; + mbedtls_rsa_copy = 0x1012c261; + mbedtls_sha1_init = 0x1012c365; + mbedtls_sha1_free = 0x1012c371; + mbedtls_sha1_clone = 0x1012c385; + mbedtls_sha1_starts = 0x1012c391; + mbedtls_sha1_process = 0x1012c3c5; + mbedtls_sha1_update = 0x1012d391; + mbedtls_sha1_finish = 0x1012d397; + mbedtls_sha1 = 0x1012d45d; + mbedtls_sha256_init = 0x1012d491; + mbedtls_sha256_free = 0x1012d49d; + mbedtls_sha256_clone = 0x1012d4b1; + mbedtls_sha256_starts = 0x1012d4bd; + mbedtls_sha256_process = 0x1012d55d; + mbedtls_sha256_update = 0x1012dc89; + mbedtls_sha256_finish = 0x1012dc8f; + mbedtls_sha256 = 0x1012dd91; + mbedtls_sha512_init = 0x1012ddc9; + mbedtls_sha512_free = 0x1012ddd5; + mbedtls_sha512_clone = 0x1012dde9; + mbedtls_sha512_starts = 0x1012ddf5; + mbedtls_sha512_process = 0x1012df29; + mbedtls_sha512_update = 0x1012ec7d; + mbedtls_sha512_finish = 0x1012ec83; + mbedtls_sha512 = 0x1012eeb9; + __rom_entry_ns_start__ = 0x101c0000; + rom_sec_call_ns_entry = 0x101c0000; + __rom_entry_ns_end__ = 0x101c0008; + SPIC_CALIB_PATTERN = 0x101c0008; + PORT_AB = 0x101c0024; + armBitRevIndexTable1024 = 0x101c004c; + twiddleCoef_1024 = 0x101c0e5c; + mbedtls_sha512_info = 0x101ce344; + mbedtls_sha384_info = 0x101ce374; + mbedtls_sha256_info = 0x101ce3a4; + mbedtls_sha224_info = 0x101ce3d4; + mbedtls_sha1_info = 0x101ce404; + mbedtls_md5_info = 0x101ce434; + mbedtls_rsa_alt_info = 0x101cea78; + mbedtls_ecdsa_info = 0x101ceaa8; + mbedtls_eckeydh_info = 0x101cead8; + mbedtls_eckey_info = 0x101ceb08; + mbedtls_rsa_info = 0x101ceb38; + __rom_bss_end_s__ = 0x200f9000; +} diff --git a/Arduino_package/hardware/variants/u-blox_nora-w30/pins_arduino.h b/Arduino_package/hardware/variants/u-blox_nora-w30/pins_arduino.h new file mode 100644 index 00000000..1ca5600e --- /dev/null +++ b/Arduino_package/hardware/variants/u-blox_nora-w30/pins_arduino.h @@ -0,0 +1,20 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" diff --git a/Arduino_package/hardware/variants/u-blox_nora-w30/variant.cpp b/Arduino_package/hardware/variants/u-blox_nora-w30/variant.cpp new file mode 100644 index 00000000..fe0fe746 --- /dev/null +++ b/Arduino_package/hardware/variants/u-blox_nora-w30/variant.cpp @@ -0,0 +1,87 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* u-blox NORA-W30 (RTL8720DF) */ + +#include "variant.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//#include "PinNames.h" +void __libc_init_array(void); + +/* + * Pins descriptions + */ +PinDescription g_APinDescription[TOTAL_GPIO_PIN_NUM]= +{ + {PA_15, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D0 + {PA_14, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D1 + {PA_13, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D2 + {PA_12, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D3 + {PA_30, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D4 + {PA_28, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D5 + {PA_26, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D6 + {PA_25, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D7 + {PA_27, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D8 + {PB_3, TYPE_DIGITAL | TYPE_ANALOG, PIO_GPIO | PIO_GPIO_IRQ | PIO_ADC, MODE_NOT_INITIAL}, // AMB_D9 + {PB_2, TYPE_DIGITAL | TYPE_ANALOG, PIO_GPIO | PIO_GPIO_IRQ | PIO_ADC, MODE_NOT_INITIAL}, // AMB_D10 + {PB_1, TYPE_DIGITAL | TYPE_ANALOG, PIO_GPIO | PIO_GPIO_IRQ | PIO_ADC, MODE_NOT_INITIAL}, // AMB_D11 + {PA_7, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D12 + {PA_8, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ , MODE_NOT_INITIAL}, // AMB_D13 + {PB_23, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D14 + {PB_22, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D15 + {PB_19, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D16 + {PB_18, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D17 + {PB_21, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D18 + {PB_20, TYPE_DIGITAL, PIO_GPIO | PIO_GPIO_IRQ | PIO_PWM , MODE_NOT_INITIAL}, // AMB_D19 +}; + +void *gpio_pin_struct[TOTAL_GPIO_PIN_NUM] = {NULL}; +void *gpio_irq_handler_list[TOTAL_GPIO_PIN_NUM] = {NULL}; + +#ifdef __cplusplus +} // extern C +#endif + +void serialEvent() __attribute__((weak)); +bool Serial_available() __attribute__((weak)); + +// ---------------------------------------------------------------------------- + +void serialEventRun(void) +{ + if (Serial_available && serialEvent && Serial_available()) serialEvent(); +} + +void init(void) +{ + // Initialize C library + __libc_init_array(); +} + +// ---------------------------------------------------------------------------- + +void wait_for_debug(void) { + while (((CoreDebug->DHCSR) & CoreDebug_DHCSR_C_DEBUGEN_Msk) == 0) { + asm("nop"); + } + delay(1000); +} diff --git a/Arduino_package/hardware/variants/u-blox_nora-w30/variant.h b/Arduino_package/hardware/variants/u-blox_nora-w30/variant.h new file mode 100644 index 00000000..a016874e --- /dev/null +++ b/Arduino_package/hardware/variants/u-blox_nora-w30/variant.h @@ -0,0 +1,129 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* u-blox NORA-W30 (RTL8720DF) */ + +#ifndef _VARIANT_ARDUINO_AMEBA_ +#define _VARIANT_ARDUINO_AMEBA_ + +#include "Arduino.h" +#include + +#ifdef __cplusplus +extern "C"{ +#include "PinNames.h" + +#define portOutputRegister(P) ((volatile uint32_t *)(0x48014000 + (P) * 0x400)) +#define portInputRegister(P) ((volatile uint32_t *)(0x48014050 + (P) * 0x400)) +#define portModeRegister(P) ((volatile uint32_t *)(0x48014004 + (P) * 0x400)) + +/* + * Wait until enter debug mode + * + * Check DHCSR(0xE000EDF0) register and hold until bit C_DEBUGEN is set. + * Use this function along with J-LINK or other debug tool + **/ +extern void wait_for_debug(void); +} +#endif + +#define MAIN_THREAD_STACK_SIZE (4096 * 4) + +#define TOTAL_GPIO_PIN_NUM (20) +#define TOTAL_PWM_PIN_NUM (12) + +/* Digital pin mapping refer to g_APinDescription */ +// index into g_APinDescription --v AMEBA NORA Function +#define EVK_D0 17 // PB_18 NORA_G9 UART_RXD +#define EVK_D1 16 // PB_19 NORA_G8 UART_TXD +#define EVK_D2 19 // PB_20 NORA_F9 I2C_SCL / UART_CTS +#define EVK_D3 18 // PB_21 NORA_F8 I2C_SDA / UART_RTS +// EVK_D4 .. D8 NC +#define EVK_D9 5 // PA_28 NORA_B3 SPI_CS +#define EVK_D10 7 // PA_25 NORA_C2 SPI_MOSI +#define EVK_D11 6 // PA_26 NORA_C1 SPI_MISO +#define EVK_D12 4 // PA_30 NORA_B1 SPI_SCLK +// EVK_D13 NC +#define EVK_D14 12 // PA_7 NORA_A5 DBG_TX +#define EVK_D15 13 // PA_8 NORA_A6 DBG_RX +#define EVK_D16 1 // PA_14 NORA_H9 LED_BLUE +#define EVK_D17 0 // PA_15 NORA_H8 LED_GREEN +#define EVK_D18 3 // PA_12 NORA_J9 +#define EVK_D19 2 // PA_13 NORA_J8 LED_RED +// Analog pin mapping +#define A0 9 // PB_3 NORA_J2 +#define A1 11 // PB_1 NORA_D8 SW1 +#define A2 8 // PA_27 NORA_H2 +#define A3 14 // PB_23 NORA_C8 SW2 +#define A4 15 // PB_22 NORA_E9 UART_DSR +#define A5 10 // PB_2 NORA_E8 UART_DTR + +// NORA-W30 module pad names +#define NORA_A5 12 // PA_7 NORA_A5 DBG_TX +#define NORA_A6 13 // PA_8 NORA_A6 DBG_RX +#define NORA_B1 4 // PA_30 NORA_B1 SPI_SCLK +#define NORA_B3 5 // PA_28 NORA_B3 SPI_CS +#define NORA_C1 6 // PA_26 NORA_C1 SPI_MISO +#define NORA_C2 7 // PA_25 NORA_C2 SPI_MOSI +#define NORA_C8 14 // PB_23 NORA_C8 SW2 +#define NORA_D8 11 // PB_1 NORA_D8 SW1 +#define NORA_E8 10 // PB_2 NORA_E8 UART_DTR +#define NORA_E9 15 // PB_22 NORA_E9 UART_DSR +#define NORA_F8 18 // PB_21 NORA_F8 I2C_SDA / UART_RTS +#define NORA_F9 19 // PB_20 NORA_F9 I2C_SCL / UART_CTS +#define NORA_G8 16 // PB_19 NORA_G8 UART_TXD +#define NORA_G9 17 // PB_18 NORA_G9 UART_RXD +#define NORA_H2 8 // PA_27 NORA_H2 +#define NORA_H8 0 // PA_15 NORA_H8 LED_GREEN +#define NORA_H9 1 // PA_14 NORA_H9 LED_BLUE +#define NORA_J2 9 // PB_3 NORA_J2 +#define NORA_J8 2 // PA_13 NORA_J8 LED_RED +#define NORA_J9 3 // PA_12 NORA_J9 + +/* LED pin mapping */ +#define LED_BUILTIN 1 // PA_14 +#define LED_RED 2 // PA_13 +#define LED_GREEN 0 // PA_15 +#define LED_BLUE 1 // PA_14 + +/* ADC/DAC pin mapping */ +#define FEATURE_ADC +//#define FEATURE_DAC + +/* SPI pin mapping */ +#define SPI_SS 5 // PA_28 +#define SPI_MOSI 7 // PA_25 +#define SPI_MISO 6 // PA_26 +#define SPI_SCLK 4 // PA_30 + +/* TwoWire/I2C pin mapping */ +#define I2C_SDA 18 // PB_21 +#define I2C_SCL 19 // PB_20 + +/* UART pin mapping */ +#define LOG_UART_MODIFIABLE_BAUD_RATE 1 +#define SERIAL_ONE_UART_MODIFIABLE_BAUD_RATE 1 +#define SERIAL_TWO_UART_MODIFIABLE_BAUD_RATE 1 +#define LOG_TX 12 // PA_7 +#define LOG_RX 13 // PA_8 +#define SERIAL1_TX 16 // PB_19 +#define SERIAL1_RX 17 // PB_18 +#define SERIAL2_TX 3 // PA_12 +#define SERIAL2_RX 2 // PA_13 + +#endif /* _VARIANT_ARDUINO_AMEBA_ */ diff --git a/Arduino_package/package_realtek.com_amebad_early_index.json b/Arduino_package/package_realtek.com_amebad_early_index.json deleted file mode 100644 index ea2b4cd9..00000000 --- a/Arduino_package/package_realtek.com_amebad_early_index.json +++ /dev/null @@ -1,801 +0,0 @@ -{ - "packages": [ - { - "name": "realtek", - "maintainer": "Realtek", - "websiteURL": "https://www.amebaiot.com/", - "email": "ameba.arduino@gmail.com", - "help": { - "online": "https://www.amebaiot.com/" - }, - - "platforms": [ - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220916", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220916.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220916.tar.gz", - "checksum": "SHA-256:05214a7218cc86366eaa80f1f520dc8ba2943fc193135d30802f07f116b07093", - "size": "16127031", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.1.0" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220905", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220905.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220905.tar.gz", - "checksum": "SHA-256:cdfa10ade73f805709ad55f02e5575d691733b797dbfd5b47576a474273e079e", - "size": "16125428", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.1.0" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220830", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220830.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220830.tar.gz", - "checksum": "SHA-256:97a83445fca8c5b5a069b3e707860cfabb09c67df517aca3bba2e41c08b640b0", - "size": "16123724", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.1.0" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220808", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220808.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220808.tar.gz", - "checksum": "SHA-256:614f2aa5f27b9f34d8680f897b0bac4a569565385341f51bb2f99bb169aabde0", - "size": "16122589", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.1.0" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220728", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220728.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220728.tar.gz", - "checksum": "SHA-256:2b4f94cb55dc0b56e5adb295d06a914517db0aa239d62d170541e93daaad03f1", - "size": "16123996", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.1.0" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220727", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220727.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220727.tar.gz", - "checksum": "SHA-256:1f1127c6969517544290abffe639b3a75d934bf12afc69734d87920d0bffff66", - "size": "16113932", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.1.0" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220725", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220725.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220725.tar.gz", - "checksum": "SHA-256:49d8a869dbe4883f209a36979d6e8e70dfdba8120e18863ed7b58b063511062c", - "size": "16115384", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.1.0" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220718", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220718.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220718.tar.gz", - "checksum": "SHA-256:4bc5c90a57c1fde9a80c404a76a2dc39659734ba9b83e74bb69df38df63499f5", - "size": "16114204", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.0.9" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.4-build20220705", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.4-build20220705.tar.gz", - "archiveFileName": "ameba_d-3.1.4-build20220705.tar.gz", - "checksum": "SHA-256:eb5837b47b9fdbdd26cc1c5ef8abe19c905d7d6800cd685dc6752eb7420384f7", - "size": "16110022", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"}, - {"name": "AW-CU488 Thing Plus (RTL8721DM)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.0.9" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.3-build20220624", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.3-build20220624.tar.gz", - "archiveFileName": "ameba_d-3.1.3-build20220624.tar.gz", - "checksum": "SHA-256:b67fb0140d44559ef1bd670877d236541496778c013a7d1a125eae0e9c160d7b", - "size": "36584994", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"}, - {"name": "BW16-TypeC (RTL8720DN)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.0.8" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.2-build20220128", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.2-build20220128.tar.gz", - "archiveFileName": "ameba_d-3.1.2-build20220128.tar.gz", - "checksum": "SHA-256:5f66469471ec70511844ec2c73433d89fd13b213f85229f6a10d98d19ab78bae", - "size": "36455744", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.0.7" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.1-build20211221", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.1-build20211221.tar.gz", - "archiveFileName": "ameba_d-3.1.1-build20211221.tar.gz", - "checksum": "SHA-256:39a17186263e75ca46989a0ec70d46ac0e9dcd3790f0647bd18942e0d72311bf", - "size": "36462447", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.0.7" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.1.0-build20211029", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.1.0-build20211029.tar.gz", - "archiveFileName": "ameba_d-3.1.0-build20211029.tar.gz", - "checksum": "SHA-256:060559304ad7759f8c71f8beb7401d4cdd410cf340d6726aa6c964914ff55ba9", - "size": "36335730", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.0.6" - } - ] - }, - { - "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", - "architecture": "AmebaD", - "version": "3.0.9-build20210810", - "category": "Contributed", - "help": { - "online": "https://www.amebaiot.com/" - }, - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d-3.0.9-build20210810.tar.gz", - "archiveFileName": "ameba_d-3.0.9-build20210810.tar.gz", - "checksum": "SHA-256:50348a5c53d5341622e76c87267335933adc5adf55e296de137c94cd40d152f1", - "size": "43667191", - "boards": [ - {"name": "AMB21 (RTL8722DM)"}, - {"name": "AMB22 (RTL8722CSM)"}, - {"name": "AMB23 (RTL8722DM_MINI)"}, - {"name": "BW16 (RTL8720DN)"} - ], - "toolsDependencies": [ - { - "packager": "realtek", - "name": "ameba_d_asdk_toolchain", - "version": "1.0.1" - }, - { - "packager": "realtek", - "name": "ameba_d_tools", - "version": "1.0.5" - } - ] - } - ], - - "tools": [ - { - "name": "ameba_d_asdk_toolchain", - "version":"1.0.1", - "systems": [ - { - "host":"i686-mingw32", - "archiveFileName":"ameba_d_toolchain_windows-1.0.1.tar.bz2", - "url":"https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_toolchain_windows-1.0.1.tar.bz2", - "checksum":"SHA-256:1157b225e207bcf4703aaeb42acbb4b10d1c0efa0696005d2e000866ba1249f0", - "size":"99360611" - }, - { - "host":"x86_64-pc-linux-gnu", - "archiveFileName":"ameba_d_toolchain_linux_64-1.0.1.tar.bz2", - "url":"https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_toolchain_linux_64-1.0.1.tar.bz2", - "checksum":"SHA-256:340ab2af5100102f7a1f5ba89b3490a843fa2aed05276427f5cc6c6c01032cd7", - "size":"87899387" - }, - { - "host":"x86_64-apple-darwin", - "archiveFileName":"ameba_d_toolchain_macos-1.0.1.tar.bz2", - "url":"https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_toolchain_macos-1.0.1.tar.bz2", - "checksum":"SHA-256:cc52c2c3650e21ef636bc10242432f75cd0f4884b1188f328982e77030d91787", - "size":"91538901" - } - ] - }, - { - "name": "ameba_d_asdk_toolchain", - "version":"1.0.0", - "systems": [ - { - "host":"i686-mingw32", - "archiveFileName":"ameba_d_toolchain_windows-1.0.0.tar.bz2", - "url":"https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_toolchain_windows-1.0.0.tar.bz2", - "checksum":"SHA-256:fa3c9d6e41acc9c4c3f223ac3f7394b6b43df942c5de02588c222d7fe8326af2", - "size":"99699540" - } - ] - }, - { - "name": "ameba_d_asdk_toolchain", - "version":"0.0.2", - "systems": [ - { - "host":"i686-mingw32", - "archiveFileName":"ameba_d_toolchain_windows-1.0.0v2.tar.gz", - "url":"https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_toolchain_windows-1.0.0v2.tar.gz", - "checksum":"SHA-256:4c1079e3a8b0ff570e428e0f74c1c291263f0e80709dd17e1ffaf7ca7a575029", - "size":"130531123" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.1.0", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.1.0.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.1.0.tar.gz", - "checksum": "SHA-256:df8f497b58b783ec84c1434df157440b5072ab00f13a0ec9e4d2d0c9422fdfff", - "size": "3127746" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.1.0.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.1.0.tar.gz", - "checksum": "SHA-256:0c8e8302fccb01bfbc872a6f4268c9b7cbfc6b106e58cb0700699919ec906fc3", - "size": "2946264" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.1.0.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.1.0.tar.gz", - "checksum": "SHA-256:23a249116404ebdad40ad038a5d9ae1917ed00aca502bd234f4b647103b5106f", - "size": "1047987" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.9", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.9.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.9.tar.gz", - "checksum": "SHA-256:1e134fb708f15d786fa0fe14177757f793c3c30ce68719fb058f291f51b3a10f", - "size": "3127751" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.9.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.9.tar.gz", - "checksum": "SHA-256:5249adcd383a07ffa76d90166eab15595f797cbe03ea57e971a66cf8c18426db", - "size": "2913886" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.9.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.9.tar.gz", - "checksum": "SHA-256:c5797d83459238ff38d0168f6b30711234ff8a399be8bf2fb4f5322311c76d3b", - "size": "1058226" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.8", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.8.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.8.tar.gz", - "checksum": "SHA-256:d0ed1dde621e8d0e9eccf9507be52649a4d4d05a81eb487e4c4b40eccd6fe698", - "size": "3127375" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.8.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.8.tar.gz", - "checksum": "SHA-256:7c546c118da677bdb5434fc5fcb6c514d18f4778dd52a239c7780847d20e8ae8", - "size": "2913399" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.8.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.8.tar.gz", - "checksum": "SHA-256:2462851821067531a64bf101cd3369483519205b2794260a209969146cddde6c", - "size": "1058034" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.7", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.7.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.7.tar.gz", - "checksum": "SHA-256:b2d5ed48ef5490f6692a8a249a569b33a2911e4745e9ad13c056c548b48b70a9", - "size": "6768547" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.7.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.7.tar.gz", - "checksum": "SHA-256:ac1215e0cf86a95344bf518b7a165b898f52187de579cda0e2fc43c52abe14b4", - "size": "2923950" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.7.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.7.tar.gz", - "checksum": "SHA-256:e3b92b950fce29bf8f47674957e376f3dfd106fda5100286f38e6780002cdf89", - "size": "1079434" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.6", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.6.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.6.tar.gz", - "checksum": "SHA-256:35e05fe9c4c127a32eda20f0ab1941849cdbc4e20365c96f558b9b8a6c20b60d", - "size": "6122829" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.6.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.6.tar.gz", - "checksum": "SHA-256:19113681cf13fc494821f3dec5e6cd3e3b2490b9b868e91a232c6d8d45f36b02", - "size": "2492822" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.6.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.6.tar.gz", - "checksum": "SHA-256:da7f1ecfe2766eedde259ce1295e0495064e541a44941b18a0b8a44c9c5bc542", - "size": "631285" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.5", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.5.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.5.tar.gz", - "checksum": "SHA-256:573a9f15c15f836f324cf56b88ba3e1abc0b2f10eb2cdde00d605f7f1d314694", - "size": "7381238" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.5-v02.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.5-v02.tar.gz", - "checksum": "SHA-256:d790f242db750575d5307670bf106da69e63b19b77e3e46a59b7550ee0313555", - "size": "2496623" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.5.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.5.tar.gz", - "checksum": "SHA-256:1ae558ed2c3f9d7f79a244f5006f7616949a216af46854ec4e6a30a4521b4542", - "size": "661518" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.4", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.4.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.4.tar.gz", - "checksum": "SHA-256:4b4deef71f2a67697fc5b87294d4657ea8e78b0d88aac81f3966a81d3bae67cb", - "size": "4137088" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.4.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.4.tar.gz", - "checksum": "SHA-256:053fc5ba3897438e43c3031bfb8b77982d1d68e643b0b7466d3c26159fdeafad", - "size": "8799158" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.4.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.4.tar.gz", - "checksum": "SHA-256:d3bb85155631fb0d14552b4424e45149ce53cd273fd7d9d3393e1c52357f1f9b", - "size": "6077070" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.3", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.3.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.3.tar.gz", - "checksum": "SHA-256:ea459d46b88d7a8092ec05ddf9f65576fa04172ab4fdac1537c0cc61ecc907e9", - "size": "3628968" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.3.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.3.tar.gz", - "checksum": "SHA-256:4fe0732ce7cc20a5f8fad7a90b517dd6e25807a4268485d71725fa5c9a14ef52", - "size": "2861177" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.3.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.3.tar.gz", - "checksum": "SHA-256:21dd80859c629b0ccd3c75a8ba437a7d66c43e31ce172bb616e6d1dc5cc0edcb", - "size": "155285" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.2", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.2.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.2.tar.gz", - "checksum": "SHA-256:134eab0cb6089b8653d9feed1360dbe8c8c2cbb881dc93c2c0deae992f801c7d", - "size": "3629093" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.2.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.2.tar.gz", - "checksum": "SHA-256:9fd3d9bb2e8a249bf634d25f9392e33897ecd170fa31b342e30e1e9332073847", - "size": "2861124" - }, - { - "host": "x86_64-apple-darwin", - "archiveFileName": "ameba_d_tools_macos-1.0.2.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_macos-1.0.2.tar.gz", - "checksum": "SHA-256:ac3f8f922fead4fb79f2ef62b2fbc93f8cddbf094b0cf31fbf176da701d679f0", - "size": "144003" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.1", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.1.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.1.tar.gz", - "checksum": "SHA-256:c2c43d6d304fdd386657ea32a0063302dd1c61bf86c2134c6128a04fc1b31aad", - "size": "1228819" - }, - { - "host": "x86_64-pc-linux-gnu", - "archiveFileName": "ameba_d_tools_linux-1.0.1.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_linux-1.0.1.tar.gz", - "checksum": "SHA-256:9aef99fd7c511daa50bb1415e6f4d8b80ac97ceed0214fbe8afe32bd0812e789", - "size": "1984210" - } - ] - }, - { - "name": "ameba_d_tools", - "version": "1.0.0", - "systems": [ - { - "host": "i686-mingw32", - "archiveFileName": "ameba_d_tools_windows-1.0.0.tar.gz", - "url": "https://github.com/ambiot/ambd_arduino/raw/dev/Arduino_package/release/ameba_d_tools_windows-1.0.0.tar.gz", - "checksum": "SHA-256:e161d0174b1ea14de8176433c2e3dc2df094ec2ece25b2d68f15415e9f6325af", - "size": "1372682" - } - ] - } - ] - } - ] -} diff --git a/Arduino_package/package_realtek.com_amebad_index.json b/Arduino_package/package_realtek.com_amebad_index.json index 4ab1d6e2..97bf4926 100644 --- a/Arduino_package/package_realtek.com_amebad_index.json +++ b/Arduino_package/package_realtek.com_amebad_index.json @@ -13,6 +13,38 @@ { "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", "architecture": "AmebaD", + "version": "3.1.5", + "category": "Contributed", + "help": { + "online": "https://www.amebaiot.com/" + }, + "url": "https://github.com/ambiot/ambd_arduino/raw/master/Arduino_package/release/ameba_d-3.1.5.tar.gz", + "archiveFileName": "ameba_d-3.1.5.tar.gz", + "checksum": "SHA-256:0b473a24fa595da8c11667a4cc30d65b0fe917deb66ff8969429dddfbf8f06e1", + "size": "15504568", + "boards": [ + {"name": "AMB21 (RTL8722DM)"}, + {"name": "AMB22 (RTL8722CSM)"}, + {"name": "AMB23 (RTL8722DM_MINI)"}, + {"name": "BW16 (RTL8720DN)"}, + {"name": "BW16-TypeC (RTL8720DN)"} + ], + "toolsDependencies": [ + { + "packager": "realtek", + "name": "ameba_d_asdk_toolchain", + "version": "1.0.1" + }, + { + "packager": "realtek", + "name": "ameba_d_tools", + "version": "1.1.1" + } + ] + }, + { + "name": "Realtek Ameba Boards (32-bits ARM Cortex-M33 @200MHz)", + "architecture": "AmebaD", "version": "3.1.4", "category": "Contributed", "help": { @@ -552,6 +584,33 @@ "size":"91538901" } ] + }, + { + "name": "ameba_d_tools", + "version": "1.1.1", + "systems": [ + { + "host": "i686-mingw32", + "archiveFileName": "ameba_d_tools_windows-1.1.1.tar.gz", + "url": "https://github.com/ambiot/ambd_arduino/raw/master/Arduino_package/release/ameba_d_tools_windows-1.1.1.tar.gz", + "checksum": "SHA-256:216e5d6a53bd5088344b614222655e6c64d537cb73d80db3a0cd04d75c78936e", + "size": "3128560" + }, + { + "host": "x86_64-pc-linux-gnu", + "archiveFileName": "ameba_d_tools_linux-1.1.1.tar.gz", + "url": "https://github.com/ambiot/ambd_arduino/raw/master/Arduino_package/release/ameba_d_tools_linux-1.1.1.tar.gz", + "checksum": "SHA-256:2dfa90886e12c4ee3ace9657da97990ed83e5c515bf4341c6812a8224d23f5c3", + "size": "2946609" + }, + { + "host": "x86_64-apple-darwin", + "archiveFileName": "ameba_d_tools_macos-1.1.1.tar.gz", + "url": "https://github.com/ambiot/ambd_arduino/raw/master/Arduino_package/release/ameba_d_tools_macos-1.1.1.tar.gz", + "checksum": "SHA-256:08bc4505d8b74c0f6fb59c54223d7bfc10c6edb3c00ecd555c0663b9586b52cf", + "size": "1048610" + } + ] }, { "name": "ameba_d_tools", diff --git a/Arduino_package/release/ameba_d-3.1.5.tar.gz b/Arduino_package/release/ameba_d-3.1.5.tar.gz new file mode 100644 index 00000000..15f36264 Binary files /dev/null and b/Arduino_package/release/ameba_d-3.1.5.tar.gz differ diff --git a/Arduino_package/release/ameba_d_tools_linux-1.1.1.tar.gz b/Arduino_package/release/ameba_d_tools_linux-1.1.1.tar.gz new file mode 100644 index 00000000..6cc94d16 Binary files /dev/null and b/Arduino_package/release/ameba_d_tools_linux-1.1.1.tar.gz differ diff --git a/Arduino_package/release/ameba_d_tools_macos-1.1.1.tar.gz b/Arduino_package/release/ameba_d_tools_macos-1.1.1.tar.gz new file mode 100644 index 00000000..e829175d Binary files /dev/null and b/Arduino_package/release/ameba_d_tools_macos-1.1.1.tar.gz differ diff --git a/Arduino_package/release/ameba_d_tools_windows-1.1.1.tar.gz b/Arduino_package/release/ameba_d_tools_windows-1.1.1.tar.gz new file mode 100644 index 00000000..82d934db Binary files /dev/null and b/Arduino_package/release/ameba_d_tools_windows-1.1.1.tar.gz differ diff --git a/Arduino_zip_libraries/Ameba_TensorFlowLite.zip b/Arduino_zip_libraries/Ameba_TensorFlowLite.zip index 99d9e03e..e88784f3 100644 Binary files a/Arduino_zip_libraries/Ameba_TensorFlowLite.zip and b/Arduino_zip_libraries/Ameba_TensorFlowLite.zip differ