forked from auracaster/bumble_mirror
Do not exit after pairing is finished
Android performs additional service discovery during pairing, otherwise pairing fails.
This commit is contained in:
+9
-2
@@ -291,6 +291,7 @@ async def pair(
|
|||||||
mitm,
|
mitm,
|
||||||
bond,
|
bond,
|
||||||
ctkd,
|
ctkd,
|
||||||
|
linger,
|
||||||
io,
|
io,
|
||||||
oob,
|
oob,
|
||||||
prompt,
|
prompt,
|
||||||
@@ -395,6 +396,7 @@ async def pair(
|
|||||||
address_or_name,
|
address_or_name,
|
||||||
transport=BT_LE_TRANSPORT if mode == 'le' else BT_BR_EDR_TRANSPORT,
|
transport=BT_LE_TRANSPORT if mode == 'le' else BT_BR_EDR_TRANSPORT,
|
||||||
)
|
)
|
||||||
|
pairing_failure = False
|
||||||
|
|
||||||
if not request:
|
if not request:
|
||||||
try:
|
try:
|
||||||
@@ -402,10 +404,12 @@ async def pair(
|
|||||||
await connection.pair()
|
await connection.pair()
|
||||||
else:
|
else:
|
||||||
await connection.authenticate()
|
await connection.authenticate()
|
||||||
return
|
|
||||||
except ProtocolError as error:
|
except ProtocolError as error:
|
||||||
|
pairing_failure = True
|
||||||
print(color(f'Pairing failed: {error}', 'red'))
|
print(color(f'Pairing failed: {error}', 'red'))
|
||||||
return
|
|
||||||
|
if not linger or pairing_failure:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
if mode == 'le':
|
if mode == 'le':
|
||||||
# Advertise so that peers can find us and connect
|
# Advertise so that peers can find us and connect
|
||||||
@@ -455,6 +459,7 @@ class LogHandler(logging.Handler):
|
|||||||
help='Enable CTKD',
|
help='Enable CTKD',
|
||||||
show_default=True,
|
show_default=True,
|
||||||
)
|
)
|
||||||
|
@click.option('--linger', default=True, is_flag=True, help='Linger after pairing')
|
||||||
@click.option(
|
@click.option(
|
||||||
'--io',
|
'--io',
|
||||||
type=click.Choice(
|
type=click.Choice(
|
||||||
@@ -490,6 +495,7 @@ def main(
|
|||||||
mitm,
|
mitm,
|
||||||
bond,
|
bond,
|
||||||
ctkd,
|
ctkd,
|
||||||
|
linger,
|
||||||
io,
|
io,
|
||||||
oob,
|
oob,
|
||||||
prompt,
|
prompt,
|
||||||
@@ -514,6 +520,7 @@ def main(
|
|||||||
mitm,
|
mitm,
|
||||||
bond,
|
bond,
|
||||||
ctkd,
|
ctkd,
|
||||||
|
linger,
|
||||||
io,
|
io,
|
||||||
oob,
|
oob,
|
||||||
prompt,
|
prompt,
|
||||||
|
|||||||
Reference in New Issue
Block a user