[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
Re: Trouble setting CM11 clock
Yes I got it. But when I send the further code, apparently the checksum
is not correct (0x87). If my calculations are rigth, the result should
be 0x22...
(=2E..)
// 7 bytes array definition
byte[] setClk=3Dnew byte[7];
//chksum definition and initialization to 0
byte chksum=3D0;
//Values assinged to the seven bytes with a cast to byte
setClk[0] =3D (byte)(0x9b);
setClk[1] =3D (byte)(0x13);
setClk[2] =3D (byte)(0x40);
setClk[3] =3D (byte)(0x0A);
setClk[4] =3D (byte)(0x48);
setClk[5] =3D (byte)(0x82);
setClk[6] =3D (byte)(0x60);
//cycle to calculate de checksum
for (int i =3D 0; i < setClk.Length; i++)
chksum +=3D setClk[i];
chksum &=3D 0xff;
(=2E..)
After this, I send the "setClk" to the device and get a reply (the one
mentioned above) from it.
Am I making a mistake calculating the checksum?
Note: the code is C#
Jo=E3o Carias
comp.home.automation Main Index |
comp.home.automation Thread Index |
comp.home.automation Home |
Archives Home