Setting low level flag for Serial Port in Java


H

Homer

Hi All,

How can I set a low level flag for Serial Port. Using C++ I can say:

if((m_hComaptm=::CreateFile(/*(LPCTSTR)port,*/"COM1", GENERIC_READ|
GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED,
NULL))==INVALID_HANDLE_VALUE)
{
IsError();// to format system error
printf("Failed to access COM1...\n");
return NULL;
}
::SetupComm(m_hComaptm, 1024,1024);
DCB m_dcb;
::GetCommState(m_hComaptm,&m_dcb);
// m_dcb.BaudRate = CBR_9600;
// m_dcb.fBinary = 1;
// m_dcb.fParity = 0;
// m_dcb.fOutxCtsFlow = 0;
// m_dcb.fOutxDsrFlow = 0;
// m_dcb.fDtrControl = DTR_CONTROL_ENABLE;
// m_dcb.fDsrSensitivity = 0;


I am using Java Win32Com library and trying to set fDsrSensitivity to
Zero in Java but there is no such a function. any idea?


Thanks in advance,

Homer
 
Ad

Advertisements

K

Knute Johnson

Homer said:
Hi All,

How can I set a low level flag for Serial Port. Using C++ I can say:

if((m_hComaptm=::CreateFile(/*(LPCTSTR)port,*/"COM1", GENERIC_READ|
GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED,
NULL))==INVALID_HANDLE_VALUE)
{
IsError();// to format system error
printf("Failed to access COM1...\n");
return NULL;
}
::SetupComm(m_hComaptm, 1024,1024);
DCB m_dcb;
::GetCommState(m_hComaptm,&m_dcb);
// m_dcb.BaudRate = CBR_9600;
// m_dcb.fBinary = 1;
// m_dcb.fParity = 0;
// m_dcb.fOutxCtsFlow = 0;
// m_dcb.fOutxDsrFlow = 0;
// m_dcb.fDtrControl = DTR_CONTROL_ENABLE;
// m_dcb.fDsrSensitivity = 0;


I am using Java Win32Com library and trying to set fDsrSensitivity to
Zero in Java but there is no such a function. any idea?


Thanks in advance,

Homer

What does it do? I've never seen that before. It is not a function of
the UART, is it a Windows driver function?
 

Top