mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-26 01:34:43 +01:00
Now showing the serial number on the RTL-SDR
This commit is contained in:
parent
ad36ede26b
commit
14e37b41d4
@ -121,9 +121,14 @@ public:
|
|||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
devCount = rtlsdr_get_device_count();
|
devCount = rtlsdr_get_device_count();
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
char snBuf[1024];
|
||||||
for (int i = 0; i < devCount; i++) {
|
for (int i = 0; i < devCount; i++) {
|
||||||
|
// Gather device info
|
||||||
const char* devName = rtlsdr_get_device_name(i);
|
const char* devName = rtlsdr_get_device_name(i);
|
||||||
sprintf(buf, "%s [%d]", devName, i);
|
int snErr = rtlsdr_get_device_usb_strings(i, NULL, NULL, snBuf);
|
||||||
|
|
||||||
|
// Build name
|
||||||
|
sprintf(buf, "[%s] %s##%d", (!snErr && snBuf[0]) ? snBuf : "No Serial", devName, i);
|
||||||
devNames.push_back(buf);
|
devNames.push_back(buf);
|
||||||
devListTxt += buf;
|
devListTxt += buf;
|
||||||
devListTxt += '\0';
|
devListTxt += '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user