diff --git a/src/devices/brennstuhl_rcs_2044.c b/src/devices/brennstuhl_rcs_2044.c index 5c278f6a..3c62a1fc 100644 --- a/src/devices/brennstuhl_rcs_2044.c +++ b/src/devices/brennstuhl_rcs_2044.c @@ -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; rownum_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; rownum_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, diff --git a/src/devices/gt_wt_02.c b/src/devices/gt_wt_02.c index 75f94aaf..437a070f 100644 --- a/src/devices/gt_wt_02.c +++ b/src/devices/gt_wt_02.c @@ -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; rownum_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; rownum_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,