Procházet zdrojové kódy

同步主干改动
SHA-1: 64534ed8162f8e3671e312d7d19affc7b35ea1b7

* 开启最严格的编译检查,并修正编译报错

wenbo13579 před 2 roky
rodič
revize
dce9ae8fc0

+ 5 - 5
Makefile

@@ -22,12 +22,12 @@ CFLAGS  += -g
 # warning param setting
 # warning param setting
 CFLAGS	+= -Wall
 CFLAGS	+= -Wall
 # think use -Os.
 # think use -Os.
-CFLAGS	+= -Wno-unused-function
-CFLAGS	+= -Wno-unused-variable
+# CFLAGS	+= -Wno-unused-function
+# CFLAGS	+= -Wno-unused-variable
 
 
-CFLAGS	+= -Wstrict-prototypes
-CFLAGS	+= -Wshadow
-# CFLAGS	+= -Werror
+# CFLAGS	+= -Wstrict-prototypes
+# CFLAGS	+= -Wshadow
+CFLAGS	+= -Werror
 
 
 # spec c version
 # spec c version
 CFLAGS  += -std=c99
 CFLAGS  += -std=c99

+ 1 - 1
chipset/csr8910/chipset_csr8910.c

@@ -77,6 +77,7 @@ static int csr_send_cmd_vs_enable_rts_cts_for_bcsp(void)
     return bt_hci_cmd_send(0xfc00, buf);
     return bt_hci_cmd_send(0xfc00, buf);
 }
 }
 
 
+__unused
 static int csr_send_cmd_vs_set_uart_baudrate_115200(void)
 static int csr_send_cmd_vs_set_uart_baudrate_115200(void)
 {
 {
     uint8_t data[] = {0xc2, 0x02, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x03, 0x70, 0x00, 0x00,
     uint8_t data[] = {0xc2, 0x02, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x03, 0x70, 0x00, 0x00,
@@ -122,7 +123,6 @@ static int csr_send_cmd_vs_set_public_addr(void)
                       0x04, 0x00, 0x08, 0x00, 0xf3, 0x00, 0xf5, 0xf4, 0xf0, 0x00, 0xf2, 0xf1};
                       0x04, 0x00, 0x08, 0x00, 0xf3, 0x00, 0xf5, 0xf4, 0xf0, 0x00, 0xf2, 0xf1};
     struct net_buf *buf;
     struct net_buf *buf;
     bt_addr_t addr = BLE_MAC_ADDR;
     bt_addr_t addr = BLE_MAC_ADDR;
-    size_t count = 1;
 
 
     // addr.val[0] = (BLE_MAC_ADDR)&0xff;
     // addr.val[0] = (BLE_MAC_ADDR)&0xff;
     // addr.val[1] = (BLE_MAC_ADDR >> 8) & 0xff;
     // addr.val[1] = (BLE_MAC_ADDR >> 8) & 0xff;

+ 0 - 4
example/broadcaster/app_main.c

@@ -62,10 +62,6 @@ void adv_work_timer_expiry(struct k_timer *timer)
 
 
 void bt_ready(int err)
 void bt_ready(int err)
 {
 {
-    char addr_s[BT_ADDR_LE_STR_LEN];
-    bt_addr_le_t addr = {0};
-    size_t count = 1;
-
     if (err)
     if (err)
     {
     {
         printk("Bluetooth init failed (err %d)\n", err);
         printk("Bluetooth init failed (err %d)\n", err);

+ 5 - 5
example/central_gatt_write/gatt_write_common.c

@@ -11,17 +11,17 @@
 #include <logging/bt_log_impl.h>
 #include <logging/bt_log_impl.h>
 
 
 static struct bt_gatt_exchange_params mtu_exchange_params;
 static struct bt_gatt_exchange_params mtu_exchange_params;
-static uint32_t write_count;
-static uint32_t write_len;
-static uint32_t write_rate;
+// static uint32_t write_count;
+// static uint32_t write_len;
+// static uint32_t write_rate;
 struct bt_conn *conn_connected;
 struct bt_conn *conn_connected;
 uint32_t last_write_rate;
 uint32_t last_write_rate;
 void (*start_scan_func)(void);
 void (*start_scan_func)(void);
 
 
 static void write_cmd_cb(struct bt_conn *conn, void *user_data)
 static void write_cmd_cb(struct bt_conn *conn, void *user_data)
 {
 {
-    static uint32_t cycle_stamp;
-    uint64_t delta;
+    // static uint32_t cycle_stamp;
+    // uint64_t delta;
     uint16_t len;
     uint16_t len;
     /* Extract the 16-bit data length stored in user_data */
     /* Extract the 16-bit data length stored in user_data */
     len = (uint32_t)user_data & 0xFFFF;
     len = (uint32_t)user_data & 0xFFFF;

+ 3 - 3
example/central_hr/app_main.c

@@ -124,13 +124,13 @@ static bool eir_found(struct bt_data *data, void *user_data)
         for (i = 0; i < data->data_len; i += sizeof(uint16_t))
         for (i = 0; i < data->data_len; i += sizeof(uint16_t))
         {
         {
             struct bt_le_conn_param *param;
             struct bt_le_conn_param *param;
-            struct bt_uuid *uuid;
+            struct bt_uuid *tmp_uuid;
             uint16_t u16;
             uint16_t u16;
             int err;
             int err;
 
 
             memcpy(&u16, &data->data[i], sizeof(u16));
             memcpy(&u16, &data->data[i], sizeof(u16));
-            uuid = BT_UUID_DECLARE_16(u16);
-            if (bt_uuid_cmp(uuid, BT_UUID_HRS))
+            tmp_uuid = BT_UUID_DECLARE_16(u16);
+            if (bt_uuid_cmp(tmp_uuid, BT_UUID_HRS))
             {
             {
                 continue;
                 continue;
             }
             }

+ 5 - 5
example/central_ht/app_main.c

@@ -26,7 +26,7 @@ static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0);
 static struct bt_gatt_discover_params discover_params;
 static struct bt_gatt_discover_params discover_params;
 static struct bt_gatt_subscribe_params subscribe_params;
 static struct bt_gatt_subscribe_params subscribe_params;
 
 
-static double pow(double x, double y)
+static double pow_cal(double x, double y)
 {
 {
     double result = 1;
     double result = 1;
 
 
@@ -66,7 +66,7 @@ static uint8_t notify_func(struct bt_conn *conn, struct bt_gatt_subscribe_params
     /* temperature value display */
     /* temperature value display */
     mantissa = sys_get_le24(&((uint8_t *)data)[1]);
     mantissa = sys_get_le24(&((uint8_t *)data)[1]);
     exponent = ((uint8_t *)data)[4];
     exponent = ((uint8_t *)data)[4];
-    temperature = (double)mantissa * pow(10, exponent);
+    temperature = (double)mantissa * pow_cal(10, exponent);
 
 
     printf("Temperature %gC.\n", temperature);
     printf("Temperature %gC.\n", temperature);
 
 
@@ -193,13 +193,13 @@ static bool eir_found(struct bt_data *data, void *user_data)
 
 
         for (i = 0; i < data->data_len; i += sizeof(uint16_t))
         for (i = 0; i < data->data_len; i += sizeof(uint16_t))
         {
         {
-            struct bt_uuid *uuid;
+            struct bt_uuid *tmp_uuid;
             uint16_t u16;
             uint16_t u16;
             int err;
             int err;
 
 
             memcpy(&u16, &data->data[i], sizeof(u16));
             memcpy(&u16, &data->data[i], sizeof(u16));
-            uuid = BT_UUID_DECLARE_16(sys_le16_to_cpu(u16));
-            if (bt_uuid_cmp(uuid, BT_UUID_HTS))
+            tmp_uuid = BT_UUID_DECLARE_16(sys_le16_to_cpu(u16));
+            if (bt_uuid_cmp(tmp_uuid, BT_UUID_HTS))
             {
             {
                 continue;
                 continue;
             }
             }

+ 3 - 3
example/eddystone/app_main.c

@@ -414,7 +414,7 @@ static ssize_t read_adv_data(struct bt_conn *conn, const struct bt_gatt_attr *at
 static int eds_slot_restart(struct eds_slot *slot, uint8_t type)
 static int eds_slot_restart(struct eds_slot *slot, uint8_t type)
 {
 {
     int err;
     int err;
-    char addr_s[BT_ADDR_LE_STR_LEN];
+    // char addr_s[BT_ADDR_LE_STR_LEN];
     bt_addr_le_t addr = {0};
     bt_addr_le_t addr = {0};
 
 
     /* Restart advertising */
     /* Restart advertising */
@@ -652,8 +652,8 @@ static struct bt_conn_cb conn_callbacks = {
 
 
 void bt_ready(int err)
 void bt_ready(int err)
 {
 {
-    char addr_s[BT_ADDR_LE_STR_LEN];
-    struct bt_le_oob oob;
+    // char addr_s[BT_ADDR_LE_STR_LEN];
+    // struct bt_le_oob oob;
 
 
     if (err)
     if (err)
     {
     {

+ 4 - 4
example/peripheral_csc/app_main.c

@@ -261,11 +261,11 @@ struct crank_rev_data_nfy
     uint16_t lcet;
     uint16_t lcet;
 } __packed;
 } __packed;
 
 
-static void measurement_nfy(struct bt_conn *conn, uint32_t cwr, uint16_t lwet, uint16_t ccr,
+static void measurement_nfy(struct bt_conn *conn, uint32_t tmp_cwr, uint16_t lwet, uint16_t ccr,
                             uint16_t lcet)
                             uint16_t lcet)
 {
 {
     struct csc_measurement_nfy *nfy;
     struct csc_measurement_nfy *nfy;
-    uint8_t buf[sizeof(*nfy) + (cwr ? sizeof(struct wheel_rev_data_nfy) : 0) +
+    uint8_t buf[sizeof(*nfy) + (tmp_cwr ? sizeof(struct wheel_rev_data_nfy) : 0) +
                 (ccr ? sizeof(struct crank_rev_data_nfy) : 0)];
                 (ccr ? sizeof(struct crank_rev_data_nfy) : 0)];
     uint16_t len = 0U;
     uint16_t len = 0U;
 
 
@@ -273,12 +273,12 @@ static void measurement_nfy(struct bt_conn *conn, uint32_t cwr, uint16_t lwet, u
     nfy->flags = 0U;
     nfy->flags = 0U;
 
 
     /* Send Wheel Revolution data is present */
     /* Send Wheel Revolution data is present */
-    if (cwr)
+    if (tmp_cwr)
     {
     {
         struct wheel_rev_data_nfy data;
         struct wheel_rev_data_nfy data;
 
 
         nfy->flags |= CSC_WHEEL_REV_DATA_PRESENT;
         nfy->flags |= CSC_WHEEL_REV_DATA_PRESENT;
-        data.cwr = sys_cpu_to_le32(cwr);
+        data.cwr = sys_cpu_to_le32(tmp_cwr);
         data.lwet = sys_cpu_to_le16(lwet);
         data.lwet = sys_cpu_to_le16(lwet);
 
 
         memcpy(nfy->data, &data, sizeof(data));
         memcpy(nfy->data, &data, sizeof(data));

+ 5 - 5
example/peripheral_gatt_write/gatt_write_common.c

@@ -11,17 +11,17 @@
 #include <logging/bt_log_impl.h>
 #include <logging/bt_log_impl.h>
 
 
 static struct bt_gatt_exchange_params mtu_exchange_params;
 static struct bt_gatt_exchange_params mtu_exchange_params;
-static uint32_t write_count;
-static uint32_t write_len;
-static uint32_t write_rate;
+// static uint32_t write_count;
+// static uint32_t write_len;
+// static uint32_t write_rate;
 struct bt_conn *conn_connected;
 struct bt_conn *conn_connected;
 uint32_t last_write_rate;
 uint32_t last_write_rate;
 void (*start_scan_func)(void);
 void (*start_scan_func)(void);
 
 
 static void write_cmd_cb(struct bt_conn *conn, void *user_data)
 static void write_cmd_cb(struct bt_conn *conn, void *user_data)
 {
 {
-    static uint32_t cycle_stamp;
-    uint64_t delta;
+    // static uint32_t cycle_stamp;
+    // uint64_t delta;
     uint16_t len;
     uint16_t len;
     /* Extract the 16-bit data length stored in user_data */
     /* Extract the 16-bit data length stored in user_data */
     len = (uint32_t)user_data & 0xFFFF;
     len = (uint32_t)user_data & 0xFFFF;

+ 1 - 0
example/peripheral_gatt_write/peripheral_gatt_write.c

@@ -29,6 +29,7 @@ static const struct bt_data ad[] = {
         BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
         BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
 };
 };
 
 
+__unused
 static void mtu_updated(struct bt_conn *conn, uint16_t tx, uint16_t rx)
 static void mtu_updated(struct bt_conn *conn, uint16_t tx, uint16_t rx)
 {
 {
     printk("Updated MTU: TX: %d RX: %d bytes\n", tx, rx);
     printk("Updated MTU: TX: %d RX: %d bytes\n", tx, rx);

+ 1 - 1
example/peripheral_ht/hts.c

@@ -65,7 +65,7 @@ void hts_indicate(void)
         static double temperature = 20U;
         static double temperature = 20U;
         uint32_t mantissa;
         uint32_t mantissa;
         uint8_t exponent;
         uint8_t exponent;
-        int r;
+        // int r;
 
 
         if (indicating)
         if (indicating)
         {
         {

+ 1 - 1
example/peripheral_throughput/throughput_service.c

@@ -78,7 +78,7 @@ static ssize_t data_rx(struct bt_conn *conn, const struct bt_gatt_attr *attr, co
 static ssize_t config_rx(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf,
 static ssize_t config_rx(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf,
                          uint16_t len, uint16_t offset, uint8_t flags)
                          uint16_t len, uint16_t offset, uint8_t flags)
 {
 {
-    char value[20] = {};
+    // char value[20] = {};
 
 
     if (offset != 0 || len != 1)
     if (offset != 0 || len != 1)
     {
     {

+ 4 - 1
platform/windows/windows_bt_log_impl.c

@@ -126,6 +126,7 @@ static void log_printf_dump(uint8_t level, const char *format, va_list argptr)
     char log_printf_buffer[LOG_FILE_PRINT_BUFFER_MAX_LENGTH];
     char log_printf_buffer[LOG_FILE_PRINT_BUFFER_MAX_LENGTH];
     char msg_str[LOG_FILE_PRINT_BUFFER_MAX_LENGTH];
     char msg_str[LOG_FILE_PRINT_BUFFER_MAX_LENGTH];
     int len = vsnprintf(msg_str, sizeof(msg_str), format, argptr);
     int len = vsnprintf(msg_str, sizeof(msg_str), format, argptr);
+    ARG_UNUSED(len);
 
 
     char timestamp_str[0x100];
     char timestamp_str[0x100];
     SYSTEMTIME timestamp;
     SYSTEMTIME timestamp;
@@ -136,6 +137,7 @@ static void log_printf_dump(uint8_t level, const char *format, va_list argptr)
 
 
     int total_len = snprintf(log_printf_buffer, sizeof(log_printf_buffer), "[%s] [0x%lx] %s",
     int total_len = snprintf(log_printf_buffer, sizeof(log_printf_buffer), "[%s] [0x%lx] %s",
                              timestamp_str, GetCurrentThreadId(), msg_str);
                              timestamp_str, GetCurrentThreadId(), msg_str);
+    ARG_UNUSED(total_len);
 
 
     pthread_mutex_lock(&print_lock);
     pthread_mutex_lock(&print_lock);
 #ifdef FUNCTION_WINDOWS_LOG_TXT_FILE
 #ifdef FUNCTION_WINDOWS_LOG_TXT_FILE
@@ -202,12 +204,13 @@ static void log_packet_dump(uint8_t packet_type, uint8_t in, uint8_t *packet, ui
 
 
     int total_len = snprintf(log_printf_buffer, sizeof(log_printf_buffer), "[%s] [0x%lx] %s %s\n",
     int total_len = snprintf(log_printf_buffer, sizeof(log_printf_buffer), "[%s] [0x%lx] %s %s\n",
                              timestamp_str, GetCurrentThreadId(), packet_type_str, msg_str);
                              timestamp_str, GetCurrentThreadId(), packet_type_str, msg_str);
+    ARG_UNUSED(total_len);
 
 
     pthread_mutex_lock(&print_lock);
     pthread_mutex_lock(&print_lock);
 #ifdef FUNCTION_WINDOWS_LOG_CFA_FILE
 #ifdef FUNCTION_WINDOWS_LOG_CFA_FILE
     uint8_t header_btsnoop[25];
     uint8_t header_btsnoop[25];
 
 
-    uint32_t tv_sec = 0;
+    // uint32_t tv_sec = 0;
     // uint32_t tv_us = 0;
     // uint32_t tv_us = 0;
     uint64_t ts_usec;
     uint64_t ts_usec;
 
 

+ 4 - 0
platform/windows/windows_driver_libusb.c

@@ -236,6 +236,7 @@ static int rx_evt_process_loop(void *args)
     return 0;
     return 0;
 }
 }
 
 
+#if defined(CONFIG_BT_CONN)
 pthread_t usb_rx_acl_thread;
 pthread_t usb_rx_acl_thread;
 static int rx_acl_process_loop(void *args)
 static int rx_acl_process_loop(void *args)
 {
 {
@@ -304,6 +305,7 @@ static int rx_acl_process_loop(void *args)
 
 
     return 0;
     return 0;
 }
 }
+#endif
 
 
 static int hci_driver_open(void)
 static int hci_driver_open(void)
 {
 {
@@ -415,7 +417,9 @@ static int reset_driver_process(void *args)
     // wait thread close.
     // wait thread close.
     pthread_join(usb_tx_thread, NULL);
     pthread_join(usb_tx_thread, NULL);
     pthread_join(usb_rx_evt_thread, NULL);
     pthread_join(usb_rx_evt_thread, NULL);
+#if defined(CONFIG_BT_CONN)
     pthread_join(usb_rx_acl_thread, NULL);
     pthread_join(usb_rx_acl_thread, NULL);
+#endif
 
 
     int ret = usb_open_process(selected_usb_vid, selected_usb_pid);
     int ret = usb_open_process(selected_usb_vid, selected_usb_pid);
     if (ret < 0)
     if (ret < 0)

+ 1 - 378
platform/windows/windows_driver_serial.c

@@ -72,58 +72,6 @@ void ClosePort(PORT com_port)
     CloseHandle(com_port);
     CloseHandle(com_port);
 }
 }
 
 
-int SetPortBoudRate(PORT com_port, int rate)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return FALSE;
-    dcbSerialParams.BaudRate = rate;
-    Status = SetCommState(com_port, &dcbSerialParams);
-    return Status;
-}
-
-int SetPortDataBits(PORT com_port, int bits)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return FALSE;
-    dcbSerialParams.ByteSize = bits;
-    Status = SetCommState(com_port, &dcbSerialParams);
-    return Status;
-}
-
-int SetPortStopBits(PORT com_port, int bits)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return FALSE;
-    dcbSerialParams.StopBits = bits;
-    Status = SetCommState(com_port, &dcbSerialParams);
-    return Status;
-}
-
-// default: NOPARITY 0; ODDPARITY 1;EVENPARITY 2;MARKPARITY 3;SPACEPARITY 4
-int SetPortParity(PORT com_port, int parity)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return FALSE;
-    dcbSerialParams.Parity = parity;
-    Status = SetCommState(com_port, &dcbSerialParams);
-    return Status;
-}
 enum FlowControl
 enum FlowControl
 {
 {
     NoFlowControl,
     NoFlowControl,
@@ -134,183 +82,9 @@ enum FlowControl
     XonXoffFlowControl
     XonXoffFlowControl
 };
 };
 
 
-int SetPortFlowControl(PORT com_port, bool flowcontrol)
-{
-    DCB dcb = {0};
-    BOOL Status;
-    dcb.DCBlength = sizeof(dcb);
-    Status = GetCommState(com_port, &dcb);
-    if (Status == FALSE)
-        return FALSE;
-    // dcb.fOutxCtsFlow = flowcontrol;
-    // dcb.fRtsControl = flowcontrol ? RTS_CONTROL_HANDSHAKE : 0;
-
-    //流控设置
-    dcb.fDsrSensitivity = FALSE;
-    dcb.fTXContinueOnXoff = FALSE;
-    dcb.fRtsControl = RTS_CONTROL_DISABLE;
-    dcb.fDtrControl = DTR_CONTROL_ENABLE;
-
-    int fc = flowcontrol ? CtsRtsFlowControl : NoFlowControl;
-    switch (fc)
-    {
-        //不流控
-    case NoFlowControl:
-    {
-        dcb.fOutxCtsFlow = FALSE;
-        dcb.fOutxDsrFlow = FALSE;
-        dcb.fOutX = FALSE;
-        dcb.fInX = FALSE;
-        break;
-    }
-    //硬件CtsRts流控
-    case CtsRtsFlowControl:
-    {
-        dcb.fOutxCtsFlow = TRUE;
-        dcb.fOutxDsrFlow = FALSE;
-        dcb.fRtsControl = RTS_CONTROL_HANDSHAKE;
-        dcb.fOutX = FALSE;
-        dcb.fInX = FALSE;
-        break;
-    }
-    //硬件 CtsDtr流控
-    case CtsDtrFlowControl:
-    {
-        dcb.fOutxCtsFlow = TRUE;
-        dcb.fOutxDsrFlow = FALSE;
-        dcb.fDtrControl = DTR_CONTROL_HANDSHAKE;
-        dcb.fOutX = FALSE;
-        dcb.fInX = FALSE;
-        break;
-    }
-    //硬件DsrRts流控
-    case DsrRtsFlowControl:
-    {
-        dcb.fOutxCtsFlow = FALSE;
-        dcb.fOutxDsrFlow = TRUE;
-        dcb.fRtsControl = RTS_CONTROL_HANDSHAKE;
-        dcb.fOutX = FALSE;
-        dcb.fInX = FALSE;
-        break;
-    }
-    //硬件DsrDtr流控
-    case DsrDtrFlowControl:
-    {
-        dcb.fOutxCtsFlow = FALSE;
-        dcb.fOutxDsrFlow = TRUE;
-        dcb.fDtrControl = DTR_CONTROL_HANDSHAKE;
-        dcb.fOutX = FALSE;
-        dcb.fInX = FALSE;
-        break;
-    }
-    //软件流控
-    case XonXoffFlowControl:
-    {
-        dcb.fOutxCtsFlow = FALSE;
-        dcb.fOutxDsrFlow = FALSE;
-        dcb.fOutX = TRUE;
-        dcb.fInX = TRUE;
-        dcb.XonChar = 0x11;
-        dcb.XoffChar = 0x13;
-        dcb.XoffLim = 100;
-        dcb.XonLim = 100;
-        break;
-    }
-    }
-
-    Status = SetCommState(com_port, &dcb);
-    return Status;
-}
-
-int GetPortBoudRate(PORT com_port)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return -1;
-    return dcbSerialParams.BaudRate;
-}
-
-int GetPortDataBits(PORT com_port)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return -1;
-    return dcbSerialParams.ByteSize;
-}
-
-int GetPortStopBits(PORT com_port)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return -1;
-    return dcbSerialParams.StopBits;
-}
-
-int GetPortParity(PORT com_port)
-{
-    DCB dcbSerialParams = {0};
-    BOOL Status;
-    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
-    Status = GetCommState(com_port, &dcbSerialParams);
-    if (Status == FALSE)
-        return -1;
-    return dcbSerialParams.Parity;
-}
-
-int SendData(PORT com_port, const char *data)
-{
-    DWORD dNoOFBytestoWrite = strlen(data);
-    DWORD dNoOfBytesWritten;
-    BOOL Status = WriteFile(com_port, data, dNoOFBytestoWrite, &dNoOfBytesWritten, NULL);
-    if (Status == FALSE)
-    {
-        return -1;
-    }
-    else
-    {
-        printk("%s\n", data);
-    }
-
-    return dNoOfBytesWritten;
-}
-
-int ReciveData(PORT com_port, char *data, int len)
-{
-    DWORD dwEventMask;
-    DWORD NoBytesRead;
-
-    BOOL Status = WaitCommEvent(com_port, &dwEventMask, NULL);
-    if (Status == FALSE)
-    {
-        return FALSE;
-    }
-    Status = ReadFile(com_port, data, len, &NoBytesRead, NULL);
-    data[NoBytesRead] = 0;
-
-    if (Status == FALSE)
-    {
-        return FALSE;
-    }
-    else
-    {
-        printk("%s\n", data);
-    }
-
-    return TRUE;
-}
 
 
 PORT serial_init(int idx, int rate, int databits, int stopbits, int parity, bool flowcontrol)
 PORT serial_init(int idx, int rate, int databits, int stopbits, int parity, bool flowcontrol)
 {
 {
-    int ret = 0;
     PORT com_port;
     PORT com_port;
     com_port = OpenPort(idx, TRUE);
     com_port = OpenPort(idx, TRUE);
     if (com_port == INVALID_HANDLE_VALUE)
     if (com_port == INVALID_HANDLE_VALUE)
@@ -514,6 +288,7 @@ int Serial_ReciveData(PORT com_port, char *data, int len)
                                   len,      //要读取的数据最大字节数
                                   len,      //要读取的数据最大字节数
                                   &NoBytesRead, // DWORD*,用来接收返回成功读取的数据字节数
                                   &NoBytesRead, // DWORD*,用来接收返回成功读取的数据字节数
                                   NULL);        // NULL为同步发送,OVERLAPPED*为异步发送
                                   NULL);        // NULL为同步发送,OVERLAPPED*为异步发送
+        ARG_UNUSED(bReadStat);
     }
     }
     else
     else
     {
     {
@@ -595,149 +370,9 @@ int Serial_AsyncReciveData(PORT com_port, char *data, int len)
 
 
 static bool is_enable;
 static bool is_enable;
 
 
-static struct k_fifo tx_queue;
-static pthread_mutex_t tx_lock;
-static struct k_fifo rx_queue;
-static pthread_mutex_t rx_lock;
 
 
 static PORT serial;
 static PORT serial;
 
 
-static struct net_buf *pop_tx_queue(void)
-{
-    pthread_mutex_lock(&tx_lock);
-    struct net_buf *buf = net_buf_get(&tx_queue, Z_FOREVER);
-    pthread_mutex_unlock(&tx_lock);
-
-    return buf;
-}
-
-static void push_tx_queue(struct net_buf *buf)
-{
-    pthread_mutex_lock(&tx_lock);
-    net_buf_put(&tx_queue, buf);
-    pthread_mutex_unlock(&tx_lock);
-}
-
-static struct net_buf *pop_rx_queue(void)
-{
-    pthread_mutex_lock(&rx_lock);
-    struct net_buf *buf = net_buf_get(&rx_queue, Z_FOREVER);
-    pthread_mutex_unlock(&rx_lock);
-
-    return buf;
-}
-
-static void push_rx_queue(struct net_buf *buf)
-{
-    pthread_mutex_lock(&rx_lock);
-    net_buf_put(&rx_queue, buf);
-    pthread_mutex_unlock(&rx_lock);
-}
-
-pthread_t serial_tx_thread;
-static int tx_process_loop(void *args)
-{
-    printk("tx_process_loop\n");
-    struct net_buf *buf;
-    int ret;
-
-    while (1)
-    {
-        if (!k_fifo_is_empty(&tx_queue))
-        {
-            buf = pop_tx_queue();
-
-            net_buf_push_u8(buf, bt_get_h4_type_by_buffer(bt_buf_get_type(buf)));
-            ret = Serial_SendData(serial, (char *)buf->data, buf->len);
-
-            if (ret < 0)
-            {
-                printk("error tx\n");
-            }
-            else
-            {
-                // printk("success: tx %d bytes\n", ret);
-                // printk("data: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", buf->data[0], buf->data[1],
-                //        buf->data[2], buf->data[3], buf->data[4], buf->data[5]);
-            }
-
-            net_buf_unref(buf);
-        }
-
-        if (!is_enable)
-        {
-            break;
-        }
-    }
-    return 0;
-}
-
-pthread_t serial_rx_thread;
-static int rx_process_loop(void *args)
-{
-    printk("rx_process_loop\n");
-    char tmp[1024];
-    int ret;
-    while (1)
-    {
-        ret = Serial_ReciveData(serial, tmp, sizeof(tmp));
-        if (ret <= 0)
-        {
-            // printk("error reading.\n");
-            Sleep(1000);
-        }
-        else
-        {
-            // printk("success: serial read %d bytes\n", ret);
-            // printk("data: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", tmp[0], tmp[1], tmp[2], tmp[3],
-            //        tmp[4], tmp[5]);
-
-            struct net_buf *buf;
-            buf = bt_buf_get_controller_tx_evt();
-
-            if (buf)
-            {
-                net_buf_add_mem(buf, tmp, ret);
-                bt_recv(buf);
-            }
-            else
-            {
-                printk("hci_driver_polling_work(), no reserve buff\n");
-                while (1)
-                    ;
-            }
-        }
-
-        if (!is_enable)
-        {
-            break;
-        }
-    }
-
-    return 0;
-}
-
-static int hci_driver_open(void)
-{
-    return 0;
-}
-
-static int hci_driver_send(struct net_buf *buf)
-{
-    push_tx_queue(buf);
-
-    return 0;
-}
-
-static const struct bt_hci_driver drv = {
-        .open = hci_driver_open,
-        .send = hci_driver_send,
-};
-
-static void hci_driver_init(void)
-{
-    bt_hci_driver_register(&drv);
-}
 
 
 static int hci_driver_h4_open(void)
 static int hci_driver_h4_open(void)
 {
 {
@@ -774,18 +409,6 @@ int serial_open_process(int idx, int rate, int databits, int stopbits, int parit
 
 
     is_enable = true;
     is_enable = true;
 
 
-    // pthread_mutex_init(&tx_lock, NULL);
-    // pthread_mutex_init(&rx_lock, NULL);
-
-    // pthread_create(&serial_tx_thread, NULL, (void*)tx_process_loop,NULL);
-    // //pthread_join(serial_tx_thread, NULL);
-
-    // pthread_create(&serial_rx_thread, NULL, (void*)rx_process_loop,NULL);
-    // //pthread_join(serial_rx_thread, NULL);
-
-    // sys_slist_init(&tx_queue);
-    // sys_slist_init(&rx_queue);
-
     return 0;
     return 0;
 }
 }
 
 

+ 2 - 0
scripts/code_compile_check.py

@@ -44,6 +44,8 @@ def parse_args():
     parser.add_argument("--cpu-arch",
     parser.add_argument("--cpu-arch",
                         help="Windows libusb need this.")
                         help="Windows libusb need this.")
     parser.add_argument("--full-check",
     parser.add_argument("--full-check",
+                        action="store_true",
+                        default=False,
                         help="For normal build.")
                         help="For normal build.")
                         
                         
     return parser.parse_args()
     return parser.parse_args()

+ 1 - 0
src/common/rpa.c

@@ -45,6 +45,7 @@ static int internal_encrypt_le(const uint8_t key[16], const uint8_t plaintext[16
     return bt_encrypt_le(key, plaintext, enc_data);
     return bt_encrypt_le(key, plaintext, enc_data);
 }
 }
 
 
+__unused
 static int ah(const uint8_t irk[16], const uint8_t r[3], uint8_t out[3])
 static int ah(const uint8_t irk[16], const uint8_t r[3], uint8_t out[3])
 {
 {
     uint8_t res[16];
     uint8_t res[16];

+ 2 - 2
src/host/adv.c

@@ -338,7 +338,7 @@ struct bt_le_ext_adv *bt_le_adv_lookup_legacy(void)
 int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable)
 int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable)
 {
 {
     struct net_buf *buf;
     struct net_buf *buf;
-    struct bt_hci_cmd_state_set state;
+    // struct bt_hci_cmd_state_set state;
     int err;
     int err;
 
 
     buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1);
     buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1);
@@ -1884,10 +1884,10 @@ int bt_le_ext_adv_delete(struct bt_le_ext_adv *adv)
 static void adv_timeout(struct k_work *work)
 static void adv_timeout(struct k_work *work)
 {
 {
     int err = 0;
     int err = 0;
+#if defined(CONFIG_BT_EXT_ADV)
     struct k_work_delayable *dwork;
     struct k_work_delayable *dwork;
     struct bt_le_ext_adv *adv;
     struct bt_le_ext_adv *adv;
 
 
-#if defined(CONFIG_BT_EXT_ADV)
     dwork = k_work_delayable_from_work(work);
     dwork = k_work_delayable_from_work(work);
     adv = CONTAINER_OF(dwork, struct bt_le_ext_adv, lim_adv_timeout_work);
     adv = CONTAINER_OF(dwork, struct bt_le_ext_adv, lim_adv_timeout_work);
 
 

+ 1 - 0
src/host/att.c

@@ -2951,6 +2951,7 @@ static void att_timeout(struct k_work *work)
     bt_att_disconnected(&chan->chan.chan);
     bt_att_disconnected(&chan->chan.chan);
 }
 }
 
 
+__unused
 static struct bt_att_chan *att_get_fixed_chan(struct bt_conn *conn)
 static struct bt_att_chan *att_get_fixed_chan(struct bt_conn *conn)
 {
 {
     struct bt_l2cap_chan *chan;
     struct bt_l2cap_chan *chan;

+ 5 - 0
src/host/gatt.c

@@ -350,6 +350,7 @@ static void sc_store(struct gatt_sc_cfg *cfg)
 #endif
 #endif
 }
 }
 
 
+__unused
 static void clear_sc_cfg(struct gatt_sc_cfg *cfg)
 static void clear_sc_cfg(struct gatt_sc_cfg *cfg)
 {
 {
     memset(cfg, 0, sizeof(*cfg));
     memset(cfg, 0, sizeof(*cfg));
@@ -5611,6 +5612,7 @@ static void ccc_clear(struct _bt_gatt_ccc *ccc, const bt_addr_le_t *addr, uint8_
     clear_ccc_cfg(cfg);
     clear_ccc_cfg(cfg);
 }
 }
 
 
+__unused
 static uint8_t ccc_load(const struct bt_gatt_attr *attr, uint16_t handle, void *user_data)
 static uint8_t ccc_load(const struct bt_gatt_attr *attr, uint16_t handle, void *user_data)
 {
 {
     struct ccc_load *load = user_data;
     struct ccc_load *load = user_data;
@@ -5756,6 +5758,7 @@ static int ccc_set(const char *name, size_t len_rd, settings_read_cb read_cb, vo
     return 0;
     return 0;
 }
 }
 
 
+__unused
 static int ccc_set_cb(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg)
 static int ccc_set_cb(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg)
 {
 {
     if (IS_ENABLED(CONFIG_BT_SETTINGS_CCC_LAZY_LOADING))
     if (IS_ENABLED(CONFIG_BT_SETTINGS_CCC_LAZY_LOADING))
@@ -5769,6 +5772,7 @@ static int ccc_set_cb(const char *name, size_t len_rd, settings_read_cb read_cb,
 
 
 // SETTINGS_STATIC_HANDLER_DEFINE(bt_ccc, "bt/ccc", NULL, ccc_set_cb, NULL, NULL);
 // SETTINGS_STATIC_HANDLER_DEFINE(bt_ccc, "bt/ccc", NULL, ccc_set_cb, NULL, NULL);
 
 
+__unused
 static int ccc_set_direct(const char *key, size_t len, settings_read_cb read_cb, void *cb_arg,
 static int ccc_set_direct(const char *key, size_t len, settings_read_cb read_cb, void *cb_arg,
                           void *param)
                           void *param)
 {
 {
@@ -5980,6 +5984,7 @@ struct ccc_save
     size_t count;
     size_t count;
 };
 };
 
 
+__unused
 static uint8_t ccc_save(const struct bt_gatt_attr *attr, uint16_t handle, void *user_data)
 static uint8_t ccc_save(const struct bt_gatt_attr *attr, uint16_t handle, void *user_data)
 {
 {
     struct ccc_save *save = user_data;
     struct ccc_save *save = user_data;

+ 9 - 5
src/host/hci_core.c

@@ -231,6 +231,7 @@ int bt_hci_le_rand(void *buffer, size_t len)
     return 0;
     return 0;
 }
 }
 
 
+__unused
 static int hci_le_read_max_data_len(uint16_t *tx_octets, uint16_t *tx_time)
 static int hci_le_read_max_data_len(uint16_t *tx_octets, uint16_t *tx_time)
 {
 {
     struct bt_hci_rp_le_read_max_data_len *rp;
     struct bt_hci_rp_le_read_max_data_len *rp;
@@ -400,7 +401,7 @@ int bt_le_create_conn_ext(const struct bt_conn *conn)
 {
 {
     struct bt_hci_cp_le_ext_create_conn *cp;
     struct bt_hci_cp_le_ext_create_conn *cp;
     struct bt_hci_ext_conn_phy *phy;
     struct bt_hci_ext_conn_phy *phy;
-    struct bt_hci_cmd_state_set state;
+    // struct bt_hci_cmd_state_set state;
     bool use_filter = false;
     bool use_filter = false;
     struct net_buf *buf;
     struct net_buf *buf;
     uint8_t own_addr_type;
     uint8_t own_addr_type;
@@ -482,7 +483,7 @@ int bt_le_create_conn_ext(const struct bt_conn *conn)
 static int bt_le_create_conn_legacy(const struct bt_conn *conn)
 static int bt_le_create_conn_legacy(const struct bt_conn *conn)
 {
 {
     struct bt_hci_cp_le_create_conn *cp;
     struct bt_hci_cp_le_create_conn *cp;
-    struct bt_hci_cmd_state_set state;
+    // struct bt_hci_cmd_state_set state;
     bool use_filter = false;
     bool use_filter = false;
     struct net_buf *buf;
     struct net_buf *buf;
     uint8_t own_addr_type;
     uint8_t own_addr_type;
@@ -558,7 +559,7 @@ int bt_le_create_conn(const struct bt_conn *conn)
 int bt_le_create_conn_cancel(void)
 int bt_le_create_conn_cancel(void)
 {
 {
     struct net_buf *buf;
     struct net_buf *buf;
-    struct bt_hci_cmd_state_set state;
+    // struct bt_hci_cmd_state_set state;
 
 
     buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_CONN_CANCEL, 0);
     buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_CONN_CANCEL, 0);
 
 
@@ -930,7 +931,7 @@ static void conn_auto_initiate(struct bt_conn *conn)
     {
     {
         // if (IS_BT_QUIRK_NO_AUTO_DLE(&bt_dev))
         // if (IS_BT_QUIRK_NO_AUTO_DLE(&bt_dev))
         {
         {
-            uint16_t tx_octets, tx_time;
+            // uint16_t tx_octets, tx_time;
 
 
             // err = hci_le_read_max_data_len(&tx_octets, &tx_time);
             // err = hci_le_read_max_data_len(&tx_octets, &tx_time);
             // if (!err)
             // if (!err)
@@ -2525,6 +2526,7 @@ static void le_read_buffer_size_complete(struct net_buf *buf)
 #endif /* CONFIG_BT_CONN */
 #endif /* CONFIG_BT_CONN */
 }
 }
 
 
+__unused
 static void read_buffer_size_v2_complete(struct net_buf *buf)
 static void read_buffer_size_v2_complete(struct net_buf *buf)
 {
 {
 #if defined(CONFIG_BT_ISO)
 #if defined(CONFIG_BT_ISO)
@@ -2557,6 +2559,7 @@ static void read_buffer_size_v2_complete(struct net_buf *buf)
 #endif /* CONFIG_BT_ISO */
 #endif /* CONFIG_BT_ISO */
 }
 }
 
 
+__unused
 static int le_set_host_feature(uint8_t bit_number, uint8_t bit_value)
 static int le_set_host_feature(uint8_t bit_number, uint8_t bit_value)
 {
 {
     struct bt_hci_cp_le_set_host_feature *cp;
     struct bt_hci_cp_le_set_host_feature *cp;
@@ -2601,6 +2604,7 @@ static void read_local_features_complete(struct net_buf *buf)
     memcpy(bt_dev.features[0], rp->features, sizeof(bt_dev.features[0]));
     memcpy(bt_dev.features[0], rp->features, sizeof(bt_dev.features[0]));
 }
 }
 
 
+__unused
 static void le_read_supp_states_complete(struct net_buf *buf)
 static void le_read_supp_states_complete(struct net_buf *buf)
 {
 {
     struct bt_hci_rp_le_read_supp_states *rp = (void *)buf->data;
     struct bt_hci_rp_le_read_supp_states *rp = (void *)buf->data;
@@ -2611,6 +2615,7 @@ static void le_read_supp_states_complete(struct net_buf *buf)
 }
 }
 
 
 #if defined(CONFIG_BT_SMP)
 #if defined(CONFIG_BT_SMP)
+__unused
 static void le_read_resolving_list_size_complete(struct net_buf *buf)
 static void le_read_resolving_list_size_complete(struct net_buf *buf)
 {
 {
     struct bt_hci_rp_le_read_rl_size *rp = (void *)buf->data;
     struct bt_hci_rp_le_read_rl_size *rp = (void *)buf->data;
@@ -3644,7 +3649,6 @@ int bt_set_name(const char *name)
 {
 {
 #if defined(CONFIG_BT_DEVICE_NAME_DYNAMIC)
 #if defined(CONFIG_BT_DEVICE_NAME_DYNAMIC)
     size_t len = strlen(name);
     size_t len = strlen(name);
-    int err;
 
 
     if (len > CONFIG_BT_DEVICE_NAME_MAX)
     if (len > CONFIG_BT_DEVICE_NAME_MAX)
     {
     {

+ 1 - 0
src/host/id.c

@@ -45,6 +45,7 @@ int bt_storage_kv_get_id(void)
 {
 {
     uint16_t len = sizeof(bt_dev.id_addr);
     uint16_t len = sizeof(bt_dev.id_addr);
     int ret;
     int ret;
+    ARG_UNUSED(ret);
     bt_storage_kv_get(KEY_INDEX_LE_ID_ADDR_LIST, (uint8_t *)bt_dev.id_addr, &len);
     bt_storage_kv_get(KEY_INDEX_LE_ID_ADDR_LIST, (uint8_t *)bt_dev.id_addr, &len);
     if (len < sizeof(bt_dev.id_addr[0]))
     if (len < sizeof(bt_dev.id_addr[0]))
     {
     {

+ 6 - 0
src/host/keys.c

@@ -166,6 +166,7 @@ int bt_storage_kv_get_key_item(uint8_t index, struct bt_keys *keys)
     return bt_storage_kv_get(KEY_INDEX_LE_KEY_INFO_ITEM(index), keys->storage_start, &len);
     return bt_storage_kv_get(KEY_INDEX_LE_KEY_INFO_ITEM(index), keys->storage_start, &len);
 }
 }
 
 
+#if defined(CONFIG_BT_SETTINGS)
 static void bt_storage_kv_key_store(struct bt_keys *keys)
 static void bt_storage_kv_key_store(struct bt_keys *keys)
 {
 {
     uint8_t id = keys->id;
     uint8_t id = keys->id;
@@ -183,7 +184,9 @@ static void bt_storage_kv_key_store(struct bt_keys *keys)
     bt_storage_kv_set_key_list_info_append(&list_info, id, addr, select_index);
     bt_storage_kv_set_key_list_info_append(&list_info, id, addr, select_index);
     bt_storage_kv_set_key_item(select_index, keys);
     bt_storage_kv_set_key_item(select_index, keys);
 }
 }
+#endif
 
 
+__unused
 static int bt_storage_kv_key_get(struct bt_keys *keys)
 static int bt_storage_kv_key_get(struct bt_keys *keys)
 {
 {
     uint8_t id = keys->id;
     uint8_t id = keys->id;
@@ -201,6 +204,7 @@ static int bt_storage_kv_key_get(struct bt_keys *keys)
     return 0;
     return 0;
 }
 }
 
 
+#if defined(CONFIG_BT_SETTINGS)
 static void bt_storage_kv_key_delete(struct bt_keys *keys)
 static void bt_storage_kv_key_delete(struct bt_keys *keys)
 {
 {
     uint8_t id = keys->id;
     uint8_t id = keys->id;
@@ -209,6 +213,7 @@ static void bt_storage_kv_key_delete(struct bt_keys *keys)
     bt_storage_kv_get_key_list_info(&list_info);
     bt_storage_kv_get_key_list_info(&list_info);
     bt_storage_kv_set_key_list_info_delete(&list_info, id, addr);
     bt_storage_kv_set_key_list_info_delete(&list_info, id, addr);
 }
 }
+#endif
 
 
 #if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
 #if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
 static uint32_t aging_counter_val;
 static uint32_t aging_counter_val;
@@ -510,6 +515,7 @@ int bt_keys_store(struct bt_keys *keys)
     return 0;
     return 0;
 }
 }
 
 
+__unused
 static void id_add(struct bt_keys *keys, void *user_data)
 static void id_add(struct bt_keys *keys, void *user_data)
 {
 {
     // bt_id_add(keys);
     // bt_id_add(keys);

+ 2 - 2
src/host/scan.c

@@ -88,7 +88,7 @@ void bt_scan_reset(void)
 static int set_le_ext_scan_enable(uint8_t enable, uint16_t duration)
 static int set_le_ext_scan_enable(uint8_t enable, uint16_t duration)
 {
 {
     struct bt_hci_cp_le_set_ext_scan_enable *cp;
     struct bt_hci_cp_le_set_ext_scan_enable *cp;
-    struct bt_hci_cmd_state_set state;
+    // struct bt_hci_cmd_state_set state;
     struct net_buf *buf;
     struct net_buf *buf;
     int err;
     int err;
 
 
@@ -128,7 +128,7 @@ static int set_le_ext_scan_enable(uint8_t enable, uint16_t duration)
 static int bt_le_scan_set_enable_legacy(uint8_t enable)
 static int bt_le_scan_set_enable_legacy(uint8_t enable)
 {
 {
     struct bt_hci_cp_le_set_scan_enable *cp;
     struct bt_hci_cp_le_set_scan_enable *cp;
-    struct bt_hci_cmd_state_set state;
+    // struct bt_hci_cmd_state_set state;
     struct net_buf *buf;
     struct net_buf *buf;
     int err;
     int err;
 
 

+ 1 - 0
src/host/smp.c

@@ -4871,6 +4871,7 @@ static int bt_smp_recv(struct bt_l2cap_chan *chan, struct net_buf *buf)
     return 0;
     return 0;
 }
 }
 
 
+__unused
 static void bt_smp_pkey_ready(const uint8_t *pkey)
 static void bt_smp_pkey_ready(const uint8_t *pkey)
 {
 {
     int i;
     int i;