PSAT-2 TLM stream decoder

Insert separator

= 'a' && $c <= 'z') || ($c >= 'A' && $c <= 'Z') || ($c >= '0' && $c <= '9') || $c == ' ')) $result = false; } return $result; } function parse_tlm($tlm) { // PSAT-2 C apng eFaaijtkpokoaB aaaa A aokF eEadjluappjxay $pos = strpos($tlm, "T-2"); while ($pos !== false) { $line = substr($tlm, $pos+4, 48); //echo "src: '" . $line . "'\n"; $valid_half = $line[0] >= 'A' && $line[0] <= 'D' && $line[1] == ' ' && $line[6] == ' ' && check_ascii($line, 21); $valid_full = $valid_half && $line[21] == ' ' && $line[26] == ' ' && $line[27] >= 'A' && $line[27] <= 'D' && $line[28] == ' ' && $line[33] == ' ' && check_ascii($line, 48); $valid_sstv = $line[0] == 'S' && $line[1] == ' ' && $line[6] == ' ' && $line[15] == ' ' && check_ascii($line, 30); if ($valid_full) ; /* ok */ else if ($valid_half) $line = substr($line, 0, 21); else if ($valid_sstv) $line = substr($line, 0, 30); else $line = ""; if ($line != "") echo $line . "\n"; $pos = strpos($tlm, "T-2", $pos+3); } } if (isset($_POST['tlm'])) $tlm = $_POST['tlm']; else $tlm = ""; if (isset($_POST['tlm2'])) $tlm2 = $_POST['tlm2']; else $tlm2 = ""; if (isset($_POST['comment'])) $comment = $_POST['comment']; else $comment = ""; if ($tlm2 != "") { echo "Sending to decoder...

";
    $line = strtok($tlm2, "\n");
    $i = 1;
    while ($line !== false) {
	$com = "[" . $i . "] " . $comment;
	$url = "http://www.urel.feec.vutbr.cz/esl/psat2/psat2tlm.php?tlm=" . urlencode("PSAT-2 " . trim($line)) . "&comment=" . urlencode($com);
	echo $url . "\n";
	ob_flush();
	flush();
	$data = file_get_contents($url);
	$line = strtok("\n");
	$i++;
    }
    echo "

Done!"; echo "

Back to start"; } else if ($tlm == "") { ?>
Telemetry:

Parsed TLM:

Comment:
Please provide any important info, like your callsign, email, SatNOGS reception ID etc.