add jtag get id code api

This commit is contained in:
2025-04-07 21:56:30 +08:00
parent 292c73e757
commit 93add0c315
6 changed files with 300 additions and 29 deletions

View File

@@ -49,19 +49,43 @@ namespace WebProtocol
/// <example> 0x10_00_00_00 </example>
public UInt32 address;
/// <summary>
/// Convert to Json String
/// </summary>
/// <returns> Json String </returns>
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}
/// <summary> Package Options which to receive from boards </summary>
public struct RecvPackOptions
{
/// <summary>
/// Task ID
/// </summary>
public byte commandID;
/// <summary>
/// Whether is succeed to finish command
/// </summary>
public bool isSuccess;
public byte[] data;
/// <summary>
/// Return Data
/// </summary>
public byte[]? data;
/// <summary>
/// Convert to Json String
/// </summary>
/// <returns> Json String </returns>
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}
/// <summary> Package which send address to write </summary>
public struct SendAddrPackage
{
readonly byte sign = (byte)PackSign.SendAddr;
@@ -227,6 +251,7 @@ namespace WebProtocol
RecvPackOptions opts;
opts.commandID = commandID;
opts.isSuccess = Convert.ToBoolean((resp >> 1) == 0b01 ? true : false);
opts.data = null;
return opts;
}