update documentation

This commit is contained in:
Paul Ortyl
2015-08-16 21:20:30 +02:00
parent ae1b622c05
commit 1012e0e28e
2 changed files with 23 additions and 21 deletions

View File

@@ -18,14 +18,6 @@
* https://github.com/xkonni/raspberry-remote
*/
static int brennstuhl_rcs_2044_process_row(int row, const bitbuffer_t *bitbuffer);
static int brennstuhl_rcs_2044_callback(bitbuffer_t *bitbuffer)
{
int counter = 0;
for(int row=0; row<bitbuffer->num_rows; row++)
counter += brennstuhl_rcs_2044_process_row(row, bitbuffer);
return counter;
}
static int brennstuhl_rcs_2044_process_row(int row, const bitbuffer_t *bitbuffer)
{
@@ -37,7 +29,7 @@ static int brennstuhl_rcs_2044_process_row(int row, const bitbuffer_t *bitbuffer
#if 0
{
// print raw bit squence for debug purposes (before exclusion of invalid sequenced is executed)
// print raw bit sequence for debug purposes (before exclusion of invalid sequenced is executed)
time_t time_now;
char time_str[LOCAL_TIME_BUFLEN];
time(&time_now);
@@ -76,7 +68,7 @@ static int brennstuhl_rcs_2044_process_row(int row, const bitbuffer_t *bitbuffer
#if 0 && !defined(NDEBUG)
{
// print raw bit squence for debug purposes (before exclusion of invalid sequenced is executed)
// print raw bit sequence for debug purposes (before exclusion of invalid sequenced is executed)
time_t time_now;
char time_str[LOCAL_TIME_BUFLEN];
time(&time_now);
@@ -146,7 +138,7 @@ static int brennstuhl_rcs_2044_process_row(int row, const bitbuffer_t *bitbuffer
}
if (! (on ^ off ) )
return 0; /* Pressing simultaneously ON and OFF key is not usefull either */
return 0; /* Pressing simultaneously ON and OFF key is not useful either */
}
char key = 0;
@@ -159,6 +151,7 @@ static int brennstuhl_rcs_2044_process_row(int row, const bitbuffer_t *bitbuffer
Skip it. It happens sometimes as the last code repetition */
{
/* @todo: remove timestamp printing as soon as the controller takes this task */
time_t time_now;
char time_str[LOCAL_TIME_BUFLEN];
time(&time_now);
@@ -174,6 +167,14 @@ static int brennstuhl_rcs_2044_process_row(int row, const bitbuffer_t *bitbuffer
return 1;
}
static int brennstuhl_rcs_2044_callback(bitbuffer_t *bitbuffer)
{
int counter = 0;
for(int row=0; row<bitbuffer->num_rows; row++)
counter += brennstuhl_rcs_2044_process_row(row, bitbuffer);
return counter;
}
r_device brennstuhl_rcs_2044 = {
.name = "Brennstuhl RCS 2044",
.modulation = OOK_PULSE_PWM_RAW,

View File

@@ -39,15 +39,6 @@
*/
static int gt_wt_02_process_row(int row, const bitbuffer_t *bitbuffer);
static int gt_wt_02_callback(bitbuffer_t *bitbuffer)
{
int counter = 0;
for(int row=0; row<bitbuffer->num_rows; row++)
counter += gt_wt_02_process_row(row, bitbuffer);
return counter;
}
static int gt_wt_02_process_row(int row, const bitbuffer_t *bitbuffer)
{
const uint8_t *b = bitbuffer->bb[row];
@@ -68,12 +59,14 @@ static int gt_wt_02_process_row(int row, const bitbuffer_t *bitbuffer)
float tempC = (negative_sign ? ( temp - (1<<12) ) : temp ) * 0.1F;
{
/* @todo: remove timestamp printing as soon as the controller takes this task */
time_t time_now;
char time_str[LOCAL_TIME_BUFLEN];
time(&time_now);
local_time_str(time_now, time_str);
printf("%s GT-WT-02 Sensor %02x: battery %s, channel %d, button %d, temperature %3.1f C / %3.1f F, humidity %2d%%\n"
/* @todo make temperature unit configurable, not printing both */
fprintf(stdout, "%s GT-WT-02 Sensor %02x: battery %s, channel %d, button %d, temperature %3.1f C / %3.1f F, humidity %2d%%\n"
, time_str, sensor_id, battery_low ? "low" : "OK", channel, button_pressed
, tempC, celsius2fahrenheit(tempC), humidity
);
@@ -81,6 +74,14 @@ static int gt_wt_02_process_row(int row, const bitbuffer_t *bitbuffer)
return 1;
}
static int gt_wt_02_callback(bitbuffer_t *bitbuffer)
{
int counter = 0;
for(int row=0; row<bitbuffer->num_rows; row++)
counter += gt_wt_02_process_row(row, bitbuffer);
return counter;
}
r_device gt_wt_02 = {
.name = "GT-WT-02 Sensor",
.modulation = OOK_PULSE_PPM_RAW,