#include <stdio.h>
#include "../config.h"
#include "../Common/Common.h"
#include "../Sysfs/Sysfs.h"
#include "../OldElro/OldElro.h"
Go to the source code of this file.
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
-
- Returns
- zero on succes and a negative number on failure
Definition at line 46 of file SendOldElroBit.c.