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
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top