#include <mw/ndefdiscovery.h>
Link against: nfcdiscoveryservice.lib
class CNdefDiscovery : public CActive |
Public Member Functions | |
---|---|
~CNdefDiscovery() | |
IMPORT_C TInt | AddNdefMessageListener(MNdefMessageListener &) |
IMPORT_C TInt | AddNdefSubscription(const CNdefRecord::TNdefRecordTnf, const TDesC8 &) |
IMPORT_C CNdefDiscovery * | NewL(RNfcServer &) |
IMPORT_C CNdefDiscovery * | NewLC(RNfcServer &) |
IMPORT_C void | RemoveAllNdefSubscription() |
IMPORT_C void | RemoveNdefMessageListener() |
IMPORT_C void | RemoveNdefSubscription(const CNdefRecord::TNdefRecordTnf, const TDesC8 &) |
IMPORT_C void | SendNdefMessageL(const CNdefMessage &) |
Protected Member Functions | |
---|---|
virtual void | DoCancel() |
virtual TInt | RunError(TInt) |
virtual void | RunL() |
Inherited Attributes | |
---|---|
CActive::iStatus |
Inherited Enumerations | |
---|---|
CActive:TPriority |
CNdefDiscovery provides the mechanism to discover NDEF messages, which are read from the NFC tags.
IMPORT_C TInt | AddNdefMessageListener | ( | MNdefMessageListener & | aListener | ) |
Adds a new MNdefMessageListener object to listen received NDEF-message actions. Only one listener can be added at the time. MNfcNdefListener must be added before calling any other method of this interface.
See also: ndefmessagelistener.h
Parameters | |
---|---|
aListener | Listener to be added. |
KErrAlreadyExists | If listener already exists. |
KErrNone | If successful, otherwise one of the system-wide errcodes. |
IMPORT_C TInt | AddNdefSubscription | ( | const CNdefRecord::TNdefRecordTnf | aTnf, |
const TDesC8 & | aType | |||
) |
Adds NDEF-subscription to NFC server.
Parameters | |
---|---|
aTnf | TNF of the message the application is interested in. |
aType | Type of the message the application is interested in. |
KErrBadHandle | If MNdefMessageListener isn't added. |
KErrNone | If successful, otherwise one of the system-wide errcodes. |
IMPORT_C CNdefDiscovery * | NewL | ( | RNfcServer & | aNfcServer | ) | [static] |
Creates a new instance of this class.
Parameters | |
---|---|
aNfcServer | Reference to NFC server. |
IMPORT_C CNdefDiscovery * | NewLC | ( | RNfcServer & | aNfcServer | ) | [static] |
Creates a new instance of this class.
Parameters | |
---|---|
aNfcServer | Reference to NFC server. |
IMPORT_C void | RemoveAllNdefSubscription | ( | ) |
Removes all NDEF subscription from the NFC server.
IMPORT_C void | RemoveNdefMessageListener | ( | ) |
Removes MNdefMessageListener object. After calling this method, all actions related to this listener will be canceled.
IMPORT_C void | RemoveNdefSubscription | ( | const CNdefRecord::TNdefRecordTnf | aTnf, |
const TDesC8 & | aType | |||
) |
Removes NDEF-subscription from the NFC server. If specified NDEF-subscription is not found, this method returns silently without any actions.
Parameters | |
---|---|
aTnf | TNF of the message. |
aType | Type of the message. |
IMPORT_C void | SendNdefMessageL | ( | const CNdefMessage & | aMessage | ) |
Sends NDEF message to NFC server to handle it. If contain of given message is unknown for NFC server confirmation query with warning message will be launched.
Parameters | |
---|---|
aMessage | Pointer to CNdefMessage, which will be handled in NFC server. |