mirror of
https://github.com/google/bumble.git
synced 2026-06-01 07:37:02 +00:00
Merge pull request #771 from khsiao-google/update
Improve connection related functions and names
This commit is contained in:
+13
-10
@@ -24,7 +24,7 @@ from unittest import mock
|
||||
import pytest
|
||||
|
||||
from bumble import device, gatt, hci, utils
|
||||
from bumble.core import ConnectionParameters, PhysicalTransport
|
||||
from bumble.core import PhysicalTransport
|
||||
from bumble.device import (
|
||||
AdvertisingEventProperties,
|
||||
AdvertisingParameters,
|
||||
@@ -289,14 +289,15 @@ async def test_legacy_advertising_disconnection(auto_restart):
|
||||
await device.power_on()
|
||||
peer_address = Address('F0:F1:F2:F3:F4:F5')
|
||||
await device.start_advertising(auto_restart=auto_restart)
|
||||
device.on_connection(
|
||||
device.on_le_connection_complete(
|
||||
0x0001,
|
||||
PhysicalTransport.LE,
|
||||
peer_address,
|
||||
None,
|
||||
None,
|
||||
Role.PERIPHERAL,
|
||||
ConnectionParameters(0, 0, 0),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
)
|
||||
|
||||
device.on_advertising_set_termination(
|
||||
@@ -347,14 +348,15 @@ async def test_extended_advertising_connection(own_address_type):
|
||||
advertising_set = await device.create_advertising_set(
|
||||
advertising_parameters=AdvertisingParameters(own_address_type=own_address_type)
|
||||
)
|
||||
device.on_connection(
|
||||
device.on_le_connection_complete(
|
||||
0x0001,
|
||||
PhysicalTransport.LE,
|
||||
peer_address,
|
||||
None,
|
||||
None,
|
||||
Role.PERIPHERAL,
|
||||
ConnectionParameters(0, 0, 0),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
)
|
||||
device.on_advertising_set_termination(
|
||||
HCI_SUCCESS,
|
||||
@@ -391,14 +393,15 @@ async def test_extended_advertising_connection_out_of_order(own_address_type):
|
||||
0x0001,
|
||||
0,
|
||||
)
|
||||
device.on_connection(
|
||||
device.on_le_connection_complete(
|
||||
0x0001,
|
||||
PhysicalTransport.LE,
|
||||
Address('F0:F1:F2:F3:F4:F5'),
|
||||
None,
|
||||
None,
|
||||
Role.PERIPHERAL,
|
||||
ConnectionParameters(0, 0, 0),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
)
|
||||
|
||||
if own_address_type == OwnAddressType.PUBLIC:
|
||||
|
||||
Reference in New Issue
Block a user