examples/Qt/qtnfctags/nfctagsdiscovery_symbian.cpp

00001 /*
00002  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003  *    
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions are met:
00006  *    
00007  *  * Redistributions of source code must retain the above copyright notice, this
00008  *    list of conditions and the following disclaimer.
00009  *  * Redistributions in binary form must reproduce the above copyright notice,
00010  *    this list of conditions and the following disclaimer in the documentation
00011  *    and/or other materials provided with the distribution.
00012  *  * Neither the name of Nokia Corporation nor the names of its contributors
00013  *    may be used to endorse or promote products derived from this software
00014  *    without specific prior written permission.
00015  *    
00016  *    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017  *    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018  *    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019  *    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020  *    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021  *    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022  *    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023  *    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024  *    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025  *    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026  *    
00027  *    Description:  
00028  */
00029 
00030 #include <utf.h>
00031 #include <nfctype1connection.h>
00032 #include <nfctype2connection.h>
00033 #include <nfctype3connection.h>
00034 #include <mifareclassicconnection.h>
00035 #include <iso14443connection.h>
00036 #include <nfctype1address.h>
00037 #include <nfctype2address.h>
00038 #include <nfctype3address.h>
00039 
00040 #include <QString>
00041 
00042 #include "activewait.h"
00043 #include "nfctagsdiscovery_symbian.h"
00044 #include "nfctagsdiscovery.h"
00045 
00046 _LIT8(KSendText,"Sending data to tag");
00047 
00048 // Create private class instance with NewL() metod.
00049 NfcTagsDiscoveryPrivate* NfcTagsDiscoveryPrivate::NewL(NfcTagsDiscovery *aPublicAPI)
00050     {
00051     NfcTagsDiscoveryPrivate* self = NewLC(aPublicAPI);
00052     CleanupStack::Pop( self );  
00053     return self;
00054     }
00055 
00056 // Create private class instance with NewLC() method.
00057 NfcTagsDiscoveryPrivate* NfcTagsDiscoveryPrivate::NewLC(NfcTagsDiscovery *aPublicAPI)
00058     {
00059     NfcTagsDiscoveryPrivate* self = new (ELeave) NfcTagsDiscoveryPrivate(aPublicAPI);
00060     CleanupStack::PushL( self );
00061     self->ConstructL(aPublicAPI);
00062     return self;
00063     }
00064 
00065 // Destructor.
00066 NfcTagsDiscoveryPrivate::~NfcTagsDiscoveryPrivate()
00067     {
00068     iWait->AsyncStop();
00069     delete iPublicAPI;
00070     delete iWait;
00071     iNfcTagDiscovery->RemoveTagConnectionListener();
00072     iNfcTagDiscovery->RemoveTagSubscription();
00073     delete iNfcTagDiscovery ;
00074     delete iSubscription;
00075     delete iNfcType1Connection;
00076     delete iNfcType2Connection;
00077     delete iNfcType3Connection;
00078     delete iMifareClassicConnection;
00079     delete iIso14443Connection;
00080     delete iMifareClassicDataSector;
00081     iWriteBuffer.Close();
00082     iReadBuffer.Close();
00083     iServer.Close();
00084     delete iReadWait;
00085     delete iWriteWait;
00086     iNdefDiscovery->RemoveNdefMessageListener();
00087     iNdefDiscovery->RemoveAllNdefSubscription();
00088     delete iNdefDiscovery;
00089     }
00090 
00101 void NfcTagsDiscoveryPrivate::StartTagDiscovery()
00102     { 
00103     // Clear the text in the main window.
00104     emit iPublicAPI->clearText();
00105     
00106     // Change the menu.
00107     emit iPublicAPI->changeMenu(NfcTagsDiscoveryPrivate::ETagDiscovery);
00108 
00109     // Add tag connection listener.
00110     TInt err = iNfcTagDiscovery->AddTagConnectionListener( *this );
00111     if(err == KErrNone)
00112         {
00113         emit iPublicAPI->showMessage("Added tag connection listener\n");
00114         }
00115     
00116     // Add all types of connection modes.
00117     iSubscription = CNfcTagSubscription::NewL();
00118     iSubscription->AddConnectionModeL(TNfcConnectionInfo::ENfcType1);
00119     iSubscription->AddConnectionModeL(TNfcConnectionInfo::ENfcType2);
00120     iSubscription->AddConnectionModeL(TNfcConnectionInfo::ENfcType3);
00121     iSubscription->AddConnectionModeL(TNfcConnectionInfo::ENfcMifareStd);
00122     iSubscription->AddConnectionModeL(TNfcConnectionInfo::ENfc14443P4);
00123     TRAP(err,iNfcTagDiscovery->AddTagSubscriptionL( *iSubscription ));
00124     
00125     if(err == KErrNone)
00126             {
00127             emit iPublicAPI->showMessage("Added all tag connections to subscription.\n");
00128             iWait->Start();
00129             }         
00130     }
00131 
00132 
00133 /*
00134  * This method is called to start the NDEF discovery.
00135  * - Create the CNdefDiscovery class instance.
00136  * - Add a NDEF message listener to this instance.
00137  * - Subscribe the NDEF discovery to necessary Message
00138  * types and TNF info.
00139  */
00140 void NfcTagsDiscoveryPrivate::StartNdefDiscovery()
00141     {
00142     // Clear the text in the application window.
00143     emit iPublicAPI->clearText();
00144     
00145     emit iPublicAPI->changeMenu(NfcTagsDiscoveryPrivate::ENdefDiscovery);
00146     TInt err = iNdefDiscovery->AddNdefMessageListener( *this );
00147     
00148     // Subscribe for the following NDEF message types.
00149     _LIT8( KSmartPoster, "Sp" );
00150     _LIT8( KTextRTD, "T" );
00151     _LIT8( KUriRTD, "U" );
00152     
00153     // Add 'NfcWellKnown', as the TNF user is interested in this kind of data. 
00154     err = iNdefDiscovery->AddNdefSubscription( CNdefRecord::ENfcWellKnown, KUriRTD);
00155     err = iNdefDiscovery->AddNdefSubscription( CNdefRecord::ENfcWellKnown, KSmartPoster);  
00156     err = iNdefDiscovery->AddNdefSubscription( CNdefRecord::ENfcWellKnown, KTextRTD);
00157     if(err == KErrNone)
00158         {
00159         emit iPublicAPI->showMessage("Added NDEF subscriptions successfully.\n");
00160         iWait->Start();
00161         }
00162     }
00163 
00164 // This method is called to stop the tag discovery.
00165 void NfcTagsDiscoveryPrivate::StopTagDiscovery()
00166     {
00167     iWait->AsyncStop();
00168     iNfcTagDiscovery->RemoveTagConnectionListener();
00169     iNfcTagDiscovery->RemoveTagSubscription();
00170     }
00171 
00172 // This method is called to stop the NDEF discovery.
00173 void NfcTagsDiscoveryPrivate::StopNdefDiscovery()
00174     {
00175     iWait->AsyncStop();
00176     iNdefDiscovery->RemoveNdefMessageListener();
00177     iNdefDiscovery->RemoveAllNdefSubscription();
00178     }
00179 
00184 void NfcTagsDiscoveryPrivate::TagOperationCompleted()
00185     {
00186     if(iTagOperation == 
00187             NfcTagsDiscoveryPrivate::EExchangeDataWithIso14443Tag){
00188         emit iPublicAPI->showMessage("Exchange data with Iso14443 "
00189                 "tag is successfull.\n");
00190         ShowTagInformation();
00191         } 
00192     else if(iTagOperation == 
00193             NfcTagsDiscoveryPrivate::EReadFromClass1Tag){
00194         emit iPublicAPI->showMessage("Read from Type1 tag "
00195                 "completed.\n");
00196         ShowTagInformation();
00197         }
00198     else if(iTagOperation == 
00199             NfcTagsDiscoveryPrivate::EWriteToClass1Tag){
00200         emit iPublicAPI->showMessage("Write to Type1 tag "
00201                 "completed.\n");
00202         ReadFromClass1Tag();    
00203         }
00204     else if(iTagOperation == 
00205             NfcTagsDiscoveryPrivate::EReadFromClass2Tag){
00206         emit iPublicAPI->showMessage("Read from Type2 tag "
00207                 "completed.\n");
00208         ShowTagInformation();
00209         }
00210     else if(iTagOperation == 
00211             NfcTagsDiscoveryPrivate::EWriteToClass2Tag){
00212         emit iPublicAPI->showMessage("Write to Type2 tag "
00213                 "completed.\n");
00214         ReadFromClass2Tag();
00215         }
00216     else if(iTagOperation == 
00217             NfcTagsDiscoveryPrivate::EUpdateClass3Tag){
00218         emit iPublicAPI->showMessage("Update Type3 tag "
00219                 "completed.\n");
00220         CheckClass3Tag();
00221         }
00222     else if(iTagOperation == 
00223             NfcTagsDiscoveryPrivate::ECheckClass3Tag){
00224         emit iPublicAPI->showMessage("Check Type3 tag "
00225                 "completed.\n");
00226         ShowTagInformation();
00227         }
00228     else if(iTagOperation == 
00229             NfcTagsDiscoveryPrivate::EWriteToMifareTag){
00230         emit iPublicAPI->showMessage("Write to mifare "
00231                 "tag completed.\n");
00232         ReadFromMifareTag();
00233         }
00234     else if(iTagOperation == 
00235             NfcTagsDiscoveryPrivate::EReadFromMifareTag){
00236         emit iPublicAPI->showMessage("Read from mifare tag "
00237                 "completed.\n");
00238         ShowTagInformation();
00239         }    
00240     }
00241 
00242 // Constructor.
00243 NfcTagsDiscoveryPrivate::NfcTagsDiscoveryPrivate(
00244         NfcTagsDiscovery* aPublicAPI): iPublicAPI(aPublicAPI)                                  
00245     {  
00246     
00247     }
00248 
00249 // Two phase constructor.
00250 void NfcTagsDiscoveryPrivate::ConstructL(NfcTagsDiscovery 
00251         *aPublicAPI)
00252     {  
00253     iWriteWait = CActiveWait::NewL(this);
00254     iReadWait = CActiveWait::NewL(this);
00255     iWait = new (ELeave) CActiveSchedulerWait();
00256     
00257     // Open Nfc server.
00258     iServer.Open();
00259     
00260     // Create Nfc tag discovery instance.    
00261     TRAPD(err,iNfcTagDiscovery = CNfcTagDiscovery::NewL( iServer ));
00262     
00263     // Create NDEF discovery instance.
00264     TRAP(err,iNdefDiscovery = CNdefDiscovery::NewL(iServer ));
00265     
00266     // Create all instance of supported tag types     
00267     TRAP(err,iNfcType1Connection = 
00268             CNfcType1Connection::NewL( iServer ));
00269     TRAP(err,iNfcType2Connection = 
00270             CNfcType2Connection::NewL( iServer ));
00271     TRAP(err,iNfcType3Connection = 
00272             CNfcType3Connection::NewL( iServer ));
00273     TRAP(err,iMifareClassicConnection = 
00274             CMifareClassicConnection::NewL( iServer ));
00275     TRAP(err,iIso14443Connection = 
00276             CIso14443Connection::NewL( iServer ));   
00277     
00278     // Add data to the read and write buffers.
00279     iWriteBuffer.ReAlloc(KSendText().Size());
00280     iWriteBuffer = KSendText;
00281     iReadBuffer.ReAlloc(KSendText().Size());
00282     }
00283 
00284 /*
00285  * This method is called, when a tag is detected.
00286  * - Finds the type of tag.
00287  * - Open a connection with the tag.
00288  * - Writes data to the tag. After completion of write,
00289  * Reads the data from the tag and displays it.
00290  */
00291 void NfcTagsDiscoveryPrivate::TagDetected(MNfcTag* aTag)
00292     {
00293     emit iPublicAPI->showMessage("\nA new tag is detected\n\n");
00294     
00295     // Check the type of the tag.
00296     if ( aTag->HasConnectionMode( 
00297             TNfcConnectionInfo::ENfc14443P4 ) )
00298         {
00299         // Open the connection to tag.
00300         emit iPublicAPI->showMessage("Iso14443 tag.\n");
00301         TInt error = aTag->OpenConnection( *iIso14443Connection ); 
00302         if(error == KErrNone)
00303             {
00304             emit iPublicAPI->showMessage("Connection mode is "
00305                     "successfully opened.\n");
00306             ExchangeDataWithIso14443Tag();
00307             }
00308         }
00309     else if ( aTag->HasConnectionMode( 
00310             TNfcConnectionInfo::ENfcType1 ) )
00311             {
00312             // Open the connection to tag.
00313             emit iPublicAPI->showMessage("Type1 tag.\n");
00314             TInt error = aTag->
00315                     OpenConnection( *iNfcType1Connection ); 
00316             if(error == KErrNone)
00317                 {
00318                 emit iPublicAPI->showMessage("Connection mode"
00319                         " is successfully opened.\n");
00320                 WriteToClass1Tag();
00321                 }
00322             }
00323     else if ( aTag->HasConnectionMode( 
00324             TNfcConnectionInfo::ENfcType2 ) )
00325                 {
00326                 // Open the connection to tag.
00327                 emit iPublicAPI->showMessage("Type2 tag.\n");
00328                 TInt error = aTag->
00329                         OpenConnection( *iNfcType2Connection );                
00330                 if(error == KErrNone)
00331                     {
00332                     emit iPublicAPI->showMessage("Connection mode "
00333                             "is successfully opened.\n");
00334                     WriteToClass2Tag();
00335                     }
00336                 }
00337     else if ( aTag->HasConnectionMode( TNfcConnectionInfo::ENfcType3 ) )
00338                 {
00339                 // Open the connection to tag.
00340                 emit iPublicAPI->showMessage("Type3 tag.\n");
00341                 TInt error = aTag->
00342                         OpenConnection( *iNfcType3Connection );                
00343                 if(error == KErrNone)
00344                     {
00345                     emit iPublicAPI->showMessage("Connection mode "
00346                             "is successfully opened.\n");
00347                     UpdateClass3Tag();
00348                     }
00349                 }
00350     else if ( aTag->
00351             HasConnectionMode( TNfcConnectionInfo::ENfcMifareStd ) )
00352                 {
00353                 // Open the connection to tag.
00354                 emit iPublicAPI->showMessage("Mifare classic tag.\n");
00355                 TInt error = aTag->
00356                         OpenConnection( *iMifareClassicConnection );                
00357                 if(error == KErrNone)
00358                     {
00359                     emit iPublicAPI->showMessage("Connection mode "
00360                             "is successfully opened.\n");
00361                     WriteToMifareTag();
00362                     }
00363                 }
00364     delete aTag;
00365     }
00366 
00367 // This method is called, when a detected tag is lost.
00368 void NfcTagsDiscoveryPrivate::TagLost()
00369     {
00370     if(iIso14443Connection->IsActivated())
00371         {
00372         iIso14443Connection->Deactivate();
00373         }
00374     emit iPublicAPI->clearText();
00375     emit iPublicAPI->showMessage("Tag is lost.\n");
00376     emit iPublicAPI->showMessage("Detected nfc tags information is \n"
00377             "displayed here.");
00378     }
00379 
00380 // This method is called, when NDEF message is detected.
00381 void NfcTagsDiscoveryPrivate::MessageDetected( CNdefMessage* aMessage )
00382     {
00383     if ( aMessage )
00384         {
00385         emit iPublicAPI->showMessage("NDEF Message received is :\n");
00386         TBuf8<200> buf(0);
00387         aMessage->ExportRawDataL(buf, 0);
00388         HBufC16* recData = HBufC16::NewL(80);
00389         recData = CnvUtfConverter::ConvertToUnicodeFromUtf8L(buf);
00390         emit iPublicAPI->showMessage(QString::fromUtf16(recData->Ptr(),recData->Length()));
00391         delete recData;
00392         delete aMessage;  
00393         }
00394     }
00395 
00396 // Exchange data with Iso14443 tag.
00397 void NfcTagsDiscoveryPrivate::ExchangeDataWithIso14443Tag()
00398     { 
00399     iTagOperation = 
00400             NfcTagsDiscoveryPrivate::EExchangeDataWithIso14443Tag;
00401     iIso14443Connection->
00402     ExchangeData(iWriteWait->iStatus, iWriteBuffer, iReadBuffer); 
00403     if(!iWriteWait->IsActive()){
00404         emit iPublicAPI->showMessage("Exchange data started\n");
00405         iWriteWait->SetActive();
00406         }
00407     }
00408 
00409 // Read/Write OTP data to Class1 Tag
00410 void NfcTagsDiscoveryPrivate::WriteToClass1Tag()
00411     { 
00412     iTagOperation = NfcTagsDiscoveryPrivate::EWriteToClass1Tag;
00413     
00414     // block address 
00415     TInt block = 1;
00416     
00417     // byte address.
00418     TInt byte = 6;    
00419     TNfcType1Address address(byte, block);  
00420     
00421     // Write information on the the tag.
00422     iNfcType1Connection->
00423     Write( iWriteWait->iStatus, iWriteBuffer, address );    
00424     if(!iWriteWait->IsActive()){
00425         emit iPublicAPI->showMessage("Write to class1 tag "
00426                 "started.\n");
00427         iWriteWait->SetActive();
00428         }
00429     }
00430 
00431 // Read/Write data to Class1 Tag.
00432 void NfcTagsDiscoveryPrivate::ReadFromClass1Tag()
00433     { 
00434     iTagOperation = NfcTagsDiscoveryPrivate::EReadFromClass1Tag;
00435     
00436     // block address.
00437     TInt block = 1;
00438     
00439     // byte address.
00440     TInt byte = 6;    
00441     TNfcType1Address address( byte, block );
00442     
00443     // Read the information from the tag.
00444     iNfcType1Connection->Read( iReadWait->iStatus, iReadBuffer,KSendText().Size(), address );    
00445     if(!iReadWait->IsActive()){
00446         emit iPublicAPI->showMessage("Read from class1 tag started\n");
00447         iReadWait->SetActive();
00448         }
00449     }
00450 
00451 // Write to the Class2 tag.
00452 void NfcTagsDiscoveryPrivate::WriteToClass2Tag()
00453     { 
00454     iTagOperation = NfcTagsDiscoveryPrivate::EWriteToClass2Tag;
00455     TInt block = 4;      
00456     iNfcType2Connection->Write( iWriteWait->iStatus, iWriteBuffer, block );    
00457     if(!iWriteWait->IsActive()){
00458         emit iPublicAPI->showMessage("Write to class2 tag started.\n");
00459         iWriteWait->SetActive();
00460         }
00461     }
00462 
00463 // Read/Write to Class2 Tag.
00464 void NfcTagsDiscoveryPrivate::ReadFromClass2Tag()
00465     {
00466     iTagOperation = NfcTagsDiscoveryPrivate::EReadFromClass2Tag;
00467     TInt block = 4;
00468     TInt byte = 0;    
00469     TNfcType2Address address( byte, block );    
00470     iNfcType2Connection->
00471     Read( iReadWait->iStatus, 
00472             iReadBuffer, KSendText().Length(), address);    
00473     if(!iReadWait->IsActive()){
00474         emit iPublicAPI->showMessage("Read from class2 "
00475                 "tag started\n");
00476         iReadWait->SetActive();
00477         }
00478     }
00479 
00480 // Update/Check information in Class3 Tag.
00481 void NfcTagsDiscoveryPrivate::UpdateClass3Tag()
00482     {
00483     iTagOperation = NfcTagsDiscoveryPrivate::EUpdateClass3Tag;
00484     TInt byte = 1;
00485     TInt block = 1; 
00486     TInt service = 11;
00487     TNfcType3Address address( byte, block, service );      
00488     iNfcType3Connection->
00489     Update( iWriteWait->iStatus, iWriteBuffer, address );
00490     if(!iWriteWait->IsActive()){
00491         emit iPublicAPI->showMessage("Update class3 tag "
00492                 "started.\n");
00493         iWriteWait->SetActive();
00494         }
00495     }
00496 
00497 // Check the information in class3 Tag.
00498 void NfcTagsDiscoveryPrivate::CheckClass3Tag()
00499     {
00500     iTagOperation = NfcTagsDiscoveryPrivate::ECheckClass3Tag;
00501     TInt byte = 1;
00502     TInt block = 1; 
00503     TInt service = 11;
00504     TNfcType3Address address( byte, block, service );     
00505     iNfcType3Connection->
00506     Check( iReadWait->iStatus, iReadBuffer,
00507             KSendText().Size(), address );
00508     if(!iReadWait->IsActive()){
00509         emit iPublicAPI->showMessage("Check class3 tag "
00510                 "started.\n");
00511         iReadWait->SetActive();
00512         }
00513     }
00514 
00515 // Write data into a sector of Mifare tag.
00516 void NfcTagsDiscoveryPrivate::WriteToMifareTag()
00517     {
00518     iTagOperation = NfcTagsDiscoveryPrivate::EWriteToMifareTag;
00519     
00520     RBuf8 keyA;
00521     CleanupClosePushL( keyA );
00522     keyA.CreateL(100);
00523     RBuf8 keyB;
00524     keyB.CreateL(100);
00525     CleanupClosePushL( keyB );
00526     
00527     TInt sect = 1;
00528     if(iMifareClassicDataSector)
00529         {
00530         delete iMifareClassicDataSector;
00531         iMifareClassicDataSector = NULL;
00532         }
00533     iMifareClassicDataSector = CMifareClassicSector::NewL(
00534             CMifareClassicSector::E1KSector);
00535    
00536     iMifareClassicConnection->WriteSector( 
00537             iWriteWait->iStatus, 
00538             *iMifareClassicDataSector, 
00539             sect);
00540     
00541     iWriteWait->SetActive();
00542     
00543     CleanupStack::PopAndDestroy(); // keyA
00544     CleanupStack::PopAndDestroy(); // keyB
00545     }
00546 
00547 // Read the data from a sector of Mifare tag.
00548 void NfcTagsDiscoveryPrivate::ReadFromMifareTag()
00549     { 
00550     iTagOperation = NfcTagsDiscoveryPrivate::EReadFromMifareTag;
00551     
00552     RBuf8 keyA;
00553     CleanupClosePushL( keyA );
00554     keyA.CreateL(100);
00555     RBuf8 keyB;
00556     keyB.CreateL(100);
00557     CleanupClosePushL( keyB );
00558      
00559      TInt sect = 1;
00560      if(iMifareClassicDataSector)
00561          {
00562          delete iMifareClassicDataSector;
00563          iMifareClassicDataSector = NULL;
00564          }
00565      iMifareClassicDataSector = CMifareClassicSector::NewL(
00566              CMifareClassicSector::E1KSector);
00567 
00568      iMifareClassicConnection->ReadSector( 
00569          iReadWait->iStatus, 
00570          *iMifareClassicDataSector, 
00571          sect,
00572          keyA,
00573          keyB);
00574      
00575      iReadWait->SetActive();
00576      
00577      CleanupStack::PopAndDestroy(); // keyA
00578      CleanupStack::PopAndDestroy(); // keyB
00579 
00580     }
00581 
00582 // Display the information read from the tag.
00583 void NfcTagsDiscoveryPrivate::ShowTagInformation()                                      
00584     {
00585     // Information read from the tag is displayed here.
00586     if(iTagOperation == NfcTagsDiscoveryPrivate::EReadFromMifareTag)
00587         {
00588         HBufC8* recData8 = iMifareClassicDataSector->ExportDataLC();
00589         emit iPublicAPI->showMessage("Information read from "
00590                 "the tag:\n");
00591         emit iPublicAPI->showMessage(QString::fromUtf16( 
00592                 CnvUtfConverter::ConvertToUnicodeFromUtf8L(
00593                         *recData8)->Ptr(), 
00594                         CnvUtfConverter::ConvertToUnicodeFromUtf8L(
00595                                 *recData8)->Length())); 
00596         CleanupStack::PopAndDestroy(); 
00597         }
00598     else{
00599         emit iPublicAPI->showMessage("Information read from "
00600             "the tag:\n");
00601         emit iPublicAPI->showMessage(
00602                 QString::fromUtf16(
00603                         CnvUtfConverter::ConvertToUnicodeFromUtf8L(
00604                         iReadBuffer)->Ptr(),
00605                         CnvUtfConverter::ConvertToUnicodeFromUtf8L(
00606                                 iReadBuffer)->Length()));
00607         }
00608     }

Generated by  doxygen 1.6.2