277/317
9 - A Carrier-current System for domestIc Remote Control
case 24 :
case 25 :
/* First 3 half cycles must have a pulse (start condition) */
if ( ! CarrierDetected )
CycleNumber = 1 ;
/*
Reset the whole process if
incorrect header. */
break ;
case 4 :
/* 4th half cycle must have no pulse ; end of start */
case 26 :
if ( CarrierDetected )
CycleNumber = 1 ;
/*
Reset the whole process if
incorrect header. */
break ;
case 5 :
/* Receive one of the four bits of house code */
case 27 :
TempHouseCode = 0 ;
/* First, initialize house code
value. */
case 7 :
case 9 :
case 11 :
case 29 :
case 31 :
case 33 :
TempHouseCode >>= 1 ;
/* Shift right by one bit */
if ( CarrierDetected )
TempHouseCode |= 8 ; /* Set most-significant bit to one */
break ;
/* House code has four bits */
case 6 :
case 8 :
case 10 :
case 12 :
/* Check that the next even bit sent is the complement
of the odd one. */
case 28 :
case 30 :
case 32 :
case 34 :
if ( ( ( TempHouseCode & 8 ) != 0 ) == CarrierDetected )
CycleNumber = 1 ;
/*
Reset the whole process if
incorrect check bit. */
break ;
case 13 :
/* Receive one of the five bits of Key code */
case 35 :
TempKeyCode = 0 ;
/* First, initialize Key code value. */
case 15 :
case 17 :
case 19 :
case 21 :
case 37 :
case 39 :
case 41 :