swixteen  0.03
Switch a lamp on/off with X10 RF commands
 All Files Functions Variables Macros Pages
SendOldElroPostamble.c
Go to the documentation of this file.
1 #include <stdio.h>
2 
3 #include "../config.h"
4 #include "../Common/Common.h"
5 #include "../Sysfs/Sysfs.h"
6 #include "../OldElro/OldElro.h"
7 
13  {
14  int rc=0;
15 
16  /* Set sender on */
17  SwitchSender(1);
18 
19  /*
20  * Preamble is high for 9 mS and low for 4.5 mS
21  */
22  Timing.tv_sec = 0;
23  Timing.tv_nsec = TimeSlot*1;
24  if( nanosleep( &Timing, &Remaining) != 0 )
25  {
26  fprintf( stderr, "201310021153 Timing failed\n" );
27  rc=-1;
28  }
29 
30  /* Set sender off */
31  SwitchSender(0);
32 
33  Timing.tv_sec = 0;
34  Timing.tv_nsec = TimeSlot*31;
35  if( nanosleep( &Timing, &Remaining) != 0 )
36  {
37  fprintf( stderr, "201310021154 Timing failed\n" );
38  rc=-1;
39  }
40 
41  return(rc);
42  }