Skip to content

Commit cdc4fd3

Browse files
authored
Merge pull request #606 from drowe67/ms-report-os-usage
Report OS usage to FreeDV Reporter.
2 parents 99deebe + 0ca60ea commit cdc4fd3

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

USER_MANUAL.md

+2
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,8 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
926926
* Add ability to double-click FreeDV Reporter entries to change the radio's frequency. (PR #592)
927927
* FreeDV Reporter: Add ability to force RX Only reporting in Tools->Options. (PR #599)
928928
* Add new 160m/80m/40m calling frequencies for IARU R2. (PR #601)
929+
3. Other:
930+
* Report OS usage to FreeDV Reporter. (PR #606)
929931

930932
## V1.9.4 October 2023
931933

src/os/os_interface.h

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define __OS_INTERFACE__
2424

2525
#include <future>
26+
#include <string>
2627

2728
// Checks whether FreeDV has permissions to access the microphone on OSX Catalina
2829
// and above. If the user doesn't grant permissions (returns FALSE), the GUI
@@ -38,4 +39,8 @@ void VerifyMicrophonePermissions(std::promise<bool>& promise);
3839
// for more details.
3940
extern "C" void ResetMainWindowColorSpace();
4041

42+
// Retrieves a string representing the operating system that FreeDV is running on.
43+
// This can be either "windows", "linux", "macos" or "other".
44+
std::string GetOperatingSystemString();
45+
4146
#endif // __OS_INTERFACE__

src/os/osx_interface.mm

+5
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,8 @@ void ResetMainWindowColorSpace()
7575
assert(cs != nullptr);
7676
CGColorSpaceRelease(cs);
7777
}
78+
79+
std::string GetOperatingSystemString()
80+
{
81+
return "macos";
82+
}

src/os/osx_stubs.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,15 @@ void VerifyMicrophonePermissions(std::promise<bool>& micPromise)
3030
void ResetMainWindowColorSpace()
3131
{
3232
// empty
33+
}
34+
35+
std::string GetOperatingSystemString()
36+
{
37+
#ifdef __linux__
38+
return "linux";
39+
#elif _WIN32
40+
return "windows";
41+
#else
42+
return "other";
43+
#endif // __linux__ || _WIN32
3344
}

src/reporting/FreeDVReporter.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "FreeDVReporter.h"
2424
#include "sio_client.h"
25+
#include "../os/os_interface.h"
2526

2627
using namespace std::chrono_literals;
2728

@@ -230,6 +231,7 @@ void FreeDVReporter::connect_()
230231
auth->insert("grid_square", gridSquare_);
231232
auth->insert("version", software_);
232233
auth->insert("rx_only", sio::bool_message::create(rxOnly_));
234+
auth->insert("os", GetOperatingSystemString());
233235
}
234236

235237
// Reconnect listener should re-report frequency so that "unknown"

0 commit comments

Comments
 (0)