Skip to content

Commit 42e4290

Browse files
error when there is no handler
1 parent fa36ed0 commit 42e4290

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static const GapScanningParams default_scan_params;
6464
static const mbed_error_status_t mixed_scan_api_error =
6565
MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_USE_INCOMPATIBLE_API);
6666

67+
static const mbed_error_status_t illegal_state_error =
68+
MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_ILLEGAL_STATE);
69+
70+
6771
/*
6872
* Return true if value is included in the range [lower_bound : higher_bound]
6973
*/
@@ -1792,6 +1796,8 @@ void GenericGap::on_connection_parameter_request(const pal::GapRemoteConnectionP
17921796
supervision_timeout_t(e.supervision_timeout)
17931797
)
17941798
);
1799+
} else {
1800+
MBED_ERROR(illegal_state_error, "Event handler required if connection params are user handled");
17951801
}
17961802
} else {
17971803
_pal_gap.accept_connection_parameter_request(

platform/mbed_error.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ typedef enum _mbed_error_code {
792792
MBED_DEFINE_SYSTEM_ERROR(AUTHENTICATION_FAILED, 69), /* 325 Authentication Failed */
793793
MBED_DEFINE_SYSTEM_ERROR(RBP_AUTHENTICATION_FAILED, 70), /* 326 Rollback Protection Authentication Failed */
794794
MBED_DEFINE_SYSTEM_ERROR(BLE_USE_INCOMPATIBLE_API, 71), /* 327 Concurrent use of incompatible versions of a BLE API */
795+
MBED_DEFINE_SYSTEM_ERROR(BLE_ILLEGAL_STATE, 72), /* 328 BLE stack entered illegal state */
795796

796797
//Everytime you add a new system error code, you must update
797798
//Error documentation under Handbook to capture the info on

0 commit comments

Comments
 (0)