as the usbmon.txt provided a perl script to receive the input. Do you talking about the following function(from usbmon.txt) class ParsedLine { int data_len; /* Available length of data */ byte data[]; void parseData(StringTokenizer st) { What is String Tokenizer st. ? Is this from /sys/kernel/debug/usbmon/*t file? int availwords = st.countTokens(); data = "" byte[availwords * 4]; data_len = 0; while (st.hasMoreTokens()) { String data_str = st.nextToken(); int len = data_str.length() / 2; int i; int b; // byte is signed, apparently?! XXX for (i = 0; i < len; i++) { // data[data_len] = Byte.parseByte( // data_str.substring(i*2, i*2 + 2), // 16); b = Integer.parseInt( data_str.substring(i*2, i*2 + 2), 16); if (b >= 128) b *= -1; data[data_len] = (byte) b; data_len++; } } } } Could you please provide more description for this function? Viz what are inputs and outputs. ....receive the input....which if the USB is the network hardware...then the incoming data is TCP/IP....ARP and all sorts of that structures....correct? I did not get exactly what this mean? do please elaborate it. Thanks & Regards, Ravikumar Peter Teoh wrote:
|