Skip to content

Commit

Permalink
Processing4beta3 - Fix "type Serial is ambigious"
Browse files Browse the repository at this point in the history
Fixes #1025
  • Loading branch information
retiutut committed Jan 21, 2022
1 parent adf2bdc commit 2df2612
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions OpenBCI_GUI/InterfaceSerial.pde
Expand Up @@ -43,7 +43,7 @@ int numPacketsDroppedSerial = 0;
//------------------------------------------------------------------------
// Global Functions
//------------------------------------------------------------------------
void serialEvent(Serial port){
void serialEvent(processing.serial.Serial port){
//check to see which serial port it is
if (iSerial.isOpenBCISerial(port)) {

Expand Down Expand Up @@ -122,7 +122,7 @@ void serialEvent(Serial port){
class InterfaceSerial {

//here is the serial port for this OpenBCI board
private Serial serial_openBCI = null;
private processing.serial.Serial serial_openBCI = null;
private boolean portIsOpen = false;

//final static int DATAMODE_TXT = 0;
Expand Down Expand Up @@ -223,7 +223,7 @@ class InterfaceSerial {
output("Attempting to open Serial/COM port: " + openBCI_portName);
try {
println("InterfaceSerial: openSerialPort: attempting to open serial port: " + openBCI_portName);
serial_openBCI = new Serial(applet, comPort, baud); //open the com port
serial_openBCI = new processing.serial.Serial(applet, comPort, baud); //open the com port
serial_openBCI.clear(); // clear anything in the com port's buffer
portIsOpen = true;
println("InterfaceSerial: openSerialPort: port is open (t)? ... " + portIsOpen);
Expand Down Expand Up @@ -320,7 +320,7 @@ class InterfaceSerial {
return false;
}
}
public boolean isOpenBCISerial(Serial port) {
public boolean isOpenBCISerial(processing.serial.Serial port) {
if (serial_openBCI == port) {
return true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion OpenBCI_GUI/OpenBCI_GUI.pde
Expand Up @@ -179,7 +179,7 @@ String playbackData_ShortName;
boolean recentPlaybackFilesHaveUpdated = false;

// Serial output
Serial serial_output;
processing.serial.Serial serial_output;

//Control Panel for (re)configuring system settings
PlotFontInfo fontInfo;
Expand Down
20 changes: 10 additions & 10 deletions OpenBCI_GUI/RadioConfig.pde
Expand Up @@ -15,7 +15,7 @@

class RadioConfig {

private Serial serial_direct_board;
private processing.serial.Serial serial_direct_board;
private final int NUM_RADIO_CHAN = 26;
private String rcStringReceived = "";
private boolean autoscanPressed = false;
Expand Down Expand Up @@ -85,7 +85,7 @@ class RadioConfig {
if(!connect_to_portName(rcConfig)){
return;
}
serial_direct_board = new Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
serial_direct_board = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
if(serial_direct_board != null){
serial_direct_board.write(0xF0);
serial_direct_board.write(0x07);
Expand All @@ -112,7 +112,7 @@ class RadioConfig {
if(!connect_to_portName()){
return false;
}
serial_direct_board = new Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
serial_direct_board = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
if(serial_direct_board != null){
serial_direct_board.write(0xF0);
serial_direct_board.write(0x07);
Expand Down Expand Up @@ -155,7 +155,7 @@ class RadioConfig {
return;
}
}
serial_direct_board = new Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
serial_direct_board = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
if(serial_direct_board != null){
serial_direct_board.write(0xF0);
serial_direct_board.write(0x00);
Expand All @@ -176,7 +176,7 @@ class RadioConfig {
return false;
}
}
serial_direct_board = new Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
serial_direct_board = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
if(serial_direct_board != null){
serial_direct_board.write(0xF0);
serial_direct_board.write(0x00);
Expand Down Expand Up @@ -221,7 +221,7 @@ class RadioConfig {
return;
}
}
serial_direct_board = new Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
serial_direct_board = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
if(serial_direct_board != null){
if(channel_number > 0){
serial_direct_board.write(0xF0);
Expand Down Expand Up @@ -260,7 +260,7 @@ class RadioConfig {
return;
}
}
serial_direct_board = new Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
serial_direct_board = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
if(serial_direct_board != null){
if(channel_number > 0){
serial_direct_board.write(0xF0);
Expand Down Expand Up @@ -288,7 +288,7 @@ class RadioConfig {
return;
}
}
serial_direct_board = new Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
serial_direct_board = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //force open the com port
if(serial_direct_board != null){
if(channel_number > 0){
serial_direct_board.write(0xF0);
Expand All @@ -312,7 +312,7 @@ class RadioConfig {
output("Attempting to open Serial/COM port: " + openBCI_portName);
try {
println("Radios_Config: connect_to_portName: Attempting to open serial port: " + openBCI_portName);
serial_output = new Serial(ourApplet, openBCI_portName, openBCI_baud); //open the com port
serial_output = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //open the com port
serial_output.clear(); // clear anything in the com port's buffer
// portIsOpen = true;
println("Radios_Config: connect_to_portName: Port is open!");
Expand Down Expand Up @@ -344,7 +344,7 @@ class RadioConfig {
verbosePrint("Attempting to open Serial/COM port: " + openBCI_portName);
try {
verbosePrint("Radios_Config: connect_to_portName: Attempting to open serial port: " + openBCI_portName);
serial_output = new Serial(ourApplet, openBCI_portName, openBCI_baud); //open the com port
serial_output = new processing.serial.Serial(ourApplet, openBCI_portName, openBCI_baud); //open the com port
serial_output.clear(); // clear anything in the com port's buffer
// portIsOpen = true;
verbosePrint("Radios_Config: connect_to_portName: Port is open!");
Expand Down
6 changes: 3 additions & 3 deletions OpenBCI_GUI/W_Networking.pde
Expand Up @@ -152,7 +152,7 @@ class W_Networking extends Widget {
baudRates = Arrays.asList(settings.nwBaudRatesArray);
protocolMode = "Serial"; //default to Serial
addDropdown("Protocol", "Protocol", Arrays.asList(settings.nwProtocolArray), protocolIndex);
comPorts = new ArrayList<String>(Arrays.asList(Serial.list()));
comPorts = new ArrayList<String>(Arrays.asList(processing.serial.Serial.list()));
verbosePrint("comPorts = " + comPorts);
comPortToSave = 0;

Expand Down Expand Up @@ -1234,7 +1234,7 @@ class Stream extends Thread {
LSL.StreamOutlet outlet_aux;

// Serial objects %%%%%
Serial serial_networking;
processing.serial.Serial serial_networking;
String portName;
int baudRate;
String serialMessage = "";
Expand Down Expand Up @@ -2170,7 +2170,7 @@ class Stream extends Thread {
} else if (this.protocol.equals("Serial")) {
//Open Serial Port! %%%%%
try {
serial_networking = new Serial(this.pApplet, this.portName, this.baudRate);
serial_networking = new processing.serial.Serial(this.pApplet, this.portName, this.baudRate);
serial_networking.clear();
verbosePrint("Successfully opened SERIAL/COM: " + this.portName);
output("Successfully opened SERIAL/COM (" + this.baudRate + "): " + this.portName );
Expand Down

0 comments on commit 2df2612

Please sign in to comment.