Witam,
Korzystam z delphi XE5, Indy 10;
Mam problem z wysłaniem komunikatu do urządzenia;
z pliku MIB:
atsConfigPreferredSource OBJECT-TYPE
SYNTAX INTEGER {
sourceA(1),
sourceB(2),
none(3)
}
ACCESS read-write
STATUS mandatory
DESCRIPTION
"This variable returns the preferred source of power when both sources are OK."
::= { atsConfig 2 }
Tak pobieram informacje z danego adresu i to śmiga ładnie:
procedure TForm9.GetClick(Sender: TObject);
var
Idx: integer;
begin
SNMP := TidSNMP.Create(nil);
idx:=0;
try
SNMP.Query.Host := '172.17.5.72';
SNMP.Query.Community := 'public';
SNMP.Query.PDUType := PDUGetRequest;
SNMP.Query.MIBAdd('1.3.6.1.4.1.318.1.1.8.4.2.0','');
if SNMP.SendQuery then
begin
for Idx := 0 to Snmp.Reply.ValueCount - 1 do
begin
showmessage(SNMP.Reply.Value[Idx]);
end;
end;
finally
SNMP.Free;
end;
end;
ale jak chce cos wysłać:
procedure TForm9.SendClick(Sender: TObject);
var
idx : integer;
begin
SNMP := TIdSNMP.Create(nil);
idx := 0;
try
SNMP.Query.Host := '172.17.5.72';
SNMP.Query.Community := 'private';
SNMP.Query.PDUType := PDUSetRequest;
SNMP.Query.MIBAdd('1.3.6.1.4.1.318.1.1.8.4.2.0','2',ASN1_INT);
if SNMP.SendQuery then
begin
for Idx := 0 to Snmp.Reply.ValueCount - 1 do
begin
showmessage(SNMP.Reply.Value[Idx]);
end;
end;
finally
SNMP.Free;
end;
end;
to mi wyskakuje error :
First chance exception at $772BC42D. Exception class EOSError with message
'System Error. Code: 123.
Nazwa pliku, nazwa katalogu lub składnia etykiety woluminu jest niepoprawna'.
Process APC.exe (3228)
Jakby ktoś mógł mnie naprowadzić co robię żle byłbym wdzięczny;
dodanie znaczników <code> i <code class="cpp"> - furious programming