Re: Unsupported device message, Compliance C.2, part 4

Aras Vaichas <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Aras Vaichas wrote:
> Alan Stern wrote:
>>> "The USB-IF enforces a "no silent failure" rule. This means that an 
>>> implementation of USB must not appear broken to the consumer. In configurations 
>>> where the consumer's expectations are not met, either the peripheral or host 
>>> must provide appropriate and useful feedback to the consumer regarding the 
>>> problem."
>> In an embedded host, the system log probably isn't accessible to the
>> user.  Error messages would have to appear somewhere else -- although
>> just where would depend on the particular system.
> 
> I was just looking at sysfs and I noticed that when a known USB device is 
> plugged in that a "product" file is created in 
> /sys/devices/platform/at91_ohci/usb1/1-1/
> 
> An unknown device will not cause this file to be created, therefore that sounds 
> like a good signalling mechanism to me. This is something that I can work with.

Sorry about answering my own questions but we are in different timezones and I 
like to document the process.  :)

Here is a prototype script that creates a log message when an unknown USB 
device is inserted into a particular USB host socket. It could form the basis 
for a smarter system that can handle multiple host sockets and hubs.

---- SNIP ----

#!/bin/sh

BASE=/sys/devices/platform/at91_ohci/usb1/1-1

indicated=0
while [ 1 ]; do
     if [ $indicated == 0 ]; then
        if [ -d "$BASE" ]; then
            indicated=1
             if [ -f "$BASE/product" ]; then
                 logger "A known USB device has been inserted."
             else
                 logger "An unknown USB device has been inserted."
             fi
         fi
     else
         if [ ! -d "$BASE" ]; then
             indicated=0
         fi
     fi
     sleep 1
done





Aras

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.