Add a simple warning if you're using OSX with a GreaseWeazle and select a

/dev/tty file rather than a /dev/cu one (the /dev/tty files usually don't work).
This commit is contained in:
dg
2021-12-04 20:57:53 +00:00
parent c88ff973b1
commit 78a070bd99
2 changed files with 5 additions and 1 deletions

View File

@@ -45,5 +45,4 @@ private:
std::stringstream _stream;
};
#endif

View File

@@ -108,6 +108,11 @@
typedef int FileHandle;
static FileHandle open_serial_port(const std::string& name)
{
#ifdef __APPLE__
if (name.find("/dev/tty.") != std::string::npos)
std::cerr << "Warning: you probably want to be using a /dev/cu.* device\n";
#endif
int fd = open(name.c_str(), O_RDWR);
if (fd == -1)
Error() << fmt::format("cannot open GreaseWeazle serial port '{}': {}",