Exemple #1
0
        private bool NotifyFilter(UsbPcapRecordParser.PacketInfo info)
        {
            var enable = false;

            switch ((UsbPcapRecordParser.UrbFunctionType)info.UsbPcapHeader.transfer) {
                case UsbPcapRecordParser.UrbFunctionType.Isochronous:
                {
                    enable = prop_.Filter_IsochronousTransfer.Value;
                }
                    break;

                case UsbPcapRecordParser.UrbFunctionType.Interrupt:
                {
                    enable = prop_.Filter_InterruptTransfer.Value;
                }
                    break;

                case UsbPcapRecordParser.UrbFunctionType.Control:
                {
                    enable = prop_.Filter_ControlTransfer.Value;
                }
                    break;

                case UsbPcapRecordParser.UrbFunctionType.Bulk:
                {
                    enable = prop_.Filter_BulkTransfer.Value;
                }
                    break;
            }

            return (enable);
        }
Exemple #2
0
        private void NotifyExec(UsbPcapRecordParser.PacketInfo info)
        {
            var info_text = new StringBuilder("");

            /* Device ID */
            if (prop_.InfoOut_UsbDeviceID.Value) {
                info_text.AppendFormat("DEV={0:X4} ", info.UsbPcapHeader.device);
            }

            /* End Point */
            if (prop_.InfoOut_EndPoint.Value) {
                info_text.AppendFormat("EP={0:X} ", info.UsbPcapHeader.endpoint & 0x7F);
            }

            /* I/O Request Packet ID */
            if (prop_.InfoOut_IrpID.Value) {
                info_text.AppendFormat("IrpID={0:X8} ", info.UsbPcapHeader.irpId);
            }

            /* Function Type */
            if (prop_.InfoOut_FunctionType.Value) {
                info_text.Append(((UsbPcapRecordParser.UrbFunctionType)info.UsbPcapHeader.transfer).ToString());

                if (prop_.InfoOut_FunctionParam.Value) {
                    /* Function Parameter */
                    switch ((UsbPcapRecordParser.UrbFunctionType)info.UsbPcapHeader.transfer) {
                        case UsbPcapRecordParser.UrbFunctionType.Isochronous:
                        {
                        }
                            break;

                        case UsbPcapRecordParser.UrbFunctionType.Interrupt:
                        {
                        }
                            break;

                        case UsbPcapRecordParser.UrbFunctionType.Control:
                        {
                            info_text.AppendFormat("-{0}", ((UsbPcapRecordParser.UsbPcapControlStage)info.UsbPcapHeader.control.stage).ToString());
                        }
                            break;

                        case UsbPcapRecordParser.UrbFunctionType.Bulk:
                        {
                        }
                            break;
                    }
                }
            }

            if (info.UsbPcapHeader.info == 0) {
                NotifySendComplete(info.PcapHeader.GetDateTime(), info_text.ToString(), "", "", info.Data);
            } else {
                NotifyRecvComplete(info.PcapHeader.GetDateTime(), info_text.ToString(), "", "", info.Data);
            }
        }