• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
November 23, 2024, 06:50:15 am

News:

SMF - Just Installed!


Wild-cards in PacketEnd

Started by lars.jagdahl, September 10, 2009, 08:45:23 am

Previous topic - Next topic

lars.jagdahl

Can I use wild-cards in property PacketEnd for the DataPacket? My packet ends with two bytes; ETX (0x03) and a checksum.

Roman Novgorodov

Hello

Current version does not support wild-cards in PacketEnd and PacketBegin properties.

But you can resolve your situation by using OnPacketLength event of TnrDataPacket item.
You can add a new packet with following handler:


procedure TForm1.nrDataProcessor1DataPackets6PacketLength(
  Packet: TnrDataPacket; chData: Byte; var IsHandled: Boolean);
begin
  if chData = $03 then begin
    Packet.PacketLength := Packet.DataLength + 1;
    IsHandled := True;
  end;
end;


And all packets ******$03* will be detected.

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.