examples: advanced_https_ota: make some globals static

This commit is contained in:
Ivan Grokhotkov
2022-01-14 19:00:47 +01:00
committed by Anton Maklakov
parent 9d3e618bc5
commit 7dac0abdff
5 changed files with 22 additions and 59 deletions

View File

@@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include "bluedroid_gatts.h" #include "bluedroid_gatts.h"
#include "esp_log.h" #include "esp_log.h"
@@ -19,6 +11,7 @@
#if CONFIG_BT_BLE_ENABLED #if CONFIG_BT_BLE_ENABLED
static const char *TAG = "bluedroid_gatts"; static const char *TAG = "bluedroid_gatts";
static prepare_type_env_t a_prepare_write_env;
uint8_t adv_service_uuid128[32] = { uint8_t adv_service_uuid128[32] = {
/* LSB <--------------------------------------------------------------------------------> MSB */ /* LSB <--------------------------------------------------------------------------------> MSB */

View File

@@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#ifndef H_BLUEDROID_GATTS_ #ifndef H_BLUEDROID_GATTS_
#define H_BLUEDROID_GATTS_ #define H_BLUEDROID_GATTS_
@@ -68,8 +60,6 @@ typedef struct {
int prepare_len; int prepare_len;
} prepare_type_env_t; } 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 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); 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);

View File

@@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#ifndef H_NIMBLE_GATTS_ #ifndef H_NIMBLE_GATTS_
#define H_NIMBLE_GATTS_ #define H_NIMBLE_GATTS_
@@ -37,7 +29,6 @@ struct ble_hs_cfg;
struct ble_gatt_register_ctxt; struct ble_gatt_register_ctxt;
int bleprph_gap_event(struct ble_gap_event *event, void *arg); int bleprph_gap_event(struct ble_gap_event *event, void *arg);
uint8_t own_addr_type;
/** GATT server. */ /** GATT server. */
#define GATT_SVR_SVC_ALERT_UUID 0x1811 #define GATT_SVR_SVC_ALERT_UUID 0x1811

View File

@@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include "sdkconfig.h" #include "sdkconfig.h"
@@ -21,6 +13,7 @@
#include "services/gatt/ble_svc_gatt.h" #include "services/gatt/ble_svc_gatt.h"
static const char *TAG = "nimble_gatts"; static const char *TAG = "nimble_gatts";
static uint8_t own_addr_type;
static const ble_uuid128_t gatt_svr_svc_sec_test_uuid = static const ble_uuid128_t gatt_svr_svc_sec_test_uuid =
BLE_UUID128_INIT(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12, BLE_UUID128_INIT(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12,

View File

@@ -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/example_test.py
examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c 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/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/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/example_test.py
examples/system/ota/native_ota_example/main/native_ota_example.c examples/system/ota/native_ota_example/main/native_ota_example.c
examples/system/ota/otatool/example_test.py examples/system/ota/otatool/example_test.py