Help set up a USB port
DTR_CONTROL_DISABLE 0x00

DTR_CONTROL_ENABLE 0x01

DTR_CONTROL_HANDSHAKE 0x02 There are three modes and three choices in the XON / XOFF program Nardware none

What to compare with, I guess None is DTR_CONTROL_DISABLE hardware DTR_CONTROL_HANDSHAKE

XON / XOFF DTR_CONTROL_ENABLE

Maybe I'm wrong ?

  • What kind of USB on which hardware in which mode, what programming language are we talking about? - Mikhail Alekseevich
  • USB thermal printer on c ++ cli. There are comboboxes in it, three values ​​of XON / XOFF Nardware none I need to match them with DTR_CONTROL_DISABLE 0x00 DTR_CONTROL_ENABLE 0x01 DTR_CONTROL_HANDSHAKE 0x02 to understand the connection with the selected parameter - Pablo Murena
  • In this case, you need more accurate data about your hardware and highly desirable source code / that does not work. - Mikhail Alekseevich
  • The DCB structure has fDtrControl (Flow control) in it. It has two modes: DTR_CONTROL_ENABLE 0x01 and DTR_CONTROL_HANDSHAKE 0x02. And the program has a combo box in it XON / XOFF and Nardware when selected must be initialized fDtrControl. Question when choosing XON / XOFF what knowledge should be recorded in fDtrControl? - Pablo Murena
  • @ MikhailAlekseevich for some reason showed me c ++ 11, so I rejected the edit. Now I see what is wrong, sorry. - 0xdb

1 answer 1

DCB SetDCB; GetCommState(ConDevice, &SetDCB); SetDCB.DCBlength = sizeof(SetDCB); SetDCB.BaudRate = System::Convert::ToInt64(BaudRateCB->SelectedItem); SetDCB.fBinary = TRUE; SetDCB.fOutxCtsFlow = FALSE; SetDCB.fOutxDsrFlow = FALSE; if (FlowControlCB->SelectedIndex == 1) { SetDCB.fDtrControl = DTR_CONTROL_HANDSHAKE; } if (FlowControlCB->SelectedIndex == 0) { SetDCB.fDtrControl = DTR_CONTROL_DISABLE; } SetDCB.fDsrSensitivity = FALSE; SetDCB.fNull = FALSE; SetDCB.fRtsControl = 0x01; SetDCB.fAbortOnError = FALSE; SetDCB.ByteSize = System::Convert::ToInt64(DataBitsCB->SelectedItem); SetDCB.Parity = ParityCB->SelectedIndex; SetDCB.StopBits = ONESTOPBIT; SetCommState(ConDevice, &SetDCB); 
  • It is not the answer to the question, since the question itself is too general, without specifics. - Mikhail Alekseevich