nimble/ll: Fix HCI Set Resolving Timeout
With this patch, controller will accept resolving timeout even resolving
is not yet enabled.
Need it for LL testing
@@ -368,13 +368,18 @@ ble_ll_resolv_set_rpa_tmo(uint8_t *cmdbuf)
return BLE_ERR_INV_HCI_CMD_PARMS;
}
- if (!g_ble_ll_resolv_data.addr_res_enabled) {
- return BLE_ERR_CMD_DISALLOWED;
+ g_ble_ll_resolv_data.rpa_tmo = tmo_secs * OS_TICKS_PER_SEC;
+
+ /* If resolving is not enabled, we are done here. */
+ if (!ble_ll_resolv_enabled()) {
+ return BLE_ERR_SUCCESS;
}
- g_ble_ll_resolv_data.rpa_tmo = tmo_secs * OS_TICKS_PER_SEC;
- return os_callout_reset(&g_ble_ll_resolv_data.rpa_timer,
+ /* Reset timeout if resolving is enabled */
+ os_callout_reset(&g_ble_ll_resolv_data.rpa_timer,
(int32_t)g_ble_ll_resolv_data.rpa_tmo);
+
+ return BLE_ERR_SUCCESS;
}
int
