2 namespace callnotifier;
10 public function parse($bytes)
12 $m = new EDSS1_Message();
13 $m->type = ord($bytes{7});
19 $curbit = $bytes{++$curpos};
20 if ($curbit == "\xFF" && $bytes{$curpos + 1} == "\n") {
24 $param = new EDSS1_Parameter();
25 $m->parameters[] = $param;
26 $param->type = ord($curbit);
29 $curbit = $bytes{++$curpos};
30 $param->length = ord($curbit);
33 $param->data = substr($bytes, $curpos + 1, $param->length);
34 $curpos += $param->length;
35 } while ($curpos < strlen($bytes) - 1);