swixteen  0.03
Switch a lamp on/off with X10 RF commands
 All Files Functions Variables Macros Pages
Macros | Functions
OldElro.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TimeSlot   290000
 

Functions

int SendOldElroRfCode (unsigned char Address, unsigned char Action)
 Send the OldElro RF Code. More...
 
int SendOldElroPostamble (void)
 Send the OldElro RF Postamble ( 1 Timeslot on, 31 timeslots off ) More...
 
int SendOldElroBit (int Bit)
 Send a bit of an OldElro RF code with the correct timing. More...
 
int GetOldElroCommandsBy (char *NameToFind)
 Find the given name in a table with names and codes and return an index to the name and the codes. More...
 

Macro Definition Documentation

#define TimeSlot   290000

time in nano Secs

Definition at line 1 of file OldElro.h.

Function Documentation

int GetOldElroCommandsBy ( char *  NameToFind)

Find the given name in a table with names and codes and return an index to the name and the codes.

lookup the code by name and return an index to it

Parameters
Name
Returns
Index to the coresponding codes

Definition at line 15 of file GetOldElroCommandsBy.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int SendOldElroBit ( int  Bit)

Send a bit of an OldElro RF code with the correct timing.

Send a bit with the OldElro encoding

  • The datagrams are rather simple, the first 4 bits are the house code (A-P).
  • (LSB first, 1000 = 0x01, 0001 = 0x08)
  • The second 4 bits are the device code (1-16).
  • (LSB first, 1000 = 0x01, 0001 = 0x08)
  • And the last 4 bits are the action (on/off/blink/dimtoggle/powertoggle):
  • Action
  • 0000 = ???
  • 0001 = ???
  • 0010 = ???
  • 0011 = OFF
  • 0100 = ???
  • 0101 = ???
  • 0110 = PWR TOGGLE
  • 0111 = DIM TOGGLE
  • 1000 = ???
  • 1001 = ???
  • 1010 = BLINK
  • 1011 = ???
  • 1100 = ON
  • 1101 = ???
  • 1110 = ???
  • 1111 = ???
  • In the encoding every bit seem to have a preamble,
  • in which the transmitter is turned on for 1 period and turned off for 3 periods
  • a Zero consists of turning the transmitter on for
  • 1 period, turn it of for 3 periods.
  • A One is turning the transmitter on for 3 periods and turn it off for 1 period,
  • So a Zero is 1-3-1-3 and a One 1-3-3-1.
  • The first 1-3 seems to be a preamble.
  • Parameters
    Bit( 0 or 1 )
  • Returns
    zero on succes and a negative number on failure

Definition at line 46 of file SendOldElroBit.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int SendOldElroPostamble ( void  )

Send the OldElro RF Postamble ( 1 Timeslot on, 31 timeslots off )

Send the OldElro Postamble

Returns
zero on succes and a negative number on failure

Definition at line 12 of file SendOldElroPostamble.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int SendOldElroRfCode ( unsigned char  Address,
unsigned char  Action 
)

Send the OldElro RF Code.

Send the OldElro RF code containing an address and an action

Returns
zero on succes and a negative number on failure

Definition at line 11 of file SendOldElroRfCode.c.

Here is the call graph for this function:

Here is the caller graph for this function: