Update of /cvsroot/com0com/hub4com/plugins/pinmap
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12850/pinmap
Modified Files:
filter.cpp
Log Message:
Added masking to HUB_MSG_TYPE_MODEM_STATUS and HUB_MSG_TYPE_LINE_STATUS
Index: filter.cpp
===================================================================
RCS file: /cvsroot/com0com/hub4com/plugins/pinmap/filter.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** filter.cpp 20 Aug 2008 14:30:19 -0000 1.4
--- filter.cpp 22 Aug 2008 12:45:34 -0000 1.5
***************
*** 20,23 ****
--- 20,26 ----
*
* $Log$
+ * Revision 1.5 2008/08/22 12:45:34 vfrolov
+ * Added masking to HUB_MSG_TYPE_MODEM_STATUS and HUB_MSG_TYPE_LINE_STATUS
+ *
* Revision 1.4 2008/08/20 14:30:19 vfrolov
* Redesigned serial port options
***************
*** 348,352 ****
if (mask) {
! DWORD dVal = (SPS_PIN2MASK(mask) | val);
//cout << "SET_PIN_STATE 0x" << hex << dVal << dec << endl;
*ppOutMsg = pMsgInsertVal(*ppOutMsg, HUB_MSG_TYPE_SET_PIN_STATE, dVal);
--- 351,355 ----
if (mask) {
! DWORD dVal = (VAL2MASK(mask) | val);
//cout << "SET_PIN_STATE 0x" << hex << dVal << dec << endl;
*ppOutMsg = pMsgInsertVal(*ppOutMsg, HUB_MSG_TYPE_SET_PIN_STATE, dVal);
***************
*** 389,393 ****
case HUB_MSG_TYPE_SET_PIN_STATE:
// discard any pin settings controlled by this filter
! pOutMsg->u.val &= ~(SPS_PIN2MASK(((Filter *)hFilter)->outMask));
break;
case HUB_MSG_TYPE_LINE_STATUS:
--- 392,396 ----
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_LINE_STATUS:
***************
*** 399,411 ****
WORD lmInVal;
! if (pOutMsg->type == HUB_MSG_TYPE_MODEM_STATUS)
! lmInVal = (MST2LSRMST(pOutMsg->u.val) | (pState->lmInVal & LSR2LSRMST(-1)));
! else
! lmInVal = (LSR2LSRMST(pOutMsg->u.val) | (pState->lmInVal & MST2LSRMST(-1)));
lmInVal &= ((Filter *)hFilter)->lmInMask;
InsertPinState(*(Filter *)hFilter, pState->lmInVal ^ lmInVal, lmInVal, &pOutMsg);
pState->lmInVal = lmInVal;
break;
--- 402,420 ----
WORD lmInVal;
+ WORD lmInMask;
! if (pOutMsg->type == HUB_MSG_TYPE_MODEM_STATUS) {
! lmInVal = MST2LSRMST(pOutMsg->u.val);
! lmInMask = MST2LSRMST(MASK2VAL(pOutMsg->u.val));
! } else {
! lmInVal = LSR2LSRMST(pOutMsg->u.val);
! lmInMask = LSR2LSRMST(MASK2VAL(pOutMsg->u.val));
! }
+ lmInVal = ((lmInVal & lmInMask) | (pState->lmInVal & ~lmInMask));
lmInVal &= ((Filter *)hFilter)->lmInMask;
InsertPinState(*(Filter *)hFilter, pState->lmInVal ^ lmInVal, lmInVal, &pOutMsg);
+
pState->lmInVal = lmInVal;
break;
|