<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MQX CDC virtual COM control signals in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181669#M2832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SET_CONTROL_LINE STATE is what I wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; USB_SETUP_STRUCT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setupPkt;&lt;BR /&gt;&amp;nbsp; unsigned int &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size;&lt;BR /&gt;&lt;BR /&gt;#define CLR_CARRIER_DETECT&amp;nbsp; 0x00&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; setupPkt.request_type = USB_REQUEST_CLASS_CLASS;&lt;BR /&gt;&amp;nbsp; setupPkt.request = SET_CONTROL_LINE_STATE;&lt;BR /&gt;&amp;nbsp; setupPkt.value = CLR_CARRIER_DETECT;&lt;BR /&gt;&amp;nbsp; setupPkt.index = 0;&lt;BR /&gt;&amp;nbsp; setupPkt.length = USB_SETUP_PKT_SIZE;&lt;BR /&gt;&amp;nbsp; (void)USB_CDC_Other_Requests(&amp;amp;setupPkt, NULL, &amp;amp;size,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cdc_device_array[cdcHandle]);&lt;BR /&gt;&lt;BR /&gt;I had to extern cdc_device_array because most CDC calls want the index to the device pointer instead of the device pointer.&amp;nbsp; This call wants the device pointer itself.&amp;nbsp; cdcHandle is the value returned from USB_Class_CDC_Init.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code is useful if your application is Java and you are attaching to it using a virtual COM port.&amp;nbsp; Since Java doesn't know about the USB layer, you can change the carrier detect signal to indicate that the device has been removed.&amp;nbsp; This allows my application to cleanly exit instead of crashing java because the serial port has disappeared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks timias.&amp;nbsp; Your information got me on the right track.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Nov 2011 05:44:03 GMT</pubDate>
    <dc:creator>Hspahr_89north</dc:creator>
    <dc:date>2011-11-11T05:44:03Z</dc:date>
    <item>
      <title>MQX CDC virtual COM control signals</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181667#M2830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the MQX CDC stack to emulate an RS232/virtual COM port to a host computer.&amp;nbsp; Data communication works great, but I want to send an indication to the host if my piece of equipment is being turned off.&amp;nbsp; Since the host computer is running a GUI written in Java, it only knows information about virtual COM port/RS232.&amp;nbsp; It doesn't know anything about the fact that the COM port is running over USB.&amp;nbsp; If I could emulate changing the control signals across the USB bus (such as setting the ring indicator, sending carrier detect/break character, or any control signal), the event could be caught on the host computer and the program could be gracefully shut down.&amp;nbsp; Does the MQX CDC stack support setting the controls signals?&amp;nbsp; Thanks in advance for any info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 22:23:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181667#M2830</guid>
      <dc:creator>Hspahr_89north</dc:creator>
      <dc:date>2011-11-10T22:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: MQX CDC virtual COM control signals</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181668#M2831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might be able touse ioctl with SET_CONTROL_LINE_STATE or&amp;nbsp;SEND_BREAK, not sure the parameters you will need to pas to them though&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also send a software break command like an ETX character. There is a well establish protocol for that when using TCP, which you could mirror.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't you trigger an event when the serial port closes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 22:46:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181668#M2831</guid>
      <dc:creator>timias</dc:creator>
      <dc:date>2011-11-10T22:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: MQX CDC virtual COM control signals</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181669#M2832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SET_CONTROL_LINE STATE is what I wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; USB_SETUP_STRUCT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setupPkt;&lt;BR /&gt;&amp;nbsp; unsigned int &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size;&lt;BR /&gt;&lt;BR /&gt;#define CLR_CARRIER_DETECT&amp;nbsp; 0x00&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; setupPkt.request_type = USB_REQUEST_CLASS_CLASS;&lt;BR /&gt;&amp;nbsp; setupPkt.request = SET_CONTROL_LINE_STATE;&lt;BR /&gt;&amp;nbsp; setupPkt.value = CLR_CARRIER_DETECT;&lt;BR /&gt;&amp;nbsp; setupPkt.index = 0;&lt;BR /&gt;&amp;nbsp; setupPkt.length = USB_SETUP_PKT_SIZE;&lt;BR /&gt;&amp;nbsp; (void)USB_CDC_Other_Requests(&amp;amp;setupPkt, NULL, &amp;amp;size,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cdc_device_array[cdcHandle]);&lt;BR /&gt;&lt;BR /&gt;I had to extern cdc_device_array because most CDC calls want the index to the device pointer instead of the device pointer.&amp;nbsp; This call wants the device pointer itself.&amp;nbsp; cdcHandle is the value returned from USB_Class_CDC_Init.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code is useful if your application is Java and you are attaching to it using a virtual COM port.&amp;nbsp; Since Java doesn't know about the USB layer, you can change the carrier detect signal to indicate that the device has been removed.&amp;nbsp; This allows my application to cleanly exit instead of crashing java because the serial port has disappeared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks timias.&amp;nbsp; Your information got me on the right track.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 05:44:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181669#M2832</guid>
      <dc:creator>Hspahr_89north</dc:creator>
      <dc:date>2011-11-11T05:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: MQX CDC virtual COM control signals</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181670#M2833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a bit off topic, but I noticed that you have achieved good virtual com port behavior in MQX. &amp;nbsp;I am having difficulty understanding how to make the virtual com port the default comm port for MQX rather than a UART. &amp;nbsp;I have the Kinetis-sc bare metal USB device demo working and I have other demos working running MQX, but haven't figured out how to merge the two.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 11:16:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CDC-virtual-COM-control-signals/m-p/181670#M2833</guid>
      <dc:creator>MarkW_</dc:creator>
      <dc:date>2012-03-15T11:16:34Z</dc:date>
    </item>
  </channel>
</rss>

