Something like this I think, but I have no way of testing.
type
TBlock: array [0..63] of Byte;
PBlock: ^TBlock;
var
send_buf: PBlock;
receive_bug: PBlock;
RecvLength: Longint;
begin
GetMem(send_buf, SizeOf(TBlock));
GetMem(receive_buf, SizeOf(TBlock));
RecvLength := 3;
send_buf[0] = $32;
send_buf[1] = (Byte)led;
if State then
send_buf[2] = 1
else
send_buf[2] = 0;
if SendReceivePacket(send_buf, 3, receive_buf, RecvLength) = 1 then
begin
// ...
end;
FreeMem(send_buf);
FreeMem(receive_buf);
end;
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 874