private MotionInfo GetMotionInfoAtIndex(int motionIndex) { var getMotionInfoAtIndexRequest = new GetMotionInfoAtIndexRequest( RobotPacket.PacketID.GetInfoMotionAtIndex, motionIndex); RobotReply reply = Connection.SendAndReceivePacket(getMotionInfoAtIndexRequest.BuildRequest()); if (reply == null) { return(null); } reply.RequestID = RobotPacket.PacketID.GetInfoMotionAtIndex; RobotReplyData robotReplyData = reply.Process(); if (robotReplyData.Type == RobotReplyData.ReplyType.Failed) { return(null); } return(new MotionInfo(robotReplyData.Data)); }
private MotionInfo GetMotionInfoAtIndex(int motionIndex) { var getMotionInfoAtIndexRequest = new GetMotionInfoAtIndexRequest( RobotPacket.PacketID.GetInfoMotionAtIndex, motionIndex); RobotReply reply = Connection.SendAndReceivePacket(getMotionInfoAtIndexRequest.BuildRequest()); if (reply == null) return null; reply.RequestID = RobotPacket.PacketID.GetInfoMotionAtIndex; RobotReplyData robotReplyData = reply.Process(); if (robotReplyData.Type == RobotReplyData.ReplyType.Failed) { return null; } return new MotionInfo(robotReplyData.Data); }