Skip to content

Commit

Permalink
minor: Acurite Atlas code style
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Aug 4, 2020
1 parent d086fef commit fcd3533
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions src/devices/acurite.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ Additional reverse engineering needed:
@todo - Get distance to front of storm to match display
@todo - figure out remaining status bits and how to report
*/

static int acurite_6045_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsigned row)
{
float tempf;
Expand Down Expand Up @@ -421,11 +420,8 @@ static int acurite_6045_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsign
return 1;
}



/**
Acurite Atlas:
Acurite Atlas weather and lightning sensor.
| Reading | Operating Range | Reading Frequency | Accuracy |
| --- | --- | --- | --- |
Expand Down Expand Up @@ -491,8 +487,6 @@ Lux needs to multiplied by 10.
- D = lightning Distance (miles)
*/


static int acurite_atlas_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsigned row)
{
uint8_t humidity, sequence_num, message_type;
Expand Down Expand Up @@ -548,13 +542,13 @@ static int acurite_atlas_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsig

/* clang-format off */
data = data_make(
"model", "", DATA_STRING, "Acurite-Atlas",
_X("id", "sensor_id"), NULL, DATA_INT, sensor_id,
"channel", NULL, DATA_STRING, &channel_str,
"sequence_num", NULL, DATA_INT, sequence_num,
"battery_ok", NULL, DATA_INT, !battery_low,
_X("subtype","message_type"), NULL, DATA_INT, message_type,
"wind_avg_mi_h", "Wind Speed", DATA_FORMAT, "%.1f mi/h", DATA_DOUBLE, wind_speed_mph,
"model", "", DATA_STRING, "Acurite-Atlas",
"id", NULL, DATA_INT, sensor_id,
"channel", NULL, DATA_STRING, &channel_str,
"sequence_num", NULL, DATA_INT, sequence_num,
"battery_ok", NULL, DATA_INT, !battery_low,
"subtype", NULL, DATA_INT, message_type,
"wind_avg_mi_h", "Wind Speed", DATA_FORMAT, "%.1f mi/h", DATA_DOUBLE, wind_speed_mph,
NULL);
/* clang-format on */

Expand Down Expand Up @@ -626,17 +620,15 @@ static int acurite_atlas_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsig


data = data_append(data,
"exception", "data_exception", DATA_INT, exception, // @todo convert to bool
"raw_msg", "raw_message", DATA_STRING, raw_str,
NULL);
"exception", "data_exception", DATA_INT, exception, // @todo convert to bool
"raw_msg", "raw_message", DATA_STRING, raw_str,
NULL);

decoder_output_data(decoder, data);

return 1; // one valid message decoded
}



/**
This callback handles several Acurite devices that use a very
similar RF encoding and data format:
Expand Down

0 comments on commit fcd3533

Please sign in to comment.