git-svn-id: svn://db.shs.com.ru/pip@282 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2016-11-23 10:59:53 +00:00
parent d3166f8fa5
commit 8f6e7d2cae
9 changed files with 73 additions and 36 deletions

View File

@@ -541,7 +541,7 @@ void PISerial::applySettings() {
}
PRIVATE->desc.StopBits = params[PISerial::TwoStopBits] ? TWOSTOPBITS : ONESTOPBIT;
PRIVATE->desc.fOutxCtsFlow = 0;
/*PRIVATE->desc.fOutxCtsFlow = 0;
PRIVATE->desc.fOutxDsrFlow = 0;
PRIVATE->desc.fDtrControl = 0;
PRIVATE->desc.fRtsControl = 0;
@@ -549,7 +549,7 @@ void PISerial::applySettings() {
PRIVATE->desc.fOutX = 0;
PRIVATE->desc.fBinary = 1;
PRIVATE->desc.fAbortOnError = 0;
PRIVATE->desc.fNull = 0;
PRIVATE->desc.fNull = 0;*/
if (SetCommState(PRIVATE->hCom, &PRIVATE->desc) == -1) {
piCoutObj << "Unable to set comm state for \"" << path() << "\"";
return;
@@ -629,9 +629,9 @@ int PISerial::read(void * read_to, int max_size) {
if (sending) return -1;
// piCoutObj << "com event ...";
//WaitCommEvent(PRIVATE->hCom, 0, 0);
// piCoutObj << "read ...";
//piCoutObj << "read ..." << PRIVATE->hCom;
ReadFile(PRIVATE->hCom, read_to, max_size, &PRIVATE->readed, 0);
// piCoutObj << "read ok";
//piCoutObj << "read ok" << PRIVATE->readed;
return PRIVATE->readed;
#else
if (!canRead()) return -1;

View File

@@ -177,9 +177,9 @@ public:
bool send(const void * data, int size) {return (write(data, size) == size);}
/// NOTE: no reason to use this function, use PIString::toUtf8() or PIString::dataAscii(),lengthAscii() instead
// //! \brief Write to device string "data" and wait for data written if "wait" is \b true.
// //! \returns \b true if sended bytes count = size of string
// bool send(const PIString & data, bool wait = false) {return (write(data.data(), data.lengthAscii(), wait) == data.size_s());}
//! \brief Write to device string "data" and wait for data written if "wait" is \b true.
//! \returns \b true if sended bytes count = size of string
//bool send(const PIString & data, bool wait = false) {return (write(data.data(), data.lengthAscii(), wait) == data.size_s());}
//! \brief Write to device byte array "data" and wait for data written if "wait" is \b true.
//! \returns \b true if sended bytes count = size of string