Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qt rfid serialport
Forum Updated to NodeBB v4.3 + New Features

qt rfid serialport

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 4 Posters 3.2k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    veysel.olgun
    wrote on last edited by koahnig
    #3
    void MainWindow::on_all_sector_authentication_clicked()
    {
       QString x1,y1;
        x1=ui->combo_key->currentText();
        y1=ui->combo_type->currentText();
        int a1,b1;
    
        if(x1=="A")
        {
            a1=0;
        }
        else if(x1=="B")
        {
            a1=4;
        }
        if(y1=="0")
        {
            b1=0;
        }
        else if(y1=="1")
        {
            b1=1;
        }
    
        QByteArray data;
    
        data[8]=a1;
    
        data[9]=b1;
       QString command="DF78";
    
        QString command2="B0";
           data[10]=0X4;
    
    
    seriport->write(paketle(command,command2,data));
    QByteArray data_read;
    data_read[8]=0X10;
    
    QString command_read="DF78";
    QString command2_read="A5";
    seriport->write(paketle(command_read,command2_read,data_read));     / / send data to card reader and after take a response but it is now coming
    }
    

    this is my code, i have a rfid card reader i send a code to authenticate after that i send to data_read to read a specific block (data_read[8]=0X10) BUT it is not work

    [koahnig: added code tags]

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      Hi and welcome to devnet,

      You have to be more precise than that. it is no work doesn't say much.

      What are you expecting ?
      What are you getting ?
      What version of Qt are you using ?
      What platform are you running ?
      Did you connect the readyRead signal ?
      Did you check that your RFID reader does indeed answer to other commands ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      V 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        You have to be more precise than that. it is no work doesn't say much.

        What are you expecting ?
        What are you getting ?
        What version of Qt are you using ?
        What platform are you running ?
        Did you connect the readyRead signal ?
        Did you check that your RFID reader does indeed answer to other commands ?

        V Offline
        V Offline
        veysel.olgun
        wrote on last edited by veysel.olgun
        #5

        @SGaist said in qt rfid serialport:

        indeed

        first of all thank you to answer,

        i am expecting to authentication all of sectors in my mifare card with one push button after that to read all of blocks with one push button

        if i send only this seriport->write(paketle(command,command2,data)); it is work and i am getting response from rfid card reader but if i send this, it is no send to response to me

        for(int i=0;i<16;i++)
        {
        QByteArray data;

        data[8]=a1; //load keyA
        
        data[9]=b1; //load key type 
        

        QString command="DF78"; mifare command
        data[10]=i; // this is saying autenticate to i. sector
        }

        i am using Qt creator 4.5.1

        i am using windows10

        i am using readyread signal

        my rfid card reader working correctly but if i send data with loop it sending data to cardreader but card reader does not send response to me

        here what i am saying

        for(int i=0;i<16;i++)
        {
        QByteArray data;

        data[8]=a1; //load keyA
        
        data[9]=b1; //load key type 
        

        QString command="DF78"; mifare command

        QString command2="B0"; authentication command
           data[10]=i; // 
        

        }

        I hope, I could express it correctly.

        thank you

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #6

          What answer are you expecting ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • V Offline
            V Offline
            veysel.olgun
            wrote on last edited by veysel.olgun
            #7

            0_1541888834181_555ab4ee-ef7d-4654-b0c7-37914f0e5184-image.png

            this is if i do click "authenticate" button 3 times it give me this datas but i want to click "be authentication all sectors" button just one time, and be authenticate all sectors(i mean sector0,sector1.....sector14,sector15

            R 1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #8

              Then you should send the command one after the other only when the last one has finished.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • V Offline
                V Offline
                veysel.olgun
                wrote on last edited by
                #9

                actually i try but no work if i click "authenticate " button many times it send to me data (spin box is 1 and i click authenticate button and i am taking data, spin box is 2 and i click authenticate button and i am taking data...)

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  That's the idea of my suggestion: trigger the next command only when you received the answer to the last one, not in a tight loop.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • V Offline
                    V Offline
                    veysel.olgun
                    wrote on last edited by
                    #11

                    thank you i will try this i hope it works that time

                    1 Reply Last reply
                    0
                    • V veysel.olgun

                      0_1541888834181_555ab4ee-ef7d-4654-b0c7-37914f0e5184-image.png

                      this is if i do click "authenticate" button 3 times it give me this datas but i want to click "be authentication all sectors" button just one time, and be authenticate all sectors(i mean sector0,sector1.....sector14,sector15

                      R Offline
                      R Offline
                      RAJALINGAM
                      wrote on last edited by
                      #12

                      @veysel-olgun
                      sir, please share rfid coding

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved