我目前正試圖將帶有NFC屏蔽的Arduino UNO連接到運行Android 4.4的Nexus 4。設置主機卡模擬
我有服務設置,現在只是簡單的登錄。問題是,NFC意圖沒有被綁定到我的應用程序。調試器報告以下錯誤:
11-24 02:45:46.139 4006-4027/? E/BrcmNfcNfa﹕ UICC[0x0] is not activated
因此,這裏是我的2個問題:
對事物的Arduino的一側,並在NFC盾需要發送到我的手機是什麼樣的「消息」爲了讓我的手機瞭解我正在尋找類別爲「其他」的某個應用程序?
在android的一面,會有什麼援助過濾器標記值來捕捉這個意圖?我可以自己組裝一個自定義的,還是需要堅持某種ISO規範才能使其工作?
UPDATE
所以這裏確定是我的Arduino草圖的相關部分,我建我的APDU:
uint8_t message[5];
message[0] = 0x00;
message[1] = 0xA4;
message[2] = 0x04;
message[3] = 0x00;
message[4] = 0x08;
message[5] = 0x4C656C616E746F73ULL;
下面是在我的Android應用程序的APDU服務XML文件:
<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/servicedesc"
android:requireDeviceUnlock="false">
<aid-group android:description="@string/aiddescription"
android:category="other">
<aid-filter android:name="4C656C616E746F73"/>
</aid-group>
</host-apdu-service>
這是我在懸停時獲得的日誌我的手機在NFC屏蔽上:
11-24 22:33:40.563 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x18
11-24 22:33:40.563 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationActivated
11-24 22:33:40.563 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
11-24 22:33:40.563 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
11-24 22:33:40.563 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
11-24 22:33:40.563 4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
11-24 22:33:40.683 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
11-24 22:33:40.683 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
11-24 22:33:40.683 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
11-24 22:33:40.683 4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
11-24 22:33:40.804 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
11-24 22:33:40.804 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
11-24 22:33:40.804 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
11-24 22:33:40.804 4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
11-24 22:33:40.924 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
11-24 22:33:40.924 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
11-24 22:33:40.934 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
11-24 22:33:40.934 4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
11-24 22:33:41.054 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
11-24 22:33:41.054 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
11-24 22:33:41.054 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
11-24 22:33:41.054 4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
11-24 22:33:41.174 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
11-24 22:33:41.174 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
11-24 22:33:41.174 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
11-24 22:33:41.174 4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
11-24 22:33:41.304 4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x19
11-24 22:33:41.304 4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationDeactivated
11-24 22:33:41.304 4006-4027/? E/BrcmNfcNfa﹕ UICC[0x0] is not activated
Android怎麼沒有將APDU路由到我的HCE服務?
Magica!有效!非常感謝! – ReX357
嗨雷克斯...你能幫我一下,你已經有了什麼。 M嘗試在Arduino和ANdroid HCE服務之間建立通信。 M得到相同的錯誤:UICC [0x0]未被激活。 M使用PN532芯片。你能幫我做一個C程序示例嗎?提前致謝 –