Implemented tapMessageToPacket method.