-
Notifications
You must be signed in to change notification settings - Fork 4
REFPLTV-3050: when there is no supported RCU models in configuration, no need to startPairing #183
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,6 +200,12 @@ bool BleRcuControllerImpl::startPairingAutoWithTimeout(int timeoutMs) | |
| { | ||
| m_ignorePairingFailure = false; | ||
|
|
||
| if (m_config->modelSettings().empty()) { | ||
| m_lastError = BleRcuError(BleRcuError::General, "No BLE RCU models configured"); | ||
| XLOGD_WARN("cannot start BLE auto pairing - no RCU models configured"); | ||
| return false; | ||
| } | ||
|
Comment on lines
+203
to
+207
|
||
|
|
||
| // check we're not currently pairing | ||
| if (m_pairingStateMachine.isRunning()) { | ||
| m_lastError = BleRcuError(BleRcuError::General, "currently performing pairing, cannot start new scan"); | ||
|
Comment on lines
+203
to
211
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigSettings::modelSettings()returns the vector by value, so callingm_config->modelSettings().empty()copies the entire model list just to check emptiness. If this path can be hit repeatedly, consider caching the returned vector in a local variable (or adding a cheaphasModelSettings()/ const-ref accessor onConfigSettings).