// Enter VSDebug mode. public static void VSDebug(int vsDebugPort) { // Create an instance of the TCP socket send/receiver class and // starts it receiving. if (vsDebugPort == 0) { Console.WriteLine($"With '--VSDebugPort' not found. Assuming Visual Studio 2019 with port {DefaultVS2019DebugPort}"); vsDebugPort = DefaultVS2019DebugPort; } debuggingServer = new DebuggingServer(vsDebugPort); debuggingServer.StartListening(); }
// Enter StartDebugging mode. public static async Task StartDebugging(MeadowSerialDevice meadow, int vsDebugPort) { // Tell meadow to start it's debugging server, after restarting. _meadowRequestType = HcomMeadowRequestType.HCOM_MDOW_REQUEST_MONO_START_DBG_SESSION; await new SendTargetData(meadow).SendSimpleCommand(_meadowRequestType); // The previous command caused Meadow to restart. Therefore, we must reestablish // Meadow communication. meadow.AttemptToReconnectToMeadow(); // Create an instance of the TCP socket send/receiver class and // start it receiving. if (vsDebugPort == 0) { Console.WriteLine($"Without '--VSDebugPort' being specified, will assume Visual Studio 2019 using default port {DefaultVS2019DebugPort}"); vsDebugPort = DefaultVS2019DebugPort; } // Start the local Meadow.CLI debugging server debuggingServer = new DebuggingServer(vsDebugPort); debuggingServer.StartListening(meadow); }