<div dir="ltr"><br><br>
<div class="gmail_quote">2008/11/12 BOUWSMA Barry <span dir="ltr">&lt;<a href="mailto:freebeer.bouwsma@gmail.com">freebeer.bouwsma@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">On Wed, 12 Nov 2008, Alex Betis wrote:<br><br></div>
<div class="Ih2E3d">&gt; BTW, you give here example of NIT parsing, do you know the format of the<br>&gt; message and what field specifies that the delivery system is DVB-S2? scan<br>&gt; utility code doesn&#39;t parse it, so I just add both DVB-S and DVB-S2 scans for<br>
<br></div>I&#39;ve spent yesterday hacking UTF-8 output into my old copy<br>of dvb-apps and then finding that the Greek 13E Hotbirds<br>channel `Βουλή:12168:h:2:27500:517:700:384&#39; [UTF-8 encoded,<br>hope my MIME headers and ESMTP are correct] is not sent as<br>
latin-greek charset, and thus doesn&#39;t appear properly for<br>me, but anyway, here is a code snippet of my `scan&#39; that sends<br>the NIT dump of the scanned transponder to stderr, that I<br>use when needed. &nbsp;Cut&#39;n&#39;paste; also part of a much larger<br>
set of hacks, so it&#39;s meant as an example, and not to be<br>used as ``useful&#39;&#39; code:<br><br>+<br>+char *fec[10] = {&quot;NONE&quot;, &quot;1/2&quot;, &quot;2/3&quot;, &quot;3/4&quot;, &quot;4/5&quot;, &quot;5/6&quot;, &quot;6/7&quot;, &quot;7/8&quot;, &quot;8/9&quot;, &quot;AUTO&quot; } ;<br>
+if (tn.type == 0) {<br>+ &nbsp;if (dump_nits == 1) {<br>+ &nbsp; &nbsp;printf(&quot;NIT result: &nbsp;%d %s %d &nbsp; pos &nbsp;%.1f%s &nbsp;&quot;, tn.param.frequency, tn.polarisation ? &quot;V&quot; : &quot;H&quot;, tn.param.u.qpsk.symbol_rate, (float)tn.orbital_pos/10, tn.we_flag ? &quot;E&quot; : &quot;W&quot;);<br>
+ &nbsp; &nbsp;printf(&quot; &nbsp;FEC %s&quot;, &nbsp;fec[tn.param.u.qpsk.fec_inner] );<br>+if (tn.modulation &amp; 0x04) {<br>+ &nbsp; &nbsp; &nbsp; printf(&quot; &nbsp;DVB-S2&quot;);<br>+ &nbsp;if ((tn.modulation &amp; 0x03) == 0x01) printf (&quot; QPSK&quot;);<br>
+ &nbsp;if ((tn.modulation &amp; 0x03) == 0x02) printf (&quot; 8PSK&quot;);<br>+<br>+}<br>+if (tn.param.inversion != 2)<br>+ &nbsp; &nbsp; &nbsp; printf(&quot; &nbsp;inv %s&quot;, &nbsp;tn.param.inversion ? &quot;OFF&quot; : &quot;ON&quot; /*XXX FIXME */);<br>
+printf(&quot;\n&quot;);<br>+ &nbsp;}<br>+}<br>+</blockquote>
<div>I must be missing something... How this code is aligned to the following modulation enumeration?</div>
<div>QPSK enumeration has value 0, 8PSK value 9.</div>
<div>&nbsp;</div>
<div><span class="k">typedef</span> <span class="k">enum</span> <span class="n">fe_modulation</span> <span class="p">{</span></div>
<div><span class="n">&nbsp;&nbsp; QPSK</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">QAM_16</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">QAM_32</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">QAM_64</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">QAM_128</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">QAM_256</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">QAM_AUTO</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">VSB_8</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">VSB_16</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">PSK_8</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">APSK_16</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">APSK_32</span><span class="p">,</span></div>
<div><span class="p">&nbsp;&nbsp; </span><span class="n">DQPSK</span><span class="p">,</span></div>
<div><span class="p"></span><span class="p">}</span> <span class="n">fe_modulation_t</span><span class="p">;</span></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span id=""></span><br><br><br>Also, I believe that the recent `dvbsnoop&#39; invoked with<br>`-s ts -tssubdecode&#39; on the NIT PID will verbosely parse<br>
the components and display everything -- I believe I used<br>that source code as the basis for the above hack.<br><br>I wonder if any of my other dvb-apps/scan hacks would be<br>of interest for someone to clean up (for me, function<br>
before form, especially when I don&#39;t have a clue as to<br>what I am doing)...<br><font color="#888888"><br><br>barry bouwsma<br></font></blockquote></div><br></div>