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.


class nfc.handover.HandoverServer(llc, request_size_limit=65536, recv_miu=1984, recv_buf=15)

Bases: threading.Thread

NFC Forum Connection Handover server


Process a handover request message. The request argument is a nfc.ndef.HandoverRequestMessage object. The return value must be a nfc.ndef.HandoverSelectMessage object to be sent back to the client.

This method should be overwritten by a subclass of HandoverServer to customize it’s behavior. The default implementation returns a version 1.2 nfc.ndef.HandoverSelectMessage with no carriers.


class nfc.handover.HandoverClient(llc)

Bases: object

NFC Forum Connection Handover client

connect(recv_miu=248, recv_buf=2)

Connect to the remote handover server if available. Raises nfc.llcp.ConnectRefused if the remote device does not have a handover service or the service does not accept any more connections.


Disconnect from the remote handover server.


Send a handover request message to the remote server.


Receive a handover select message from the remote server.