refactoring code and protocol

fix iterface bugs and debuging protocol
added toggle auto-man mode
fix some bugs
add trace opros module