File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ public function __construct()
8989 public static function getPduSubstr ($ length )
9090 {
9191 $ str = mb_substr (self ::$ _pduParse , 0 , $ length );
92+ PDU ::debug ("PDU::getPduSubstr: " . $ str );
9293 self ::$ _pduParse = mb_substr (self ::$ _pduParse , $ length );
9394 return $ str ;
9495 }
Original file line number Diff line number Diff line change @@ -76,14 +76,21 @@ public function __construct(array $params)
7676 */
7777 public static function parse ()
7878 {
79+ $ udhl = hexdec (PDU ::getPduSubstr (2 ));
80+ $ type = hexdec (PDU ::getPduSubstr (2 ));
81+ $ psize = hexdec (PDU ::getPduSubstr (2 ));
82+ $ pointer = hexdec (PDU ::getPduSubstr ( ($ psize - 2 ) * 2 )); // psize is pointer + segments + current
83+ $ sergments = hexdec (PDU ::getPduSubstr (2 ));
84+ $ current = hexdec (PDU ::getPduSubstr (2 ));
85+
7986 $ self = new self (
8087 array (
81- 'UDHL ' => hexdec ( PDU :: getPduSubstr ( 2 )) ,
82- 'TYPE ' => hexdec ( PDU :: getPduSubstr ( 2 )) ,
83- 'PSIZE ' => hexdec ( PDU :: getPduSubstr ( 2 )) ,
84- 'POINTER ' => hexdec ( PDU :: getPduSubstr ( 4 )) ,
85- 'SEGMENTS ' => hexdec ( PDU :: getPduSubstr ( 2 )) ,
86- 'CURRENT ' => hexdec ( PDU :: getPduSubstr ( 2 ))
88+ 'UDHL ' => $ udhl ,
89+ 'TYPE ' => $ type ,
90+ 'PSIZE ' => $ psize ,
91+ 'POINTER ' => $ pointer ,
92+ 'SEGMENTS ' => $ sergments ,
93+ 'CURRENT ' => $ current
8794 )
8895 );
8996
Original file line number Diff line number Diff line change @@ -90,10 +90,12 @@ public static function parse(Data $data)
9090 $ length = $ data ->getPdu ()->getUdl () * ($ alphabet == PDU \DCS ::ALPHABET_UCS2 ? 4 : 2 );
9191
9292 if ($ data ->getPdu ()->getType ()->getUdhi ()){
93+ PDU ::debug ("Header::parse() " );
9394 $ header = Header::parse ();
9495 }
9596
9697 $ hex = PDU ::getPduSubstr ($ length );
98+ PDU ::debug ("Data (hex): " . $ hex );
9799
98100 switch ($ alphabet ){
99101 case PDU \DCS ::ALPHABET_DEFAULT :
You can’t perform that action at this time.
0 commit comments