
Originally Posted by
Diegocho
Hi!
I'm doing a project about door access control using nokia 6212 and omnikey reader 5321. I want to exchange information like a code number (password) or a word from my nokia 6212 to the reader nd then i the password is correct the door will open it. But I don't understand what kind of communication should I establish (NDEF communication, P2P, smart card emulation, push registry)??
I'm new in mobile development and programming and I was looking for code examples of jsr 257 contactless communication and I tried to apply the following:
Listing 1 - Discovering Targets and Registering Target Listeners
import javax.microedition.contactless.TargetListener;
:
DiscoveryManager dm = DiscoveryManager.getInstance();
:
/**
* Discover supported targets, registers listeners
*
* @param targetListener the target listener
*/
public void registerTargetListeners(TargetListener targetListener) {
// Discover supported types
TargetType[] tp = DiscoveryManager.getSupportedTargetTypes();
try {
// Register listener for each of the supported types
for (int i=0; i<tp.length; i++) {
if (tp[i].equals((TargetType.ISO14443_CARD))) {
dm.addTargetListener(
targetListener, TargetType.ISO14443_CARD);
} else...
:
:
}
}
} catch (Exception e) {
// ...
}
}
But it produce errors that I don't understand specially in the red text above and I don´t know if the code is right and later it will function for establishing the contactless comunication.
I don't understand if I must communicate with internal smart card.
Can anybody explain me the contactless communication and help me with my project?? or can you give me some code that works??
I will appreciate your help as soon as possible
Thank you very much!