Esempio n. 1
0
        private void onDataReceivedEvent(object sender, DataEventArgs d)
        {
            BTDataReceivedEventHandler dataReceived = this.onDataReceived;

            if (dataReceived == null)
                return;
            dataReceived(this, d);
        }
Esempio n. 2
0
        private void theThread()
        {
            System.Diagnostics.Debug.WriteLine("theThread: started...");
            try
            {
                string s = "";
                char[] buf = new char[1];
                int iCount = 0;
                DataEventArgs args = new DataEventArgs();
                while (!_bStopThread && _sr!=null)
                {
                    iCount = _sr.Read(buf, 0, 1);
                    if (iCount != 0)
                    {
                        s = buf.ToString();
                        args._string = s;
                        onDataReceivedEvent(this, args);
                    }
                    Thread.Sleep(1000);
                }

            }
            catch (ThreadAbortException tax)
            {
                System.Diagnostics.Debug.WriteLine("theThread: ThreadAbortException=" + tax.Message);
                _bStopThread = true;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("theThread: Exception=" + ex.Message);
            }
            System.Diagnostics.Debug.WriteLine("theThread: ...ended");
        }
Esempio n. 3
0
 private void OnDataReceived(object sender, DataEventArgs da){
 }
Esempio n. 4
0
 void _thread_BTDataReceived(object sender, DataEventArgs d)
 {
     throw new NotImplementedException();
 }