Просмотр исходного кода

examples: advanced_https_ota: make some globals static

Ivan Grokhotkov 4 лет назад
Родитель
Сommit
7dac0abdff

+ 6 - 13
examples/system/ota/advanced_https_ota/main/ble_helper/bluedroid_gatts.c

@@ -1,16 +1,8 @@
-// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
 
 #include "bluedroid_gatts.h"
 #include "esp_log.h"
@@ -19,6 +11,7 @@
 #if CONFIG_BT_BLE_ENABLED
 
 static const char *TAG = "bluedroid_gatts";
+static prepare_type_env_t a_prepare_write_env;
 
 uint8_t adv_service_uuid128[32] = {
     /* LSB <--------------------------------------------------------------------------------> MSB */

+ 5 - 15
examples/system/ota/advanced_https_ota/main/ble_helper/include/bluedroid_gatts.h

@@ -1,16 +1,8 @@
-// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
 
 #ifndef H_BLUEDROID_GATTS_
 #define H_BLUEDROID_GATTS_
@@ -68,8 +60,6 @@ typedef struct {
     int                     prepare_len;
 } prepare_type_env_t;
 
-prepare_type_env_t a_prepare_write_env;
-
 void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
 
 void example_write_event_env(esp_gatt_if_t gatts_if, prepare_type_env_t *prepare_write_env, esp_ble_gatts_cb_param_t *param);

+ 5 - 14
examples/system/ota/advanced_https_ota/main/ble_helper/include/nimble_gatts.h

@@ -1,16 +1,8 @@
-// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
 
 #ifndef H_NIMBLE_GATTS_
 #define H_NIMBLE_GATTS_
@@ -37,7 +29,6 @@ struct ble_hs_cfg;
 struct ble_gatt_register_ctxt;
 
 int bleprph_gap_event(struct ble_gap_event *event, void *arg);
-uint8_t own_addr_type;
 
 /** GATT server. */
 #define GATT_SVR_SVC_ALERT_UUID               0x1811

+ 6 - 13
examples/system/ota/advanced_https_ota/main/ble_helper/nimble_gatts.c

@@ -1,16 +1,8 @@
-// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
 
 #include "sdkconfig.h"
 
@@ -21,6 +13,7 @@
 #include "services/gatt/ble_svc_gatt.h"
 
 static const char *TAG = "nimble_gatts";
+static uint8_t own_addr_type;
 
 static const ble_uuid128_t gatt_svr_svc_sec_test_uuid =
     BLE_UUID128_INIT(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12,

+ 0 - 4
tools/ci/check_copyright_ignore.txt

@@ -2819,11 +2819,7 @@ examples/system/light_sleep/main/light_sleep_example_main.c
 examples/system/ota/advanced_https_ota/example_test.py
 examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c
 examples/system/ota/advanced_https_ota/main/ble_helper/ble_api.c
-examples/system/ota/advanced_https_ota/main/ble_helper/bluedroid_gatts.c
 examples/system/ota/advanced_https_ota/main/ble_helper/include/ble_api.h
-examples/system/ota/advanced_https_ota/main/ble_helper/include/bluedroid_gatts.h
-examples/system/ota/advanced_https_ota/main/ble_helper/include/nimble_gatts.h
-examples/system/ota/advanced_https_ota/main/ble_helper/nimble_gatts.c
 examples/system/ota/native_ota_example/example_test.py
 examples/system/ota/native_ota_example/main/native_ota_example.c
 examples/system/ota/otatool/example_test.py