public bool setServoOn() { if ((ConnectStatus & CONNECTTYPE.CONNECTED) == 0) { return(false); } //已經開啟,直接回傳 if ((ConnectStatus & CONNECTTYPE.SERVOON) > 0) { return(true); } try { //P.78 Sets the servo to ON. _Robot.ServoOn(); TsStatusAllS status = _Robot.GetStatusAll(); //仍為關閉 if (status.ServoStatus == 0) { return(false); } ConnectStatus |= CONNECTTYPE.SERVOON; return(true); } catch (TsRemoteSException ex) { //Error processing Console.WriteLine("setServoOn: " + ex.Message); } return(false); }