Qt Mobility Reference Documentation

QNearFieldTagType1 Class Reference

The QNearFieldTagType1 class provides an interface for communicating with an NFC Tag Type 1 tag. More...

 #include <QNearFieldTagType1>

Inherits QNearFieldTarget.

Public Types

enum WriteMode { EraseAndWrite, WriteOnly }

Public Functions

QNearFieldTagType1 ( QObject * parent = 0 )
int memorySize ()
virtual QByteArray readAll ()
virtual QByteArray readBlock ( quint8 blockAddress )
virtual quint8 readByte ( quint8 address )
virtual QByteArray readIdentification ()
virtual QByteArray readSegment ( quint8 segmentAddress )
quint8 version ()
virtual bool writeBlock ( quint8 blockAddress, const QByteArray & data, WriteMode mode = EraseAndWrite )
virtual bool writeByte ( quint8 address, quint8 data, WriteMode mode = EraseAndWrite )

Reimplemented Public Functions

virtual bool hasNdefMessage ()
virtual QList<QNdefMessage> ndefMessages ()
virtual void setNdefMessages ( const QList<QNdefMessage> & messages )
virtual Type type () const

Additional Inherited Members

Detailed Description

The QNearFieldTagType1 class provides an interface for communicating with an NFC Tag Type 1 tag.

Member Type Documentation

enum QNearFieldTagType1::WriteMode

This enum describes the write modes that are supported.

ConstantValueDescription
QNearFieldTagType1::EraseAndWrite0The memory is erased before the new value is written.
QNearFieldTagType1::WriteOnly1The memory is not erased before the new value is written. The effect of this mode is that the final value store is the bitwise or of the data to be written and the original data value.

Member Function Documentation

QNearFieldTagType1::QNearFieldTagType1 ( QObject * parent = 0 )

Constructs a new tag type 1 near field target with parent.

bool QNearFieldTagType1::hasNdefMessage () [virtual]

Reimplemented from QNearFieldTarget::hasNdefMessage().

int QNearFieldTagType1::memorySize ()

Returns the memory size in bytes of the tag.

QList<QNdefMessage> QNearFieldTagType1::ndefMessages () [virtual]

Reimplemented from QNearFieldTarget::ndefMessages().

See also setNdefMessages().

QByteArray QNearFieldTagType1::readAll () [virtual]

Reads and returns HR0, HR1 and all data in the static memory area of the tag.

The returned byte array contains HR0, HR1 followed by 120 bytes of static data. An empty byte array is returned if an error occurs.

QByteArray QNearFieldTagType1::readBlock ( quint8 blockAddress ) [virtual]

Reads and returns 8 bytes of data from the block specified by blockAddress. An empty byte array is returned if an error occurs.

quint8 QNearFieldTagType1::readByte ( quint8 address ) [virtual]

Reads and returns a single byte from the static memory area of the tag. The address parameter specifices the linear byte address to read.

QByteArray QNearFieldTagType1::readIdentification () [virtual]

Returns identification information read from the tag.

The returned byte array contains HR0, HR1, UID0, UID1, UID2, UID3 in order. An empty byte array is returned if an error occurs.

QByteArray QNearFieldTagType1::readSegment ( quint8 segmentAddress ) [virtual]

Reads and returns 120 bytes of data from the segment specified by segmentAddress. An empty byte array is returned if an error occurs.

void QNearFieldTagType1::setNdefMessages ( const QList<QNdefMessage> & messages ) [virtual]

Reimplemented from QNearFieldTarget::setNdefMessages().

See also ndefMessages().

Type QNearFieldTagType1::type () const [virtual]

Reimplemented from QNearFieldTarget::type().

quint8 QNearFieldTagType1::version ()

Returns the NFC Tag Type 1 specification version number that the tag supports.

bool QNearFieldTagType1::writeBlock ( quint8 blockAddress, const QByteArray & data, WriteMode mode = EraseAndWrite ) [virtual]

Writes 8 bytes of data to the block specified by blockAddress. If mode is EraseAndWrite the bytes are erased before writing. If mode is WriteOnly the contents are not earsed before writing. This is equivelant to writing the result of the bitwise or of data and the original value.

Returns true on success; otherwise returns false.

bool QNearFieldTagType1::writeByte ( quint8 address, quint8 data, WriteMode mode = EraseAndWrite ) [virtual]

Writes a single data byte to the linear byte address on the tag. If mode is EraseAndWrite the byte is erased before writing. If mode is WriteOnly the contents are not earsed before writing. This is equivelant to writing the result of the bitwise or of data and the original value.

Returns true on success; otherwise returns false.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.