当前的情况是一方面我有一个系统,其中我们有相机适配器(我们开发),它可以帮助我们将相机集成到系统中。另一方面,我们有一个相机模拟器。
在我的相机适配器中,为了获取UpTime相机的电流,我发送了一个SNMP Get带有正确 Oid 的命令system UpTime。
在我的适配器中,我使用的是SnmpSharpNet library.
public static void GetSystemUptime(string host, out TimeSpan? uptime)
{
   SimpleSnmp snmp = new SimpleSnmp();
   snmp.PeerIP = IPAddress.Parse(host);
   Oid oid = new Oid(SnmpOid.SYS_UPTIME);
   Dictionary<Oid, AsnType> dict = snmp.Get(SnmpVersion.Ver1, new[] { oid.ToString()});
   AsnType asnType;
   if (dict == null || dict.TryGetValue(oid, out asnType) == false || asnType == null || asnType.GetType() != typeof(TimeTicks))
   {
      uptime = null;
      return;
   }
   uptime = (TimeSpan)(asnType as TimeTicks);
}
但现在,我正在研究实际模拟相机的相机模拟器。所以我现在需要制作SNMP Agent. 我似乎无法找到有关如何Get在 SNMP 代理中处理命令的信息,因此我可以在后面回复正确的信息。
任何人都可以将我链接到相关信息或指导我完成整个过程。
坦克,
拍