fixed var_header and payload layout
fixed var_header and payload layout2
added QoS option
QoS1 support added