Update of /cvsroot/com0com/hub4com/plugins/pin2con
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7231/pin2con
Modified Files:
filter.cpp
Log Message:
Added
HUB_MSG_TYPE_GET_ESC_OPTS
HUB_MSG_TYPE_FAIL_ESC_OPTS
HUB_MSG_TYPE_BREAK_STATUS
Index: filter.cpp
===================================================================
RCS file: /cvsroot/com0com/hub4com/plugins/pin2con/filter.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** filter.cpp 22 Aug 2008 12:45:34 -0000 1.7
--- filter.cpp 22 Aug 2008 16:57:11 -0000 1.8
***************
*** 20,23 ****
--- 20,29 ----
*
* $Log$
+ * Revision 1.8 2008/08/22 16:57:11 vfrolov
+ * Added
+ * HUB_MSG_TYPE_GET_ESC_OPTS
+ * HUB_MSG_TYPE_FAIL_ESC_OPTS
+ * HUB_MSG_TYPE_BREAK_STATUS
+ *
* Revision 1.7 2008/08/22 12:45:34 vfrolov
* Added masking to HUB_MSG_TYPE_MODEM_STATUS and HUB_MSG_TYPE_LINE_STATUS
***************
*** 105,109 ****
{"dcd", GO_V2O_MODEM_STATUS(MODEM_STATUS_DCD)},
{"ring", GO_V2O_MODEM_STATUS(MODEM_STATUS_RI)},
! {"break", GO_V2O_LINE_STATUS(LINE_STATUS_BI)},
};
--- 111,115 ----
{"dcd", GO_V2O_MODEM_STATUS(MODEM_STATUS_DCD)},
{"ring", GO_V2O_MODEM_STATUS(MODEM_STATUS_RI)},
! {"break", GO_BREAK_STATUS},
};
***************
*** 231,234 ****
--- 237,260 ----
}
///////////////////////////////////////////////////////////////
+ static HUB_MSG *InsertConnectState(
+ Filter &filter,
+ int nFromPort,
+ HUB_MSG *pInMsg,
+ BOOL pinState)
+ {
+ State *pState = filter.GetState(nFromPort);
+
+ if (!pState)
+ return FALSE;
+
+ if (filter.negative)
+ pinState = !pinState;
+
+ if (pState->connect != pinState)
+ pInMsg = pMsgInsertVal(pInMsg, HUB_MSG_TYPE_CONNECT, pState->connect = pinState);
+
+ return pInMsg;
+ }
+
static BOOL CALLBACK InMethod(
HFILTER hFilter,
***************
*** 264,268 ****
break;
case HUB_MSG_TYPE_LINE_STATUS:
! case HUB_MSG_TYPE_MODEM_STATUS:
WORD pin;
--- 290,294 ----
break;
case HUB_MSG_TYPE_LINE_STATUS:
! case HUB_MSG_TYPE_MODEM_STATUS: {
WORD pin;
***************
*** 276,298 ****
break;
! BOOL connect = ((pInMsg->u.val & pin) != 0);
!
! if (((Filter *)hFilter)->negative)
! connect = !connect;
!
! State *pState = ((Filter *)hFilter)->GetState(nFromPort);
!
! if (!pState)
! return FALSE;
!
! if (pState->connect != connect) {
! pState->connect = connect;
! if (connect) {
! pInMsg = pMsgInsertVal(pInMsg, HUB_MSG_TYPE_CONNECT, TRUE);
! } else {
! pInMsg = pMsgInsertVal(pInMsg, HUB_MSG_TYPE_CONNECT, FALSE);
! }
! }
break;
}
--- 302,312 ----
break;
! pInMsg = InsertConnectState(*((Filter *)hFilter), nFromPort, pInMsg, ((pInMsg->u.val & pin) != 0));
! break;
! }
! case HUB_MSG_TYPE_BREAK_STATUS:
! if (((Filter *)hFilter)->pin & GO_BREAK_STATUS)
! pInMsg = InsertConnectState(*((Filter *)hFilter), nFromPort, pInMsg, pInMsg->u.val != 0);
break;
}
|