Skip to content

Commit 399191f

Browse files
reuse existing call
1 parent 4b1ce49 commit 399191f

File tree

1 file changed

+6
-9
lines changed
  • features/FEATURE_BLE/ble

1 file changed

+6
-9
lines changed

features/FEATURE_BLE/ble/Gap.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,15 +2113,12 @@ class Gap {
21132113
* @note All restrictions from setScanParams(uint16_t, uint16_t, uint16_t, bool) apply.
21142114
*/
21152115
ble_error_t setScanParams(const GapScanningParams& scanningParams) {
2116-
ble_error_t rc;
2117-
if (((rc = _scanningParams.setInterval(scanningParams.getInterval())) == BLE_ERROR_NONE) &&
2118-
((rc = _scanningParams.setWindow(scanningParams.getWindow())) == BLE_ERROR_NONE) &&
2119-
((rc = _scanningParams.setTimeout(scanningParams.getTimeout())) == BLE_ERROR_NONE)) {
2120-
_scanningParams.setActiveScanning(scanningParams.getActiveScanning());
2121-
return BLE_ERROR_NONE;
2122-
}
2123-
2124-
return rc;
2116+
return setScanParams(
2117+
scanningParams.getInterval(),
2118+
scanningParams.getWindow(),
2119+
scanningParams.getTimeout(),
2120+
scanningParams.getActiveScanning()
2121+
);
21252122
}
21262123

21272124
/**

0 commit comments

Comments
 (0)