Skip to content

Commit 4b1ce49

Browse files
use sets to apply limits
1 parent 588e68b commit 4b1ce49

File tree

1 file changed

+10
-3
lines changed
  • features/FEATURE_BLE/ble

1 file changed

+10
-3
lines changed

features/FEATURE_BLE/ble/Gap.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,9 +2112,16 @@ class Gap {
21122112
*
21132113
* @note All restrictions from setScanParams(uint16_t, uint16_t, uint16_t, bool) apply.
21142114
*/
2115-
ble_error_t setScanParams(GapScanningParams scanningParams) {
2116-
_scanningParams = scanningParams;
2117-
return BLE_ERROR_NONE;
2115+
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;
21182125
}
21192126

21202127
/**

0 commit comments

Comments
 (0)