summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-06-04 19:25:41 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-06-04 19:25:41 +0200
commite758988579c3bf058214bf6e4ae56cf27b52bcfb (patch)
treeab6cfb2cb6d7287ce1fd52cab4879b943d08f387 /src
parent094c977b8877d652f629260cc753aacc7000e328 (diff)
downloadradio-controller-e758988579c3bf058214bf6e4ae56cf27b52bcfb.tar.gz
radio-controller-e758988579c3bf058214bf6e4ae56cf27b52bcfb.tar.bz2
radio-controller-e758988579c3bf058214bf6e4ae56cf27b52bcfb.tar.xz
radio-controller-e758988579c3bf058214bf6e4ae56cf27b52bcfb.zip
o Decoding manufacturer and command too.
Diffstat (limited to 'src')
-rw-r--r--src/radio-controller.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/radio-controller.cpp b/src/radio-controller.cpp
index 2c038ed..e4218cc 100644
--- a/src/radio-controller.cpp
+++ b/src/radio-controller.cpp
@@ -245,7 +245,12 @@ void main_loop()
} else if (result.state == decoding_state::BAD_START) {
printf("Bad start\n");
} else if (result.state == decoding_state::OK) {
- printf("OK: size=%d, value: 0x%08" PRIx32 "%08" PRIx32 "\n", result.data.size(), result.data.u32(1), result.data.u32(0));
+ printf("OK: size=%d, value: 0x%08" PRIx32 "%08" PRIx32 "\n", result.data.size(),
+ result.data.u32(1), result.data.u32(0));
+ uint32_t manufacturer = result.data.extract_bits(0, 12);
+ uint32_t command = result.data.extract_bits(12, 8);
+ printf("Samsung: Manufacturer=%" PRIu32 ", 0x%" PRIx32 ", command=%" PRIu32 ", 0x%" PRIx32 "\n",
+ manufacturer, manufacturer, command, command);
}
ir_buffer.reset();