Git Product home page Git Product logo

comport-library's People

Contributors

cwbudde avatar pierreyager avatar raccoon-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comport-library's Issues

Comport and unpluged USB

Hi, folks.

Do you have an effective way to disconnect the USB cable?

Unfortunately, all solutions from internet do not work.

Regards
Robert

using String Buffer Y lost data after #0 character

String converting lost data after #0 symbol
You can't get #0 from port....

property Buffer: string read FBuffer write FBuffer; <<<<<<<<<<<< Here!

procedure TComDataPacket.RxBuf(Sender: TObject; const Buffer; Count: Integer);
var sa:AnsiString; Str: string;
i:Integer;
begin
SetLength(Str, Count);
SetLength(Sa, Count);
Move(Buffer, Sa[1], Count);
{$IFDEF Unicode}
if Length(sa)>0 then
for i := 1 to Length(sa) do Str[i] := char(Byte(sa[i]));
{$ELSE} Str := sa; {$ENDIF} <<<<<<<<<<<< Here!
AddData(Str);
end;

// add custom data to packet buffer
procedure TComDataPacket.AddData(const Str: string);
begin
if ValidStop then
begin
Buffer := Buffer + Str; <<<<<<<<<<<< Here!
HandleBuffer;
end
else
DoPacket(Str);
end;

Issue with EnumComPorts- Solved

There is an issue while enumerating available comports and access-violation when closing port.
Returned Stringslist contains additional zeros after portname (here 5x with 10.3.2 and Win 8.1)
This may lead into wrong comparison of a list-entry and a default value: e.g. "COM3ooooo" and "COM3".
The evildoer will be DataLen (in RegEnum) that will return always a value of 10 (here in my setup).
Might be a prob by Microsoft ?!

Next prob is: When i use a 'wrong' port name (with zeros) the designated port will open without error.
But if i close the pot, an access violation occured (reading from adress) !
I couldn't find out the reason yet.
Using 'zero-cleaned' port-names everything is fine.

Here is my modified code :

procedure EnumComPorts(Ports: TStrings);
var
KeyHandle: HKEY;
ErrCode, Index: Integer;
ValueName, Data: array[0..256] of char; // string;
ValueLen, DataLen, ValueType : DWORD;
begin
if NOT Assigned(Ports) then exit;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
'HARDWARE\DEVICEMAP\SERIALCOMM',
0,
KEY_READ,
KeyHandle) <> ERROR_SUCCESS) then exit;
try
Index := 0;
repeat
ValueLen := 256;
DataLen := 256;
ErrCode := RegEnumValue(KeyHandle,
Index,
@valuename, // PChar(ValueName),
ValueLen,
nil,
@valuetype,
PByte(@DaTa), // PByte(PChar(Data)),
@DataLen);
if ErrCode = ERROR_SUCCESS then
begin
Ports.Add(Data); // TmpPorts.Add(Data);
Inc(Index);
end;
until (ErrCode <> ERROR_SUCCESS) ;
finally
RegCloseKey(KeyHandle);
end;
end;

Send hex values

Hi!
How can I send hex values to the comport? I've an array of bytes (for example 6 bytes)...Any help?

Never fires any of the OnRx* Events...

I have a Serial Port tracing module (allows me to mimic a loopback).

It shows each character I send:

Comport1.WriteStr('ATZ'#13);

However, all of the OnRx* events - I do a show message for each... even added to your Test\ CPortUTestMainFm - nothing ever fires. Yet, I can open any Windows Terminal program - and when the Port tracing module shows "A", "T", "Z", #13, #10 - the windows terminal programs show: ATZ.

I have tried with Comport v4.11 and your code - neither work. Could someone shed some light - what am I missing??

Delphi 11

Hello Christian,

do you plan to create a release for Delphi 11 Alexandria? Thanks.

Problem when to build CPort for instalation on delphi 10.4

Hi, Guys

I'm getting error [dcc32 Error] CPort.pas(664): E2004 Identifier redeclared: 'System.Types' When i tryng to build CPort_R103R on Delphi 10.4.

I think is happening because line 23 already in use Types declaration. Anyone here already had this problem?

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.