unit ami_management; {$mode objfpc}{$H+} interface uses Classes, SysUtils, appprops_bom, XMLCfg, error_console ; {: Sets the port that proxy will listen on. } procedure SetProxyPort(APort: string); {: Sets the Host and Port numbers to connect to AMI.} procedure SetAMIConnect(AHost, APort, AUserName, ASecret: string); implementation procedure SetProxyPort(APort: string); var Config: TXMLConfig; I: integer; begin // test for numeric try i := StrToInt(APort); except on e: exception do begin WriteOutError('Value supplied is not integer'); exit; end; end; Config:= gAppXMLConfig('amiproxy.xml'); try Config.SetValue('clientproxy/port', APort); finally Config.free; end; end; procedure SetAMIConnect(AHost, APort, AUserName, ASecret: string); var Config: TXMLConfig; I: integer; begin // test for numeric try i := StrToInt(APort); except on e: exception do begin WriteOutError('Value supplied is not integer'); exit; end; end; Config:= gAppXMLConfig('amiproxy.xml'); try Config.SetValue('ami/host', AHost); Config.SetValue('ami/port', APort); Config.SetValue('ami/username', AUserName); Config.SetValue('ami/secret', ASecret); finally Config.free; end; end; end.