Skip to content

Commit

Permalink
V1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
h-elsner authored Jan 30, 2025
1 parent 7bb287e commit e0375ca
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scr/YTHtool_de.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ resourcestring {deutsch}
capClose='Close';
capSaveGUItext='&Save text';
hntSaveGUItext='Save the text in the messages-window to a text file.';
capDeleteGUItext='&Text löschen';
hntDeleteGUItext='Die Message Liste leeren.';
capCopySerial='Copy Vehicle ID';
hntCopySerial='Copy Vehicle ID (serial number) to clipboard.';

Expand Down
2 changes: 2 additions & 0 deletions scr/YTHtool_en.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ resourcestring {english}
capClose='Close';
capSaveGUItext='&Save text';
hntSaveGUItext='Save the text in the messages-window to a text file.';
capDeleteGUItext='&Delete text';
hntDeleteGUItext='Empty the text message list.';
capCopySerial='Copy Vehicle ID';
hntCopySerial='Copy Vehicle ID (serial number) to clipboard.';

Expand Down
56 changes: 56 additions & 0 deletions scr/msg57_public.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{********************************************************}
{ }
{ Common functions and definitions }
{ }
{ Copyright (c) 2025 Helmut Elsner }
{ }
{ Compiler: FPC 3.2.3 / Lazarus 3.7 }
{ }
{ Pascal programmers tend to plan ahead, they think }
{ before they type. We type a lot because of Pascal }
{ verboseness, but usually our code is right from the }
{ start. We end up typing less because we fix less bugs. }
{ [Jorge Aldo G. de F. Junior] }
{********************************************************}

(*
This source is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This code is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
A copy of the GNU General Public License is available on the World Wide Web
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
Boston, MA 02110-1335, USA.
*******************************************************************************)

unit msg57;

{$mode objfpc}{$H+}

interface

uses
mav_def;

procedure CreateMsg57(var msg: TMAVmessage; const serial: shortstring; cmd: byte);

implementation

procedure CreateMsg57(var msg: TMAVmessage; const serial: shortstring; cmd: byte);
begin
msg.msgbytes[5]:=57;
msg.msgbytes[6]:=cmd;
// doing this is not legal although I know how ;-)

msg.valid:=false;
end;

end.
69 changes: 69 additions & 0 deletions scr/msg57_secret.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{********************************************************}
{ }
{ Common functions and definitions }
{ }
{ Copyright (c) 2025 Helmut Elsner }
{ }
{ Compiler: FPC 3.2.3 / Lazarus 3.7 }
{ }
{ Pascal programmers tend to plan ahead, they think }
{ before they type. We type a lot because of Pascal }
{ verboseness, but usually our code is right from the }
{ start. We end up typing less because we fix less bugs. }
{ [Jorge Aldo G. de F. Junior] }
{********************************************************}

(*
This source is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This code is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
A copy of the GNU General Public License is available on the World Wide Web
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
Boston, MA 02110-1335, USA.
*******************************************************************************)

unit msg57;

{$mode objfpc}{$H+}

interface

uses
Classes, mav_def, mav_msg, MD5;

procedure CreateMsg57(var msg: TMAVmessage; const serial: shortstring; cmd: byte);

implementation

procedure CreateMsg57(var msg: TMAVmessage; const serial: shortstring; cmd: byte);
var
HashStream: TMemoryStream;
HashBuffer: array [0..15] of byte;
i: byte;

begin
HashStream:=TMemoryStream.Create;
try
HashBuffer:=MD5String(serial);
HashStream.WriteBuffer(HashBuffer, 16);
CreateStandardGUIMsg(msg, 18);
msg.msgbytes[5]:=57;
msg.msgbytes[6]:=cmd;
for i:=0 to 15 do
msg.msgbytes[i+LengthFixPartBC+2]:=HashBuffer[i];
SetCRC_BC(msg);
finally
HashStream.Free;
end;
end;

end.

0 comments on commit e0375ca

Please sign in to comment.