Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter .tty serial ports in Networking for Mac users (Issue #1097) #1137

Merged

Conversation

kkashiva
Copy link
Contributor

Added a new method getCuCommPorts() to W_Networking.pde.

The method filters out .tty ports from the SerialPort library for Mac users and returns the results as a LinkedList

This method is called to store the result as an ArrayList in comPorts, which is then fed to the dropdown.

These changes are made to resolve Issue #1097 as recommended changes are made in a branch "networking_filter_serial_ports" based off the "development" branch.

@kkashiva kkashiva marked this pull request as draft May 22, 2023 17:14
@kkashiva
Copy link
Contributor Author

Got an error "W_Networking.pde:182:0:182:0: cannot convert from element type SerialPort to String".
Will fix this error, any tips will be helpful.

Till then converting this to a draft pull request

@kkashiva kkashiva marked this pull request as ready for review May 22, 2023 17:22
@kkashiva
Copy link
Contributor Author

Error fixed. Was a silly miss of using String type iterator in for loop instead of the SerialPort.
All tests passed. Please review @retiutut

@retiutut
Copy link
Member

retiutut commented Jun 6, 2023

Working!
Screen Shot 2023-06-06 at 1 56 09 PM

@@ -154,7 +154,9 @@ class W_Networking extends Widget {
protocolMode = "UDP"; //Set Default to UDP
protocolIndex = 2; //Set Default to UDP
addDropdown("Protocol", "Protocol", Arrays.asList(settings.nwProtocolArray), protocolIndex);
comPorts = new ArrayList<String>(Arrays.asList(processing.serial.Serial.list()));
// comPorts = new ArrayList<String>(Arrays.asList(processing.serial.Serial.list()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This old line of code should be removed, but I'm about to start a major refactor of this class and I'll take care of it.

@retiutut
Copy link
Member

retiutut commented Jun 6, 2023

Thanks for this PR! Tested and approved. Merging, and then after this I'll add this is an item in the changelog.

@retiutut retiutut merged commit 1035abd into OpenBCI:development Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants