feat: 添加I2C与Camera初始化的支持

This commit is contained in:
2025-07-08 21:21:31 +08:00
parent dd7efe3c84
commit 1af3fa3a8f
4 changed files with 326 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
using System.Net;
using DotNext;
namespace Peripherals.OscilloscopeClient;
static class OscilloscopeAddr
{
public const UInt32 Base = 0x0000_0000;
}
class Oscilloscope
{
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
readonly int timeout = 2000;
readonly int port;
readonly string address;
private IPEndPoint ep;
/// <summary>
/// 初始化示波器客户端
/// </summary>
/// <param name="address">示波器设备IP地址</param>
/// <param name="port">示波器设备端口</param>
/// <param name="timeout">超时时间(毫秒)</param>
public Oscilloscope(string address, int port, int timeout = 2000)
{
if (timeout < 0)
throw new ArgumentException("Timeout couldn't be negative", nameof(timeout));
this.address = address;
this.port = port;
this.ep = new IPEndPoint(IPAddress.Parse(address), port);
this.timeout = timeout;
}
}