From 0301b1a999f028e5dd6a42f65b254121342738d8 Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Wed, 2 Aug 2023 17:46:32 +0800 Subject: [PATCH] Pandora: Configure identity address type --- bumble/pandora/config.py | 9 ++++++++- bumble/pandora/security.py | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bumble/pandora/config.py b/bumble/pandora/config.py index 5edba553..fa448b85 100644 --- a/bumble/pandora/config.py +++ b/bumble/pandora/config.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from bumble.pairing import PairingDelegate +from bumble.pairing import PairingConfig, PairingDelegate from dataclasses import dataclass from typing import Any, Dict @@ -20,6 +20,7 @@ from typing import Any, Dict @dataclass class Config: io_capability: PairingDelegate.IoCapability = PairingDelegate.NO_OUTPUT_NO_INPUT + identity_address_type: PairingConfig.AddressType = PairingConfig.AddressType.RANDOM pairing_sc_enable: bool = True pairing_mitm_enable: bool = True pairing_bonding_enable: bool = True @@ -35,6 +36,12 @@ class Config: 'io_capability', 'no_output_no_input' ).upper() self.io_capability = getattr(PairingDelegate, io_capability_name) + identity_address_type_name: str = config.get( + 'identity_address_type', 'random' + ).upper() + self.identity_address_type = getattr( + PairingConfig.AddressType, identity_address_type_name + ) self.pairing_sc_enable = config.get('pairing_sc_enable', True) self.pairing_mitm_enable = config.get('pairing_mitm_enable', True) self.pairing_bonding_enable = config.get('pairing_bonding_enable', True) diff --git a/bumble/pandora/security.py b/bumble/pandora/security.py index 9f98f3ff..fb6fd6f7 100644 --- a/bumble/pandora/security.py +++ b/bumble/pandora/security.py @@ -232,6 +232,7 @@ class SecurityService(SecurityServicer): sc=config.pairing_sc_enable, mitm=config.pairing_mitm_enable, bonding=config.pairing_bonding_enable, + identity_address_type=config.identity_address_type, delegate=PairingDelegate( connection, self,