2012-03-09 24 views
5

Tôi có điện thoại Galaxy Nexus với Android 4.0.2 và bản giới thiệu NXP PN532-C106.Không thể gửi dữ liệu đến hoặc từ Galaxy Nexus qua LLCP

Tôi đang cố gắng kết nối chúng để gửi dữ liệu bằng giao thức LLCP và tôi đang sử dụng "npp-server" và "llcp-test-server" từ libnfc-llcp để thực hiện điều đó. Nhưng tôi chỉ có thể khiến họ bắt đầu kết nối chỉ để nó kết thúc. Tôi không thể gửi bất kỳ dữ liệu và đến và các đường nối logcat để chỉ ra rằng có cái gì đó sai trong thiết lập kết nối, xem phần cuối của bài viết.

Tôi đã cố gắng tìm bất kỳ mã ví dụ nào để gửi dữ liệu và tôi đã cố gắng sử dụng nfcpy (thư viện python để liên lạc với nfc) nhưng từ chối tìm demoboard của tôi. Và ví dụ "npp-server" yêu cầu một tệp để chạy và tôi đang sử dụng một tệp rỗng vì tôi không biết phải đưa vào nó.

Tôi không biết nếu có sự cố gì xảy ra với thiết lập của tôi hoặc nếu tôi thiếu thứ gì đó. Có ai biết tại sao kết nối của tôi chết quá nhanh, hay có một ví dụ làm việc tôi có thể làm theo?

Đây là kết quả từ logcat
Từ thử nghiệm với NPP-server

03-09 14:22:28.035: D/dalvikvm(196): GC_EXPLICIT freed 134K, 10% free 24179K/26759K, paused 6ms+5ms 
03-09 14:22:58.723: W/NFC-LLC(429): bad LLC length byte 90 
03-09 14:22:58.723: W/NFC-LLC(429): bad LLC length byte ec 
03-09 14:22:58.723: W/NFC-LLC(429): bad LLC length byte 50 
03-09 14:22:58.723: W/NFC-LLC(429): bad LLC length byte 0 
03-09 14:22:58.723: W/NFC-LLC(429): bad LLC length byte 31 
03-09 14:22:58.723: W/NFC-LLC(429): bad LLC length byte 56 
03-09 14:22:59.129: D/NFC JNI(429): Discovered P2P Target 
03-09 14:22:59.137: D/NfcService(429): LLCP Activation message 
03-09 14:22:59.137: D/NfcService(429): NativeP2pDevice.MODE_P2P_TARGET 
03-09 14:22:59.168: D/NfcService(429): Cannot connect remote Target. Polling loop restarted. 
03-09 14:22:59.785: W/ThrottleService(196): unable to find stats for iface rmnet0 
03-09 14:23:04.481: D/dalvikvm(7375): GC_CONCURRENT freed 151K, 2% free 14308K/14535K, paused 7ms+3ms 
03-09 14:23:08.535: D/NfcService(429): Set Foreground Dispatch 
03-09 14:23:08.543: D/NfcService(429): Set Foreground Dispatch 
03-09 14:23:08.598: V/PhoneStatusBar(271): setLightsOn(true) 
03-09 14:23:08.598: I/WindowManager(196): createSurface Window{41c2a718 android.stickynotes/android.stickynotes.StickyNotesActivity paused=false}: DRAW NOW PENDING 
03-09 14:23:20.238: W/NFC-LLC(429): bad LLC length byte d0 
03-09 14:23:20.238: W/NFC-LLC(429): bad LLC length byte db 
03-09 14:23:20.238: W/NFC-LLC(429): bad LLC length byte 52 
03-09 14:23:20.238: W/NFC-LLC(429): bad LLC length byte 1 
03-09 14:23:20.340: W/NFC_uart(429): timeout! 
03-09 14:23:20.340: W/NFC-LLC(429): LLC length mis-match 
03-09 14:23:20.637: D/NfcService(429): SE FIELD ACTIVATED 
03-09 14:23:20.637: D/NfcService(429): SE FIELD DEACTIVATED 

Phần này là từ thử nghiệm với llcp-test-server

enter code here 

03-09 14:23:20.653: D/NFC JNI(429): Discovered P2P Target 
03-09 14:23:20.653: D/NfcService(429): LLCP Activation message 
03-09 14:23:20.653: D/NfcService(429): NativeP2pDevice.MODE_P2P_TARGET 
03-09 14:23:20.684: D/NfcService(429): Cannot connect remote Target. Polling loop restarted. 
03-09 14:23:53.957: D/NfcService(429): Set Foreground Dispatch 
03-09 14:23:53.965: D/NfcService(429): Set Foreground Dispatch 
03-09 14:23:53.973: V/PhoneStatusBar(271): setLightsOn(true) 
03-09 14:23:53.988: W/InputManagerService(196): Window already focused, ignoring focus gain of: [email protected] 
03-09 14:24:03.082: W/NFC_uart(429): timeout! 
03-09 14:24:03.082: W/NFC-LLC(429): LLC length mis-match 
03-09 14:24:03.387: D/NfcService(429): SE FIELD ACTIVATED 
03-09 14:24:03.387: D/NfcService(429): SE FIELD DEACTIVATED 
03-09 14:24:03.387: D/NfcService(429): SE FIELD ACTIVATED 
03-09 14:24:03.387: D/NfcService(429): SE FIELD DEACTIVATED 
03-09 14:24:03.418: D/NFC JNI(429): Discovered P2P Initiator 
03-09 14:24:03.418: D/NFC JNI(429): 46 
03-09 14:24:03.418: D/NFC JNI(429): 66 
03-09 14:24:03.418: D/NFC JNI(429): 6d 
03-09 14:24:03.418: D/NfcService(429): LLCP Activation message 
03-09 14:24:03.418: D/NfcService(429): NativeP2pDevice.MODE_P2P_INITIATOR 
03-09 14:24:03.418: I/NFC JNI(429): LLCP Link deactivated 
03-09 14:24:03.418: D/NfcService(429): Target Activate LLCP OK 
03-09 14:24:03.418: I/NfcP2pLinkManager(429): LLCP activated 
03-09 14:24:03.418: D/NfcP2pLinkManager(429): onP2pInRange() 
03-09 14:24:03.426: D/PermissionCache(116): checking android.permission.READ_FRAME_BUFFER for uid=1025 => granted (457 us) 
03-09 14:24:03.567: D/dalvikvm(429): GC_FOR_ALLOC freed 174K, 5% free 14576K/15303K, paused 15ms 
03-09 14:24:03.574: I/dalvikvm-heap(429): Grow heap (frag case) to 17.416MB for 3265936-byte allocation 
03-09 14:24:03.621: D/dalvikvm(429): GC_CONCURRENT freed 4K, 5% free 17761K/18503K, paused 4ms+5ms 
03-09 14:24:03.660: D/NfcP2pLinkManager(429): onP2pSendConfirmationRequested() 
03-09 14:24:03.668: D/NfcService(429): LLCP Link Deactivated message. Restart polling loop. 
03-09 14:24:03.668: D/NfcService(429): not disconnecting from initiator 
03-09 14:24:03.668: I/NfcP2pLinkManager(429): LLCP deactivated. 
03-09 14:24:03.668: D/PhoneStatusBar(271): disable: < EXPAND* icons alerts ticker system_info back home recent clock > 
03-09 14:24:03.676: I/WindowManager(196): createSurface Window{41bde010 paused=false}: DRAW NOW PENDING 
03-09 14:24:03.684: D/libEGL(429): loaded /system/lib/egl/libGLES_android.so 
03-09 14:24:03.699: D/libEGL(429): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so 
03-09 14:24:03.707: D/libEGL(429): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so 
03-09 14:24:03.715: D/libEGL(429): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so 
03-09 14:24:03.817: D/OpenGLRenderer(429): Enabling debug mode 0 
03-09 14:24:03.824: W/IInputConnectionWrapper(7375): showStatusIcon on inactive InputConnection 
03-09 14:24:03.824: W/InputManagerService(196): Starting input on non-focused client [email protected] (uid=10090 pid=7375) 
03-09 14:24:04.426: D/NfcP2pLinkManager(429): Debounce timeout 
03-09 14:24:04.426: D/NfcP2pLinkManager(429): onP2pOutOfRange() 
03-09 14:24:04.754: D/PhoneStatusBar(271): disable: < expand* icons alerts ticker system_info back home recent clock > 
03-09 14:24:04.801: W/SurfaceTexture(429): freeAllBuffersExceptCurrentLocked called but mQueue is not empty 
03-09 14:24:07.676: D/NfcService(429): SE FIELD ACTIVATED 
03-09 14:24:07.699: D/NfcService(429): SE FIELD DEACTIVATED` 

Trả lời

-1

Tôi đã sử dụng dự án này bằng Arduino + PM532. Tôi đã sử dụng thư viện PN532 tại GitHub. Sử dụng nó, tôi có thể gửi văn bản và hình ảnh từ PM532 đến điện thoại Android. Bạn có thể sử dụng thư viện này (https://github.com/don/NDEF).

+1

Trong khi công cụ hoặc thư viện này có thể giúp trả lời câu hỏi, [ít nhất bạn nên giải thích lý do tại sao nó lại làm như vậy] (http://meta.stackoverflow.com/a/251605). –

Các vấn đề liên quan