swixteen  0.03
Switch a lamp on/off with X10 RF commands
 All Files Functions Variables Macros Pages
Functions
SendOldElroBit.c File Reference
#include <stdio.h>
#include "../config.h"
#include "../Common/Common.h"
#include "../Sysfs/Sysfs.h"
#include "../OldElro/OldElro.h"
Include dependency graph for SendOldElroBit.c:

Go to the source code of this file.

Functions

int SendOldElroBit (int Bit)
 Send a bit of an OldElro RF code with the correct timing. More...
 

Function Documentation

int SendOldElroBit ( int  Bit)

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

  • 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: