[dvblast-devel] strength and snr dvb values should be unsigned.

Georgi Chorbadzhiyski git at videolan.org
Tue Jan 14 16:43:29 CET 2014


dvblast | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Tue Jan 14 17:38:10 2014 +0200| [3b09b7f99cab510ad554203769d171484f2d978d] | committer: Georgi Chorbadzhiyski

strength and snr dvb values should be unsigned.

The problem with the wrong types was reported by Dr. Torge Szczepanek,
and after asking on linux-media mailing list it turns out that he was
right and the documentation is wrong:

http://www.mail-archive.com/linux-media@vger.kernel.org/msg70287.html

This does not change the comm protocol, just the interpretation of
the returned values.

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=3b09b7f99cab510ad554203769d171484f2d978d
---

 comm.h       |    2 +-
 dvblastctl.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/comm.h b/comm.h
index a878bc7..00fb6af 100644
--- a/comm.h
+++ b/comm.h
@@ -74,7 +74,7 @@ struct ret_frontend_status
     struct dvb_frontend_info info;
     fe_status_t i_status;
     uint32_t i_ber;
-    int16_t i_strength, i_snr;
+    uint16_t i_strength, i_snr;
 };
 
 struct ret_mmi_status
diff --git a/dvblastctl.c b/dvblastctl.c
index 92d0304..c4df1ea 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -718,12 +718,12 @@ int main( int i_argc, char **ppsz_argv )
             if ( i_print_type == PRINT_XML )
             {
                 printf(" <VALUE bit_error_rate=\"%u\"/>\n", p_ret->i_ber);
-                printf(" <VALUE signal_strength=\"%d\"/>\n", p_ret->i_strength);
-                printf(" <VALUE SNR=\"%d\"/>\n", p_ret->i_snr);
+                printf(" <VALUE signal_strength=\"%u\"/>\n", p_ret->i_strength);
+                printf(" <VALUE SNR=\"%u\"/>\n", p_ret->i_snr);
             } else {
                 printf("\nBit error rate: %u\n", p_ret->i_ber);
-                printf("Signal strength: %d\n", p_ret->i_strength);
-                printf("SNR: %d\n", p_ret->i_snr);
+                printf("Signal strength: %u\n", p_ret->i_strength);
+                printf("SNR: %u\n", p_ret->i_snr);
             }
             ret = 0;
         }



More information about the dvblast-devel mailing list