22
Pseudo Code Example
This illustrates the program flow needed in order to send the first packet described on the prior page.
Begin Program
Set Uart to 9600 baud
Set Uart to 8 data bits, 1 stop bit, No parity
Constance definitions
Checksumvalue is type byte
Let Header1 = 0x16
Let Header2 = 0x39
Let TurnOn = 0x2D
Let ZoneOn = 0x25
Let DVD = 0x18
Let Vol-Up = 0x03
Variable definitions
Firstpacketchecksum = 0x6C (see ARIA Command Protocol Definition for calculation method)
Let Length = ( #commandfields)
PACKETSENDING is byte array. SIZE of ( #command 2 h 1 length byte + 1cksum)
Main
Let checksumvalue = Firstpacketchecksum
LOAD up the packet
{
PACKETSENDING (1) = header1=0x16
(2) = header2=0x39
(3) = length=#of commandfields = 0x04
(4) = command1=TurnON=0x2D
(5) = command2=ZoneOn=0x25
(6) = command3=DVD=0x18
(7) = command4=VolUp=0x03
(8) = checksum=0x6C (see next section for instructions on calculating)
}
Call sendthepacket routine. Pass the routine PACKETSENDING as the data.
END Main
*This is meant for illustration. Syntax does not apply to any programming language.
Содержание Aria A6600
Страница 35: ...INSTALLER S NOTES 33...