Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force including <ble/Ble.h> umbrella header instead of specific headers #33023

Merged
merged 6 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/all-clusters-app/asr/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
#pragma once

#include "AppEvent.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <lega_rtos_api.h>
#include <platform/CHIPDeviceLayer.h>
#include <stdbool.h>
2 changes: 1 addition & 1 deletion examples/all-clusters-app/infineon/psoc6/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
#include "AppEvent.h"
#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
2 changes: 1 addition & 1 deletion examples/all-clusters-minimal-app/asr/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
#include "AppEvent.h"
#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
#include "AppEvent.h"
#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
2 changes: 1 addition & 1 deletion examples/chef/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@

#include "AppEvent.h"
#include "BaseApplication.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/light-switch-app/asr/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@

#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@

#include "AppEvent.h"
#include "BaseApplication.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/lighting-app/infineon/psoc6/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
2 changes: 1 addition & 1 deletion examples/lighting-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
#include "AppEvent.h"
#include "BaseApplication.h"
#include "LightingManager.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/lit-icd-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@

#include "AppEvent.h"
#include "BaseApplication.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/lock-app/asr/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
#include <lock/BoltLockManager.h>

#include "freertos/FreeRTOS.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>

2 changes: 1 addition & 1 deletion examples/lock-app/infineon/psoc6/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
2 changes: 1 addition & 1 deletion examples/lock-app/qpg/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>

2 changes: 1 addition & 1 deletion examples/lock-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
#include "AppEvent.h"
#include "BaseApplication.h"
#include "LockManager.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/platform/silabs/BaseApplication.h
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
#include <app/clusters/identify-server/identify-server.h>
#include <app/server/AppDelegate.h>
#include <app/util/config.h>
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceEvent.h>
2 changes: 1 addition & 1 deletion examples/pump-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
#include "AppEvent.h"
#include "BaseApplication.h"
#include "PumpManager.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/smoke-co-alarm-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
#include "AppEvent.h"
#include "BaseApplication.h"
#include "SmokeCoAlarmManager.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/temperature-measurement-app/asr/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
#include "AppEvent.h"
#include "FreeRTOS.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

// Application-defined error codes in the CHIP_ERROR space.
2 changes: 1 addition & 1 deletion examples/thermostat/asr/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
#include "SensorManager.h"
#include "TemperatureManager.h"
#include "timers.h" // provides FreeRTOS timer support
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <platform/CHIPDeviceLayer.h>

#include <FreeRTOS.h>
2 changes: 1 addition & 1 deletion examples/thermostat/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
#include "BaseApplication.h"
#include "SensorManager.h"
#include "TemperatureManager.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
2 changes: 1 addition & 1 deletion examples/window-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
#include <stdint.h>

#include "BaseApplication.h"
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#include <cmsis_os2.h>
#include <lib/core/CHIPError.h>
#include <platform/CHIPDeviceLayer.h>
55 changes: 27 additions & 28 deletions scripts/helpers/iwyu-check.py
Original file line number Diff line number Diff line change
@@ -51,42 +51,38 @@ def find_program(names):
@click.command()
@click.option(
'--log-level',
default='INFO',
show_default=True,
default='info',
type=click.Choice(__LOG_LEVELS__.keys(), case_sensitive=False),
help='Determines the verbosity of script output.')
help='Set the verbosity of script output.')
@click.option(
'--no-log-timestamps',
default=False,
is_flag=True,
help='Skip timestamps in log output')
help='Skip timestamps in log output.')
@click.option(
'--compile-commands-glob',
show_default=True,
default=os.path.join(proj_root_dir, "out", "debug", "compile_commands*.json"),
help='Set global pattern for compile_commands.json files'
)
@click.option(
'--scanning-destination',
show_default=True,
default=os.path.join(proj_root_dir, "src", "platform"),
help='Set scanning destination file(s) or directory /ies in project'
)
default=os.path.join(proj_root_dir, "out", "debug",
"compile_commands*.json"),
help='Set global pattern for compile_commands.json files.')
@click.option(
'--mapping-file-dir',
help='Set mapping file directory /ies manually. File should have name iwyu.imp'
)
help='Set directory with iwyu.imp mapping file.')
@click.option(
'--iwyu-args',
show_default=True,
default="-Xiwyu --no_fwd_decls",
help='Set custom arg(s) for include what you use'
)
help='Set custom arg(s) for include what you use.')
@click.option(
'--clang-args',
default="",
help='Set custom arg(s) for clang'
)
def main(compile_commands_glob, scanning_destination, mapping_file_dir,
help='Set custom arg(s) for clang.')
@click.argument(
'source',
nargs=-1,
type=click.Path(exists=True))
def main(compile_commands_glob, source, mapping_file_dir,
iwyu_args, clang_args, log_level, no_log_timestamps):
# Ensures somewhat pretty logging of what is going on
log_fmt = '%(asctime)s %(levelname)-7s %(message)s'
@@ -114,8 +110,10 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir,
for compile_commands in compile_commands_glob:

compile_commands_path = os.path.dirname(compile_commands)
compile_commands_file = os.path.join(compile_commands_path, "compile_commands.json")
logging.debug("Copy compile command file %s to %s", compile_commands, compile_commands_file)
compile_commands_file = os.path.join(
compile_commands_path, "compile_commands.json")
logging.debug("Copy compile command file %s to %s",
compile_commands, compile_commands_file)

with contextlib.suppress(shutil.SameFileError):
shutil.copyfile(compile_commands, compile_commands_file)
@@ -153,14 +151,14 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir,

command_arr = [
iwyu,
"-p", compile_commands_path, scanning_destination,
"-p", compile_commands_path, *source,
"--", iwyu_args,
"-Xiwyu", "--mapping_file=" + mapping_file_dir + "/iwyu.imp",
] + platform_clang_args + [clang_args]

logging.info("Used compile commands: %s", compile_commands)
logging.info("Scanning includes for platform: %s", platform)
logging.info("Scanning destination: %s", scanning_destination)
logging.info("Scanning sources(s): %s", ", ".join(source))

logging.debug("Command: %s", " ".join(command_arr))
status = subprocess.Popen(" ".join(command_arr),
@@ -175,13 +173,13 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir,
for line in status.stdout:
line = line.rstrip()

if re.match(r"^warning:.*$", line):
if re.search(r"^warning:", line):
logger = logging.warning
elif re.match(r"^.*([A-Za-z0-9]+(/[A-Za-z0-9]+)+)\.cpp should [a-zA-Z]+ these lines:$", line):
elif re.search(r"should (add|remove)? these lines:$", line):
logger = logging.warning
elif re.match(r"^.*([A-Za-z0-9]+(/[A-Za-z0-9]+)+)\.[a-zA-Z]+ has correct #includes/fwd-decls\)$", line):
elif re.search(r"has correct #includes/fwd-decls\)$", line):
logger = logging.info
elif re.match(r"^The full include-list for .*$", line):
elif re.search(r"^The full include-list for", line):
logger = logging.warning
warning_in_files += 1

@@ -190,7 +188,8 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir,
logging.info("============== IWYU output end ================")

if warning_in_files:
logging.error("Number of files with include issues: %d", warning_in_files)
logging.error("Number of files with include issues: %d",
warning_in_files)
sys.exit(2)
else:
logging.info("Every include looks good!")
2 changes: 1 addition & 1 deletion src/app/server/Server.cpp
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
#include <app/util/ember-compatibility-functions.h>

#if CONFIG_NETWORK_LAYER_BLE
#include <ble/BLEEndPoint.h>
#include <ble/Ble.h>
#endif
#include <inet/IPAddress.h>
#include <inet/InetError.h>
31 changes: 18 additions & 13 deletions src/ble/BLEEndPoint.cpp
Original file line number Diff line number Diff line change
@@ -25,22 +25,29 @@
*
*/

#include <stdint.h>
#include <string.h>
#define _CHIP_BLE_BLE_H
#include "BLEEndPoint.h"

#include <ble/BleConfig.h>

#if CONFIG_NETWORK_LAYER_BLE
#include <lib/core/CHIPConfig.h>
#include <cstdint>
#include <cstring>
#include <utility>

#include <lib/support/BitFlags.h>
#include <lib/support/CHIPFaultInjection.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>

#include <ble/BLEEndPoint.h>
#include <ble/BleLayer.h>
#include <ble/BtpEngine.h>
#include <system/SystemClock.h>
#include <system/SystemLayer.h>
#include <system/SystemPacketBuffer.h>

#include "BleApplicationDelegate.h"
#include "BleConfig.h"
#include "BleError.h"
#include "BleLayer.h"
#include "BleLayerDelegate.h"
#include "BlePlatformDelegate.h"
#include "BleRole.h"
#include "BleUUID.h"
#include "BtpEngine.h"

// Define below to enable extremely verbose, BLE end point-specific debug logging.
#undef CHIP_BLE_END_POINT_DEBUG_LOGGING_ENABLED
@@ -1498,5 +1505,3 @@ void BLEEndPoint::HandleUnsubscribeTimeout(chip::System::Layer * systemLayer, vo

} /* namespace Ble */
} /* namespace chip */

#endif /* CONFIG_NETWORK_LAYER_BLE */
Loading
Loading