Class SimpleRawRepl
Namespace: Belay.Core
Assembly: Belay.Core.dll
Simple Raw REPL implementation following official MicroPython mpremote patterns. Direct implementation without complex state management or capability detection.
public class SimpleRawRepl : IDisposable
Inheritance
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
This class is designed for use by a single DeviceConnection and is NOT thread-safe. Each DeviceConnection should create and use its own SimpleRawRepl instance exclusively. Concurrent access from multiple threads will result in race conditions and protocol corruption.
The class maintains internal state (inRawRepl, atPrompt, useRawPaste) that tracks the device's protocol state. These state variables must be accessed sequentially to ensure protocol integrity and prevent communication errors.
Constructors
SimpleRawRepl(Stream, ILogger)
Initializes a new instance of the class.
Methods
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EnterRawReplAsync(bool, int, CancellationToken)
Enters raw REPL mode with optional soft reset. Based on official mpremote enter_raw_repl implementation.
ExecuteAsync(string, int, CancellationToken)
Executes Python code and returns the result. Based on official mpremote exec_raw implementation.
ExitRawReplAsync(CancellationToken)
Exits raw REPL mode to friendly REPL. Based on official mpremote exit_raw_repl implementation.