Skip to content
Commit 5a09325b authored by Aleksander Wasaznik's avatar Aleksander Wasaznik Committed by Fabio Baltieri
Browse files

Bluetooth: Simplify predicate for host-based RPA resolution



The expression for the condition for using host-based RPA resolution now
simplifies to "Use host-based when we need to resolve more identities
than the controller can handle.".

Proof:
X=((bt_dev.le.rl_entries > 0) && (!bt_dev.le.rl_size ||
        bt_dev.le.rl_entries > bt_dev.le.rl_size))
X=(a > 0) && (!b || a > b)
a>=0, b>=0, because they are cardinal / size_t.
If a=0:
	// X evaluates to false. (0 > b)=(a > b) also always evaluates to false.
	X=false=(0 > b)=(a > b)
If a>0:
        X=(!b || a > b)
        If b=0: X=true=(a > 0)=(a > b)
        If b>0: X=(false || (a > b))=(a > b)
The expression is equivalent with (a > b) for all values of (a,b).
QED.

Signed-off-by: default avatarAleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
parent 404d0c7a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment