Author Topic: Wild-cards in PacketEnd  (Read 1902 times)

lars.jagdahl

  • Newbie
  • *
  • Posts: 1
    • View Profile
Wild-cards in PacketEnd
« on: September 10, 2009, 11:45:23 am »
Can I use wild-cards in property PacketEnd for the DataPacket? My packet ends with two bytes; ETX (0x03) and a checksum.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Wild-cards in PacketEnd
« Reply #1 on: September 12, 2009, 02:25:05 pm »
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:

Code: [Select]
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.