[Com0com-cvs] hub4com/plugins/pin2con filter.cpp,1.4,1.5
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
From: Vyacheslav F. <vf...@us...> - 2008-08-11 07:15:39
|
Update of /cvsroot/com0com/hub4com/plugins/pin2con In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8775/plugins/pin2con Modified Files: filter.cpp Log Message: Replaced HUB_MSG_TYPE_COM_FUNCTION HUB_MSG_TYPE_INIT_LSR_MASK HUB_MSG_TYPE_INIT_MST_MASK by HUB_MSG_TYPE_SET_PIN_STATE HUB_MSG_TYPE_GET_OPTIONS HUB_MSG_TYPE_SET_OPTIONS Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pin2con/filter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** filter.cpp 14 Apr 2008 07:32:04 -0000 1.4 --- filter.cpp 11 Aug 2008 07:15:33 -0000 1.5 *************** *** 20,23 **** --- 20,33 ---- * * $Log$ + * Revision 1.5 2008/08/11 07:15:33 vfrolov + * Replaced + * HUB_MSG_TYPE_COM_FUNCTION + * HUB_MSG_TYPE_INIT_LSR_MASK + * HUB_MSG_TYPE_INIT_MST_MASK + * by + * HUB_MSG_TYPE_SET_PIN_STATE + * HUB_MSG_TYPE_GET_OPTIONS + * HUB_MSG_TYPE_SET_OPTIONS + * * Revision 1.4 2008/04/14 07:32:04 vfrolov * Renamed option --use-port-module to --use-driver *************** *** 76,90 **** static struct { const char *pName; ! WORD val; } pin_names[] = { ! {"cts", MODEM_STATUS_CTS}, ! {"dsr", MODEM_STATUS_DSR}, ! {"dcd", MODEM_STATUS_DCD}, ! {"ring", MODEM_STATUS_RI}, ! {"break", LINE_STATUS_BI << 8}, }; Filter::Filter(int argc, const char *const argv[]) ! : pin(MODEM_STATUS_DSR), negative(FALSE) { --- 86,100 ---- static struct { const char *pName; ! DWORD val; } pin_names[] = { ! {"cts", GO_V2O_MODEM_STATUS(MODEM_STATUS_CTS)}, ! {"dsr", GO_V2O_MODEM_STATUS(MODEM_STATUS_DSR)}, ! {"dcd", GO_V2O_MODEM_STATUS(MODEM_STATUS_DCD)}, ! {"ring", GO_V2O_MODEM_STATUS(MODEM_STATUS_RI)}, ! {"break", GO_V2O_LINE_STATUS(LINE_STATUS_BI)}, }; Filter::Filter(int argc, const char *const argv[]) ! : pin(GO_V2O_MODEM_STATUS(MODEM_STATUS_DSR)), negative(FALSE) { *************** *** 170,177 **** << endl << "IN method input data stream description:" << endl ! << " INIT_LSR_MASK(<pval>) - the value pointed by <pval> will be or'ed with the" << endl ! << " required line status mask." << endl ! << " INIT_MST_MASK(<pval>) - the value pointed by <pval> will be or'ed with the" << endl ! << " required modem status mask." << endl << " CONNECT(TRUE/FALSE) - will be discarded from stream." << endl << " LINE_STATUS(<val>) - current state of line" << endl --- 180,187 ---- << endl << "IN method input data stream description:" << endl ! << " HUB_MSG_TYPE_GET_OPTIONS(<pOptions>)" << endl ! << " - the value pointed by <pOptions> will be or'ed with" << endl ! << " the required mask to get line status and modem" << endl ! << " status." << endl << " CONNECT(TRUE/FALSE) - will be discarded from stream." << endl << " LINE_STATUS(<val>) - current state of line" << endl *************** *** 207,218 **** _ASSERTE(*ppEchoMsg == NULL); ! if (pInMsg->type == HUB_MSG_TYPE_INIT_LSR_MASK) { ! _ASSERTE(pInMsg->u.pVal != NULL); ! *pInMsg->u.pVal |= (((Filter *)hFilter)->pin >> 8); ! } ! else ! if (pInMsg->type == HUB_MSG_TYPE_INIT_MST_MASK) { ! _ASSERTE(pInMsg->u.pVal != NULL); ! *pInMsg->u.pVal |= (((Filter *)hFilter)->pin & 0xFF); } else --- 217,223 ---- _ASSERTE(*ppEchoMsg == NULL); ! if (pInMsg->type == HUB_MSG_TYPE_GET_OPTIONS) { ! _ASSERTE(pInMsg->u.pv.pVal != NULL); ! *pInMsg->u.pv.pVal |= (((Filter *)hFilter)->pin & pInMsg->u.pv.val); } else *************** *** 228,234 **** if (pInMsg->type == HUB_MSG_TYPE_LINE_STATUS) ! connect = ((pInMsg->u.val & (((Filter *)hFilter)->pin >> 8)) != 0); else ! connect = ((pInMsg->u.val & (((Filter *)hFilter)->pin & 0xFF)) != 0); if (((Filter *)hFilter)->negative) --- 233,239 ---- if (pInMsg->type == HUB_MSG_TYPE_LINE_STATUS) ! connect = ((pInMsg->u.val & GO_O2V_LINE_STATUS(((Filter *)hFilter)->pin)) != 0); else ! connect = ((pInMsg->u.val & GO_O2V_MODEM_STATUS(((Filter *)hFilter)->pin)) != 0); if (((Filter *)hFilter)->negative) |