Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Setting low level flag for Serial Port in Java

Reply
Thread Tools

Setting low level flag for Serial Port in Java

 
 
Homer
Guest
Posts: n/a
 
      07-16-2007
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

 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      07-16-2007
Homer wrote:
> 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?

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pcos low carb diet. Low carb diet program. Cholesterol low carb diet.Low carb diet foods. zyraco C++ 0 11-10-2009 01:44 PM
Low carb diabetes diet. Low fat high carb diet. The low carb diet.Low carb diet pregnancy. zyraco C++ 0 11-10-2009 01:44 PM
Low carb calorie diet. No low carb diet. Free low carb diet. Low carbdiet meal plan. zyraco C++ 0 11-10-2009 01:44 PM
c is a low-level language or neither low level nor high level language pabbu C Programming 8 11-07-2005 03:05 PM
Extremely low-level serial port programming rusttree@gmail.com C++ 3 08-10-2005 07:24 PM



Advertisments