some parts added to packetEncoder_c