Paulo Costa wrote 20 lines
On 02/11/2010 07:20, Bo Berglund wrote:
> I am working on a serial communications class and I have been adviced
> to use the 5dpo component.
>
> But when I am writing the initialization part of my class I discovered
> that there is a field value defined and used that does not get an
> initialization value...
?
From the source code:
constructor TSdpoSerial.Create(AOwner: TComponent);
begin
inherited;
...
FHardflow:=false;
FSoftflow:=false;
FFlowControl:=fcNone;
...
end;
The top line of my file reads:
{ SdpoSerial v0.1.3
Here is the constructor from my file:
constructor TSdpoSerial.Create(AOwner: TComponent);
begin
inherited;
//FHandle:=-1;
ReadThread:=nil;
FSynSer:=TBlockSerial.Create;
FSynSer.LinuxLock:=false;
{$IFDEF LINUX}
FDevice:='/dev/ttyS0';
{$ELSE}
FDevice:='COM1';
{$ENDIF}
// FBaudRate:=br115200;
end;
As you can see there is no sig of any flow control setting. And I did not put in the comments...
Show quoted text 15 lines
> The flowcontrol is set by FSoftflow and FHardflow but there is no
> place in the 5dpo code where these fields are initialized to some
> valid value.
> And they are not exposed in a setter or getter either.
>
> Why?
??
property FlowControl: TFlowControl read FFlowControl write
SetFlowControl;
FSoftflow and FHardflow are set/reset by flowcontrol and it is exposed.
Again here is from my source file:
published
property Active: boolean read FActive write SetActive;
property BaudRate: TBaudRate read FBaudRate write SetBaudRate; //
default br115200;
property DataBits: TDataBits read FDataBits write SetDataBits;
property Parity: TParity read FParity write SetParity;
// property FlowControl: TFlowControl read FFlowControl write
SetFlowControl;
property StopBits: TStopBits read FStopBits write SetStopBits;
property SynSer: TBlockSerial read FSynSer write FSynSer;
property Device: string read FDevice write FDevice;
property OnRxData: TNotifyEvent read FOnRxData write FOnRxData;
end;
As you can see the property FlowControl has been commented out...
The file date is 2010-03-30 and it comes from a download I did some weeks ago. I am trying hard to find it right now...
Bo Berglund
Developer in Sweden