Beispiel #1
0
        /// <summary>
        /// serial data receive
        /// </summary>
        /// <returns>수신된 데이터</returns>
        public byte[] Receive()
        {
            List <byte> array = new List <byte>();

            byte[] read_bf;

            while (rxq.qout(out read_bf))
            {
                array.AddRange(read_bf);
            }

            return(array.ToArray());
        }
        public void Test()
        {
            Queue_buffer a = new Queue_buffer();

            a.qin(0x31);
            a.qin(0x32);
            a.qin(0x33);

            Console.WriteLine(a.ToString());
            Console.WriteLine(a.qsize());

            byte[] bf = new byte[a.qsize()];

            int    len = a.qout(bf, a.qsize());
            string b   = System.Text.Encoding.UTF8.GetString(bf, 0, len);

            Console.WriteLine(b);
            Console.WriteLine(a.qsize());
        }