[Com0com-cvs] hub4com comhub.cpp,1.8,1.9
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
From: Vyacheslav F. <vf...@us...> - 2008-08-20 14:57:17
|
Update of /cvsroot/com0com/hub4com In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29647 Modified Files: comhub.cpp Log Message: Redesigned serial port options Index: comhub.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** comhub.cpp 20 Aug 2008 08:46:06 -0000 1.8 --- comhub.cpp 20 Aug 2008 14:30:18 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/08/20 14:30:18 vfrolov + * Redesigned serial port options + * * Revision 1.8 2008/08/20 08:46:06 vfrolov * Implemented ComHub::FilterName() *************** *** 101,105 **** HubMsg msg; ! msg.type = HUB_MSG_TYPE_SET_OPTIONS; if (!OnFakeRead(*i, &msg)) --- 104,108 ---- HubMsg msg; ! msg.type = HUB_MSG_TYPE_SET_OUT_OPTS; if (!OnFakeRead(*i, &msg)) *************** *** 108,124 **** for (Ports::const_iterator i = ports.begin() ; i != ports.end() ; i++) { ! HubMsg msg; ! DWORD options = 0; ! msg.type = HUB_MSG_TYPE_GET_OPTIONS; ! msg.u.pv.pVal = &options; ! msg.u.pv.val = DWORD(-1); ! if (!OnFakeRead(*i, &msg)) ! return FALSE; ! if (options) { ! cout << (*i)->Name() << " WARNING: Requested option(s) 0x" ! << hex << options << dec << " not supported" << endl; } } --- 111,152 ---- for (Ports::const_iterator i = ports.begin() ; i != ports.end() ; i++) { ! DWORD fail_options = 0; ! DWORD repeats = 0; ! { ! HubMsg msg; ! msg.type = HUB_MSG_TYPE_COUNT_REPEATS; ! msg.u.pv.pVal = &repeats; ! msg.u.pv.val = HUB_MSG_TYPE_GET_IN_OPTS; ! if (!OnFakeRead(*i, &msg)) ! return FALSE; ! } ! ! do { ! HubMsg msg; ! ! msg.type = HUB_MSG_TYPE_GET_IN_OPTS; ! msg.u.pv.pVal = &fail_options; ! msg.u.pv.val = DWORD(-1); ! ! if (!OnFakeRead(*i, &msg)) ! return FALSE; ! } while (repeats--); ! ! if (fail_options) { ! cerr << (*i)->Name() << " WARNING: Requested option(s) 0x" ! << hex << fail_options << dec << " not supported" << endl; ! } ! ! { ! HubMsg msg; ! ! msg.type = HUB_MSG_TYPE_FAIL_IN_OPTS; ! msg.u.val = fail_options; ! ! if (!OnFakeRead(*i, &msg)) ! return FALSE; } } |