internal async Task streamHandler(List <YPktStreamHead> streams)
        {
            foreach (YPktStreamHead s in streams)
            {
                uint streamType = s.StreamType;
                switch (streamType)
                {
                case YGenericHub.YSTREAM_NOTICE:
                case YGenericHub.YSTREAM_NOTICE_V2:
                    imm_handleNotifcation(s);
                    break;

                case YGenericHub.YSTREAM_TCP_CLOSE:
                case YGenericHub.YSTREAM_TCP:
                    if (_devState != DevState.StreamReadyReceived || _currentRequest == null)
                    {
                        continue;
                    }

                    _currentRequest.imm_AddIncommingData(s);
                    if (streamType == YGenericHub.YSTREAM_TCP_CLOSE)
                    {
                        // construct a HID output report to send to the device
                        HidOutputReport outReport = Hid.CreateOutputReport();
                        YUSBPkt.imm_FormatTCP(outReport, null, 0, true);
                        // Send the output report asynchronously
                        var u = await Hid.SendOutputReportAsync(outReport);

                        if (u != 65)
                        {
                            _devState = DevState.IOError;
                            _watcher.imm_removeUsableDevice(this);
                            return;
                        }

                        _currentRequest.imm_Close();
                    }

                    break;

                case YGenericHub.YSTREAM_EMPTY:
                    break;

                case YGenericHub.YSTREAM_REPORT:
                    if (_devState == DevState.StreamReadyReceived)
                    {
                        imm_handleTimedNotification(s);
                    }

                    break;

                case YGenericHub.YSTREAM_REPORT_V2:
                    if (_devState == DevState.StreamReadyReceived)
                    {
                        handleTimedNotificationV2(s);
                    }

                    break;

                default:
                    _yctx._Log("drop unknown ystream:" + s);
                    break;
                }
            }
        }