예제 #1
0
        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));
        }
예제 #2
0
 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);
 }