I have posted code on www.planet-source-code.com for encoding-decoding pdu you can check there
Forum Rules