05.11.2011 - stable version, 0.1.0, self-test program, work at GCC 2.95 - 4.5, VC 2010, MinGW, Linux, Windows, QNX
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
PISerial::PISerial(PIString name, void * data_, SerialFunc slot): PIThread() {
|
||||
piMonitor.serials++;
|
||||
setPriority(piHigh);
|
||||
data = data_;
|
||||
devName = name;
|
||||
@@ -10,6 +11,8 @@ PISerial::PISerial(PIString name, void * data_, SerialFunc slot): PIThread() {
|
||||
headerPtr = 0;
|
||||
hbuffer = pbuffer = 0;
|
||||
ret_func = slot;
|
||||
memset(buffer, 0, BUFFER_SIZE);
|
||||
memset(sbuffer, 0, BUFFER_SIZE);
|
||||
#ifdef WINDOWS
|
||||
hCom = 0;
|
||||
#endif
|
||||
@@ -18,6 +21,7 @@ PISerial::PISerial(PIString name, void * data_, SerialFunc slot): PIThread() {
|
||||
|
||||
|
||||
PISerial::~PISerial() {
|
||||
piMonitor.serials--;
|
||||
terminate();
|
||||
}
|
||||
|
||||
@@ -132,6 +136,8 @@ void PISerial::run() {
|
||||
}
|
||||
if (j == headerSize) {
|
||||
first = true;
|
||||
mheader.resize(headerSize);
|
||||
memcpy(mheader.data(),headerPtr,headerSize);
|
||||
//cout << "yes" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user