From 9385779f92976da074dbfe520a218f362f8ee6ee Mon Sep 17 00:00:00 2001
From: "Christian W. Zuckschwerdt" <christian@zuckschwerdt.org>
Date: Sat, 23 Jan 2021 15:09:52 +0100
Subject: [PATCH] Add TFA 30.3208.02 note (closes #1622)

---
 README.md                     | 4 ++--
 conf/rtl_433.example.conf     | 2 +-
 man/man1/rtl_433.1            | 2 +-
 src/devices/ambient_weather.c | 8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index dc86a737..51c5736a 100644
--- a/README.md
+++ b/README.md
@@ -98,7 +98,7 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md).
     [17]  Cardin S466-TX2
     [18]  Fine Offset Electronics, WH2, WH5, Telldus Temperature/Humidity/Rain Sensor
     [19]  Nexus, FreeTec NC-7345, NX-3980, Solight TE82S, TFA 30.3209 temperature/humidity sensor
-    [20]  Ambient Weather Temperature Sensor
+    [20]  Ambient Weather, TFA 30.3208.02 temperature sensor
     [21]  Calibeur RF-104 Sensor
     [22]* X10 RF
     [23]  DSC Security Contact
@@ -402,7 +402,7 @@ E.g. -X "n=doorbell,m=OOK_PWM,s=400,l=800,r=7000,g=1000,match={24}0xa9878c,repea
 	Parameters are detected from the full path, file name, and extension.
 
 	File content and format are detected as parameters, possible options are:
-	'cu8', 'cs16', 'cf32' ('IQ' implied),
+	'cu8', 'cs8', 'cs16', 'cf32' ('IQ' implied),
 	'am.s16', 'am.f32', 'fm.s16', 'fm.f32',
 	'i.f32', 'q.f32', 'logic.u8', 'ook', and 'vcd'.
 
diff --git a/conf/rtl_433.example.conf b/conf/rtl_433.example.conf
index bb40d41a..5364cb0e 100644
--- a/conf/rtl_433.example.conf
+++ b/conf/rtl_433.example.conf
@@ -205,7 +205,7 @@ stop_after_successful_events false
   protocol 17  # Cardin S466-TX2
   protocol 18  # Fine Offset Electronics, WH2, WH5, Telldus Temperature/Humidity/Rain Sensor
   protocol 19  # Nexus, FreeTec NC-7345, NX-3980, Solight TE82S, TFA 30.3209 temperature/humidity sensor
-  protocol 20  # Ambient Weather Temperature Sensor
+  protocol 20  # Ambient Weather, TFA 30.3208.02 temperature sensor
   protocol 21  # Calibeur RF-104 Sensor
 # protocol 22  # X10 RF
   protocol 23  # DSC Security Contact
diff --git a/man/man1/rtl_433.1 b/man/man1/rtl_433.1
index 6032f7dc..ea103b54 100644
--- a/man/man1/rtl_433.1
+++ b/man/man1/rtl_433.1
@@ -466,7 +466,7 @@ Parameters are detected from the full path, file name, and extension.
 File content and format are detected as parameters, possible options are:
 .RE
 .RS
- 'cu8', 'cs16', 'cf32' ('IQ' implied),
+ 'cu8', 'cs8', 'cs16', 'cf32' ('IQ' implied),
 .RE
 .RS
  'am.s16', 'am.f32', 'fm.s16', 'fm.f32',
diff --git a/src/devices/ambient_weather.c b/src/devices/ambient_weather.c
index 9b2899d5..c717f3fb 100644
--- a/src/devices/ambient_weather.c
+++ b/src/devices/ambient_weather.c
@@ -13,6 +13,8 @@
 /**
 Ambient Weather F007TH Thermo-Hygrometer.
 
+Also TFA senders 30.3208.02 from the TFA "Klima-Monitor" 30.3054
+
 The check is an LFSR Digest-8, gen 0x98, key 0x3e, init 0x64
 */
 
@@ -35,9 +37,7 @@ static int ambient_weather_decode(r_device *decoder, bitbuffer_t *bitbuffer, uns
 
     if (expected != calculated) {
         if (decoder->verbose) {
-            fprintf(stderr, "Checksum error in Ambient Weather message.    Expected: %02x    Calculated: %02x\n", expected, calculated);
-            fprintf(stderr, "Message: ");
-            bitrow_print(b, 48);
+            bitrow_printf(b, 48, "%s: Checksum error, expected: %02x calculated: %02x\n", __func__, expected, calculated);
         }
         return DECODE_FAIL_MIC;
     }
@@ -115,7 +115,7 @@ static char *output_fields[] = {
 };
 
 r_device ambient_weather = {
-        .name        = "Ambient Weather Temperature Sensor",
+        .name        = "Ambient Weather, TFA 30.3208.02 temperature sensor",
         .modulation  = OOK_PULSE_MANCHESTER_ZEROBIT,
         .short_width = 500,
         .long_width  = 0, // not used