btdev: Fix not checking conditions for LE Set Random Address
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 16 Jul 2021 20:27:16 +0000 (13:27 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:36 +0000 (19:08 +0530)
commit51edaa9885588ea2036dc14795efa5228185203e
tree0cd5dc680e06001ecda4a814fe2a3fc2a1d6b7ee
parent514468081cb5c3cdc0e4e29cf7565b48c5ab4713
btdev: Fix not checking conditions for LE Set Random Address

The spec says LE Set Random Address cannot be used when scan is enabled
or with legacy advertising:

BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 4, Part E
page 2480

  'If the Host issues this command when any of advertising (created
  using legacy advertising commands), scanning, or initiating are
  enabled, the Controller shall return the error code Command
  Disallowed (0x0C).'

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
emulator/btdev.c