Commit a601da6f authored by springob's avatar springob
Browse files

* MSW/OSX versions

git-svn-id: https://svn.code.sf.net/p/robodude/code/bobdude@40 bbe26285-3967-4f0a-9db1-5cc42c1bf15a
parent 56298766
......@@ -5,7 +5,7 @@
#include <wx/msw/registry.h>
#endif
#include <wx/config.h>
#include <wx/dir.h>
//(*InternalHeaders(PlatformDialog)
#include <wx/intl.h>
......@@ -294,10 +294,27 @@ wxArrayString getExistingUSBComPorts(const wxString & vid, const wxString & pid)
return result;
}
static
wxArrayString listDevices(const wxString & pattern) {
wxArrayString result;
const wxString devdir = _T("/dev");
const int flags = wxDIR_FILES;
if (wxDirExists(devdir)) {
wxDir::GetAllFiles(devdir, &result, pattern, flags);
}
for (unsigned int i=0; i<result.GetCount(); ++i) {
result[i]="/dev/"+result[i];
}
return result;
}
wxArrayString PlatformDialog::getUSBComPorts(const wxString & vid, const wxString & pid) {
#if defined(__WINDOWS__)
return loc_StringArrayAnd(getExistingUSBComPorts(vid, pid), getAvailableComPorts());
#else
return listDevices("tty.usb*");
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment