Changeset 415 for PinConnection
- Timestamp:
- Aug 20, 2012, 8:32:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PinConnection/USerialPort.pas
r409 r415 8 8 Classes, SysUtils, SynaSer, StdCtrls, Dialogs, UCommon, UThreading, 9 9 DateUtils, FileUtil, SpecializedList; 10 11 const 12 MaxPort = 255; 10 13 11 14 type … … 180 183 try 181 184 TestPort := TSerialPort.Create; 182 for I := 0 to Strings.Count - 1 do185 for I := 0 to MaxPort - 1 do 183 186 with TestPort do begin 184 Name := Strings[I];187 Name := 'COM' + IntToStr(I); 185 188 Active := True; 186 189 if Active then begin 187 Strings.AddObject(Name, TObject(I));190 Strings.AddObject(Name, nil); 188 191 end; 189 192 Active := False; … … 192 195 TestPort.Free; 193 196 end else begin 194 for I := 1 to 255do197 for I := 1 to MaxPort do 195 198 Strings.AddObject('COM' + IntToStr(I), nil); 196 199 end; 197 200 {$ENDIF} 198 201 {$IFDEF Linux} 199 if Check then begin 202 if Check then 203 try 200 204 Files := FindAllFiles('/dev', 'tty*', False); 201 205 Strings.Assign(Files); 206 finally 202 207 Files.Free; 203 208 end else begin
Note:
See TracChangeset
for help on using the changeset viewer.