mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 12:30:55 +00:00
sadsdf
This commit is contained in:
1 parent
862c335937
commit
d1e5906b7a
32 files changed
+550
-1756
No files matched your search
@@ -25,22 +25,19 @@ namespace CartriX.Api.Controllers
|
||||
return NotFound();
|
||||
}
|
||||
var endpoint = new IPEndPoint(IPAddress.Parse(printer!.IpAddress!), 161);
|
||||
|
||||
// community string (как "пароль" в SNMP v2c)
|
||||
var community = new OctetString("public");
|
||||
|
||||
// OID sysName.0
|
||||
var oid = new ObjectIdentifier(printer.PrinterUsedPagesOID!);
|
||||
|
||||
var result = Messenger.Get(
|
||||
VersionCode.V2,
|
||||
endpoint,
|
||||
community,
|
||||
new List<Variable> { new Variable(oid) },
|
||||
timeout: 2000
|
||||
var result = Messenger.Get(VersionCode.V2, endpoint, community,
|
||||
new List<Variable> { new Variable(oid) }, timeout: 2000
|
||||
);
|
||||
|
||||
return Ok($"{result[0].Data}");
|
||||
}
|
||||
//[HttpPost]
|
||||
//public IActionResult AddPrinter([FromBody] CreateAddPrinterRequest PrinterDto)
|
||||
//{
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user