Move apps/system/usbmonitor to nuttx/drivers/usbmonitor
This commit is contained in:
parent
378b22ec07
commit
7c34a77b54
@ -396,7 +396,7 @@ static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_SYSTEM_USBMONITOR=y</code>
|
||||
<code>CONFIG_USBMONITOR=y</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Enable the USB monitor daemon
|
||||
@ -404,7 +404,7 @@ static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_STACKSIZE=<i>nnnn</i></code>
|
||||
<code>CONFIG_USBMONITOR_STACKSIZE=<i>nnnn</i></code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Sets the USB monitor daemon stack size to <i>nnnn</i>.
|
||||
@ -413,7 +413,7 @@ static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_PRIORITY=50</code>
|
||||
<code>CONFIG_USBMONITOR_PRIORITY=50</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Sets the USB monitor daemon priority to <i>nnnn</i>.
|
||||
@ -423,7 +423,7 @@ static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_INTERVAL=<i>nnnn</i></code>
|
||||
<code>CONFIG_USBMONITOR_INTERVAL=<i>nnnn</i></code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Dump the buffered USB data every <i>nnnn</i> seconds.
|
||||
@ -432,11 +432,11 @@ static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y</code><br>
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y</code><br>
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y</code><br>
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y</code><br>
|
||||
<code>CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACEINIT=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACECLASS=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACETRANSFERS=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACECONTROLLER=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACEINTERRUPTS=y</code><br>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Selects which USB event(s) that you want to be traced.
|
||||
|
@ -785,6 +785,6 @@ CONFIG_EXAMPLES_USBSERIAL_BUFSIZE=512
|
||||
# CONFIG_SYSTEM_READLINE is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -667,16 +667,16 @@ Where <subdir> is one of the following:
|
||||
CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
|
||||
CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
|
||||
Using the Prolifics PL2303 Emulation
|
||||
|
@ -1426,7 +1426,7 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
CONFIG_SYSTEM_USBMSC=y
|
||||
CONFIG_SYSTEM_USBMSC_NLUNS=1
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1=0
|
||||
|
@ -1129,6 +1129,6 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -1345,6 +1345,6 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -1166,6 +1166,6 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -853,7 +853,7 @@ CONFIG_SYSTEM_COMPOSITE_BUFSIZE=256
|
||||
# CONFIG_SYSTEM_READLINE is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_USBMSC is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -800,7 +800,7 @@ CONFIG_ARCH_HAVE_TLS=y
|
||||
# CONFIG_SYSTEM_READLINE is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
CONFIG_SYSTEM_USBMSC=y
|
||||
CONFIG_SYSTEM_USBMSC_NLUNS=1
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1=0
|
||||
|
@ -925,16 +925,16 @@ Where <subdir> is one of the following:
|
||||
CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
|
||||
CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
5. By default, this project assumes that you are *NOT* using the DFU
|
||||
bootloader.
|
||||
|
@ -55,7 +55,7 @@
|
||||
# include <nuttx/mtd/mtd.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -827,8 +827,8 @@ Configurations
|
||||
CONFIG_USBHOST_TRACE_VERBOSE=y
|
||||
|
||||
Application Configuration -> System Add-Ons
|
||||
CONFIG_SYSTEM_USBMONITOR=y
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1
|
||||
CONFIG_USBMONITOR=y
|
||||
CONFIG_USBMONITOR_INTERVAL=1
|
||||
|
||||
NOTE: I have found that if you enable USB DEBUG and/or USB tracing,
|
||||
the resulting image requires to much memory to execute out of
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
# undef CONFIG_USBHOST_TRACE
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SYSTEM_USBMONITOR) || !defined(CONFIG_USBHOST_TRACE)
|
||||
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBHOST_TRACE)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -78,7 +78,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/mmcsd.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -837,15 +837,15 @@ USB Full-Speed Device
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
NOTE: If USB debug output is also enabled, both outputs will appear on the
|
||||
serial console. However, the debug output will be asynchronous with the
|
||||
|
@ -130,7 +130,7 @@
|
||||
# undef CONFIG_USBDEV_TRACE
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SYSTEM_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE)
|
||||
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -106,7 +106,7 @@
|
||||
# undef CONFIG_USBDEV_TRACE
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SYSTEM_USBMONITOR) && !defined(CONFIG_USBDEV_TRACE)
|
||||
#if !defined(CONFIG_USBMONITOR) && !defined(CONFIG_USBDEV_TRACE)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
||||
# include <nuttx/timers/timer.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -1374,15 +1374,15 @@ USB High-Speed Device
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
NOTE: If USB debug output is also enabled, both outputs will appear on the
|
||||
serial console. However, the debug output will be asynchronous with the
|
||||
@ -1568,10 +1568,10 @@ file1: CONFIG_USBHOST_ISOC_DISABLE=y
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
|
||||
NOTE: If USB debug output is also enabled, both outpus will appear on the
|
||||
serial console. However, the debug output will be asynchronous with the
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -237,7 +237,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#ifndef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifndef CONFIG_USBMONITOR
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -1552,15 +1552,15 @@ USB High-Speed Device
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
NOTE: If USB debug output is also enabled, both outputs will appear on the
|
||||
serial console. However, the debug output will be asynchronous with the
|
||||
@ -1736,10 +1736,10 @@ USB High-Speed Host
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
|
||||
NOTE: If USB debug output is also enabled, both outpus will appear on the
|
||||
serial console. However, the debug output will be asynchronous with the
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -297,7 +297,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#ifndef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifndef CONFIG_USBMONITOR
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -1928,15 +1928,15 @@ USB High-Speed Device
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
NOTE: If USB debug output is also enabled, both outputs will appear on the
|
||||
serial console. However, the debug output will be asynchronous with the
|
||||
@ -2120,10 +2120,10 @@ USB High-Speed Host
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
|
||||
NOTE: If USB debug output is also enabled, both outpus will appear on the
|
||||
serial console. However, the debug output will be asynchronous with the
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -352,7 +352,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#ifndef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifndef CONFIG_USBMONITOR
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -157,7 +157,7 @@
|
||||
# undef CONFIG_USBDEV_TRACE
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SYSTEM_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE)
|
||||
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -166,7 +166,7 @@
|
||||
# undef CONFIG_USBDEV_TRACE
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SYSTEM_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE)
|
||||
#if !defined(CONFIG_USBMONITOR) || !defined(CONFIG_USBDEV_TRACE)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -1305,7 +1305,7 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_USBMSC is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -1291,7 +1291,7 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_USBMSC is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -54,7 +54,7 @@
|
||||
# include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -54,7 +54,7 @@
|
||||
# include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -1253,7 +1253,7 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
CONFIG_SYSTEM_USBMSC=y
|
||||
CONFIG_SYSTEM_USBMSC_NLUNS=1
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1=0
|
||||
|
@ -1236,6 +1236,6 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -1169,6 +1169,6 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=y
|
||||
# CONFIG_SYSTEM_READLINE is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -624,7 +624,7 @@ Where <subdir> is one of the following:
|
||||
infinite loops and deadlocks: Debug output generates USB debug
|
||||
output which generatates USB debug output, etc. If you want USB
|
||||
debug output, you should consider enabling USB trace
|
||||
(CONFIG_USBDEV_TRACE) and perhaps the USB monitor (CONFIG_SYSTEM_USBMONITOR).
|
||||
(CONFIG_USBDEV_TRACE) and perhaps the USB monitor (CONFIG_USBMONITOR).
|
||||
|
||||
See the usbnsh configuration below for more information on configuring
|
||||
USB trace output and the USB monitor.
|
||||
@ -674,16 +674,16 @@ Where <subdir> is one of the following:
|
||||
CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
|
||||
CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
5. By default, this project assumes that you are *NOT* using the DFU
|
||||
bootloader.
|
||||
|
@ -1154,6 +1154,6 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -607,16 +607,16 @@ Where <subdir> is one of the following:
|
||||
CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
|
||||
CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
5. By default, this project assumes that you are *NOT* using the DFU
|
||||
bootloader.
|
||||
|
@ -1154,6 +1154,6 @@ CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -806,15 +806,15 @@ Where <subdir> is one of the following:
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
NOTE: USB debug output also be enabled in this case. Both will appear
|
||||
on the serial SYSLOG output. However, the debug output will be
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -733,7 +733,7 @@ Where <subdir> is one of the following:
|
||||
infinite loops and deadlocks: Debug output generates USB debug
|
||||
output which generatates USB debug output, etc. If you want USB
|
||||
debug output, you should consider enabling USB trace
|
||||
(CONFIG_USBDEV_TRACE) and perhaps the USB monitor (CONFIG_SYSTEM_USBMONITOR).
|
||||
(CONFIG_USBDEV_TRACE) and perhaps the USB monitor (CONFIG_USBMONITOR).
|
||||
|
||||
See the usbnsh configuration below for more information on configuring
|
||||
USB trace output and the USB monitor.
|
||||
|
@ -55,7 +55,7 @@
|
||||
# include <nuttx/mtd/mtd.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -1659,7 +1659,7 @@ Where <subdir> is one of the following:
|
||||
infinite loops and deadlocks: Debug output generates USB debug
|
||||
output which generatates USB debug output, etc. If you want USB
|
||||
debug output, you should consider enabling USB trace
|
||||
(CONFIG_USBDEV_TRACE) and perhaps the USB monitor (CONFIG_SYSTEM_USBMONITOR).
|
||||
(CONFIG_USBDEV_TRACE) and perhaps the USB monitor (CONFIG_USBMONITOR).
|
||||
|
||||
See the usbnsh configuration below for more information on configuring
|
||||
USB trace output and the USB monitor.
|
||||
@ -2002,16 +2002,16 @@ Where <subdir> is one of the following:
|
||||
CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
|
||||
CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
5. By default, this project assumes that you are *NOT* using the DFU
|
||||
bootloader.
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
|
@ -98,7 +98,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -882,15 +882,15 @@ Where <subdir> is one of the following:
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
|
||||
Application Configuration -> System NSH Add-Ons:
|
||||
CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
NOTE: USB debug output also be enabled in this case. Both will appear
|
||||
on the serial SYSLOG output. However, the debug output will be
|
||||
|
@ -51,7 +51,7 @@
|
||||
#include <nuttx/lcd/hd4478ou.h>
|
||||
#include <nuttx/usb/usbhost.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
|
||||
/* Check if we should enable the USB monitor before starting NSH */
|
||||
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
|
||||
# undef NSH_HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
|
@ -956,14 +956,14 @@ CONFIG_READLINE_CMD_HISTORY_LINELEN=80
|
||||
CONFIG_READLINE_CMD_HISTORY_LEN=16
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
CONFIG_SYSTEM_USBMONITOR=y
|
||||
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048
|
||||
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=2
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
|
||||
CONFIG_USBMONITOR=y
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048
|
||||
CONFIG_USBMONITOR_PRIORITY=50
|
||||
CONFIG_USBMONITOR_INTERVAL=2
|
||||
CONFIG_USBMONITOR_TRACEINIT=y
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
@ -515,6 +515,20 @@ if USBHOST
|
||||
source drivers/usbhost/Kconfig
|
||||
endif # USBHOST
|
||||
|
||||
menuconfig USBMONITOR
|
||||
bool "USB Monitor"
|
||||
default n
|
||||
depends on (USBDEV && USBDEV_TRACE) || (USBHOST && USBHOST_TRACE)
|
||||
---help---
|
||||
If USB device tracing (USBDEV_TRACE) AND/OR USB host tracing
|
||||
(USBHOST_TRACE) are enabled then this option will select the USB
|
||||
monitor. The USB monitor is a daemon that will periodically collect
|
||||
the buffered USB trace data and dump it to the SYSLOG device.
|
||||
|
||||
if USBMONITOR
|
||||
source drivers/usbmonitor/Kconfig
|
||||
endif
|
||||
|
||||
menuconfig DRIVERS_WIRELESS
|
||||
bool "Wireless Device Support"
|
||||
default n
|
||||
|
@ -49,4 +49,3 @@ DEPPATH += --dep-path spi
|
||||
VPATH += :spi
|
||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)spi}
|
||||
endif
|
||||
|
||||
|
58
drivers/usbmonitor/Kconfig
Normal file
58
drivers/usbmonitor/Kconfig
Normal file
@ -0,0 +1,58 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
|
||||
config USBMONITOR_STACKSIZE
|
||||
int "USB Monitor daemon stack size"
|
||||
default 2048
|
||||
---help---
|
||||
The stack size to use the the USB monitor daemon. Default: 2048
|
||||
|
||||
config USBMONITOR_PRIORITY
|
||||
int "USB Monitor daemon priority"
|
||||
default 50
|
||||
---help---
|
||||
The priority to use the the USB monitor daemon. Default: 50
|
||||
|
||||
config USBMONITOR_INTERVAL
|
||||
int "USB Monitor dump frequency"
|
||||
default 2
|
||||
---help---
|
||||
The rate in seconds that the USB monitor will wait before dumping
|
||||
the next set of buffered USB trace data. Default: 2 seconds.
|
||||
|
||||
if USBDEV && USBDEV_TRACE
|
||||
|
||||
config USBMONITOR_TRACEINIT
|
||||
bool "Show USB device initialization events"
|
||||
default n
|
||||
---help---
|
||||
Show initialization events
|
||||
|
||||
config USBMONITOR_TRACECLASS
|
||||
bool "Show USB device class driver events"
|
||||
default n
|
||||
---help---
|
||||
Show class driver events
|
||||
|
||||
config USBMONITOR_TRACETRANSFERS
|
||||
bool "Show USB device data transfer events"
|
||||
default n
|
||||
---help---
|
||||
Show data transfer events
|
||||
|
||||
config USBMONITOR_TRACECONTROLLER
|
||||
bool "Show USB device controller events"
|
||||
default n
|
||||
---help---
|
||||
Show controller events
|
||||
|
||||
config USBMONITOR_TRACEINTERRUPTS
|
||||
bool "Show USB device interrupt-related events"
|
||||
default n
|
||||
---help---
|
||||
Show interrupt-related events
|
||||
|
||||
endif # USBDEV && USBDEV_TRACE
|
51
drivers/usbmonitor/Make.defs
Normal file
51
drivers/usbmonitor/Make.defs
Normal file
@ -0,0 +1,51 @@
|
||||
############################################################################
|
||||
# drivers/usbmonitor/Make.defs
|
||||
#
|
||||
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Don't build anything if there is no USB monitor support
|
||||
|
||||
ifeq ($(CONFIG_USBMONITOR),y)
|
||||
|
||||
# Include the USB monitor
|
||||
|
||||
CSRCS += usbmonitor.c
|
||||
|
||||
# Include USB monitor build support
|
||||
|
||||
DEPPATH += --dep-path usbmonitor
|
||||
VPATH += :usbmonitor
|
||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)usbmonitor}
|
||||
|
||||
endif
|
||||
|
264
drivers/usbmonitor/usbmonitor.c
Normal file
264
drivers/usbmonitor/usbmonitor.c
Normal file
@ -0,0 +1,264 @@
|
||||
/****************************************************************************
|
||||
* drivers/usbmonitor/usbmonitor.c
|
||||
*
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/progmem.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/kthread.h>
|
||||
#include <nuttx/usb/usbdev_trace.h>
|
||||
#include <nuttx/usb/usbhost_trace.h>
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_USBMONITOR_STACKSIZE
|
||||
# define CONFIG_USBMONITOR_STACKSIZE 2048
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBMONITOR_PRIORITY
|
||||
# define CONFIG_USBMONITOR_PRIORITY 50
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBMONITOR_INTERVAL
|
||||
# define CONFIG_USBMONITOR_INTERVAL 2
|
||||
#endif
|
||||
|
||||
/* USB device trace selection */
|
||||
|
||||
#ifdef CONFIG_USBDEV_TRACE
|
||||
# ifdef CONFIG_USBMONITOR_TRACEINIT
|
||||
# define TRACE_INIT_BITS (TRACE_INIT_BIT)
|
||||
# else
|
||||
# define TRACE_INIT_BITS (0)
|
||||
# endif
|
||||
|
||||
# define TRACE_ERROR_BITS (TRACE_DEVERROR_BIT|TRACE_CLSERROR_BIT)
|
||||
|
||||
# ifdef CONFIG_USBMONITOR_TRACECLASS
|
||||
# define TRACE_CLASS_BITS (TRACE_CLASS_BIT|TRACE_CLASSAPI_BIT|\
|
||||
TRACE_CLASSSTATE_BIT)
|
||||
# else
|
||||
# define TRACE_CLASS_BITS (0)
|
||||
# endif
|
||||
|
||||
# ifdef CONFIG_USBMONITOR_TRACETRANSFERS
|
||||
# define TRACE_TRANSFER_BITS (TRACE_OUTREQQUEUED_BIT|TRACE_INREQQUEUED_BIT|\
|
||||
TRACE_READ_BIT|TRACE_WRITE_BIT|\
|
||||
TRACE_COMPLETE_BIT)
|
||||
# else
|
||||
# define TRACE_TRANSFER_BITS (0)
|
||||
# endif
|
||||
|
||||
# ifdef CONFIG_USBMONITOR_TRACECONTROLLER
|
||||
# define TRACE_CONTROLLER_BITS (TRACE_EP_BIT|TRACE_DEV_BIT)
|
||||
# else
|
||||
# define TRACE_CONTROLLER_BITS (0)
|
||||
# endif
|
||||
|
||||
# ifdef CONFIG_USBMONITOR_TRACEINTERRUPTS
|
||||
# define TRACE_INTERRUPT_BITS (TRACE_INTENTRY_BIT|TRACE_INTDECODE_BIT|\
|
||||
TRACE_INTEXIT_BIT)
|
||||
# else
|
||||
# define TRACE_INTERRUPT_BITS (0)
|
||||
# endif
|
||||
|
||||
# define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|\
|
||||
TRACE_CLASS_BITS|TRACE_TRANSFER_BITS|\
|
||||
TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
struct usbmon_state_s
|
||||
{
|
||||
volatile bool started;
|
||||
volatile bool stop;
|
||||
pid_t pid;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static struct usbmon_state_s g_usbmonitor;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBDEV_TRACE
|
||||
static int usbtrace_syslog(FAR const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
/* Let vsyslog do the real work */
|
||||
|
||||
va_start(ap, fmt);
|
||||
ret = vsyslog(LOG_INFO, fmt, ap);
|
||||
va_end(ap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int usbmonitor_tracecallback(struct usbtrace_s *trace, void *arg)
|
||||
{
|
||||
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int usbmonitor_daemon(int argc, char **argv)
|
||||
{
|
||||
uinfo("Running: %d\n", g_usbmonitor.pid);
|
||||
|
||||
/* Loop until we detect that there is a request to stop. */
|
||||
|
||||
while (!g_usbmonitor.stop)
|
||||
{
|
||||
sleep(CONFIG_USBMONITOR_INTERVAL);
|
||||
#ifdef CONFIG_USBDEV_TRACE
|
||||
(void)usbtrace_enumerate(usbmonitor_tracecallback, NULL);
|
||||
#endif
|
||||
#ifdef CONFIG_USBHOST_TRACE
|
||||
(void)usbhost_trdump();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Stopped */
|
||||
|
||||
g_usbmonitor.stop = false;
|
||||
g_usbmonitor.started = false;
|
||||
uinfo("Stopped: %d\n", g_usbmonitor.pid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
int usbmonitor_start(int argc, char **argv)
|
||||
{
|
||||
/* Has the monitor already started? */
|
||||
|
||||
sched_lock();
|
||||
if (!g_usbmonitor.started)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* No.. start it now */
|
||||
|
||||
#ifdef CONFIG_USBDEV_TRACE
|
||||
/* First, initialize any USB tracing options that were requested */
|
||||
|
||||
usbtrace_enable(TRACE_BITSET);
|
||||
#endif
|
||||
|
||||
/* Then start the USB monitoring daemon */
|
||||
|
||||
g_usbmonitor.started = true;
|
||||
g_usbmonitor.stop = false;
|
||||
|
||||
ret = kernel_thread("USB Monitor", CONFIG_USBMONITOR_PRIORITY,
|
||||
CONFIG_USBMONITOR_STACKSIZE,
|
||||
(main_t)usbmonitor_daemon,
|
||||
(FAR char * const *)NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
int errcode = errno;
|
||||
uerr("ERROR: Failed to start the USB monitor: %d\n",
|
||||
errcode);
|
||||
UNUSED(errcode);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_usbmonitor.pid = ret;
|
||||
uinfo("Started: %d\n", g_usbmonitor.pid);
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
uinfo("%s: %d\n",
|
||||
g_usbmonitor.stop ? "Stopping" : "Running", g_usbmonitor.pid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbmonitor_stop(int argc, char **argv)
|
||||
{
|
||||
/* Has the monitor already started? */
|
||||
|
||||
if (g_usbmonitor.started)
|
||||
{
|
||||
/* Stop the USB monitor. The next time the monitor wakes up,
|
||||
* it will see the the stop indication and will exist.
|
||||
*/
|
||||
|
||||
uinfo("Stopping: %d\n", g_usbmonitor.pid);
|
||||
g_usbmonitor.stop = true;
|
||||
|
||||
#ifdef CONFIG_USBDEV_TRACE
|
||||
/* We may as well disable tracing since there is no listener */
|
||||
|
||||
usbtrace_enable(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
uinfo("Stopped: %d\n", g_usbmonitor.pid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USBMONITOR */
|
Loading…
Reference in New Issue
Block a user