Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/SerialPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SerialPort
COMSTAT status;
DWORD errors;
public:
SerialPort(char *portName);
SerialPort(char *portName, DWORD baudRate = CBR_9600);
~SerialPort();

int readSerialPort(char *buffer, unsigned int buf_size);
Expand Down
4 changes: 2 additions & 2 deletions src/SerialPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "SerialPort.h"

SerialPort::SerialPort(char *portName)
SerialPort::SerialPort(char *portName, DWORD baudRate)
{
this->connected = false;

Expand All @@ -34,7 +34,7 @@ SerialPort::SerialPort(char *portName)
printf("failed to get current serial parameters");
}
else {
dcbSerialParameters.BaudRate = CBR_9600;
dcbSerialParameters.BaudRate = baudRate;
dcbSerialParameters.ByteSize = 8;
dcbSerialParameters.StopBits = ONESTOPBIT;
dcbSerialParameters.Parity = NOPARITY;
Expand Down