swixteen
0.03
Switch a lamp on/off with X10 RF commands
Main Page
Files
File List
Globals
All
Files
Functions
Variables
Macros
Pages
MarmitekX10
SendX10Command.c
Go to the documentation of this file.
1
#include <stdio.h>
2
3
#include "../MarmitekX10/MarmitekX10.h"
4
#include "../Commands/Commands.h"
5
#include "../Sysfs/Sysfs.h"
6
#include "../config.h"
7
14
int
main
(
int
argc,
char
*argv[] )
15
{
16
17
int
Repeat=5;
/* Number of times to send the command */
18
char
*
Name
;
/* Command to send */
19
int
Index=0;
/* Index to the name and codes */
20
21
if
( argc != 2)
22
{
23
fprintf(stderr,
"Please provide me with an X10 command\n"
);
24
fprintf(stderr,
"eq A1on (uppercase/lowercase is important)\n"
);
25
return
(-1);
26
}
27
28
Name=argv[1];
29
30
Index=
GetX10CommandsBy
(Name);
/* find the codes belonging to the given name */
31
32
OpenGpioPinFd
(
Sender
);
33
34
while
(Repeat--)
35
{
36
SendRfCode
(
Address
[Index],
Action
[Index] );
37
}
38
39
CloseGpioPinFd
(
Sender
);
40
41
return
(0);
42
}
Generated on Sat Oct 5 2013 21:30:15 for swixteen by
1.8.3.1