mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-09 15:12:59 -04:00
Add COM:, UDP:, and TCP: prefixes to location string for Espurna, LED Strip, and NZXT Hue Plus controllers
This commit is contained in:
@@ -86,21 +86,37 @@ void LEDStripController::Initialize(char* ledstring)
|
||||
void LEDStripController::InitializeSerial(char* portname, int baud)
|
||||
{
|
||||
portname = strtok(portname, "\r");
|
||||
strcpy(port_name, portname);
|
||||
port_name = portname;
|
||||
baud_rate = baud;
|
||||
serialport = new serial_port(port_name, baud_rate);
|
||||
serialport = new serial_port(port_name.c_str(), baud_rate);
|
||||
udpport = NULL;
|
||||
}
|
||||
|
||||
void LEDStripController::InitializeUDP(char * clientname, char * port)
|
||||
{
|
||||
strcpy(client_name, clientname);
|
||||
strcpy(port_name, port);
|
||||
client_name = clientname;
|
||||
port_name = port;
|
||||
|
||||
udpport = new net_port(client_name, port_name);
|
||||
udpport = new net_port(client_name.c_str(), port_name.c_str());
|
||||
serialport = NULL;
|
||||
}
|
||||
|
||||
std::string LEDStripController::GetLocation()
|
||||
{
|
||||
if(serialport != NULL)
|
||||
{
|
||||
return("COM: " + port_name);
|
||||
}
|
||||
else if(udpport != NULL)
|
||||
{
|
||||
return("UDP: " + client_name + ":" + port_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return("");
|
||||
}
|
||||
}
|
||||
|
||||
char* LEDStripController::GetLEDString()
|
||||
{
|
||||
return(led_string);
|
||||
@@ -143,4 +159,4 @@ void LEDStripController::SetLEDs(std::vector<RGBColor> colors)
|
||||
}
|
||||
|
||||
delete[] serial_buf;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user