2014-05-12 1 views
2

nfcpy을 다운로드했으며 개의 빔 예제을 성공적으로 실행했습니다. 나는, 데이터가 제대로 전송되는 넥서스 안드로이드 전화에 PN532 NFC 칩와 RPI에서 데이터를 전송하기 위해 beam.py를 사용하지만, RPI에 파이썬 스크립트는 내가 다음에 전화를 지킬 는 한 존재하지 않습니다 독자에게. 질문은 보내기 및 받기에 적용됩니다. nfcpy. beam.py가 존재하도록하려면 무엇을해야합니까? 안전하게 안전한가요?NFCPY : 안전하게 beam.py를 종료합니다.

예 :

송신 :

./beam.py --device tty:AMA0:pn53x send ndef start.ndef 
[nfc.clf] searching for reader with path 'tty:AMA0:pn53x' 
[nfc.clf] using NXP PN532 at /dev/ttyAMA0 
[nfc.snep.server] snep server bound to port 4 (MIU=1984, RW=15), will accept up to 1048576 byte NDEF messages 
[nfc.dev.pn53x] activated as target in 424 kbps active mode 
[nfc.dev.pn53x] [Errno 110] Connection timed out 
[nfc.dev.pn53x] activated a p2p target in 424 kbps active mode 
[nfc.llcp.llc] LLCP Link established as NFC-DEP Initiator 
Local LLCP Settings 
    LLCP Version: 1.1 
    Link Timeout: 500 ms 
    Max Inf Unit: 2175 octet 
    Service List: 0000000000010011 
Remote LLCP Settings 
    LLCP Version: 1.1 
    Link Timeout: 1500 ms 
    Max Inf Unit: 128 octet 
    Service List: 0000000000010011 
[nfc.dev.pn53x] [PN53x Error 0x13] Format error during RF communication 

수신 :

./beam.py --device tty:AMA0:pn53x recv print 
[nfc.clf] searching for reader with path 'tty:AMA0:pn53x' 
[nfc.clf] using NXP PN532 at /dev/ttyAMA0 
[nfc.snep.server] snep server bound to port 4 (MIU=1984, RW=15), will accept up to 1048576 byte NDEF messages 
[nfc.dev.pn53x] activated as target in 424 kbps active mode 
[nfc.dev.pn53x] [Errno 110] Connection timed out 
[nfc.dev.pn53x] activated a p2p target in 424 kbps active mode 
[nfc.llcp.llc] LLCP Link established as NFC-DEP Initiator 
Local LLCP Settings 
    LLCP Version: 1.1 
    Link Timeout: 500 ms 
    Max Inf Unit: 2175 octet 
    Service List: 0000000000010011 
Remote LLCP Settings 
    LLCP Version: 1.1 
    Link Timeout: 1500 ms 
    Max Inf Unit: 128 octet 
    Service List: 0000000000010011 
[nfc.llcp.tco] accepting CONNECT from SAP 32 
[nfc.snep.server] serving snep client on remote sap 32 
[main] default snep server got put request 
[main] print ndef message 'application/com.example.android.beam' 
record 1 
    type = 'application/com.example.android.beam' 
    name = '' 
    data = 'Beam me up!\n\nBeam Time: 15:11:22\n' 
record 2 
    type = 'urn:nfc:ext:android.com:pkg' 
    name = '' 
    data = 'com.example.android.beam' 
[nfc.dev.pn53x] [PN53x Error 0x13] Format error during RF communication 

답변

1

가장 N NFC P2P 링크가 종료되는 방식은 링크 중단으로 인한 일부 오류입니다. 두 장치가 근접해있는 한 대칭 패킷 교환으로 통신이 계속됩니다. 이 방법을 사용하면 두 장치가 원하는대로 다른 대화를 시작할 수 있습니다. SNEP (또는 빔)은 단지 유일한 것만이 아닙니다.

특히 nfcpy의 빔 예제의 경우 이전에 종료하는 방법은 Ctrl-C를 사용하는 것입니다. 또는 작업이 끝나면 예제를 수정하여 종료하십시오.

+0

두 엔티티간에 무제한의 대체 메시지를 교환 할 수 있도록 nfcpy를 사용하여 RPi에서 연속 서버와 연속 클라이언트를 동시에 실행할 수 있습니까? – AlexandruC

+0

예, nfcpy에 관한 한 가능합니다. 그러나 다른 기기가 Android 휴대 전화라면 터치하기 전에 준비된 메시지 만 "전송"할 수있는 한계가 있습니다. SNEP을 통해 송수신하는 nfcpy의 예는 "examples/beam.py recv echo"이며 피어 장치가 보낸 모든 것을 반환합니다. –

+0

안드로이드에서 동일한 작업을 수행 할 수있는 방법이 있습니까? 어쩌면 .. 그것에 nfcpy? Android Beam이 없거나 터치해야합니다. – AlexandruC

관련 문제