Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ endchoice

endif #BLUETOOTH_FRAMEWORK

config FEATURE_ERROR_CODE_CONVERT
bool "FEATURE error code conversion"
default n
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FEATURE_ERROR_CODE_CONVERT configuration option is missing a help text. Kconfig options should include help text to explain their purpose, when to enable them, and any implications of enabling/disabling the option. This is especially important given that this appears to be a workaround for a framework synchronization issue.

Suggested change
default n
default n
help
Enable conversion of FEATURE framework error codes to Bluetooth-specific
error codes for compatibility with different framework versions.
Enable this only when you need to synchronize error handling between
components or frameworks, as it may mask underlying integration issues.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FEATURE_ERROR_CODE_CONVERT configuration option is placed outside the BLUETOOTH_FRAMEWORK conditional block (which ends at line 82), even though it's only used within feature_bluetooth_util.c which is part of the feature_async module. Consider whether this option should be placed inside the BLUETOOTH_FRAMEWORK block or should have a dependency on BLUETOOTH_FRAMEWORK or BLUETOOTH_FEATURE_ASYNC to ensure it's only available when the relevant code is compiled.

Suggested change
default n
default n
depends on BLUETOOTH_FEATURE_ASYNC

Copilot uses AI. Check for mistakes.

menu "Core"
config BLUETOOTH_BREDR_SUPPORT
bool "Bluetooth BREDR"
Expand Down
3 changes: 3 additions & 0 deletions feature/feature_async/src/feature_bluetooth_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ bt_instance_t* feature_bluetooth_get_bt_ins(FeatureInstanceHandle feature)

FeatureErrorCode bt_status_to_feature_error(uint8_t status)
{
#ifdef FEATURE_ERROR_CODE_CONVERT
return FT_ERR_GENERAL;
#else
Comment on lines +152 to +154
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When FEATURE_ERROR_CODE_CONVERT is enabled, this function unconditionally returns FT_ERR_GENERAL for all Bluetooth status codes, losing important error context. This means all specific error conditions like BT_STATUS_NOT_ENABLED, BT_STATUS_PARM_INVALID, and BT_STATUS_NOT_FOUND will be mapped to the same generic error. Consider if this is the intended behavior, or if the conversion should still differentiate between different error types. If this is intentional as a temporary workaround for the framework patch synchronization issue, add a comment explaining this and noting that proper error mapping should be restored later.

Suggested change
#ifdef FEATURE_ERROR_CODE_CONVERT
return FT_ERR_GENERAL;
#else

Copilot uses AI. Check for mistakes.
switch (status) {
case BT_STATUS_FAIL:
return FT_ERR_GENERAL;
Expand Down
Loading