[Com0com-cvs] hub4com/plugins/trace filter.cpp,1.2,1.3
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
|
From: Vyacheslav F. <vf...@us...> - 2008-09-30 08:28:58
|
Update of /cvsroot/com0com/hub4com/plugins/trace In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13607/trace Modified Files: filter.cpp Log Message: Added ability to control OUT1 and OUT2 pins Added ability to get remote baud rate and line control settings Added ability to set baud rate and line control Added fallback to non escape mode Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/trace/filter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filter.cpp 29 Aug 2008 15:17:07 -0000 1.2 --- filter.cpp 30 Sep 2008 08:28:32 -0000 1.3 *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.3 2008/09/30 08:28:32 vfrolov + * Added ability to control OUT1 and OUT2 pins + * Added ability to get remote baud rate and line control settings + * Added ability to set baud rate and line control + * Added fallback to non escape mode + * * Revision 1.2 2008/08/29 15:17:07 vfrolov * Added printing command line and config *************** *** 296,300 **** while (pTable->name) { if (pTable->code == code) { ! tout << pTable->name; return; } --- 302,306 ---- while (pTable->name) { if (pTable->code == code) { ! tout << pTable->name; return; } *************** *** 366,373 **** TOCODE2NAME(HUB_MSG_TYPE_, FAIL_ESC_OPTS), TOCODE2NAME(HUB_MSG_TYPE_, BREAK_STATUS), {0, NULL} }; /////////////////////////////////////////////////////////////// ! static FIELD2NAME fieldNameTableModemStatus[] = { TOFIELD2NAME2(MODEM_STATUS_, DCTS), TOFIELD2NAME2(MODEM_STATUS_, DDSR), --- 372,398 ---- TOCODE2NAME(HUB_MSG_TYPE_, FAIL_ESC_OPTS), TOCODE2NAME(HUB_MSG_TYPE_, BREAK_STATUS), + TOCODE2NAME(HUB_MSG_TYPE_, SET_BR), + TOCODE2NAME(HUB_MSG_TYPE_, SET_LC), {0, NULL} }; /////////////////////////////////////////////////////////////// ! static const CODE2NAME codeNameTableParity[] = { ! NOPARITY, "N", ! ODDPARITY, "O", ! EVENPARITY, "E", ! MARKPARITY, "M", ! SPACEPARITY, "S", ! {0, NULL} ! }; ! /////////////////////////////////////////////////////////////// ! static const CODE2NAME codeNameTableStopBits ! [] = { ! ONESTOPBIT, "1", ! ONE5STOPBITS, "1.5", ! TWOSTOPBITS, "2", ! {0, NULL} ! }; ! /////////////////////////////////////////////////////////////// ! static const FIELD2NAME fieldNameTableModemStatus[] = { TOFIELD2NAME2(MODEM_STATUS_, DCTS), TOFIELD2NAME2(MODEM_STATUS_, DDSR), *************** *** 381,385 **** }; /////////////////////////////////////////////////////////////// ! static FIELD2NAME fieldNameTableLineStatus[] = { TOFIELD2NAME2(LINE_STATUS_, DR), TOFIELD2NAME2(LINE_STATUS_, OE), --- 406,410 ---- }; /////////////////////////////////////////////////////////////// ! static const FIELD2NAME fieldNameTableLineStatus[] = { TOFIELD2NAME2(LINE_STATUS_, DR), TOFIELD2NAME2(LINE_STATUS_, OE), *************** *** 393,397 **** }; /////////////////////////////////////////////////////////////// ! static FIELD2NAME fieldNameTableGoOptions[] = { TOFIELD2NAME2(GO_, RBR_STATUS), TOFIELD2NAME2(GO_, RLC_STATUS), --- 418,422 ---- }; /////////////////////////////////////////////////////////////// ! static const FIELD2NAME fieldNameTableGoOptions[] = { TOFIELD2NAME2(GO_, RBR_STATUS), TOFIELD2NAME2(GO_, RLC_STATUS), *************** *** 401,405 **** }; /////////////////////////////////////////////////////////////// ! static FIELD2NAME codeNameTableSetPinState[] = { TOFIELD2NAME2(PIN_STATE_, RTS), TOFIELD2NAME2(PIN_STATE_, DTR), --- 426,430 ---- }; /////////////////////////////////////////////////////////////// ! static const FIELD2NAME codeNameTableSetPinState[] = { TOFIELD2NAME2(PIN_STATE_, RTS), TOFIELD2NAME2(PIN_STATE_, DTR), *************** *** 410,413 **** --- 435,444 ---- }; /////////////////////////////////////////////////////////////// + static const FIELD2NAME fieldNameTableSoOptions[] = { + TOFIELD2NAME2(SO_, SET_BR), + TOFIELD2NAME2(SO_, SET_LC), + {0, 0, NULL} + }; + /////////////////////////////////////////////////////////////// static BOOL PrintGoOptions( ostream &tout, *************** *** 496,499 **** --- 527,536 ---- tout << val; break; + case HUB_MSG_VAL_TYPE_LC: + tout << (unsigned)LC2VAL_BYTESIZE(val) << '-'; + PrintCode(tout, codeNameTableParity, LC2VAL_PARITY(val)); + tout << '-'; + PrintCode(tout, codeNameTableStopBits, LC2VAL_STOPBITS(val)); + break; default: tout << "0x" << hex << val << dec; *************** *** 513,517 **** break; case HUB_MSG_UNION_TYPE_PVAL: ! tout << "&0x" << hex << *pMsg->u.pv.pVal << dec << " "; PrintVal(tout, pMsg->type, pMsg->u.pv.val); break; --- 550,554 ---- break; case HUB_MSG_UNION_TYPE_PVAL: ! tout << hex << "&" << pMsg->u.pv.pVal << "[0x" << *pMsg->u.pv.pVal << dec << "] "; PrintVal(tout, pMsg->type, pMsg->u.pv.val); break; *************** *** 540,550 **** tout << "["; BOOL delimitNext = FALSE; ! delimitNext = PrintFields(tout, codeNameTableSetPinState, SO_O2V_PIN_STATE(pMsg->u.val), delimitNext, "PIN_"); ! PrintFields(tout, NULL, pMsg->u.val & ~SO_V2O_PIN_STATE(-1), delimitNext); tout << "]"; break; } case HUB_MSG_TYPE_GET_IN_OPTS: { ! tout << "&["; PrintGoOptions(tout, *pMsg->u.pv.pVal); tout << "] ["; --- 577,587 ---- tout << "["; BOOL delimitNext = FALSE; ! delimitNext = PrintFields(tout, codeNameTableSetPinState, SO_O2V_PIN_STATE(pMsg->u.val), delimitNext, "SET_"); ! PrintFields(tout, fieldNameTableSoOptions, pMsg->u.val & ~SO_V2O_PIN_STATE(-1), delimitNext); tout << "]"; break; } case HUB_MSG_TYPE_GET_IN_OPTS: { ! tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; PrintGoOptions(tout, *pMsg->u.pv.pVal); tout << "] ["; *************** *** 560,564 **** } case HUB_MSG_TYPE_GET_ESC_OPTS: { ! tout << "&["; tout << "CHAR_0x" << hex << (unsigned)ESC_OPTS_O2V_ESCCHAR(*pMsg->u.pv.pVal) << dec; PrintEscOptions(tout, *pMsg->u.pv.pVal & ~ESC_OPTS_V2O_ESCCHAR(-1), TRUE); --- 597,601 ---- } 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; PrintEscOptions(tout, *pMsg->u.pv.pVal & ~ESC_OPTS_V2O_ESCCHAR(-1), TRUE); *************** *** 567,572 **** } case HUB_MSG_TYPE_FAIL_ESC_OPTS: { ! tout << "["; ! PrintEscOptions(tout, pMsg->u.val & ~ESC_OPTS_V2O_ESCCHAR(-1)); tout << "]"; break; --- 604,611 ---- } case HUB_MSG_TYPE_FAIL_ESC_OPTS: { ! tout << hex << "&" << pMsg->u.pv.pVal << "[" << dec; ! PrintGoOptions(tout, *pMsg->u.pv.pVal); ! tout << "] ["; ! PrintEscOptions(tout, pMsg->u.pv.val & ~ESC_OPTS_V2O_ESCCHAR(-1)); tout << "]"; break; |