QtMobility 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.

This class was introduced in Qt Mobility 1.2.

Public Types

enum WriteMode { EraseAndWrite, WriteOnly }

Public Functions

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

Reimplemented Public Functions

virtual bool hasNdefMessage ()
virtual RequestId readNdefMessages ()
virtual Type type () const
virtual RequestId writeNdefMessages ( const QList<QNdefMessage> & messages )

Reimplemented Protected Functions

virtual bool handleResponse ( const QNearFieldTarget::RequestId & id, const QByteArray & response )

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.

QNearFieldTagType1::~QNearFieldTagType1 ()

Destroys the tag type 1 near field target.

bool QNearFieldTagType1::handleResponse ( const QNearFieldTarget::RequestId & id, const QByteArray & response ) [virtual protected]

Reimplemented from QNearFieldTarget::handleResponse().

bool QNearFieldTagType1::hasNdefMessage () [virtual]

Reimplemented from QNearFieldTarget::hasNdefMessage().

int QNearFieldTagType1::memorySize () [virtual]

Returns the memory size in bytes of the tag.

RequestId QNearFieldTagType1::readAll () [virtual]

Requests all data in the static memory area of the target. Returns a request id which can be used to track the completion status of the request.

Once the request completes successfully the response can be retrieved from the requestResponse() function. The response of this request will be a QByteArray containing: HR0 and HR1 followed by the 120 bytes of data stored in the static memory area of the target.

See also requestCompleted() and waitForRequestCompleted().

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

Requests 8 bytes of data from the block specified by blockAddress. Returns a request id which can be used to track the completion status of the request.

Once the request completes successfully the response can be retrieved from the requestResponse() function. The response of this request will be a QByteArray.

See also requestCompleted() and waitForRequestCompleted().

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

Requests a single byte from the static memory area of the tag. The address parameter specifices the linear byte address to read. Returns a request id which can be used to track the completion status of the request.

Once the request completes successfully the response can be retrieved from the requestResponse() function. The response of this request will be a quint8.

See also requestCompleted() and waitForRequestCompleted().

RequestId QNearFieldTagType1::readIdentification () [virtual]

Requests the identification bytes from the target. Returns a request id which can be used to track the completion status of the request.

Once the request completes successfully the response can be retrieved from the requestResponse() function. The response of this request will be a QByteArray containing: HR0, HR1, UID0, UID1, UID2 and UID3 in order.

See also requestCompleted() and waitForRequestCompleted().

RequestId QNearFieldTagType1::readNdefMessages () [virtual]

Reimplemented from QNearFieldTarget::readNdefMessages().

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

Requests 128 bytes of data from the segment specified by segmentAddress. Returns a request id which can be used to track the completion status of the request.

Once the request completes successfully the response can be retrieved from the requestResponse() function. The response of this request will be a QByteArray.

See also requestCompleted() and waitForRequestCompleted().

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.

RequestId 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 will be erased before writing. If mode is WriteOnly the contents will not be erased before writing. This is equivelant to writing the result of the bitwise OR of data and the original value.

Returns a request id which can be used to track the completion status of the request.

Once the request completes the response can be retrieved from the requestResponse() function. The response of this request will be a boolean value, true for success; otherwise false.

See also requestCompleted() and waitForRequestCompleted().

RequestId 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 will be erased before writing. If mode is WriteOnly the contents will not be erased before writing. This is equivelant to writing the result of the bitwise OR of data and the original value.

Returns a request id which can be used to track the completion status of the request.

Once the request completes the response can be retrieved from the requestResponse() function. The response of this request will be a boolean value, true for success; otherwise false.

See also requestCompleted() and waitForRequestCompleted().

RequestId QNearFieldTagType1::writeNdefMessages ( const QList<QNdefMessage> & messages ) [virtual]

Reimplemented from QNearFieldTarget::writeNdefMessages().

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.