<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>USB CONNECT event and DISCONNECT event subscription</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79205/usb-connect-event-and-disconnect-event-subscription</link><description>Hi, 
 I am looking for usb connect and disconnect events to be able to trigger some behaviors in our product. 
 I don&amp;#39;t find any API for that, like subscribing via a callback to USB-events. It&amp;#39;s kind of basic need for detecting USB-events. 
 Perhaps this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Sep 2021 07:09:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79205/usb-connect-event-and-disconnect-event-subscription" /><item><title>RE: USB CONNECT event and DISCONNECT event subscription</title><link>https://devzone.nordicsemi.com/thread/327893?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 07:09:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10b9d174-ff58-44ab-88cd-bcbc29ecece4</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Johan&lt;/p&gt;
&lt;p&gt;Good to hear you found a solution, and thanks for sharing it&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I will consider the case resolved then.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB CONNECT event and DISCONNECT event subscription</title><link>https://devzone.nordicsemi.com/thread/327742?ContentTypeID=1</link><pubDate>Thu, 02 Sep 2021 09:40:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99478647-e58d-4b92-bab6-5a5b0253324b</guid><dc:creator>Johan</dc:creator><description>&lt;p&gt;I found the answer from the zephyr slack channel response.&lt;br /&gt;I&amp;#39;ll share it:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;You can pass a status callback to usb_enable(),&amp;nbsp;&lt;/span&gt;&lt;a class="c-link" href="https://gist.github.com/jfischer-no/506c38ec81e7bf0118b423d0fcdaa0f3#file-diff" rel="noopener noreferrer" target="_blank"&gt;https://gist.github.com/jfischer-no/506c38ec81e7bf0118b423d0fcdaa0f3#file-diff&lt;/a&gt;&lt;span&gt;&amp;nbsp;The current stack was not designed for that,&amp;nbsp; therefore it is more a workaround as solution. I suggest to keep this status callback as short as possible and best to outsource the work into a thread (msq queue) or workqueue.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;/Johan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>