nfc.handover¶
The nfc.handover module implements the NFC Forum Connection Handover 1.2 protocol as a server and client class that simplify realization of handover selector and requester functionality.
nfc.handover.HandoverServer¶
-
class
nfc.handover.HandoverServer(llc, request_size_limit=65536, recv_miu=1984, recv_buf=15)¶ Bases:
threading.ThreadNFC Forum Connection Handover server
-
process_handover_request_message(records)¶ Process a handover request message. The records argument holds a list of
ndef.Recordobjects decoded from the received handover request message octets, where the first record type isurn:nfc:wkt:Hr. The method returns a list ofndef.Recordobjects with the first record typurn:nfc:wkt:Hs.This method should be overwritten by a subclass to customize it’s behavior. The default implementation returns a
ndef.HandoverSelectRecordwith version1.2and no alternative carriers.
-
nfc.handover.HandoverClient¶
-
class
nfc.handover.HandoverClient(llc)¶ Bases:
objectNFC Forum Connection Handover client
-
connect(recv_miu=248, recv_buf=2)¶ Connect to the remote handover server if available. Raises
nfc.llcp.ConnectRefusedif the remote device does not have a handover service or the service does not accept any more connections.
-
close()¶ Disconnect from the remote handover server.
-
send_records(records)¶ Send handover request message records to the remote server.
-
recv_records(timeout=None)¶ Receive a handover select message from the remote server.
-