Ignore:
Timestamp:
Aug 20, 2012, 2:45:39 PM (12 years ago)
Author:
chronos
Message:
  • Added: TDeviceConnector in PinConnection package for generalized routing serial data to various TCommNode objects.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • PinConnection/UCommTelnet.pas

    r414 r416  
    5757    ServerChecked: Boolean;
    5858    SupportedByServer: Boolean;
     59    procedure Assign(Source: TTelnetOption); virtual;
    5960    function CheckOption: Boolean;
    6061    procedure SendCommand(Request, Response: TListByte);
     
    7879    procedure ReadResponse(Response: TListByte);
    7980    function ResponseCount: Integer;
     81  protected
     82    procedure AssignTo(Dest: TPersistent); override;
    8083  public
    8184    Options: TListObject;
     
    9295    procedure SendSubCommand(OptionCode: TTelnetCommand; Request, Response: TListByte);
    9396    procedure SendCommand(Code: TTelnetCode; Request, Response: TListByte);
     97    procedure Purge;
    9498    constructor Create(AOwner: TComponent); override;
    9599    destructor Destroy; override;
     
    114118  if FActive = AValue then Exit;
    115119  FActive := AValue;
     120end;
     121
     122procedure TTelnetOption.Assign(Source: TTelnetOption);
     123begin
     124  SupportedByServer := Source.SupportedByServer;
     125  ServerChecked := Source.ServerChecked;
     126  Code := Source.Code;
     127  FOnRequest := Source.FOnRequest;
     128  Active := Source.FActive;
    116129end;
    117130
     
    306319end;
    307320
     321procedure TCommTelnet.AssignTo(Dest: TPersistent);
     322var
     323  I: Integer;
     324begin
     325  if Dest is TCommTelnet then begin
     326    TCommTelnet(Dest).Timeout := Timeout;
     327    TCommTelnet(Dest).PortType := PortType;
     328    TCommTelnet(Dest).ErrorCount := ErrorCount;
     329    TCommTelnet(Dest).OptionsNegotationEnable := OptionsNegotationEnable;
     330    for I := 0 to Options.Count - 1 do begin
     331      TTelnetOption(TCommTelnet(Dest).Options[I]).Assign(TTelnetOption(Options[I]));
     332      TTelnetOption(TCommTelnet(Dest).Options[I]).Telnet := TCommTelnet(Dest);
     333    end;
     334  end else inherited;
     335end;
     336
    308337procedure TCommTelnet.Register(Option: TTelnetOption);
    309338begin
     
    399428end;
    400429
     430procedure TCommTelnet.Purge;
     431begin
     432  FState := tsNormal;
     433  FResponses.Clear;
     434end;
     435
    401436constructor TCommTelnet.Create(AOwner: TComponent);
    402437begin
Note: See TracChangeset for help on using the changeset viewer.