예제 #1
0
        public override bool SyncOpen()
        {
            bool ret = OpenCDC();

            if (ret)
            {
                SetSyncParams(inEndpoint, outEndpoint);
                asyncMode = false;
                IsOpen    = true;

                // Init Streams
                inputStream  = new SerialInputStream(this);
                outputStream = new SerialOutputStream(this);

                return(true);
            }
            else
            {
                IsOpen = false;
                return(false);
            }
        }
예제 #2
0
        public override bool SyncOpen()
        {
            bool ret = OpenCP2102();

            if (ret)
            {
                // Create Flow control thread but it will only be started if necessary
                CreateFlowControlThread();
                SetSyncParams(inEndpoint, outEndpoint);
                asyncMode = false;
                IsOpen    = true;

                // Init Streams
                inputStream  = new SerialInputStream(this);
                outputStream = new SerialOutputStream(this);

                return(true);
            }
            else
            {
                IsOpen = false;
                return(false);
            }
        }