- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to check if the PC has opened the com port? I can determine whether the USB is connected and I can get all the port settings (baud, etc), but I want to know if the user on the PC has opened the com port with a terminal or other program.
This is on a PSoc5 with the USBUART component. I am using the feature to send data, but only want to send it if a user has actually opened the port.
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One possible way to check that Com port is open is to use an expiration counter, see e.g.
Re: PSOC5 USB UART buffer when no program is reading the data
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply.
That appears to be a good way to see if the port was opened initially, but I am not sure how to determine the port state after a few open/closes. Sometimes the line coding changes due to baudrate or DTR, RTS, etc changes.
I am looking for a something to put inside ...
state = USBUART_1_IsLineChanged();
if (state & USBUART_1_LINE_CODING_CHANGED)
{
// did the port open?
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One possible way to check that Com port is open is to use an expiration counter, see e.g.
Re: PSOC5 USB UART buffer when no program is reading the data
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
That seems like a good work around.