using System; using System.IO; using System.Text; using System.IO.Ports; using System.Threading; using Microsoft.SPOT; namespace CPF { class BTConsoleDebug : BTConsole { private static StructQueue.qStruct qS = new StructQueue.qStruct(); public override void OpenConsolePort() { qS.byteArray = new byte[StructQueue.byteArrayWidth]; } public override void detachEventHandler() { //Detach the "regular" console port event handler so the XModem class attach its event handler } private static Object BTLock = new Object(); private static StringBuilder sbWaiting = new StringBuilder("Can't upload data file in Debug Mode"); public override void uploadDataFile(StringBuilder uploadFileName) { Debug.Print("Can't upload data file in Debug Mode"); qS.timeStamp = DateTime.Now; qS.state = Program.CPFState; qS.qRecordType = StructQueue.QRecordType.BTConsole; Array.Copy(UTF8Encoding.UTF8.GetBytes(sbWaiting.ToString()), qS.byteArray, sbWaiting.Length); lock (BTLock) { Program.sQueue.Enqueue(qS); } } public override void SendLine(StringBuilder sbLineToSend) { if (BTSend) { Debug.Print(sbLineToSend.ToString()); } } } }