private int CloseMotionFile() { crcCount++; var closeMotionFileRequest = new CloseMotionFileRequest(); //var bytes = closeMotionFileRequest.BuildRequest(); //writer.WriteLine("Close motion file command"); //WriteToText(bytes); //return 1; if (crcCount == WirelessConnection.MaxCrcRetry) { crcCount = 0; return(0); } var reply = closeMotionFileRequest.Process() as RobotReplyData; if (reply == null) { return(0); } if (reply.Type == RobotReplyData.ReplyType.CRC) { return(CloseMotionFile()); } else if (reply.Type != RobotReplyData.ReplyType.Success) { return(0); } crcCount = 0; return(1); }
private int CloseMotionFile() { crcCount++; var closeMotionFileRequest = new CloseMotionFileRequest(); //var bytes = closeMotionFileRequest.BuildRequest(); //writer.WriteLine("Close motion file command"); //WriteToText(bytes); //return 1; if (crcCount == WirelessConnection.MaxCrcRetry) { crcCount = 0; return 0; } var reply = closeMotionFileRequest.Process() as RobotReplyData; if (reply == null) return 0; if (reply.Type == RobotReplyData.ReplyType.CRC) { return CloseMotionFile(); } else if (reply.Type != RobotReplyData.ReplyType.Success) return 0; crcCount = 0; return 1; }