From 7dac0abdff916fced36f409e6d4a64fc64abfae4 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 14 Jan 2022 19:00:47 +0100 Subject: [PATCH] examples: advanced_https_ota: make some globals static --- .../main/ble_helper/bluedroid_gatts.c | 19 ++++++------------ .../main/ble_helper/include/bluedroid_gatts.h | 20 +++++-------------- .../main/ble_helper/include/nimble_gatts.h | 19 +++++------------- .../main/ble_helper/nimble_gatts.c | 19 ++++++------------ tools/ci/check_copyright_ignore.txt | 4 ---- 5 files changed, 22 insertions(+), 59 deletions(-) diff --git a/examples/system/ota/advanced_https_ota/main/ble_helper/bluedroid_gatts.c b/examples/system/ota/advanced_https_ota/main/ble_helper/bluedroid_gatts.c index c8fd0e5917..c09955f1ce 100644 --- a/examples/system/ota/advanced_https_ota/main/ble_helper/bluedroid_gatts.c +++ b/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 */ diff --git a/examples/system/ota/advanced_https_ota/main/ble_helper/include/bluedroid_gatts.h b/examples/system/ota/advanced_https_ota/main/ble_helper/include/bluedroid_gatts.h index 13aee0cc01..b685a3d031 100644 --- a/examples/system/ota/advanced_https_ota/main/ble_helper/include/bluedroid_gatts.h +++ b/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); diff --git a/examples/system/ota/advanced_https_ota/main/ble_helper/include/nimble_gatts.h b/examples/system/ota/advanced_https_ota/main/ble_helper/include/nimble_gatts.h index 0133136df3..8c52e7e81a 100644 --- a/examples/system/ota/advanced_https_ota/main/ble_helper/include/nimble_gatts.h +++ b/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 diff --git a/examples/system/ota/advanced_https_ota/main/ble_helper/nimble_gatts.c b/examples/system/ota/advanced_https_ota/main/ble_helper/nimble_gatts.c index 9037549a34..9045cb4f18 100644 --- a/examples/system/ota/advanced_https_ota/main/ble_helper/nimble_gatts.c +++ b/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, diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index c8503a1683..3cf2ee7163 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/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