add SendRecive function, refactor SetReg GetReg