Added encoder emulation . Not tested yet.