/*
Based on "Jeti Box Communication for Arduino Mini Pro 328 16MHz" by Alexander Buschek
Modified and stripped down to minimal functions by sceak
This program 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 3 of the License, or
any later version. see
*/
#define TX_COMPLETE (1< GETCHAR_TIMEOUT_ms)
return 0; // return, if timout occures
}
return UDR0;
}
// write entire frame to the box including two lines of information (à 16 characters) plus alarm code (letter A-Z)
unsigned char JetiSensor(char line1[17], char line2[17], char alarmCode, boolean sendExitSeqence)
{
unsigned char ack;
int i;
// result of the last frame to allow the boy some time to send the answer
ack = JetiGetChar();
UCSR0B &= ~(1< 0
JetiTransmitByte(0x7E, false);
JetiTransmitByte(0x92, true);
JetiTransmitByte(0x23, true);
JetiTransmitByte(alarmCode, true);
}
// 34 Byte Data Package
if (line1[0] != 0) {
JetiTransmitByte(0xFE, false);
for (i=0; i<16; i++) JetiTransmitByte(line1[i], true);
for (i=0; i<16; i++) JetiTransmitByte(line2[i], true);
JetiTransmitByte(0xFF, false);
} else {
// Exit Expander Test
JetiTransmitByte(0xFE, false);
for (i=0; i<32; i++) JetiTransmitByte(0, false);
JetiTransmitByte(0xFF, false);
}
UCSR0B &= ~(1<