dpp-nfc: Do not indicate no initial HS as failure if alt HR will be sent

Do not use red color for the "No response receive" message in case
another HR will be sent after this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-07-31 00:48:46 +03:00 committed by Jouni Malinen
parent 475b34665c
commit f7b5a1d347

View file

@ -383,6 +383,8 @@ def run_dpp_handover_client(handover, alt=False):
summary("No response received as expected since I'm the handover server") summary("No response received as expected since I'm the handover server")
elif handover.alt_proposal_used and not alt: elif handover.alt_proposal_used and not alt:
summary("No response received for initial proposal as expected since alternative proposal was also used") summary("No response received for initial proposal as expected since alternative proposal was also used")
elif handover.try_own and not alt:
summary("No response received for initial proposal as expected since alternative proposal will also be sent")
else: else:
summary("No response received", color=C_RED) summary("No response received", color=C_RED)
run_client_alt(handover, alt) run_client_alt(handover, alt)
@ -490,7 +492,6 @@ class HandoverServer(nfc.handover.HandoverServer):
self.sent_carrier = None self.sent_carrier = None
self.ho_server_processing = False self.ho_server_processing = False
self.success = False self.success = False
self.try_own = False
self.llc = llc self.llc = llc
self.handover = handover self.handover = handover
@ -686,7 +687,7 @@ class HandoverServer(nfc.handover.HandoverServer):
handover.hs_sent = True handover.hs_sent = True
else: else:
summary("Try to initiate with alternative parameters") summary("Try to initiate with alternative parameters")
self.try_own = True handover.try_own = True
handover.hs_sent = False handover.hs_sent = False
handover.no_alt_proposal = True handover.no_alt_proposal = True
if handover.client_thread: if handover.client_thread:
@ -856,8 +857,8 @@ def llcp_worker(llc, try_alt):
else: else:
print("Wait for handover to complete - press 'i' to initiate") print("Wait for handover to complete - press 'i' to initiate")
while not handover.wait_connection and handover.srv.sent_carrier is None: while not handover.wait_connection and handover.srv.sent_carrier is None:
if handover.srv.try_own: if handover.try_own:
handover.srv.try_own = False handover.try_own = False
summary("Try to initiate another handover with own parameters") summary("Try to initiate another handover with own parameters")
handover.my_crn_ready = False handover.my_crn_ready = False
handover.my_crn = None handover.my_crn = None
@ -905,6 +906,7 @@ class ConnectionHandover():
self.i_m_selector = False self.i_m_selector = False
self.start_client_alt = False self.start_client_alt = False
self.terminate_on_hs_send_completion = False self.terminate_on_hs_send_completion = False
self.try_own = False
def start_handover_server(self, llc): def start_handover_server(self, llc):
summary("Start handover server") summary("Start handover server")