com0com-cvs Mailing List for Null-modem emulator (Page 10)
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
You can subscribe to this list here.
2005 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
(13) |
Jun
(18) |
Jul
(9) |
Aug
(10) |
Sep
(15) |
Oct
(6) |
Nov
(9) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(4) |
Mar
(4) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(6) |
Aug
(9) |
Sep
(1) |
Oct
(27) |
Nov
(22) |
Dec
(3) |
2007 |
Jan
(13) |
Feb
(16) |
Mar
(2) |
Apr
(3) |
May
(7) |
Jun
(17) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(20) |
Nov
(18) |
Dec
(1) |
2008 |
Jan
|
Feb
(3) |
Mar
(46) |
Apr
(40) |
May
(4) |
Jun
(9) |
Jul
(7) |
Aug
(62) |
Sep
(25) |
Oct
(51) |
Nov
(67) |
Dec
(81) |
2009 |
Jan
(13) |
Feb
(31) |
Mar
(12) |
Apr
|
May
(10) |
Jun
|
Jul
(5) |
Aug
(2) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
(12) |
Jun
(9) |
Jul
(12) |
Aug
(7) |
Sep
(6) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
|
Jul
(26) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(23) |
2012 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(9) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vyacheslav F. <vf...@us...> - 2008-12-25 16:55:31
|
Update of /cvsroot/com0com/com0com/setup In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15211 Modified Files: params.cpp Log Message: Added converting portnames to uppercase Index: params.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/params.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** params.cpp 2 Dec 2008 11:54:28 -0000 1.14 --- params.cpp 25 Dec 2008 16:55:23 -0000 1.15 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.15 2008/12/25 16:55:23 vfrolov + * Added converting portnames to uppercase + * * Revision 1.14 2008/12/02 11:54:28 vfrolov * Fixed typo *************** *** 150,153 **** --- 153,157 ---- if (lstrcmpi(portName, pNewPortName)) { SNPRINTF(portName, sizeof(portName)/sizeof(portName[0]), "%s", pNewPortName); + CharUpper(portName); maskChanged |= m_portName; } |
From: Vyacheslav F. <vf...@us...> - 2008-12-24 15:32:26
|
Update of /cvsroot/com0com/com0com/setup In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29195 Modified Files: sources setup.cpp Log Message: Added logging COM port numbers in the COM port database Index: sources =================================================================== RCS file: /cvsroot/com0com/com0com/setup/sources,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sources 1 Oct 2007 14:56:39 -0000 1.6 --- sources 24 Dec 2008 15:32:22 -0000 1.7 *************** *** 13,16 **** --- 13,17 ---- devutils.cpp \ portnum.cpp \ + comdb.cpp \ msg.cpp \ utils.cpp \ Index: setup.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/setup.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** setup.cpp 12 Sep 2008 12:21:49 -0000 1.25 --- setup.cpp 24 Dec 2008 15:32:22 -0000 1.26 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.26 2008/12/24 15:32:22 vfrolov + * Added logging COM port numbers in the COM port database + * * Revision 1.25 2008/09/12 12:21:49 vfrolov * Added --silent option *************** *** 111,115 **** #include "utils.h" #include "portnum.h" ! #include <msports.h> #define TEXT_PREF --- 114,118 ---- #include "utils.h" #include "portnum.h" ! #include "comdb.h" #define TEXT_PREF *************** *** 150,155 **** /////////////////////////////////////////////////////////////// static BOOL IsValidPortName( ! const char *pPortName, ! const char *pPhDevName) { int res; --- 153,157 ---- /////////////////////////////////////////////////////////////// static BOOL IsValidPortName( ! const char *pPortName) { int res; *************** *** 171,247 **** if (!QueryDosDevice(pPortName, phDevName, sizeof(phDevName)/sizeof(phDevName[0]))) { ! if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { ! if ((pPortName[0] == 'C' || pPortName[0] == 'c') && ! (pPortName[1] == 'O' || pPortName[1] == 'o') && ! (pPortName[2] == 'M' || pPortName[2] == 'm')) ! { ! int num; ! ! if (StrToInt(pPortName + 3, &num) && num > 0) { ! HCOMDB hComDB; ! LONG err; ! ! err = ComDBOpen(&hComDB); ! ! if (err != ERROR_SUCCESS) { ! res = ShowLastError(MB_CANCELTRYCONTINUE, "ComDBOpen()"); ! continue; ! } ! ! DWORD maxPortsReported; ! ! err = ComDBGetCurrentPortUsage(hComDB, NULL, 0, CDB_REPORT_BYTES, &maxPortsReported); ! ! if (err != ERROR_SUCCESS) { ! ComDBClose(hComDB); ! res = ShowError(MB_CANCELTRYCONTINUE, err, "ComDBGetCurrentPortUsage()"); ! continue; ! } ! ! if (maxPortsReported < (DWORD)num) { ! ComDBClose(hComDB); ! continue; ! } ! ! if (maxPortsReported > (DWORD)num) ! maxPortsReported = num; ! ! BYTE *pBuf = (BYTE *)LocalAlloc(LPTR, maxPortsReported); ! ! if (!pBuf) { ! ComDBClose(hComDB); ! ! SetLastError(ERROR_NOT_ENOUGH_MEMORY); ! res = ShowLastError(MB_CANCELTRYCONTINUE, "LocalAlloc(%lu)", (unsigned long)maxPortsReported); ! continue; ! } ! ! err = ComDBGetCurrentPortUsage(hComDB, pBuf, num, CDB_REPORT_BYTES, &maxPortsReported); ! ComDBClose(hComDB); ! ! if (err != ERROR_SUCCESS) { ! LocalFree(pBuf); ! res = ShowError(MB_CANCELTRYCONTINUE, err, "ComDBGetCurrentPortUsage()"); ! continue; ! } ! ! if (pBuf[num - 1]) ! res = ShowMsg(MB_CANCELTRYCONTINUE, ! "The port name %s is already logged as \"in use\"\n" ! "in the COM port database.", ! pPortName); ! ! LocalFree(pBuf); ! } ! } continue; - } phDevName[0] = 0; } - if (pPhDevName && !lstrcmpi(pPhDevName, phDevName)) - break; - res = ShowMsg(MB_CANCELTRYCONTINUE, "The port name %s is already used for other device %s.", --- 173,182 ---- if (!QueryDosDevice(pPortName, phDevName, sizeof(phDevName)/sizeof(phDevName[0]))) { ! if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) continue; phDevName[0] = 0; } res = ShowMsg(MB_CANCELTRYCONTINUE, "The port name %s is already used for other device %s.", *************** *** 253,256 **** --- 188,212 ---- return FALSE; + do { + res = IDCONTINUE; + + BOOL inUse; + + if (!ComDbGetInUse(pPortName, inUse)) { + res = IDCANCEL; + continue; + } + + if (inUse) { + res = ShowMsg(MB_CANCELTRYCONTINUE, + "The port name %s is already logged as \"in use\"\n" + "in the COM port database.", + pPortName); + } + } while (res == IDTRYAGAIN); + + if (res != IDCONTINUE) + return FALSE; + return TRUE; } *************** *** 310,318 **** struct ChangeDeviceParams { ChangeDeviceParams(InfFile &_infFile, const char *_pPhPortName, const char *_pParameters) ! : pInfFile(&_infFile), pPhPortName(_pPhPortName), pParameters(_pParameters) {} InfFile *pInfFile; const char *pPhPortName; const char *pParameters; }; --- 266,275 ---- struct ChangeDeviceParams { ChangeDeviceParams(InfFile &_infFile, const char *_pPhPortName, const char *_pParameters) ! : pInfFile(&_infFile), pPhPortName(_pPhPortName), pParameters(_pParameters), changed(FALSE) {} InfFile *pInfFile; const char *pPhPortName; const char *pParameters; + BOOL changed; }; *************** *** 348,351 **** --- 305,312 ---- if (err == ERROR_SUCCESS) { if (pPhPortName && !lstrcmpi(pPhPortName, phPortName)) { + char portNameOld[20]; + + portParameters.FillPortName(portNameOld, sizeof(portNameOld)/sizeof(portNameOld[0])); + portParameters.ParseParametersStr(pParameters); *************** *** 359,366 **** portParameters.FillPortName(portName, sizeof(portName)/sizeof(portName[0])); ! if (IsValidPortName(portName, phDevName) && portParameters.Changed()) { err = portParameters.Save(); if (err == ERROR_SUCCESS) { portParameters.FillParametersStr(buf, sizeof(buf)/sizeof(buf[0]), detailPrms); Trace("change %s %s\n", phPortName, buf); --- 320,331 ---- portParameters.FillPortName(portName, sizeof(portName)/sizeof(portName[0])); ! if (portParameters.Changed() && ! (!lstrcmpi(portName, portNameOld) || IsValidPortName(portName))) ! { err = portParameters.Save(); if (err == ERROR_SUCCESS) { + ((ChangeDeviceParams *)pParam)->changed = TRUE; + portParameters.FillParametersStr(buf, sizeof(buf)/sizeof(buf[0]), detailPrms); Trace("change %s %s\n", phPortName, buf); *************** *** 403,406 **** --- 368,374 ---- EnumDevices(infFile, &devProperties, &rebootRequired, ChangeDevice, ¶ms); + if (params.changed) + ComDbSync(infFile); + if (rebootRequired) SetupPromptReboot(NULL, NULL, FALSE); *************** *** 474,477 **** --- 442,447 ---- } + ComDbSync(infFile); + if (rebootRequired) SetupPromptReboot(NULL, NULL, FALSE); *************** *** 531,534 **** --- 501,506 ---- CleanDevPropertiesStack(infFile, stack, TRUE, &rebootRequired); + ComDbSync(infFile); + if (rebootRequired || rr) SetupPromptReboot(NULL, NULL, FALSE); *************** *** 691,695 **** portParameters.FillPortName(portName[j], sizeof(portName[j])/sizeof(portName[j][0])); ! if (!IsValidPortName(portName[j], NULL)) goto err; --- 663,667 ---- portParameters.FillPortName(portName[j], sizeof(portName[j])/sizeof(portName[j][0])); ! if (!IsValidPortName(portName[j])) goto err; *************** *** 723,726 **** --- 695,700 ---- goto err; + ComDbSync(infFile); + return 0; *************** *** 760,763 **** --- 734,739 ---- return 1; + ComDbSync(infFile); + if (rebootRequired) { SetupPromptReboot(NULL, NULL, FALSE); |
From: Vyacheslav F. <vf...@us...> - 2008-12-24 15:22:54
|
Update of /cvsroot/com0com/com0com/setup In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28003 Modified Files: utils.cpp utils.h Log Message: Added BusyMask::Clear() and BusyMask::DelNum() Index: utils.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/utils.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** utils.cpp 20 Sep 2007 12:37:06 -0000 1.6 --- utils.cpp 24 Dec 2008 15:22:44 -0000 1.7 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/12/24 15:22:44 vfrolov + * Added BusyMask::Clear() and BusyMask::DelNum() + * * Revision 1.6 2007/09/20 12:37:06 vfrolov * Added SetLastError(ERROR_NOT_ENOUGH_MEMORY) *************** *** 151,158 **** } /////////////////////////////////////////////////////////////// ! BusyMask::~BusyMask() { ! if (pBusyMask) LocalFree(pBusyMask); } --- 154,164 ---- } /////////////////////////////////////////////////////////////// ! void BusyMask::Clear() { ! if (pBusyMask) { LocalFree(pBusyMask); + pBusyMask = NULL; + busyMaskLen = 0; + } } *************** *** 186,189 **** --- 192,207 ---- } + void BusyMask::DelNum(int num) + { + ULONG maskNum = num/(sizeof(*pBusyMask)*8); + + if (maskNum >= busyMaskLen) + return; + + ULONG mask = 1 << (num%(sizeof(*pBusyMask)*8)); + + pBusyMask[maskNum] &= ~mask; + } + BOOL BusyMask::IsFreeNum(int num) const { Index: utils.h =================================================================== RCS file: /cvsroot/com0com/com0com/setup/utils.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** utils.h 25 Sep 2007 12:28:22 -0000 1.5 --- utils.h 24 Dec 2008 15:22:44 -0000 1.6 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/12/24 15:22:44 vfrolov + * Added BusyMask::Clear() and BusyMask::DelNum() + * * Revision 1.5 2007/09/25 12:28:22 vfrolov * Implemented Stack class *************** *** 49,55 **** public: BusyMask() : pBusyMask(NULL), busyMaskLen(0) {} ! ~BusyMask(); BOOL AddNum(int num); BOOL IsFreeNum(int num) const; int GetFirstFreeNum() const; --- 52,60 ---- public: BusyMask() : pBusyMask(NULL), busyMaskLen(0) {} ! ~BusyMask() { Clear(); } + void Clear(); BOOL AddNum(int num); + void DelNum(int num); BOOL IsFreeNum(int num) const; int GetFirstFreeNum() const; |
From: Vyacheslav F. <vf...@us...> - 2008-12-24 15:20:43
|
Update of /cvsroot/com0com/com0com/setup In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27725 Added Files: comdb.cpp comdb.h Log Message: Initial revision --- NEW FILE: comdb.h --- /* * $Id: comdb.h,v 1.1 2008/12/24 15:20:35 vfrolov Exp $ * * Copyright (c) 2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * $Log: comdb.h,v $ * Revision 1.1 2008/12/24 15:20:35 vfrolov * Initial revision * */ #ifndef _C0C_COMDB_H_ #define _C0C_COMDB_H_ /////////////////////////////////////////////////////////////// class InfFile; /////////////////////////////////////////////////////////////// BOOL ComDbGetInUse(const char *pPortName, BOOL &inUse); void ComDbSync(InfFile &infFile); /////////////////////////////////////////////////////////////// #endif /* _C0C_COMDB_H_ */ --- NEW FILE: comdb.cpp --- /* * $Id: comdb.cpp,v 1.1 2008/12/24 15:20:35 vfrolov Exp $ * * Copyright (c) 2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * $Log: comdb.cpp,v $ * Revision 1.1 2008/12/24 15:20:35 vfrolov * Initial revision * */ #include "precomp.h" #include "params.h" #include "devutils.h" #include "msg.h" #include "utils.h" #include "portnum.h" #include "comdb.h" #include <msports.h> #define TEXT_PREF #include "../include/com0com.h" /////////////////////////////////////////////////////////////// static const char comDbLocalKey[] = REGSTR_PATH_SERVICES "\\" C0C_SERVICE "\\COM Name Arbiter"; static const char comDbLocalName[] = "ComDB"; /////////////////////////////////////////////////////////////// static WORD name2num(const char *pPortName) { int num; if ((pPortName[0] != 'C' && pPortName[0] != 'c') || (pPortName[1] != 'O' && pPortName[1] != 'o') || (pPortName[2] != 'M' && pPortName[2] != 'm') || !StrToInt(pPortName + 3, &num) || num <= 0 || num > COMDB_MAX_PORTS_ARBITRATED) { return 0; } return (WORD)num; } /////////////////////////////////////////////////////////////// static BOOL LoadComDb(BusyMask &comDb) { comDb.Clear(); int res; do { res = IDCONTINUE; HCOMDB hComDB; LONG err; err = ComDBOpen(&hComDB); if (err != ERROR_SUCCESS) { res = ShowLastError(MB_CANCELTRYCONTINUE, "ComDBOpen()"); continue; } DWORD maxPortsReported; err = ComDBGetCurrentPortUsage(hComDB, NULL, 0, CDB_REPORT_BITS, &maxPortsReported); if (err != ERROR_SUCCESS) { ComDBClose(hComDB); res = ShowError(MB_CANCELTRYCONTINUE, err, "ComDBGetCurrentPortUsage()"); continue; } DWORD bufSize = (maxPortsReported + 7)/8; BYTE *pBuf = (BYTE *)LocalAlloc(LPTR, bufSize); if (!pBuf) { ComDBClose(hComDB); res = ShowError(MB_CANCELTRYCONTINUE, ERROR_NOT_ENOUGH_MEMORY, "LocalAlloc(%lu)", (unsigned long)bufSize); continue; } err = ComDBGetCurrentPortUsage(hComDB, pBuf, bufSize, CDB_REPORT_BITS, &maxPortsReported); ComDBClose(hComDB); if (err != ERROR_SUCCESS) { LocalFree(pBuf); res = ShowError(MB_CANCELTRYCONTINUE, err, "ComDBGetCurrentPortUsage()"); continue; } for (DWORD num = 0 ; num < maxPortsReported ; num++) { if (((pBuf[num/8] >> (num%8)) & 1) != 0) comDb.AddNum(num); } LocalFree(pBuf); } while (res == IDTRYAGAIN); if (res != IDCONTINUE) return FALSE; return TRUE; } /////////////////////////////////////////////////////////////// static BOOL ClaimReleasePort(DWORD num, BOOL claim) { int res; do { res = IDCONTINUE; HCOMDB hComDB; LONG err; err = ComDBOpen(&hComDB); if (err != ERROR_SUCCESS) { res = ShowLastError(MB_RETRYCANCEL, "ComDBOpen()"); continue; } if (claim) { err = ComDBClaimPort(hComDB, num, FALSE, NULL); if (err != ERROR_SUCCESS) { ComDBClose(hComDB); if (err == ERROR_SHARING_VIOLATION) res = IDCANCEL; else res = ShowError(MB_RETRYCANCEL, err, "ComDBClaimPort(COM%u)", (unsigned)num); continue; } } else { err = ComDBReleasePort(hComDB, num); if (err != ERROR_SUCCESS) { ComDBClose(hComDB); res = ShowError(MB_RETRYCANCEL, err, "ComDBReleasePort(COM%u)", (unsigned)num); continue; } } ComDBClose(hComDB); } while (res == IDRETRY); if (res != IDCONTINUE) return FALSE; return TRUE; } /////////////////////////////////////////////////////////////// static BOOL LoadComDbLocal(BusyMask &comDb) { comDb.Clear(); int res; do { res = IDCONTINUE; LONG err; HKEY hKey; err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, comDbLocalKey, 0, KEY_READ, &hKey); if (err != ERROR_SUCCESS) { if (err != ERROR_FILE_NOT_FOUND) res = ShowError(MB_CANCELTRYCONTINUE, err, "RegOpenKeyEx(%s)", comDbLocalKey); continue; } DWORD bufSize = 1; err = RegQueryValueEx(hKey, comDbLocalName, NULL, NULL, NULL, &bufSize); if (err != ERROR_SUCCESS) { RegCloseKey(hKey); if (err != ERROR_FILE_NOT_FOUND) res = ShowError(MB_CANCELTRYCONTINUE, err, "RegQueryValueEx(%s\\%s)", comDbLocalKey, comDbLocalName); continue; } BYTE *pBuf = (BYTE *)LocalAlloc(LPTR, bufSize); if (!pBuf) { RegCloseKey(hKey); res = ShowError(MB_CANCELTRYCONTINUE, ERROR_NOT_ENOUGH_MEMORY, "LocalAlloc(%lu)", (unsigned long)bufSize); continue; } err = RegQueryValueEx(hKey, comDbLocalName, NULL, NULL, pBuf, &bufSize); RegCloseKey(hKey); if (err != ERROR_SUCCESS) { LocalFree(pBuf); if (err != ERROR_FILE_NOT_FOUND) res = ShowError(MB_CANCELTRYCONTINUE, err, "RegQueryValueEx(%s\\%s)", comDbLocalKey, comDbLocalName); continue; } DWORD maxPortsReported = bufSize*8; for (DWORD num = 0 ; num < maxPortsReported ; num++) { if (((pBuf[num/8] >> (num%8)) & 1) != 0) comDb.AddNum(num); } LocalFree(pBuf); } while (res == IDTRYAGAIN); if (res != IDCONTINUE) return FALSE; return TRUE; } /////////////////////////////////////////////////////////////// static BOOL AddComNames( HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDevInfoData, PCDevProperties /*pDevProperties*/, BOOL * /*pRebootRequired*/, void *pParam) { int i = GetPortNum(hDevInfo, pDevInfoData); if (i < 0) return TRUE; for (int j = 0 ; j < 2 ; j++) { char phPortName[20]; SNPRINTF(phPortName, sizeof(phPortName)/sizeof(phPortName[0]), "%s%d", j ? C0C_PREF_PORT_NAME_B : C0C_PREF_PORT_NAME_A, i); PortParameters portParameters(C0C_SERVICE, phPortName); if (portParameters.Load() != ERROR_SUCCESS) return FALSE; char portName[20]; portParameters.FillPortName(portName, sizeof(portName)/sizeof(portName[0])); WORD num = name2num(portName); if (num > 0) ((BusyMask *)pParam)->AddNum(num - 1); } return TRUE; } static BOOL LoadComNames(InfFile &infFile, BusyMask &comDb) { comDb.Clear(); DevProperties devProperties; if (!devProperties.DevId(C0C_BUS_DEVICE_ID)) return FALSE; if (EnumDevices(infFile, &devProperties, NULL, AddComNames, &comDb) < 0) return FALSE; return TRUE; } /////////////////////////////////////////////////////////////// static BOOL SaveComDbLocal(const BusyMask &comDb) { int res; do { res = IDCONTINUE; LONG err; HKEY hKey; err = RegCreateKeyEx(HKEY_LOCAL_MACHINE, comDbLocalKey, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL); if (err != ERROR_SUCCESS) { res = ShowError(MB_CANCELTRYCONTINUE, err, "RegCreateKeyEx(%s)", comDbLocalKey); continue; } DWORD maxPortsReported = 0; for (DWORD num = 0 ; num < COMDB_MAX_PORTS_ARBITRATED ; num++) { if (!comDb.IsFreeNum(num)) maxPortsReported = num + 1; } if (!maxPortsReported) { err = RegDeleteValue(hKey, comDbLocalName); RegCloseKey(hKey); if (err != ERROR_SUCCESS && err != ERROR_FILE_NOT_FOUND) res = ShowError(MB_CANCELTRYCONTINUE, err, "RegDeleteValue(%s\\%s)", comDbLocalKey, comDbLocalName); continue; } DWORD bufSize = (maxPortsReported + 7)/8; BYTE *pBuf = (BYTE *)LocalAlloc(LPTR, bufSize); if (!pBuf) { RegCloseKey(hKey); res = ShowError(MB_CANCELTRYCONTINUE, ERROR_NOT_ENOUGH_MEMORY, "LocalAlloc(%lu)", (unsigned long)bufSize); continue; } for (DWORD num = 0 ; num < maxPortsReported ; num++) { if (!comDb.IsFreeNum(num)) pBuf[num/8] |= (1 << (num%8)); } err = RegSetValueEx(hKey, comDbLocalName, NULL, REG_BINARY, pBuf, bufSize); RegCloseKey(hKey); LocalFree(pBuf); if (err != ERROR_SUCCESS) { res = ShowError(MB_CANCELTRYCONTINUE, err, "RegSetValueEx(%s\\%s)", comDbLocalKey, comDbLocalName); continue; } } while (res == IDTRYAGAIN); if (res != IDCONTINUE) return FALSE; return TRUE; } /////////////////////////////////////////////////////////////// BOOL ComDbGetInUse(const char *pPortName, BOOL &inUse) { WORD num = name2num(pPortName); if (num == 0) { inUse = FALSE; // not arbitered by ComDB } else { BusyMask comDb; if (!LoadComDb(comDb)) return FALSE; inUse = !comDb.IsFreeNum(num - 1); } return TRUE; } /////////////////////////////////////////////////////////////// void ComDbSync(InfFile &infFile) { BusyMask comNames; if (!LoadComNames(infFile, comNames)) return; BusyMask comDbLocal; if (!LoadComDbLocal(comDbLocal)) return; for (DWORD num = 0 ; num < COMDB_MAX_PORTS_ARBITRATED ; num++) { if (comNames.IsFreeNum(num)) { if (!comDbLocal.IsFreeNum(num)) { if (ClaimReleasePort(num + 1, FALSE)) { Trace("ComDB: COM%u - released\n", unsigned(num + 1)); comDbLocal.DelNum(num); SaveComDbLocal(comDbLocal); } } } else { if (comDbLocal.IsFreeNum(num)) { if (ClaimReleasePort(num + 1, TRUE)) { Trace("ComDB: COM%u - logged as \"in use\"\n", unsigned(num + 1)); comDbLocal.AddNum(num); SaveComDbLocal(comDbLocal); } } } } } /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:54
|
Update of /cvsroot/com0com/hub4com/plugins/purge In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/purge Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/purge/filter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filter.cpp 18 Dec 2008 16:50:52 -0000 1.2 --- filter.cpp 22 Dec 2008 09:40:46 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.2 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 163,173 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_SET_OUT_OPTS: { // or'e with the required mask to purge pOutMsg->u.val |= ((Filter *)hFilter)->soOutMask; break; } ! case HUB_MSG_TYPE_GET_IN_OPTS: { _ASSERTE(pOutMsg->u.pv.pVal != NULL); --- 166,176 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { // or'e with the required mask to purge pOutMsg->u.val |= ((Filter *)hFilter)->soOutMask; break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { _ASSERTE(pOutMsg->u.pv.pVal != NULL); *************** *** 179,183 **** break; } ! case HUB_MSG_TYPE_FAIL_IN_OPTS: { if (GO_O2I(pOutMsg->u.pv.val) != 1) break; --- 182,186 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_IN_OPTS): { if (GO_O2I(pOutMsg->u.pv.val) != 1) break; *************** *** 194,198 **** break; } ! case HUB_MSG_TYPE_PURGE_TX: // discard if controlled by this filter if (((Filter *)hFilter)->soOutMask & SO_PURGE_TX) { --- 197,201 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_PURGE_TX): // discard if controlled by this filter if (((Filter *)hFilter)->soOutMask & SO_PURGE_TX) { *************** *** 201,205 **** } break; ! case HUB_MSG_TYPE_PURGE_TX_IN: if ((((Filter *)hFilter)->goInMask & GO1_PURGE_TX_IN) == 0) break; --- 204,208 ---- } break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_PURGE_TX_IN): if ((((Filter *)hFilter)->goInMask & GO1_PURGE_TX_IN) == 0) break; |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:54
|
Update of /cvsroot/com0com/hub4com/plugins/lsrmap In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/lsrmap Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/lsrmap/filter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filter.cpp 18 Dec 2008 16:50:52 -0000 1.5 --- filter.cpp 22 Dec 2008 09:40:45 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.5 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 169,179 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_SET_OUT_OPTS: { // or'e with the required mask to set line status pOutMsg->u.val |= SO_V2O_LINE_STATUS(((Filter *)hFilter)->lsrMask); break; } ! case HUB_MSG_TYPE_GET_IN_OPTS: { _ASSERTE(pOutMsg->u.pv.pVal != NULL); --- 172,182 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { // or'e with the required mask to set line status pOutMsg->u.val |= SO_V2O_LINE_STATUS(((Filter *)hFilter)->lsrMask); break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { _ASSERTE(pOutMsg->u.pv.pVal != NULL); *************** *** 185,189 **** break; } ! case HUB_MSG_TYPE_FAIL_IN_OPTS: { if (GO_O2I(pOutMsg->u.pv.val) != 1) break; --- 188,192 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_IN_OPTS): { if (GO_O2I(pOutMsg->u.pv.val) != 1) break; *************** *** 200,204 **** break; } ! case HUB_MSG_TYPE_LINE_STATUS: { BYTE lsr; --- 203,207 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_STATUS): { BYTE lsr; |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:54
|
Update of /cvsroot/com0com/hub4com/plugins/telnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/telnet Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/filter.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** filter.cpp 18 Dec 2008 16:50:52 -0000 1.12 --- filter.cpp 22 Dec 2008 09:40:46 -0000 1.13 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.13 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.12 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 478,483 **** _ASSERTE(*ppEchoMsg == NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_GET_IN_OPTS: { int iGo = GO_O2I(pInMsg->u.pv.val); --- 481,486 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { int iGo = GO_O2I(pInMsg->u.pv.val); *************** *** 511,515 **** break; } ! case HUB_MSG_TYPE_LINE_DATA: { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); --- 514,518 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); *************** *** 529,533 **** break; } ! case HUB_MSG_TYPE_CONNECT: { State *pState = ((Filter *)hFilter)->GetState(hFromPort); --- 532,536 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): { State *pState = ((Filter *)hFilter)->GetState(hFromPort); *************** *** 608,613 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_SET_OUT_OPTS: { DWORD soMask = (pOutMsg->u.val & ((Filter *)hFilter)->soMask); --- 611,616 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { DWORD soMask = (pOutMsg->u.val & ((Filter *)hFilter)->soMask); *************** *** 624,628 **** break; } ! case HUB_MSG_TYPE_SET_BR: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 627,631 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_BR): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 652,656 **** break; } ! case HUB_MSG_TYPE_SET_LC: { _ASSERTE((pOutMsg->u.val & ~(VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE |VAL2LC_PARITY(-1)|LC_MASK_PARITY --- 655,659 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LC): { _ASSERTE((pOutMsg->u.val & ~(VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE |VAL2LC_PARITY(-1)|LC_MASK_PARITY *************** *** 699,703 **** break; } ! case HUB_MSG_TYPE_SET_PIN_STATE: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 702,706 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 740,744 **** break; } ! case HUB_MSG_TYPE_SET_LSR: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 743,747 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LSR): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 766,770 **** break; } ! case HUB_MSG_TYPE_PURGE_TX: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 769,773 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_PURGE_TX): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 790,794 **** break; } ! case HUB_MSG_TYPE_ADD_XOFF_XON: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 793,797 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_ADD_XOFF_XON): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 804,808 **** break; } ! case HUB_MSG_TYPE_LINE_DATA: { _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); --- 807,811 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:52
|
Update of /cvsroot/com0com/hub4com/plugins/tcp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/tcp Modified Files: comport.cpp Log Message: Optimized message switching Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** comport.cpp 1 Dec 2008 17:09:34 -0000 1.12 --- comport.cpp 22 Dec 2008 09:40:46 -0000 1.13 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.13 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.12 2008/12/01 17:09:34 vfrolov * Improved write buffering *************** *** 331,335 **** _ASSERTE(pMsg != NULL); ! if (pMsg->type == HUB_MSG_TYPE_LINE_DATA) { BYTE *pBuf = pMsg->u.buf.pBuf; DWORD len = pMsg->u.buf.size; --- 334,339 ---- _ASSERTE(pMsg != NULL); ! switch (HUB_MSG_T2N(pMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { BYTE *pBuf = pMsg->u.buf.pBuf; DWORD len = pMsg->u.buf.size; *************** *** 387,393 **** //cout << "Started Write " << name << " " << len << " " << writeQueued << endl; } ! else ! if (pMsg->type == HUB_MSG_TYPE_CONNECT) { if (pMsg->u.val) { connectionCounter++; --- 391,397 ---- //cout << "Started Write " << name << " " << len << " " << writeQueued << endl; + break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): { if (pMsg->u.val) { connectionCounter++; *************** *** 409,415 **** PortTcp::Disconnect(hSock); } } ! else ! if (pMsg->type == HUB_MSG_TYPE_SET_OUT_OPTS) { if (pMsg->u.val) { cerr << name << " WARNING: Requested output option(s) [0x" --- 413,419 ---- PortTcp::Disconnect(hSock); } + break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): if (pMsg->u.val) { cerr << name << " WARNING: Requested output option(s) [0x" *************** *** 417,423 **** << "] will be ignored by driver" << endl; } ! } ! else ! if (pMsg->type == HUB_MSG_TYPE_ADD_XOFF_XON) { if (pMsg->u.val) { countXoff++; --- 421,426 ---- << "] will be ignored by driver" << endl; } ! break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_ADD_XOFF_XON): if (pMsg->u.val) { countXoff++; *************** *** 426,429 **** --- 429,433 ---- StartRead(); } + break; } |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:52
|
Update of /cvsroot/com0com/hub4com/plugins/connector In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/connector Modified Files: comport.cpp Log Message: Optimized message switching Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/connector/comport.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** comport.cpp 27 Nov 2008 16:38:05 -0000 1.1 --- comport.cpp 22 Dec 2008 09:40:45 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.1 2008/11/27 16:38:05 vfrolov * Initial revision *************** *** 52,57 **** _ASSERTE(pInMsg != NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_LOOP_TEST: pInMsg->u.hVal = (HANDLE)hMasterPort; break; --- 55,60 ---- _ASSERTE(pInMsg != NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LOOP_TEST): pInMsg->u.hVal = (HANDLE)hMasterPort; break; *************** *** 65,70 **** _ASSERTE(pMsg != NULL); ! switch (pMsg->type) { ! case HUB_MSG_TYPE_LOOP_TEST: for (Ports::const_iterator i = connectedDataPorts.begin() ; i != connectedDataPorts.end() ; i++) { if (pMsg->u.hVal == (HANDLE)(*i)->hMasterPort) { --- 68,73 ---- _ASSERTE(pMsg != NULL); ! switch (HUB_MSG_T2N(pMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LOOP_TEST): for (Ports::const_iterator i = connectedDataPorts.begin() ; i != connectedDataPorts.end() ; i++) { if (pMsg->u.hVal == (HANDLE)(*i)->hMasterPort) { *************** *** 75,79 **** break; ! case HUB_MSG_TYPE_LINE_DATA: if (!pMsg->u.buf.size) break; --- 78,82 ---- break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): if (!pMsg->u.buf.size) break; *************** *** 97,101 **** break; ! case HUB_MSG_TYPE_CONNECT: if (pMsg->u.val) { if (countConnections++ != 0) --- 100,104 ---- break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): if (pMsg->u.val) { if (countConnections++ != 0) *************** *** 116,120 **** break; ! case HUB_MSG_TYPE_SET_OUT_OPTS: if (pMsg->u.val) { cerr << name << " WARNING: Requested output option(s) [0x" --- 119,123 ---- break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): if (pMsg->u.val) { cerr << name << " WARNING: Requested output option(s) [0x" *************** *** 123,127 **** } break; ! case HUB_MSG_TYPE_ADD_XOFF_XON: if (pMsg->u.val) { if (countXoff++ != 0) --- 126,130 ---- } break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_ADD_XOFF_XON): if (pMsg->u.val) { if (countXoff++ != 0) |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:52
|
Update of /cvsroot/com0com/hub4com/plugins/crypt In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/crypt Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/crypt/filter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filter.cpp 19 Dec 2008 18:27:47 -0000 1.2 --- filter.cpp 22 Dec 2008 09:40:45 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.2 2008/12/19 18:27:47 vfrolov * Fixed Release compile error *************** *** 283,288 **** _ASSERTE(*ppEchoMsg == NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_LINE_DATA: { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); --- 286,291 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); *************** *** 307,311 **** break; } ! case HUB_MSG_TYPE_CONNECT: { State *pState = ((Filter *)hFilter)->GetState(hFromPort); --- 310,314 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): { State *pState = ((Filter *)hFilter)->GetState(hFromPort); *************** *** 336,341 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_LINE_DATA: { _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); --- 339,344 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:51
|
Update of /cvsroot/com0com/hub4com/plugins/pinmap In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/pinmap Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pinmap/filter.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** filter.cpp 18 Dec 2008 16:50:52 -0000 1.14 --- filter.cpp 22 Dec 2008 09:40:46 -0000 1.15 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.15 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.14 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 419,424 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_SET_OUT_OPTS: { // or'e with the required mask to set pin state pOutMsg->u.val |= SO_V2O_PIN_STATE(((Filter *)hFilter)->outMask); --- 422,427 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { // or'e with the required mask to set pin state pOutMsg->u.val |= SO_V2O_PIN_STATE(((Filter *)hFilter)->outMask); *************** *** 434,438 **** break; } ! case HUB_MSG_TYPE_GET_IN_OPTS: { _ASSERTE(pOutMsg->u.pv.pVal != NULL); --- 437,441 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { _ASSERTE(pOutMsg->u.pv.pVal != NULL); *************** *** 444,448 **** break; } ! case HUB_MSG_TYPE_FAIL_IN_OPTS: { if (GO_O2I(pOutMsg->u.pv.val) != 1) break; --- 447,451 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_IN_OPTS): { if (GO_O2I(pOutMsg->u.pv.val) != 1) break; *************** *** 459,467 **** break; } ! case HUB_MSG_TYPE_SET_PIN_STATE: // discard any pin settings controlled by this filter pOutMsg->u.val &= ~(VAL2MASK(((Filter *)hFilter)->outMask)); break; ! case HUB_MSG_TYPE_MODEM_STATUS: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 462,470 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): // discard any pin settings controlled by this filter pOutMsg->u.val &= ~(VAL2MASK(((Filter *)hFilter)->outMask)); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_MODEM_STATUS): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 477,481 **** break; } ! case HUB_MSG_TYPE_BREAK_STATUS: { if (((Filter *)hFilter)->lmInMask & LM_BREAK) { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 480,484 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_BREAK_STATUS): { if (((Filter *)hFilter)->lmInMask & LM_BREAK) { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 492,496 **** break; } ! case HUB_MSG_TYPE_CONNECT: { if (((Filter *)hFilter)->lmInMask & LM_CONNECT) { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 495,499 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): { if (((Filter *)hFilter)->lmInMask & LM_CONNECT) { State *pState = ((Filter *)hFilter)->GetState(hToPort); |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:51
|
Update of /cvsroot/com0com/hub4com/plugins/trace In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/trace Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/trace/filter.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** filter.cpp 18 Dec 2008 16:50:52 -0000 1.14 --- filter.cpp 22 Dec 2008 09:40:46 -0000 1.15 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.15 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.14 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 686,701 **** tout << " {"; ! switch (pMsg->type) { ! case HUB_MSG_TYPE_MODEM_STATUS: PrintMaskedFields(tout, fieldNameTableModemStatus, pMsg->u.val); break; ! case HUB_MSG_TYPE_LINE_STATUS: ! case HUB_MSG_TYPE_SET_LSR: PrintMaskedFields(tout, fieldNameTableLineStatus, pMsg->u.val); break; ! case HUB_MSG_TYPE_SET_PIN_STATE: PrintMaskedFields(tout, codeNameTableSetPinState, pMsg->u.val); break; ! case HUB_MSG_TYPE_SET_OUT_OPTS: { tout << "["; BOOL delimitNext = FALSE; --- 689,704 ---- tout << " {"; ! switch (HUB_MSG_T2N(pMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_MODEM_STATUS): PrintMaskedFields(tout, fieldNameTableModemStatus, pMsg->u.val); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_STATUS): ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LSR): PrintMaskedFields(tout, fieldNameTableLineStatus, pMsg->u.val); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): PrintMaskedFields(tout, codeNameTableSetPinState, pMsg->u.val); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { tout << "["; BOOL delimitNext = FALSE; *************** *** 705,709 **** break; } ! case HUB_MSG_TYPE_GET_IN_OPTS: { tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; PrintGoOptions(tout, (*pMsg->u.pv.pVal & ~(GO_I2O(-1))) | (pMsg->u.pv.val & GO_I2O(-1))); --- 708,712 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; PrintGoOptions(tout, (*pMsg->u.pv.pVal & ~(GO_I2O(-1))) | (pMsg->u.pv.val & GO_I2O(-1))); *************** *** 713,717 **** break; } ! case HUB_MSG_TYPE_FAIL_IN_OPTS: { tout << "["; PrintGoOptions(tout, pMsg->u.val); --- 716,720 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_IN_OPTS): { tout << "["; PrintGoOptions(tout, pMsg->u.val); *************** *** 719,723 **** break; } ! case HUB_MSG_TYPE_GET_ESC_OPTS: { tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; tout << "CHAR_0x" << hex << (unsigned)ESC_OPTS_O2V_ESCCHAR(*pMsg->u.pv.pVal) << dec; --- 722,726 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_ESC_OPTS): { tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; tout << "CHAR_0x" << hex << (unsigned)ESC_OPTS_O2V_ESCCHAR(*pMsg->u.pv.pVal) << dec; *************** *** 726,730 **** break; } ! case HUB_MSG_TYPE_FAIL_ESC_OPTS: { tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; PrintGoOptions(tout, (*pMsg->u.pv.pVal & ~(GO_I2O(-1))) | GO_I2O(1)); --- 729,733 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_ESC_OPTS): { tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; PrintGoOptions(tout, (*pMsg->u.pv.pVal & ~(GO_I2O(-1))) | GO_I2O(1)); |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/escinsert In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/escinsert Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/escinsert/filter.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** filter.cpp 25 Nov 2008 16:40:40 -0000 1.7 --- filter.cpp 22 Dec 2008 09:40:45 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.7 2008/11/25 16:40:40 vfrolov * Added assert for port handle *************** *** 279,284 **** _ASSERTE(*ppEchoMsg == NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_CONNECT: { State *pState = ((Filter *)hFilter)->GetState(hFromPort); --- 282,287 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): { State *pState = ((Filter *)hFilter)->GetState(hFromPort); *************** *** 332,337 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_SET_OUT_OPTS: { DWORD soMask = (pOutMsg->u.val & ((Filter *)hFilter)->soMask); --- 335,340 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { DWORD soMask = (pOutMsg->u.val & ((Filter *)hFilter)->soMask); *************** *** 348,352 **** break; } ! case HUB_MSG_TYPE_SET_BR: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 351,355 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_BR): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 373,377 **** break; } ! case HUB_MSG_TYPE_SET_LC: { _ASSERTE((pOutMsg->u.val & ~(VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE |VAL2LC_PARITY(-1)|LC_MASK_PARITY --- 376,380 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LC): { _ASSERTE((pOutMsg->u.val & ~(VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE |VAL2LC_PARITY(-1)|LC_MASK_PARITY *************** *** 417,421 **** break; } ! case HUB_MSG_TYPE_SET_PIN_STATE: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 420,424 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 456,460 **** break; } ! case HUB_MSG_TYPE_SET_LSR: { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 459,463 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LSR): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 479,483 **** break; } ! case HUB_MSG_TYPE_LINE_DATA: { // escape escape characters --- 482,486 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { // escape escape characters |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/pin2con In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/pin2con Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pin2con/filter.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** filter.cpp 18 Dec 2008 16:50:52 -0000 1.14 --- filter.cpp 22 Dec 2008 09:40:46 -0000 1.15 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.15 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.14 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 298,303 **** _ASSERTE(*ppEchoMsg == NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_GET_IN_OPTS: _ASSERTE(pInMsg->u.pv.pVal != NULL); --- 301,306 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): _ASSERTE(pInMsg->u.pv.pVal != NULL); *************** *** 308,312 **** *pInMsg->u.pv.pVal |= (((Filter *)hFilter)->pin & pInMsg->u.pv.val); break; ! case HUB_MSG_TYPE_FAIL_IN_OPTS: { if (GO_O2I(pInMsg->u.pv.val) != 1) break; --- 311,315 ---- *pInMsg->u.pv.pVal |= (((Filter *)hFilter)->pin & pInMsg->u.pv.val); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_IN_OPTS): { if (GO_O2I(pInMsg->u.pv.val) != 1) break; *************** *** 322,331 **** break; } ! case HUB_MSG_TYPE_CONNECT: // discard any CONNECT messages from the input stream if (!pMsgReplaceNone(pInMsg, HUB_MSG_TYPE_EMPTY)) return FALSE; break; ! case HUB_MSG_TYPE_MODEM_STATUS: { WORD pin; --- 325,334 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): // discard any CONNECT messages from the input stream if (!pMsgReplaceNone(pInMsg, HUB_MSG_TYPE_EMPTY)) return FALSE; break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_MODEM_STATUS): { WORD pin; *************** *** 339,343 **** break; } ! case HUB_MSG_TYPE_BREAK_STATUS: if (((Filter *)hFilter)->pin & GO1_BREAK_STATUS) pInMsg = InsertConnectState(*((Filter *)hFilter), hFromPort, pInMsg, pInMsg->u.val != 0); --- 342,346 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_BREAK_STATUS): if (((Filter *)hFilter)->pin & GO1_BREAK_STATUS) pInMsg = InsertConnectState(*((Filter *)hFilter), hFromPort, pInMsg, pInMsg->u.val != 0); |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/tag In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/tag Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tag/filter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filter.cpp 19 Dec 2008 18:28:56 -0000 1.2 --- filter.cpp 22 Dec 2008 09:40:46 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.2 2008/12/19 18:28:56 vfrolov * Fixed Release compile warning *************** *** 229,234 **** _ASSERTE(*ppEchoMsg == NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_LINE_DATA: { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); --- 232,237 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); *************** *** 267,272 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_LINE_DATA: { _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); --- 270,275 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/escparse In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/escparse Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/escparse/filter.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** filter.cpp 18 Dec 2008 16:50:51 -0000 1.9 --- filter.cpp 22 Dec 2008 09:40:45 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.9 2008/12/18 16:50:51 vfrolov * Extended the number of possible IN options *************** *** 486,492 **** _ASSERTE(*ppEchoMsg == NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_COUNT_REPEATS: ! if (pInMsg->u.pv.val == HUB_MSG_TYPE_GET_IN_OPTS) { // we need it twice to // - get interceptable options from subsequent filters --- 489,495 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_COUNT_REPEATS): ! if (HUB_MSG_T2N(pInMsg->u.pv.val) == HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS)) { // we need it twice to // - get interceptable options from subsequent filters *************** *** 496,500 **** } break; ! case HUB_MSG_TYPE_GET_IN_OPTS: { int iGo = GO_O2I(pInMsg->u.pv.val); --- 499,503 ---- } break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { int iGo = GO_O2I(pInMsg->u.pv.val); *************** *** 549,553 **** break; } ! case HUB_MSG_TYPE_GET_ESC_OPTS: { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); --- 552,556 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_ESC_OPTS): { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); *************** *** 564,568 **** break; } ! case HUB_MSG_TYPE_FAIL_ESC_OPTS: { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); --- 567,571 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_ESC_OPTS): { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); *************** *** 588,592 **** break; } ! case HUB_MSG_TYPE_FAIL_IN_OPTS: { if (GO_O2I(pInMsg->u.pv.val) != 0) break; --- 591,595 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_IN_OPTS): { if (GO_O2I(pInMsg->u.pv.val) != 0) break; *************** *** 610,614 **** break; } ! case HUB_MSG_TYPE_LINE_DATA: { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); --- 613,617 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); *************** *** 625,629 **** break; } ! case HUB_MSG_TYPE_MODEM_STATUS: { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); --- 628,632 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_MODEM_STATUS): { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); *************** *** 635,639 **** break; } ! case HUB_MSG_TYPE_LINE_STATUS: { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); --- 638,642 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_STATUS): { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); *************** *** 645,649 **** break; } ! case HUB_MSG_TYPE_RBR_STATUS: { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); --- 648,652 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_RBR_STATUS): { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); *************** *** 658,662 **** break; } ! case HUB_MSG_TYPE_RLC_STATUS: { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); --- 661,665 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_RLC_STATUS): { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); *************** *** 671,675 **** break; } ! case HUB_MSG_TYPE_BREAK_STATUS: { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); --- 674,678 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_BREAK_STATUS): { EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/serial In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/serial Modified Files: comport.cpp Log Message: Optimized message switching Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** comport.cpp 18 Dec 2008 16:50:52 -0000 1.23 --- comport.cpp 22 Dec 2008 09:40:46 -0000 1.24 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.24 2008/12/22 09:40:46 vfrolov + * Optimized message switching + * * Revision 1.23 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 518,523 **** _ASSERTE(pInMsg != NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_GET_IN_OPTS: { int iGo = GO_O2I(pInMsg->u.pv.val); --- 521,526 ---- _ASSERTE(pInMsg != NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { int iGo = GO_O2I(pInMsg->u.pv.val); *************** *** 606,611 **** _ASSERTE(pMsg != NULL); ! switch (pMsg->type) { ! case HUB_MSG_TYPE_LINE_DATA: { BYTE *pBuf = pMsg->u.buf.pBuf; DWORD len = pMsg->u.buf.size; --- 609,614 ---- _ASSERTE(pMsg != NULL); ! switch (HUB_MSG_T2N(pMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { BYTE *pBuf = pMsg->u.buf.pBuf; DWORD len = pMsg->u.buf.size; *************** *** 678,682 **** break; } ! case HUB_MSG_TYPE_SET_PIN_STATE: _ASSERTE((~SO_O2V_PIN_STATE(outOptions) & MASK2VAL(pMsg->u.val)) == 0); --- 681,685 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): _ASSERTE((~SO_O2V_PIN_STATE(outOptions) & MASK2VAL(pMsg->u.val)) == 0); *************** *** 686,690 **** pComIo->SetPinState((WORD)pMsg->u.val, MASK2VAL(pMsg->u.val)); break; ! case HUB_MSG_TYPE_SET_BR: { _ASSERTE(outOptions & SO_SET_BR); --- 689,693 ---- pComIo->SetPinState((WORD)pMsg->u.val, MASK2VAL(pMsg->u.val)); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_BR): { _ASSERTE(outOptions & SO_SET_BR); *************** *** 722,726 **** break; } ! case HUB_MSG_TYPE_SET_LC: { _ASSERTE(outOptions & SO_SET_LC); --- 725,729 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LC): { _ASSERTE(outOptions & SO_SET_LC); *************** *** 782,786 **** break; } ! case HUB_MSG_TYPE_PURGE_TX: _ASSERTE(outOptions & SO_PURGE_TX); --- 785,789 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_PURGE_TX): _ASSERTE(outOptions & SO_PURGE_TX); *************** *** 791,795 **** FlowControlUpdate(); break; ! case HUB_MSG_TYPE_SET_OUT_OPTS: { if (!pComIo) return FALSE; --- 794,798 ---- FlowControlUpdate(); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { if (!pComIo) return FALSE; *************** *** 839,843 **** break; } ! case HUB_MSG_TYPE_ADD_XOFF_XON: if (pMsg->u.val) { countXoff++; --- 842,846 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_ADD_XOFF_XON): if (pMsg->u.val) { countXoff++; |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/echo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/echo Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/echo/filter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filter.cpp 25 Nov 2008 16:40:40 -0000 1.5 --- filter.cpp 22 Dec 2008 09:40:45 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.5 2008/11/25 16:40:40 vfrolov * Added assert for port handle *************** *** 116,120 **** _ASSERTE(*ppEchoMsg == NULL); ! if (pInMsg->type == HUB_MSG_TYPE_LINE_DATA) { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); --- 119,124 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); *************** *** 129,132 **** --- 133,138 ---- if (!*ppEchoMsg) return FALSE; + + break; } |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/awakseq In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/awakseq Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/awakseq/filter.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** filter.cpp 25 Nov 2008 16:40:40 -0000 1.10 --- filter.cpp 22 Dec 2008 09:40:45 -0000 1.11 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.11 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.10 2008/11/25 16:40:40 vfrolov * Added assert for port handle *************** *** 222,226 **** _ASSERTE(*ppEchoMsg == NULL); ! if (pInMsg->type == HUB_MSG_TYPE_LINE_DATA) { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); --- 225,230 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (HUB_MSG_T2N(pInMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); *************** *** 281,287 **** pState->pAwakSeqNext = pAwakSeqNext; } } ! else ! if (pInMsg->type == HUB_MSG_TYPE_CONNECT) { if (pInMsg->u.val) { // discard CONNECT(TRUE) from the input stream --- 285,291 ---- pState->pAwakSeqNext = pAwakSeqNext; } + break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): if (pInMsg->u.val) { // discard CONNECT(TRUE) from the input stream *************** *** 306,309 **** --- 310,314 ---- pState->StartAwakSeq(((Filter *)hFilter)->pAwakSeq); } + break; } *************** *** 322,327 **** _ASSERTE(pOutMsg != NULL); ! ! if (pOutMsg->type == HUB_MSG_TYPE_CONNECT) { State *pState = ((Filter *)hFilter)->GetState(hToPort); --- 327,332 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): { State *pState = ((Filter *)hFilter)->GetState(hToPort); *************** *** 339,342 **** --- 344,349 ---- pState->StartAwakSeq(((Filter *)hFilter)->pAwakSeq); } + break; + } } |
From: Vyacheslav F. <vf...@us...> - 2008-12-22 09:40:50
|
Update of /cvsroot/com0com/hub4com/plugins/linectl In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4027/plugins/linectl Modified Files: filter.cpp Log Message: Optimized message switching Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/linectl/filter.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** filter.cpp 18 Dec 2008 16:50:51 -0000 1.9 --- filter.cpp 22 Dec 2008 09:40:45 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/12/22 09:40:45 vfrolov + * Optimized message switching + * * Revision 1.9 2008/12/18 16:50:51 vfrolov * Extended the number of possible IN options *************** *** 244,254 **** _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_SET_OUT_OPTS: { // or'e with the required mask to set pOutMsg->u.val |= ((Filter *)hFilter)->soOutMask; break; } ! case HUB_MSG_TYPE_GET_IN_OPTS: { _ASSERTE(pOutMsg->u.pv.pVal != NULL); --- 247,257 ---- _ASSERTE(pOutMsg != NULL); ! switch (HUB_MSG_T2N(pOutMsg->type)) { ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { // or'e with the required mask to set pOutMsg->u.val |= ((Filter *)hFilter)->soOutMask; break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { _ASSERTE(pOutMsg->u.pv.pVal != NULL); *************** *** 262,266 **** break; } ! case HUB_MSG_TYPE_FAIL_IN_OPTS: { int iGo = GO_O2I(pOutMsg->u.pv.val); --- 265,269 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_FAIL_IN_OPTS): { int iGo = GO_O2I(pOutMsg->u.pv.val); *************** *** 279,283 **** break; } ! case HUB_MSG_TYPE_SET_BR: // discard if controlled by this filter if (((Filter *)hFilter)->soOutMask & SO_SET_BR) { --- 282,286 ---- break; } ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_BR): // discard if controlled by this filter if (((Filter *)hFilter)->soOutMask & SO_SET_BR) { *************** *** 286,290 **** } break; ! case HUB_MSG_TYPE_SET_LC: // discard if controlled by this filter if (((Filter *)hFilter)->soOutMask & SO_SET_LC) { --- 289,293 ---- } break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LC): // discard if controlled by this filter if (((Filter *)hFilter)->soOutMask & SO_SET_LC) { *************** *** 293,297 **** } break; ! case HUB_MSG_TYPE_LBR_STATUS: if ((((Filter *)hFilter)->goInMask[0] & GO0_LBR_STATUS) == 0) break; --- 296,300 ---- } break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_LBR_STATUS): if ((((Filter *)hFilter)->goInMask[0] & GO0_LBR_STATUS) == 0) break; *************** *** 302,306 **** pOutMsg = pMsgInsertVal(pOutMsg, HUB_MSG_TYPE_SET_BR, pOutMsg->u.val); break; ! case HUB_MSG_TYPE_RBR_STATUS: if ((((Filter *)hFilter)->goInMask[1] & GO1_RBR_STATUS) == 0) break; --- 305,309 ---- pOutMsg = pMsgInsertVal(pOutMsg, HUB_MSG_TYPE_SET_BR, pOutMsg->u.val); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_RBR_STATUS): if ((((Filter *)hFilter)->goInMask[1] & GO1_RBR_STATUS) == 0) break; *************** *** 311,315 **** pOutMsg = pMsgInsertVal(pOutMsg, HUB_MSG_TYPE_SET_BR, pOutMsg->u.val); break; ! case HUB_MSG_TYPE_LLC_STATUS: if ((((Filter *)hFilter)->goInMask[0] & GO0_LLC_STATUS) == 0) break; --- 314,318 ---- pOutMsg = pMsgInsertVal(pOutMsg, HUB_MSG_TYPE_SET_BR, pOutMsg->u.val); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_LLC_STATUS): if ((((Filter *)hFilter)->goInMask[0] & GO0_LLC_STATUS) == 0) break; *************** *** 320,324 **** pOutMsg = pMsgInsertVal(pOutMsg, HUB_MSG_TYPE_SET_LC, pOutMsg->u.val); break; ! case HUB_MSG_TYPE_RLC_STATUS: if ((((Filter *)hFilter)->goInMask[1] & GO1_RLC_STATUS) == 0) break; --- 323,327 ---- pOutMsg = pMsgInsertVal(pOutMsg, HUB_MSG_TYPE_SET_LC, pOutMsg->u.val); break; ! case HUB_MSG_T2N(HUB_MSG_TYPE_RLC_STATUS): if ((((Filter *)hFilter)->goInMask[1] & GO1_RLC_STATUS) == 0) break; |
From: Vyacheslav F. <vf...@us...> - 2008-12-19 18:29:02
|
Update of /cvsroot/com0com/hub4com/plugins/tag In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22067 Modified Files: filter.cpp Log Message: Fixed Release compile warning Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tag/filter.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filter.cpp 27 Nov 2008 16:38:05 -0000 1.1 --- filter.cpp 19 Dec 2008 18:28:56 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/12/19 18:28:56 vfrolov + * Fixed Release compile warning + * * Revision 1.1 2008/11/27 16:38:05 vfrolov * Initial revision *************** *** 216,220 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) --- 219,223 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT DEBUG_PARAM(hFromPort), HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) *************** *** 256,260 **** HFILTER hFilter, HMASTERPORT DEBUG_PARAM(hFromPort), ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { --- 259,263 ---- HFILTER hFilter, HMASTERPORT DEBUG_PARAM(hFromPort), ! HMASTERPORT DEBUG_PARAM(hToPort), HUB_MSG *pOutMsg) { |
From: Vyacheslav F. <vf...@us...> - 2008-12-19 18:27:52
|
Update of /cvsroot/com0com/hub4com/plugins/crypt In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21911 Modified Files: filter.cpp Log Message: Fixed Release compile error Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/crypt/filter.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filter.cpp 5 Dec 2008 14:27:02 -0000 1.1 --- filter.cpp 19 Dec 2008 18:27:47 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/12/19 18:27:47 vfrolov + * Fixed Release compile error + * * Revision 1.1 2008/12/05 14:27:02 vfrolov * Initial revision *************** *** 270,274 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT DEBUG_PARAM(hFromPort), HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) --- 273,277 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) *************** *** 325,329 **** HFILTER hFilter, HMASTERPORT DEBUG_PARAM(hFromPort), ! HMASTERPORT DEBUG_PARAM(hToPort), HUB_MSG *pOutMsg) { --- 328,332 ---- HFILTER hFilter, HMASTERPORT DEBUG_PARAM(hFromPort), ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { |
From: Vyacheslav F. <vf...@us...> - 2008-12-19 18:23:18
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21620 Modified Files: export.cpp Log Message: Changed message type to 32 bit Index: export.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/export.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** export.cpp 27 Nov 2008 16:19:16 -0000 1.8 --- export.cpp 19 Dec 2008 18:23:05 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/12/19 18:23:05 vfrolov + * Changed message type to 32 bit + * * Revision 1.8 2008/11/27 16:19:16 vfrolov * Added pBufAppend() *************** *** 72,76 **** } /////////////////////////////////////////////////////////////// ! static BOOL CALLBACK msg_replace_buf(HUB_MSG *pMsg, WORD type, const BYTE *pSrc, DWORD sizeSrc) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF); --- 75,79 ---- } /////////////////////////////////////////////////////////////// ! static BOOL CALLBACK msg_replace_buf(HUB_MSG *pMsg, DWORD type, const BYTE *pSrc, DWORD sizeSrc) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF); *************** *** 95,99 **** } /////////////////////////////////////////////////////////////// ! static HUB_MSG *CALLBACK msg_insert_buf(HUB_MSG *pPrevMsg, WORD type, const BYTE *pSrc, DWORD sizeSrc) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF); --- 98,102 ---- } /////////////////////////////////////////////////////////////// ! static HUB_MSG *CALLBACK msg_insert_buf(HUB_MSG *pPrevMsg, DWORD type, const BYTE *pSrc, DWORD sizeSrc) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF); *************** *** 130,134 **** } /////////////////////////////////////////////////////////////// ! static BOOL CALLBACK msg_replace_val(HUB_MSG *pMsg, WORD type, DWORD val) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_VAL); --- 133,137 ---- } /////////////////////////////////////////////////////////////// ! static BOOL CALLBACK msg_replace_val(HUB_MSG *pMsg, DWORD type, DWORD val) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_VAL); *************** *** 145,149 **** } /////////////////////////////////////////////////////////////// ! static HUB_MSG *CALLBACK msg_insert_val(HUB_MSG *pPrevMsg, WORD type, DWORD val) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_VAL); --- 148,152 ---- } /////////////////////////////////////////////////////////////// ! static HUB_MSG *CALLBACK msg_insert_val(HUB_MSG *pPrevMsg, DWORD type, DWORD val) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_VAL); *************** *** 165,169 **** } /////////////////////////////////////////////////////////////// ! static BOOL CALLBACK msg_replace_none(HUB_MSG *pMsg, WORD type) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_NONE); --- 168,172 ---- } /////////////////////////////////////////////////////////////// ! static BOOL CALLBACK msg_replace_none(HUB_MSG *pMsg, DWORD type) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_NONE); *************** *** 179,183 **** } /////////////////////////////////////////////////////////////// ! static HUB_MSG *CALLBACK msg_insert_none(HUB_MSG *pPrevMsg, WORD type) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_NONE); --- 182,186 ---- } /////////////////////////////////////////////////////////////// ! static HUB_MSG *CALLBACK msg_insert_none(HUB_MSG *pPrevMsg, DWORD type) { _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_NONE); |
From: Vyacheslav F. <vf...@us...> - 2008-12-19 18:23:13
|
Update of /cvsroot/com0com/hub4com/plugins In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21620/plugins Modified Files: plugins_api.h Log Message: Changed message type to 32 bit Index: plugins_api.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/plugins_api.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** plugins_api.h 18 Dec 2008 16:50:51 -0000 1.22 --- plugins_api.h 19 Dec 2008 18:23:05 -0000 1.23 *************** *** 28,46 **** /*******************************************************************/ ! #define HUB_MSG_UNION_TYPES_MASK 0xF000 ! #define HUB_MSG_UNION_TYPE_NONE 0x0000 ! #define HUB_MSG_UNION_TYPE_BUF 0x1000 ! #define HUB_MSG_UNION_TYPE_VAL 0x2000 ! #define HUB_MSG_UNION_TYPE_PVAL 0x3000 ! #define HUB_MSG_UNION_TYPE_HVAL 0x4000 /*******************************************************************/ ! #define HUB_MSG_VAL_TYPES_MASK 0x0F00 ! #define HUB_MSG_VAL_TYPE_MASK_VAL 0x0100 #define VAL2MASK(v) ((DWORD)(WORD)(v) << 16) #define MASK2VAL(m) ((WORD)((m) >> 16)) ! #define HUB_MSG_VAL_TYPE_BOOL 0x0200 ! #define HUB_MSG_VAL_TYPE_MSG_TYPE 0x0300 ! #define HUB_MSG_VAL_TYPE_UINT 0x0400 ! #define HUB_MSG_VAL_TYPE_LC 0x0500 #define LC_MASK_BYTESIZE ((DWORD)1 << 24) #define LC_MASK_PARITY ((DWORD)1 << 25) --- 28,46 ---- /*******************************************************************/ ! #define HUB_MSG_UNION_TYPES_MASK ((DWORD)0xFF000000) ! #define HUB_MSG_UNION_TYPE_NONE ((DWORD)0x00000000) ! #define HUB_MSG_UNION_TYPE_BUF ((DWORD)0x01000000) ! #define HUB_MSG_UNION_TYPE_VAL ((DWORD)0x02000000) ! #define HUB_MSG_UNION_TYPE_PVAL ((DWORD)0x03000000) ! #define HUB_MSG_UNION_TYPE_HVAL ((DWORD)0x04000000) /*******************************************************************/ ! #define HUB_MSG_VAL_TYPES_MASK ((DWORD)0x00FF0000) ! #define HUB_MSG_VAL_TYPE_MASK_VAL ((DWORD)0x00010000) #define VAL2MASK(v) ((DWORD)(WORD)(v) << 16) #define MASK2VAL(m) ((WORD)((m) >> 16)) ! #define HUB_MSG_VAL_TYPE_BOOL ((DWORD)0x00020000) ! #define HUB_MSG_VAL_TYPE_MSG_TYPE ((DWORD)0x00030000) ! #define HUB_MSG_VAL_TYPE_UINT ((DWORD)0x00040000) ! #define HUB_MSG_VAL_TYPE_LC ((DWORD)0x00050000) #define LC_MASK_BYTESIZE ((DWORD)1 << 24) #define LC_MASK_PARITY ((DWORD)1 << 25) *************** *** 53,57 **** #define VAL2LC_STOPBITS(v) ((DWORD)(BYTE)(v) << 16) /*******************************************************************/ ! #define HUB_MSG_ROUTE_FLOW_CONTROL 0x0080 /*******************************************************************/ #define HUB_MSG_TYPE_EMPTY (0 | HUB_MSG_UNION_TYPE_NONE) --- 53,59 ---- #define VAL2LC_STOPBITS(v) ((DWORD)(BYTE)(v) << 16) /*******************************************************************/ ! #define HUB_MSG_ROUTE_FLOW_CONTROL ((DWORD)0x00008000) ! /*******************************************************************/ ! #define HUB_MSG_T2N(t) ((BYTE)((t) & 0xFF)) /*******************************************************************/ #define HUB_MSG_TYPE_EMPTY (0 | HUB_MSG_UNION_TYPE_NONE) *************** *** 134,138 **** /*******************************************************************/ typedef struct _HUB_MSG { ! WORD type; union { struct { --- 136,140 ---- /*******************************************************************/ typedef struct _HUB_MSG { ! DWORD type; union { struct { *************** *** 163,188 **** typedef BOOL (CALLBACK ROUTINE_MSG_REPLACE_BUF)( HUB_MSG *pMsg, ! WORD type, const BYTE *pSrc, DWORD sizeSrc); typedef HUB_MSG *(CALLBACK ROUTINE_MSG_INSERT_BUF)( HUB_MSG *pPrevMsg, ! WORD type, const BYTE *pSrc, DWORD sizeSrc); typedef BOOL (CALLBACK ROUTINE_MSG_REPLACE_VAL)( HUB_MSG *pMsg, ! WORD type, DWORD val); typedef HUB_MSG *(CALLBACK ROUTINE_MSG_INSERT_VAL)( HUB_MSG *pMsg, ! WORD type, DWORD val); typedef BOOL (CALLBACK ROUTINE_MSG_REPLACE_NONE)( HUB_MSG *pMsg, ! WORD type); typedef HUB_MSG *(CALLBACK ROUTINE_MSG_INSERT_NONE)( HUB_MSG *pMsg, ! WORD type); typedef const char *(CALLBACK ROUTINE_PORT_NAME_A)( HMASTERPORT hMasterPort); --- 165,190 ---- typedef BOOL (CALLBACK ROUTINE_MSG_REPLACE_BUF)( HUB_MSG *pMsg, ! DWORD type, const BYTE *pSrc, DWORD sizeSrc); typedef HUB_MSG *(CALLBACK ROUTINE_MSG_INSERT_BUF)( HUB_MSG *pPrevMsg, ! DWORD type, const BYTE *pSrc, DWORD sizeSrc); typedef BOOL (CALLBACK ROUTINE_MSG_REPLACE_VAL)( HUB_MSG *pMsg, ! DWORD type, DWORD val); typedef HUB_MSG *(CALLBACK ROUTINE_MSG_INSERT_VAL)( HUB_MSG *pMsg, ! DWORD type, DWORD val); typedef BOOL (CALLBACK ROUTINE_MSG_REPLACE_NONE)( HUB_MSG *pMsg, ! DWORD type); typedef HUB_MSG *(CALLBACK ROUTINE_MSG_INSERT_NONE)( HUB_MSG *pMsg, ! DWORD type); typedef const char *(CALLBACK ROUTINE_PORT_NAME_A)( HMASTERPORT hMasterPort); |
From: Vyacheslav F. <vf...@us...> - 2008-12-18 16:51:06
|
Update of /cvsroot/com0com/hub4com/plugins/pinmap In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5084/plugins/pinmap Modified Files: filter.cpp Log Message: Extended the number of possible IN options Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pinmap/filter.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** filter.cpp 25 Nov 2008 16:40:40 -0000 1.13 --- filter.cpp 18 Dec 2008 16:50:52 -0000 1.14 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.14 2008/12/18 16:50:52 vfrolov + * Extended the number of possible IN options + * * Revision 1.13 2008/11/25 16:40:40 vfrolov * Added assert for port handle *************** *** 107,115 **** }; /////////////////////////////////////////////////////////////// ! #define LM_BREAK ((WORD)1 << 8) ! #define LM_CONNECT ((WORD)1 << 9) ! #define MST2LM(m) ((WORD)((BYTE)(m))) ! #define LM2MST(lm) ((BYTE)(lm)) ! #define LM2GO(lm) (GO_V2O_MODEM_STATUS(LM2MST(lm)) | ((lm & LM_BREAK) ? GO_BREAK_STATUS : 0)) static struct { --- 110,118 ---- }; /////////////////////////////////////////////////////////////// ! #define LM_BREAK ((WORD)1 << 8) ! #define LM_CONNECT ((WORD)1 << 9) ! #define MST2LM(m) ((WORD)((BYTE)(m))) ! #define LM2MST(lm) ((BYTE)(lm)) ! #define LM_2_GO1(lm) (GO1_V2O_MODEM_STATUS(LM2MST(lm)) | ((lm & LM_BREAK) ? GO1_BREAK_STATUS : 0)) static struct { *************** *** 434,443 **** _ASSERTE(pOutMsg->u.pv.pVal != NULL); // or'e with the required mask to get break status and modem status ! *pOutMsg->u.pv.pVal |= (LM2GO(((Filter *)hFilter)->lmInMask) & pOutMsg->u.pv.val); break; } case HUB_MSG_TYPE_FAIL_IN_OPTS: { ! DWORD fail_options = (pOutMsg->u.val & LM2GO(((Filter *)hFilter)->lmInMask)); if (fail_options) { --- 437,452 ---- _ASSERTE(pOutMsg->u.pv.pVal != NULL); + if (GO_O2I(pOutMsg->u.pv.val) != 1) + break; + // or'e with the required mask to get break status and modem status ! *pOutMsg->u.pv.pVal |= (LM_2_GO1(((Filter *)hFilter)->lmInMask) & pOutMsg->u.pv.val); break; } case HUB_MSG_TYPE_FAIL_IN_OPTS: { ! if (GO_O2I(pOutMsg->u.pv.val) != 1) ! break; ! ! DWORD fail_options = (pOutMsg->u.val & LM_2_GO1(((Filter *)hFilter)->lmInMask)); if (fail_options) { *************** *** 445,449 **** << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " for port " << pPortName(hToPort) ! << " option(s) 0x" << hex << fail_options << dec << " not accepted" << endl; } --- 454,458 ---- << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " for port " << pPortName(hToPort) ! << " option(s) GO1_0x" << hex << fail_options << dec << " not accepted" << endl; } |