예제 #1
0
파일: list.py 프로젝트: gmodena/pyNFC
#SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
#ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
#NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#The views and conclusions contained in the software and documentation are those of the
#authors and should not be interpreted as representing official policies, either expressed
#or implied, of Gabriele Modena.

from libnfc.wrapper import NFCWrapper
from libnfc.config.options import *
from libnfc.mifare import *
from libnfc.tag import *

if __name__ == '__main__':
	nfc = NFCWrapper()

    nfc.connect() # connect to a device

    # device information are stored in the NFCWrapper().pdi attribute
	print "Connected to NFC reader: ", nfc.pdi.acName

    # device initialization
	nfc.initiator_init()

    # device configuration
	nfc.configure(DCO_ACTIVATE_FIELD, False)
	nfc.configure(DCO_INFINITE_SELECT,False);

	nfc.configure(DCO_HANDLE_CRC,True);
 	nfc.configure(DCO_HANDLE_PARITY,True);