//添加校验和函数 add by nextop 20170615
function GetXorC(AStr: string):Byte;
var
i,Count:integer;
bTemp :Byte;
IDATALEN:INTEGER;
ADATA:ARRAY OF STRING;
IBEGININDEX:INTEGER;
begin
Result:= 0;
bTemp := 0;
Count := Length(AStr);
IBEGININDEX:=1;
iDataLen := length(AStr);
if (iDataLen mod 2) <> 0 then
Exit;
for i:= 0 to Trunc(Count / 2)-1 do
begin
if i = 0 then
bTemp := strtoint('$'+copy(AStr,i* 2 + 1,2))
else
bTemp := strtoint('$'+copy(ASTR, i * 2 + 1,2)) xor bTemp;
end;
Result:= bTemp;
end;
//添加校验和函数 add by nextop 20170615
function GetXorC(AStr: string):Byte;
var
i,Count:integer;
bTemp :Byte;
IDATALEN:INTEGER;
ADATA:ARRAY OF STRING;
IBEGININDEX:INTEGER;
begin
Result:= 0;
bTemp := 0;
Count := Length(AStr);
IBEGININDEX:=1;
iDataLen := length(AStr);
if (iDataLen mod 2) <> 0 then
Exit;
for i:= 0 to Trunc(Count / 2)-1 do
begin
if i = 0 then
bTemp := strtoint('$'+copy(AStr,i* 2 + 1,2))
else
bTemp := strtoint('$'+copy(ASTR, i * 2 + 1,2)) xor bTemp;
end;
Result:= bTemp;
end;
//添加校验和函数 add by nextop 20170615