002
03.05.2004, 12:46 Uhr
~toxic
Gast
|
C++: |
// com-port settings & timeouts DCB dcb; dcb.DCBlength = sizeof(dcb); COMMTIMEOUTS cto;
GetCommState(h_ComPort, &dcb); dcb.BaudRate = (DWORD)9600; dcb.ByteSize = (BYTE)8; // 8 datenbits dcb.StopBits = (BYTE)0; // 1 stopbit dcb.Parity = (BYTE)0;// 0-4=None,Odd,Even,Mark,Space dcb.fDsrSensitivity = 0; dcb.fOutxCtsFlow = 0; dcb.fOutxDsrFlow = 0; dcb.fInX = 0; dcb.fOutX = 0; dcb.fDtrControl = DTR_CONTROL_DISABLE; dcb.fRtsControl = RTS_CONTROL_DISABLE; SetCommState(h_ComPort, &dcb); GetCommTimeouts(h_ComPort,&cto); cto.ReadIntervalTimeout = 10; cto.ReadTotalTimeoutConstant = 10; cto.ReadTotalTimeoutMultiplier = 0; cto.WriteTotalTimeoutConstant = 5000; cto.WriteTotalTimeoutMultiplier = 0; SetCommTimeouts(h_ComPort,&cto);
|
bsp so|CPP|| aber guck dir noch mal die members an, eventuell musst du auch die timeouts anders einstellen. -- grusz |