public SerialComm(SerialPort obj_serial) : this() { if (obj_serial == null) { Debug.WriteLine("시리얼 포트 초기화 오류"); throw new ArgumentNullException("시리얼 포트 초기화 오류"); } else { serial_port = obj_serial; rxq = new Queue_buffer <byte[]>(); serial_port.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serial_DataReceived_callback); } }
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()); }