mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
This commit is contained in:
parent
7a25468505
commit
dc7d0dc66b
3 changed files with 13 additions and 6 deletions
|
|
@ -8,15 +8,15 @@ using System.Text;
|
|||
namespace Cosmos.Debug.VSDebugEngine {
|
||||
|
||||
public class DebugWindows {
|
||||
|
||||
|
||||
public static void Test(string aData) {
|
||||
using (var xPipe = new NamedPipeClientStream(".", "CosmosDebug", PipeDirection.Out)) {
|
||||
// The connect function will indefinately wait for the pipe to become available
|
||||
// If that is not acceptable specify a maximum waiting time (in ms)
|
||||
using (var xPipe = new NamedPipeClientStream(".", "CosmosDebugWindows", PipeDirection.Out)) {
|
||||
xPipe.Connect();
|
||||
using (var xWriter = new StreamWriter(xPipe)) {
|
||||
xWriter.WriteLine(aData);
|
||||
}
|
||||
xPipe.Flush();
|
||||
xPipe.WaitForPipeDrain();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,6 +139,9 @@ namespace Cosmos.Debug.VSDebugEngine
|
|||
var eventObject = new AD7BreakpointEvent(boundBreakpointsEnum);
|
||||
var ad7Thread = (AD7Thread)thread;
|
||||
Send(eventObject, AD7BreakpointEvent.IID, ad7Thread);
|
||||
// We catch and resend data rather than using a second serial port because
|
||||
// while this would work fine in a VM, it puts extra requirements on the setup
|
||||
// when real hardware is used.
|
||||
DebugWindows.Test("Test");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,16 @@ using System.Windows.Threading;
|
|||
|
||||
namespace Cosmos.VS.Debug {
|
||||
public partial class MainWindow : Window {
|
||||
|
||||
public MainWindow() {
|
||||
InitializeComponent();
|
||||
|
||||
var xServerThread = new Thread(ThreadStartServer);
|
||||
xServerThread.Start();
|
||||
}
|
||||
|
||||
public void ThreadStartClient(object obj) {
|
||||
using (var xPipe = new NamedPipeServerStream("CosmosDebug", PipeDirection.In)) {
|
||||
public void ThreadStartServer() {
|
||||
using (var xPipe = new NamedPipeServerStream("CosmosDebugWindows", PipeDirection.In)) {
|
||||
xPipe.WaitForConnection();
|
||||
using (var xReader = new StreamReader(xPipe)) {
|
||||
string xLine = xReader.ReadLine();
|
||||
|
|
|
|||
Loading…
Reference in a new issue