mirror of
https://git.code.sf.net/p/fldigi/flrig
synced 2026-08-13 17:28:24 -04:00
BigSur serial ports
* Modify port discovery for Big Sur naming convention
This commit is contained in:
parent
290c27e622
commit
ea2e4e8f11
1 changed files with 10 additions and 10 deletions
|
|
@ -292,25 +292,25 @@ out:
|
|||
|
||||
void init_port_combos()
|
||||
{
|
||||
clear_combos();
|
||||
|
||||
struct stat st;
|
||||
|
||||
std::string pname;
|
||||
const char* tty_fmt[] = {
|
||||
"/dev/cu.*",
|
||||
"/dev/tty.*"
|
||||
};
|
||||
|
||||
struct stat st;
|
||||
glob_t gbuf;
|
||||
bool is_serial;
|
||||
|
||||
clear_combos();
|
||||
for (size_t i = 0; i < sizeof(tty_fmt)/sizeof(*tty_fmt); i++) {
|
||||
glob(tty_fmt[i], 0, NULL, &gbuf);
|
||||
for (size_t j = 0; j < gbuf.gl_pathc; j++) {
|
||||
if ( !(stat(gbuf.gl_pathv[j], &st) == 0 && S_ISCHR(st.st_mode)) ||
|
||||
strstr(gbuf.gl_pathv[j], "modem") )
|
||||
continue;
|
||||
LOG_WARN("Found serial port %s", gbuf.gl_pathv[j]);
|
||||
add_combos(gbuf.gl_pathv[j]);
|
||||
pname = gbuf.gl_pathv[j];
|
||||
is_serial = (stat(gbuf.gl_pathv[j], &st) == 0 && S_ISCHR(st.st_mode));
|
||||
if ( is_serial || pname.find("modem") != std::string::npos ) {
|
||||
LOG_WARN ("Found serial port %s", gbuf.gl_pathv[j]);
|
||||
add_combos (gbuf.gl_pathv[j]);
|
||||
}
|
||||
}
|
||||
globfree(&gbuf);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue