Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nfc-rx tool #35

Merged
merged 17 commits into from
Jul 13, 2024
Merged

nfc-rx tool #35

merged 17 commits into from
Jul 13, 2024

Conversation

josevcm
Copy link
Owner

@josevcm josevcm commented Jul 13, 2024

nfc-rx tool

@josevcm josevcm merged commit 0e3fdca into master Jul 13, 2024
@Steffen-W
Copy link
Contributor

Steffen-W commented Jul 13, 2024

Hi @josevcm,

you're really fast. I looked at the result.
grafik

I get a lot of information. Can I somehow make the NFC packets visible?

warning compiling

warning: ‘QPainter::HighQualityAntialiasing’ is deprecated: Use Antialiasing instead [-Wdeprecated-declarations]
  682 |   result->setRenderHint(QPainter::HighQualityAntialiasing);

There is a warning when compiling. Not bad but easy to solve. Instead of "QPainter::HighQualityAntialiasing" just "QPainter::Antialiasing".

diff --git a/src/nfc-app/app-qt/src/main/cpp/3party/customplot/QCustomPlot.cpp b/src/nfc-app/app-qt/src/main/cpp/3party/customplot/QCustomPlot.cpp
index d3f5b8f..9fc022c 100644
--- a/src/nfc-app/app-qt/src/main/cpp/3party/customplot/QCustomPlot.cpp
+++ b/src/nfc-app/app-qt/src/main/cpp/3party/customplot/QCustomPlot.cpp
@@ -679,7 +679,7 @@ QCPPainter *QCPPaintBufferPixmap::startPainting()
 {
   QCPPainter *result = new QCPPainter(&mBuffer);
 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-  result->setRenderHint(QPainter::HighQualityAntialiasing);
+  result->setRenderHint(QPainter::Antialiasing);
 #endif
   return result;
 }
@@ -768,7 +768,7 @@ QCPPainter *QCPPaintBufferGlPbuffer::startPainting()
   }
   
   QCPPainter *result = new QCPPainter(mGlPBuffer);
-  result->setRenderHint(QPainter::HighQualityAntialiasing);
+  result->setRenderHint(QPainter::Antialiasing);
   return result;
 }
 
@@ -881,7 +881,7 @@ QCPPainter *QCPPaintBufferGlFbo::startPainting()
   mGlFrameBuffer->bind();
   QCPPainter *result = new QCPPainter(paintDevice.data());
 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-  result->setRenderHint(QPainter::HighQualityAntialiasing);
+  result->setRenderHint(QPainter::Antialiasing);
 #endif
   return result;
 }

I also have a warning regarding a possible buffer overflow.
RealtekDevice.cpp#L122-L124

            snprintf(buffer, sizeof(buffer), "rtlsdr://%s", serial);

            result.emplace_back(buffer);

This can be solved like this, for example:

            // 1015 = 1024 - len "rtlsdr://" - 1
            if (strlen(serial) < 1015)
            {
               snprintf(buffer, sizeof(buffer), "rtlsdr://%s", serial);

               result.emplace_back(buffer);
            }
            else
            {
               fprintf(stderr, "Error: Serial string is too long for device %d\n", i);
            }

The program continues to work due to the changes and without warnings when compiling. If you want I can also make a merge request.

Many thanks for your work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants