C:\Users\Talus\Projet\Arduino_console\Serial.cpp||In constructor 'Serial::Serial(char*)':|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::BaudRate'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fBinary'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fParity'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fOutxCtsFlow'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fOutxDsrFlow'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fDtrControl'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fDsrSensitivity'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fTXContinueOnXoff'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fOutX'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fInX'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fErrorChar'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fNull'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fRtsControl'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fAbortOnError'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::fDummy2'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::wReserved'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::XonLim'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::XoffLim'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::ByteSize'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::Parity'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::StopBits'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::XonChar'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::XoffChar'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::ErrorChar'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::EofChar'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::EvtChar'|C:\Users\Talus\Projet\Arduino_console\Serial.cpp|34|error: missing initializer for member '_DCB::wReserved1'|||=== Build finished: 27 errors, 0 warnings ===|

//Use the ClearCommError function to get status info on the Serial port ClearCommError(this->hSerial, &this->errors, &this->status);

//Check if there is something to read if(this->status.cbInQue>0) { //If there is we check if there is enough data to read the required number //of characters, if not we'll read only the available characters to prevent //locking of the application. if(this->status.cbInQue>nbChar) toRead = nbChar; else toRead = this->status.cbInQue;

//Try to read the require number of chars, and return the number of read bytes on success if(ReadFile(this->hSerial, buffer, toRead, &bytesRead, NULL) && bytesRead != 0) return bytesRead; } //If nothing has been read, or that an error was detected return -1 return -1;}

public: //Initialize Serial communication with the given COM port Serial(const char *portName); //Close the connection //NOTA: for some reason you can't connect again before exiting //the program and running it again ~Serial(); //Read data in a buffer, if nbChar is greater than the //maximum number of bytes available, it will return only the //bytes available. The function return -1 when nothing could //be read, the number of bytes actually read. int ReadData(char *buffer, unsigned int nbChar); //Writes data from a buffer through the Serial connection //return true on success. bool WriteData(char *buffer, unsigned int nbChar); //Check if we are actually connected bool IsConnected();};