Server: finish jtag controller; Web: finish sibebar animation

This commit is contained in:
2025-04-05 19:41:56 +08:00
parent 342a5a2436
commit 20d4fa12d8
15 changed files with 336 additions and 168 deletions

View File

@@ -59,6 +59,7 @@ namespace WebProtocol
{
public byte commandID;
public bool isSuccess;
public byte[] data;
}
public struct SendAddrPackage
@@ -184,13 +185,27 @@ namespace WebProtocol
this.bodyData = bodyData;
}
public RecvPackOptions Options()
public RecvPackOptions Options
{
RecvPackOptions opts;
opts.commandID = commandID;
opts.isSuccess = Convert.ToBoolean((resp >> 1) == 0b01 ? true : false);
get
{
RecvPackOptions opts;
opts.commandID = commandID;
opts.isSuccess = Convert.ToBoolean((resp >> 1) == 0b01 ? true : false);
opts.data = bodyData;
return opts;
return opts;
}
}
public static Result<RecvDataPackage> FromBytes(byte[] bytes)
{
if (bytes[0] != (byte)PackSign.RecvData)
throw new ArgumentException(
"The sign of bytes is not RecvData Package!",
nameof(bytes)
);
return new RecvDataPackage(bytes[1], bytes[2], bytes[4..]);
}
}