Module Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Lambda arguments args NameParam defaults IfExp CompareIs NameLoad NameLoad Call NameLoad NameLoad Call AttributeLoad Call NameLoad NameLoad attr Str Return Call AttributeLoad Str attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Lambda arguments args NameParam defaults IfExp CompareIs NameLoad NameLoad Call NameLoad NameLoad Call AttributeLoad Call NameLoad NameLoad attr Str Return Call AttributeLoad Str attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Lambda arguments args NameParam defaults IfExp CompareIs NameLoad NameLoad Call NameLoad NameLoad Call AttributeLoad Call NameLoad NameLoad attr Str Return Call AttributeLoad Str attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If BoolOpAnd NameLoad UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str If UnaryOpNot CompareGt Call NameLoad NameLoad Num body Raise Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad With AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str With AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Pass Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Lambda arguments args defaults NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str ListLoad Call NameLoad keyword Num keyword NameLoad keyword NameLoad Call NameLoad keyword Num Call NameLoad keyword Num keyword NameLoad keyword NameLoad keyword NameLoad Call NameLoad keyword Num keyword NameLoad keyword NameLoad keyword NameLoad If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad If CompareIsNot NameLoad NameLoad body If UnaryOpNot CompareIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Lambda arguments args NameParam defaults NameLoad orelse If CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword Call AttributeLoad NameLoad attr Str Num keyword Call AttributeLoad NameLoad attr Str Num keyword Call AttributeLoad NameLoad attr Str NameLoad keyword Call AttributeLoad NameLoad attr Str NameLoad If CompareIn Str NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body If UnaryOpNot CompareIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Lambda arguments args NameParam defaults NameLoad orelse If CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str If Call NameLoad NameLoad NameLoad body If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad If CompareIsNot NameLoad NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Str Return NameLoad If UnaryOpNot CompareIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Lambda arguments args NameParam NameParam defaults NameLoad orelse If CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore BoolOpOr NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Return NameLoad TryExcept body While UnaryOpNot Call NameLoad body If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body Return NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body Return NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body Return NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str ListLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If BoolOpAnd NameLoad Call NameLoad NameLoad body While BoolOpAnd UnaryOpNot Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body For NameStore TupleLoad Str Str body If BoolOpOr CompareIs Call AttributeLoad NameLoad attr Str NameLoad CompareEq Call AttributeLoad NameLoad attr Str NameLoad body Assign NameStore Call NameLoad BinOpAdd Str Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr keyword Call NameLoad keyword NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If BoolOpAnd NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr keyword NameLoad Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Num For NameStore Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Assign TupleStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If BoolOpAnd NameLoad Call NameLoad NameLoad NameLoad body While UnaryOpNot Call NameLoad body Assign NameStore IfExp CompareIsNot NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore NameLoad ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Break orelse If CompareIs NameLoad NameLoad body Break Assign NameStore Call AttributeLoad NameLoad attr Str Lambda arguments args NameParam defaults NameLoad Return Call NameLoad keyword NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr With AttributeLoad NameLoad attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr With AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr With AttributeLoad NameLoad attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr With AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Str Return Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse Return Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list
N/A N/A logging N/A log N/A N/A logging getLogger __name__ N/A os N/A time N/A errno N/A threading N/A nfc.dev N/A nfc.dep N/A nfc.tag N/A nfc.llcp TTA N/A object N/A N/A Represents a Type A target. The integer *br* is the
    bitrate. The bytearray *cf* is the two byte SENS_RES data plus the
    one byte SEL_RES data for a tag type 1/4 tag. The bytearray *uid*
    is the target UID. The bytearray *ats* is the answer to select
    data of a type 4 tag if the chipset does activation as part of
    discovery. __init__ N/A N/A self br cfg uid ats N/A None None None None N/A N/A N/A self br br N/A N/A self cfg cfg N/A N/A self uid uid N/A N/A self ats ats N/A __str__ N/A N/A self N/A N/A N/A hx N/A N/A N/A x N/A N/A N/A x None N/A str x N/A N/A N/A str x encode hex N/A N/A N/A TTA br={0} cfg={1} uid={2} ats={3} format N/A self br N/A hx N/A self cfg N/A hx N/A self uid N/A hx N/A self ats N/A N/A TTB N/A object N/A N/A Represents a Type B target. The integer *br* is the
    bitrate. Type B targets are not yet supported in nfcpy, for the
    simple reason that no cards for testing are available. __init__ N/A N/A self br N/A None N/A N/A N/A self br br N/A __str__ N/A N/A self N/A N/A N/A N/A N/A TTA br={0} format N/A self br N/A N/A TTF N/A object N/A N/A Represents a Type F target. The integer *br* is the
    bitrate. The bytearray *idm* is the 8 byte manufacture id. The
    bytearray *pmm* is the 8 byte manufacture parameter. The bytearray
    *sys* is the 2 byte system code. __init__ N/A N/A self br idm pmm sys N/A None None None None N/A N/A N/A self br br N/A N/A self idm idm N/A N/A self pmm pmm N/A N/A self sys sys N/A __str__ N/A N/A self N/A N/A N/A hx N/A N/A N/A x N/A N/A N/A x None N/A str x N/A N/A N/A str x encode hex N/A N/A N/A TTF br={0} idm={1} pmm={2} sys={3} format N/A self br N/A hx N/A self idm N/A hx N/A self pmm N/A hx N/A self sys N/A N/A DEP N/A object N/A N/A Represents a DEP target. The integer *br* is the bitrate. The
    bytearray *gb* is the ATR general bytes. __init__ N/A N/A self br gb N/A None None N/A N/A N/A self br br N/A N/A self gb gb N/A __str__ N/A N/A self N/A N/A N/A hx N/A N/A N/A x N/A N/A N/A x None N/A str x N/A N/A N/A str x encode hex N/A N/A N/A DEP br={0} gb={1} format N/A self br N/A hx N/A self gb N/A N/A ContactlessFrontend N/A object N/A N/A The contactless frontend is the main interface class for
    working with contactless reader devices.  A reader device may be
    opened when an instance is created by providing the *path*
    argument, see :meth:`nfc.ContactlessFrontend.open` for how it must
    be constructed.

    The initializer method raises :exc:`IOError(errno.ENODEV)` if a
    path is specified but no no reader are found.
     __init__ N/A N/A self path N/A None N/A N/A N/A self dev None N/A N/A self lock N/A N/A threading Lock N/A N/A path N/A N/A N/A self open path N/A N/A N/A IOError N/A errno ENODEV N/A N/A os strerror N/A errno ENODEV N/A open N/A N/A self path N/A N/A N/A Open a contactless reader device identified by *path*.

        :param path: search path for contactless reader
        :returns True: if reader was found and activated

        **Path specification:**
        
          ``usb[:vendor[:product]]``
            with optional *vendor* and *product* as four digit
            hexadecimal numbers, like ``usb:054c:06c3`` would open the
            first Sony RC-S380 reader and ``usb:054c`` the first Sony
            reader.
        
          ``usb[:bus[:device]]``
            with optional *bus* and *device* number as three-digit
            decimal numbers, like ``usb:001:023`` would specifically
            mean the usb device with bus number 1 and device id 23
            whereas ``usb:001`` would mean to use the first available
            reader on bus number 1.
        
          ``tty:port:driver``
            with mandatory *port* and *driver* name should be used on
            Posix systems to open the serial port at device node
            ``/dev/tty<port>`` and load the driver from module
            ``nfc/dev/<driver>.py``. A typical example would be
            ``tty:USB0:arygon`` for the Arygon APPx/ADRx at
            ``/dev/ttyUSB0``.
        
          ``com:port:driver``
            with mandatory *port* and *driver* name should be used on
            Windows systems to open the serial port ``COM<port>`` and
            load the ``nfc/dev/<driver>.py`` driver module.
        
          ``udp[:host][:port]`` with optional *host* name or address
            and *port* number will use a fake communication channel over
            UDP/IP. Either value may be omitted in which case *host*
            defaults to 'localhost' and *port* defaults to 54321.

         N/A N/A N/A isinstance path str N/A N/A N/A TypeError expecting a string type argument *path* N/A N/A N/A N/A len path 0 N/A N/A N/A ValueError argument *path* must not be empty N/A N/A N/A log info N/A N/A searching for reader with path '{0}' format path N/A N/A self lock N/A N/A N/A self dev N/A N/A N/A nfc dev connect path N/A N/A N/A self dev None N/A N/A N/A N/A log error N/A N/A no reader found at '{0}' format path N/A N/A N/A N/A log info N/A N/A using {0} format N/A self dev N/A N/A bool N/A self dev N/A close N/A N/A self N/A N/A N/A Close the contacless reader device. N/A N/A self lock N/A N/A N/A self dev N/A N/A N/A N/A N/A N/A N/A self dev close N/A N/A N/A IOError N/A N/A N/A N/A self dev None N/A connect N/A N/A self N/A options N/A N/A Connect with a contactless target or become connected as a
        contactless target. The calling thread is blocked until a
        single activation and deactivation has completed or a callback
        function supplied as the keyword argument ``terminate``
        returned True. The result of the terminate function also
        applies to the loop run after activation, so the example below
        will make :meth:`~connect()` return after 10 seconds from
        either waiting for a peer device or when connected. ::

        >>> import nfc, time
        >>> clf = nfc.ContactlessFrontend('usb')
        >>> after5s = lambda: time.time() - started > 5
        >>> started = time.time(); clf.connect(llcp={}, terminate=after5s)

        Connect options are given as keyword arguments with dictionary
        values. Possible options are:
        
        * ``rdwr={key: value, ...}`` - options for reader/writer operation
        * ``llcp={key: value, ...}`` - options for peer to peer mode operation
        * ``card={key: value, ...}`` - options for card emulation operation

        **Reader/Writer Options**

        'targets': sequence
          A list of target specifications with each target of either
          type :class:`~nfc.clf.TTA`, :class:`~nfc.clf.TTB`, or
          :class:`~nfc.clf.TTF`. A default set is choosen if 'targets'
          is not provided.
          
        'on-startup': function
          A function that will be called with the list of targets
          (from 'targets') to search for. Must return a list of
          targets or :const:`None`. Only the targets returned are
          finally considered.
          
        'on-connect': function
          A function object that will be called with an activated
          :class:`~nfc.tag.Tag` object.
        
        >>> import nfc
        >>> def connected(tag):
        ...     print tag
        ...     return True
        ...
        >>> clf = nfc.ContactlessFrontend()
        >>> clf.connect(rdwr={'on-connect': connected})
        Type3Tag IDm=01010501b00ac30b PMm=03014b024f4993ff SYS=12fc
        True
        
        **Peer To Peer Options**

        'on-startup': function
          A function that is called before an attempt is made to
          establish peer to peer communication. The function receives
          the initialized :class:`~nfc.llcp.llc.LogicalLinkController`
          instance as parameter, which may then be used to allocate
          and bind communication sockets for service applications. The
          return value must be either the
          :class:`~nfc.llcp.llc.LogicalLinkController` instance or
          :const:`None` to effectively remove llcp from the options
          considered.
          
        'on-connect': function
          A function that is be called when peer to peer communication
          was established. The function receives the connected
          :class:`~nfc.llcp.llc.LogicalLinkController` instance as
          parameter, which may then be used to allocate communication
          sockets with
          :meth:`~nfc.llcp.llc.LogicalLinkController.socket` and spawn
          working threads to perform communication. The callback must
          return more or less immediately with :const:`True` unless
          the logical link controller run loop is handled within the
          callback.
          
        'role': string
          Defines which role the local LLC shall take for the data
          exchange protocol activation. Possible values are
          'initiator' and 'target'.  The default is to alternate
          between both roles until communication is established.
          
        'miu': integer
          Defines the maximum information unit size that will be
          supported and announced to the remote LLC. The default value
          is 128.
          
        'lto': integer
          Defines the link timeout value (in milliseconds) that will
          be announced to the remote LLC. The default value is 100
          milliseconds.
          
        'agf': boolean
          Defines if the local LLC performs PDU aggregation and may
          thus send Aggregated Frame (AGF) PDUs to the remote LLC. The
          dafault is to use aggregation.
        
        >>> import nfc
        >>> import threading
        >>> def worker(socket):
        ...     socket.sendto("Hi there!", address=16)
        ...     socket.close()
        ...
        >>> def connected(llc):
        ...     socket = llc.socket(nfc.llcp.LOGICAL_DATA_LINK)
        ...     threading.Thread(target=worker, args=(socket,)).start()
        ...     return True
        ...
        >>> clf = nfc.ContactlessFrontend()
        >>> clf.connect(llcp={'on-connect': connected})
        
        **Card Emulation Options**

        'targets': sequence
          A list of target specifications with each target of either
          type :class:`~nfc.clf.TTA`, :class:`~nfc.clf.TTB`, or
          :class:`~nfc.clf.TTF`. The list of targets is processed
          sequentially. Defaults to an empty list.
          
        'on-startup': function
          A function that will be called with the list of targets
          (from 'targets') to emulate. Must return a list of one
          target choosen or :const:`None`.
          
        'on-connect': function
          A function that will be called with an activated
          :class:`~nfc.tag.TagEmulation` instance as first parameter and
          the first command received as the second parameter.

        'on-release': function A function that will be called when the
          activated tag has been released by it's Initiator, basically
          that is when the tag has been removed from the Initiator's
          RF field.

        'timeout': integer
          The timeout in seconds to wait for for each target to become
          initialized. The default value is 1 second.

        >>> import nfc
        >>>
        >>> def connected(tag, command):
        ...     print tag
        ...     print str(command).encode("hex")
        ...
        >>> clf = nfc.ContactlessFrontend()
        >>> idm = bytearray.fromhex("01010501b00ac30b")
        >>> pmm = bytearray.fromhex("03014b024f4993ff")
        >>> sys = bytearray.fromhex("12fc")
        >>> target = nfc.clf.TTF(212, idm, pmm, sys)
        >>> clf.connect(card={'targets': [target], 'on-connect': connected})
        Type3TagEmulation IDm=01010501b00ac30b PMm=03014b024f4993ff SYS=12fc
        100601010501b00ac30b010b00018000
        True
        
        Connect returns :const:`None` if no options were to execute,
        :const:`False` if interrupted by a :exc:`KeyboardInterrupt`,
        or :const:`True` if terminated normally and the 'on-connect'
        callback function had returned :const:`True`. If the
        'on-connect' callback had returned :const:`False` the return
        value of connect() is the same parameters as were provided to
        the callback function.

        Connect raises :exc:`IOError(errno.ENODEV)` if called before a
        contactless reader was opened.
         N/A N/A N/A self dev None N/A N/A N/A IOError N/A errno ENODEV N/A N/A os strerror N/A errno ENODEV N/A N/A N/A log debug N/A N/A connect({0}) format options N/A terminate N/A N/A options get terminate N/A N/A N/A N/A False N/A rdwr_options N/A N/A options get rdwr N/A llcp_options N/A N/A options get llcp N/A card_options N/A N/A options get card N/A N/A isinstance rdwr_options dict N/A N/A N/A N/A rdwr_options setdefault targets N/A N/A TTA br 106 cfg None uid None N/A TTB br 106 N/A TTF br 424 idm None pmm None sys None N/A TTF br 212 idm None pmm None sys None N/A N/A on-startup rdwr_options N/A N/A targets N/A N/A rdwr_options get targets N/A targets N/A N/A rdwr_options N/A on-startup self targets N/A N/A targets None N/A N/A rdwr_options None N/A N/A N/A rdwr_options N/A targets targets N/A N/A rdwr_options None N/A N/A N/A N/A on-connect rdwr_options N/A N/A N/A rdwr_options N/A on-connect N/A N/A N/A tag N/A True N/A N/A N/A rdwr_options None N/A N/A N/A TypeError argument *rdrw* must be a dictionary N/A N/A isinstance llcp_options dict N/A N/A llc N/A N/A N/A N/A nfc llcp llc LogicalLinkController recv_miu N/A N/A llcp_options get miu 128 send_lto N/A N/A llcp_options get lto 100 send_agf N/A N/A llcp_options get agf True symm_log N/A N/A llcp_options get symm-log True N/A N/A on-startup llcp_options N/A N/A llc N/A N/A llcp_options N/A on-startup self llc N/A N/A llc None N/A N/A llcp_options None N/A N/A llcp_options None N/A N/A N/A N/A on-connect llcp_options N/A N/A N/A llcp_options N/A on-connect N/A N/A N/A llc N/A True N/A N/A N/A llcp_options None N/A N/A N/A TypeError argument *llcp* must be a dictionary N/A N/A isinstance card_options dict N/A N/A N/A on-startup card_options N/A N/A targets N/A N/A card_options get targets N/A N/A targets N/A N/A card_options N/A on-startup self targets N/A N/A targets None N/A N/A card_options None N/A N/A N/A card_options N/A targets targets N/A N/A card_options None N/A N/A N/A N/A N/A card_options get targets N/A N/A N/A N/A log error a target must be specified to connect as tag N/A None N/A N/A N/A on-connect card_options N/A N/A N/A card_options N/A on-connect N/A N/A N/A tag command N/A True N/A N/A N/A card_options None N/A N/A N/A TypeError argument *card* must be a dictionary N/A some_options N/A rdwr_options llcp_options card_options N/A N/A some_options N/A N/A N/A N/A log warning no options left to connect N/A None N/A N/A N/A N/A N/A terminate N/A N/A llcp_options N/A N/A result N/A N/A self _llcp_connect llcp_options llc terminate N/A N/A N/A bool result True N/A N/A result N/A rdwr_options N/A N/A result N/A N/A self _rdwr_connect rdwr_options terminate N/A N/A N/A bool result True N/A N/A result N/A card_options N/A N/A result N/A N/A self _card_connect card_options terminate N/A N/A N/A bool result True N/A N/A result N/A N/A N/A KeyboardInterrupt N/A error N/A N/A N/A N/A log debug error N/A False N/A N/A IOError N/A error N/A N/A N/A N/A log error error N/A False N/A _rdwr_connect N/A N/A self options terminate N/A N/A N/A target N/A N/A self sense N/A N/A options get targets N/A N/A N/A target None N/A N/A N/A N/A log debug N/A N/A found target {0} format target N/A tag N/A N/A N/A nfc tag activate self target N/A N/A tag None N/A N/A N/A N/A log debug N/A N/A connected to {0} format tag N/A callback N/A options N/A on-connect N/A N/A callback N/A callback tag N/A N/A N/A N/A N/A terminate N/A tag is_present N/A N/A N/A N/A time sleep 0.1 N/A True N/A N/A tag N/A _llcp_connect N/A N/A self options llc terminate N/A N/A N/A role N/A target initiator N/A N/A N/A N/A N/A N/A options get role None N/A N/A N/A options get role role N/A N/A DEP N/A eval N/A nfc.dep. N/A N/A role capitalize N/A N/A N/A llc activate mac N/A DEP clf self N/A N/A N/A N/A log debug N/A N/A connected {0} format llc N/A callback N/A options N/A on-connect N/A N/A callback N/A callback llc N/A N/A N/A N/A llc run terminate terminate N/A True N/A N/A llc N/A _card_connect N/A N/A self options terminate N/A N/A N/A timeout N/A N/A options get timeout 1.0 N/A target N/A N/A options get targets N/A N/A activated N/A N/A self listen target timeout N/A activated N/A N/A N/A target command activated N/A N/A N/A log debug N/A N/A activated as target {0} format target N/A tag N/A N/A N/A nfc tag emulate self target N/A N/A tag None N/A N/A N/A N/A log debug N/A N/A connected as {0} format tag N/A callback N/A options N/A on-connect N/A N/A callback N/A callback tag command N/A N/A N/A N/A terminate N/A N/A response N/A N/A command None N/A N/A tag process_command command None N/A N/A N/A command N/A N/A tag send_response response timeout 1 N/A N/A N/A N/A N/A nfc clf TimeoutError N/A N/A command None N/A N/A N/A N/A nfc clf DigitalProtocolError N/A error N/A N/A N/A N/A log error error N/A N/A N/A N/A command None N/A N/A N/A callback N/A N/A options get on-release N/A N/A N/A tag N/A True N/A N/A callback tag tag N/A N/A tag N/A capabilities N/A N/A self N/A N/A N/A N/A N/A self dev capabilities N/A property sense N/A N/A self targets N/A kwargs N/A N/A Send discovery and activation requests to find a
        target. Targets is a list of target specifications (TTA, TTB,
        TTF). Not all readers may support all possible target
        types. The return value is an activated target with a possibly
        updated specification (bitrate) or None.

        Additional keyword arguments are driver specific.

        .. note:: This is a direct interface to the
           driver and not needed if :meth:`connect` is used.
         N/A N/A N/A self dev None N/A N/A N/A IOError N/A errno ENODEV N/A N/A os strerror N/A errno ENODEV N/A N/A self lock N/A N/A N/A N/A N/A self dev sense targets kwargs N/A listen N/A N/A self target timeout N/A N/A N/A Listen for *timeout* seconds to become initialized as a
        *target*. The *target* must be one of :class:`nfc.clf.TTA`,
        :class:`nfc.clf.TTB`, :class:`nfc.clf.TTF`, or
        :class:`nfc.clf.DEP` (note that target type support depends on
        the hardware capabilities). The return value is :const:`None`
        if *timeout* elapsed without activation or a tuple (target,
        command) where target is the activated target (which may
        differ from the requested target, see below) and command is
        the first command received from the initiator.

        If an activated target is returned, the target type and
        attributes may differ from the *target* requested. This is
        especically true if activation as a :class:`nfc.clf.DEP`
        target is requested but the contactless frontend does not have
        a hardware implementation of the data exchange protocol and
        returns a :class:`nfc.clf.TTA` or :class:`nfc.clf.TTF` target
        instead.

        .. note:: This is a direct interface to the
           driver and not needed if :meth:`connect` is used.
         N/A N/A N/A self dev None N/A N/A N/A IOError N/A errno ENODEV N/A N/A os strerror N/A errno ENODEV N/A N/A self lock N/A N/A N/A N/A log debug N/A N/A listen for {0:.3f} sec as target {1} format timeout target N/A N/A N/A type target TTA N/A N/A N/A N/A N/A self dev listen_tta target timeout N/A N/A N/A type target TTB N/A N/A N/A N/A N/A self dev listen_ttb target timeout N/A N/A N/A type target TTF N/A N/A N/A N/A N/A self dev listen_ttf target timeout N/A N/A N/A type target DEP N/A N/A N/A N/A N/A self dev listen_dep target timeout N/A exchange N/A N/A self send_data timeout N/A N/A N/A Exchange data with an activated target (data is a command
        frame) or as an activated target (data is a response
        frame). Returns a target response frame (if data is send to an
        activated target) or a next command frame (if data is send
        from an activated target). Returns None if the communication
        link broke during exchange (if data is sent as a target). The
        timeout is the number of seconds to wait for data to return,
        if the timeout expires an nfc.clf.TimeoutException is
        raised. Other nfc.clf.DigitalProtocolExceptions may be raised
        if an error is detected during communication.

        .. note:: This is a direct interface to the
           driver and not needed if :meth:`connect` is used.
         N/A N/A N/A self dev None N/A N/A N/A IOError N/A errno ENODEV N/A N/A os strerror N/A errno ENODEV N/A N/A self lock N/A N/A N/A N/A N/A self dev exchange send_data timeout N/A set_communication_mode N/A N/A self brm N/A kwargs N/A N/A Set the hardware communication mode. The effect of calling
        this method depends on the hardware support, some drivers may
        purposely ignore this function. If supported, the parameter
        *brm* specifies the communication mode to choose as a string
        composed of the bitrate and modulation type, for example
        '212F' shall switch to 212 kbps Type F communication. Other
        communication parameters may be changed with optional keyword
        arguments. Currently implemented by the RC-S380 driver are the
        parameters 'add-crc' and 'check-crc' when running as
        initator. It is possible to set *brm* to an empty string if
        bitrate and modulation shall not be changed but only optional
        parameters executed.

        .. note:: This is a direct interface to the
           driver and not needed if :meth:`connect` is used.
         N/A N/A N/A self dev None N/A N/A N/A IOError N/A errno ENODEV N/A N/A os strerror N/A errno ENODEV N/A N/A self lock N/A N/A N/A N/A N/A self dev set_communication_mode brm kwargs N/A __enter__ N/A N/A self N/A N/A N/A self N/A __exit__ N/A N/A self exc_type exc_value traceback N/A N/A N/A N/A N/A self close N/A __str__ N/A N/A self N/A N/A N/A N/A N/A self dev None N/A N/A s {dev.vendor} {dev.product} on {dev.path} N/A N/A N/A s format dev N/A self dev N/A N/A N/A N/A self __repr__ N/A N/A DigitalProtocolError N/A Exception N/A N/A info N/A 4.4.1.3 4.6.3.3 6.4.1.8 8.6.2.1 9.6.2 9.6.2.3 9.7.2 9.7.2.1 9.8.3.1 9.8.3.3 9.9.1.3 10.6 10.6.1.1 10.6.1.3 14.4.1.1 14.4.1.2 14.4.1.3 14.6.1.1 14.6.1.2 14.6.1.3 14.6.1.4 14.6.2.1 14.6.2.2 14.7.2.2 14.8.4.2 14.12.2.1 14.12.3.3 14.12.4.2 14.12.4.3 14.12.4.4 14.12.4.5 14.12.4.6 14.12.4.7 14.12.5.4 14.12.5.6 Table-86 Table-98 Table-102 NFCA frame checksum error SENS_RES has invalid encoding NFCF frame checksum T1TP invalid header rom byte 0 T2TP undefined read response T2TP read command returned nack T2TP undefined write response error T2TP write command returned nack T2TP sector select 1 returned nack T2TP sector select 2 returned data T2TP frame delay time expired T3TP maximum response time T3TP check command timeout T3TP update command timeout [NFC-DEP] first byte must be SB=F0h for NFC-A [NFC-DEP] length byte must equal data length + 1 [NFC-DEP] length byte must be 3 <= LEN <= 255 [NFC-DEP] ATR_REQ would be more than 64 byte [NFC-DEP] ATR_REQ received with more than 64 byte [NFC-DEP] ATR_RES received with more than 64 byte [NFC-DEP] ATR_RES would be more than 64 byte [NFC-DEP] Initiator must copy nfcid2t to nfcid3i [NFC-DEP] NFCID3i differs from NFCID2t [NFC-DEP] Target must return same DID as in PSL_REQ [NFC-DEP] RTOX must be in range 1 <= x <= 59 [NFC-DEP] more information must be acknowledged [NFC-DEP] wrong packet number [NFC-DEP] invalid response to supervisory a request [NFC-DEP] unexpected or out-of-sequence ACK PDU [NFC-DEP] received RTOX response to NACK or ATN [NFC-DEP] received NACK PDU from Target [NFC-DEP] expected INF PDU after sending [NFC-DEP] chaing must be continued after ACK [NFC-DEP] unrecoverable transmission error [NFC-DEP] unrecoverable timeout error [NFC-DEP] invalid command/response code [NFC-DEP] invalid format of PSL_REQ [NFC-DEP] invalid format of PSL_RES __init__ N/A N/A self requirement N/A None N/A N/A N/A self requirement requirement N/A __str__ N/A N/A self N/A N/A N/A N/A N/A N/A self info get N/A self requirement N/A self requirement N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A {0}({1!r}) format N/A N/A self __class__ __name__ N/A self requirement N/A N/A ProtocolError N/A DigitalProtocolError N/A N/A N/A TransmissionError N/A DigitalProtocolError N/A N/A N/A TimeoutError N/A DigitalProtocolError N/A N/A N/A