From e4ba0dee6eb1a6129346437da93778abcef70a7a Mon Sep 17 00:00:00 2001 From: josesimoes Date: Wed, 20 Mar 2024 22:41:16 +0000 Subject: [PATCH] Add PrepareForSend to deal with "no data" operations --- .../WireProtocol/Commands.cs | 7 +++++++ .../WireProtocol/Engine.cs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Commands.cs b/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Commands.cs index e4a89be..cf92de9 100644 --- a/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Commands.cs +++ b/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Commands.cs @@ -643,6 +643,13 @@ public override bool PrepareForSend( return true; } + internal void PrepareForSend() + { + // add the file name to the data property buffer + Data = Encoding.UTF8.GetBytes(FileName); + NameLength = (uint)FileName.Length; + } + ////////////////////////////////////////////////////////////////////////////////////// // !!! KEEP IN SYNC WITH typedef enum Monitor_StorageOperation (in native code) !!! // ////////////////////////////////////////////////////////////////////////////////////// diff --git a/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Engine.cs b/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Engine.cs index d35e24e..b779123 100644 --- a/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Engine.cs +++ b/nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Engine.cs @@ -4494,6 +4494,8 @@ public StorageOperationErrorCode DeleteStorageFile(string fileName) Commands.Monitor_StorageOperation.StorageOperation.Delete, fileName); + storop.PrepareForSend(); + IncomingMessage reply = PerformSyncRequest( Commands.c_Monitor_StorageOperation, 0,