CNdefConnection Class Reference

#include <mw/ndefconnection.h>

Link against: ndefaccess.lib

class CNdefConnection : public CActive, public MNfcConnection

Inherits from

Detailed Description

CNdefConnection interface provides the basic functionality for exchanging NFC Forum formatted data with contactless targets.

Before NDEF data exchange NDEF connection must be opened. Usually NDEF connection is opened with a tag. This requires tag subscription and listening of tag connection. NDEF connection is opened by giving CNdefConnection object to MNfcTag::OpenConnection as a parameter.

Since
S60 ?S60_version

Constructor & Destructor Documentation

~CNdefConnection ( )

IMPORT_C~CNdefConnection()

Destructor.

Member Function Documentation

Activate ( TInt )

IMPORT_C TIntActivate(TIntaHandle)[virtual]

Reimplemented from MNfcConnection::Activate(TInt)

CancelRawModeAccess ( )

IMPORT_C voidCancelRawModeAccess()[virtual]

Not supported.

CancelRead ( )

IMPORT_C voidCancelRead()

Cancel read request.

CancelWrite ( )

IMPORT_C voidCancelWrite()

Cancel write request.

ConnectionMode ( )

Deactivate ( )

IMPORT_C voidDeactivate()[virtual]

Reimplemented from MNfcConnection::Deactivate()

IsActivated ( )

IMPORT_C TBoolIsActivated()[virtual]

IsEmptyL ( )

IMPORT_C TBoolIsEmptyL()

Check whether NDEF connection is empty or not. Usually NDEF connection is a tag. So this checks if tag is empty.

May leave with system wide error code.

Return Values

EFalse if NDEF connection isn't empty.
ETrue If NDEF connection is empty.

NdefMemorySize ( )

IMPORT_C TInt32NdefMemorySize()

Gets NDEF memory size.

Return Value
Represent NDEF memory size in bytes when return value is positive. Negative value represent system wide error code.

NewL ( RNfcServer &, MNdefHandler & )

IMPORT_C CNdefConnection *NewL(RNfcServer &aNfcServer,
MNdefHandler &aHandler
)[static]

Creates a new instance of this class.

May leave with one of the system wide error codes.

Parameters
aNfcServerreference to NFC Server.
aHandlerHandler for callbacks.
Return Value
Pointer to the newly created instance.

NewLC ( RNfcServer &, MNdefHandler & )

IMPORT_C CNdefConnection *NewLC(RNfcServer &aNfcServer,
MNdefHandler &aHandler
)[static]

Creates a new instance of this class.

May leave with one of the system wide error codes.

Parameters
aNfcServerreference to NFC Server.
aHandlerHandler for callbacks.
Return Value
Pointer to the newly created instance.

RawModeAccess ( TRequestStatus &, const TDesC8 &, TDes8 &, TTimeIntervalMicroSeconds32 & )

IMPORT_C voidRawModeAccess(TRequestStatus &aStatus,
const TDesC8 &aCommand,
TDes8 &aResponse,
TTimeIntervalMicroSeconds32 &aTimeout
)[virtual]

Not supported.

ReadMessage ( )

IMPORT_C TIntReadMessage()

Asynchronous read which attempts to read a NDEF Message from the target device. When read is complete MNdefHandler::ReadComplete( CNdefMessage* aMessage ) will be called. If an error occurs MNdefHandler::HandleError() will be called.

May return one of the system wide error codes.

Return Values

KErrInUse Previous request pending.
KErrNone Request ok.

ReadMessages ( )

IMPORT_C TIntReadMessages()

Asynchronous read which attempts to read all NDEF Messages from the target device. When read is complete MNdefHandler::ReadComplete( const RPointerArray<CNdefMessage>& aMessages ) will be called. If an error occurs MNdefHandler::HandleError() will be called.

May return one of the system wide error codes.

Return Values

KErrInUse Previous request pending.
KErrNone Request ok.

ReadRecord ( )

IMPORT_C TIntReadRecord()

Asynchronous read which attempts to read a NDEF Record from the target device. When read is complete MNdefHandler::ReadComplete( CNdefRecord* aRecord, CNdefRecord::TNdefMessagePart aPart ) will be called. If an error occures MNdefHandler::HandleError() will be called.

May return one of the system wide error codes.

Return Values

KErrInUse Previous request pending.
KErrNone Request ok.

WriteMessage ( const CNdefMessage & )

IMPORT_C TIntWriteMessage(const CNdefMessage &aMessage)

Asynchronous write which attempts to write a NDEF Message to the target device. When writing has been completed MNdefHandler::WriteComplete() will be called. If an error occures MNdefHandler::HandleError() will be called.

May return one of the system wide error codes.

Parameters
aMessageMessage to write.

Return Values

KErrInUse Previous request pending.
KErrNone Request ok.

WriteMessages ( const RPointerArray< CNdefMessage > & )

IMPORT_C TIntWriteMessages(const RPointerArray< CNdefMessage > &aMessages)

Asynchronous write which attempts to write several NDEF Messages to the target device. When writing has been completed MNdefHandler::WriteComplete() will be called. If an error occurs MNdefHandler::HandleError() will be called.

May return one of the system wide error codes.

Return Values

KErrInUse Previous request pending.
KErrNone Request ok.