public override byte[] BuildRequest() { var packet = new RobotPacket(PacketID); packet.Parameters = Data; return(packet.BuildPacket()); }
public override byte[] BuildRequest() { var packet = new RobotPacket(RobotPacket.PacketID.CreateMotionPair); packet.Parameters = GlobalFunction.DecToLE8(MotionID); return(packet.BuildPacket()); }
public override byte[] BuildRequest() { var packet = new RobotPacket(RequestID) { Parameters = GlobalFunction.DecToLE8(MotionID) }; return packet.BuildPacket(); }
public override byte[] BuildRequest() { var packet = new RobotPacket(RequestID) { Parameters = GlobalFunction.DecToLE8(MotionID) }; return(packet.BuildPacket()); }
public override byte[] BuildRequest() { var packet = new RobotPacket(RequestID); if (volumeLevel != -1) { packet.Parameters = new[] { (byte)volumeLevel }; } if (motionIDToPlay != 0) { var param = GlobalFunction.DecToLE8(motionIDToPlay); packet.Parameters = param; } return(packet.BuildPacket()); }
public override byte[] BuildRequest() { var packet = new RobotPacket(RequestID); if (volumeLevel != -1) { packet.Parameters = new[] { (byte)volumeLevel }; } if (motionIDToPlay != 0) { var param = GlobalFunction.DecToLE8(motionIDToPlay); packet.Parameters = param; } return packet.BuildPacket(); }
public GetMotionInfoWithIDRequest(ulong motionID, RobotPacket.PacketID packetID) { RequestID = packetID; MotionID = motionID; }
public override byte[] BuildRequest() { var packet = new RobotPacket(RequestID); return(packet.BuildPacket()); }
public RemoteRequest(RobotPacket.PacketID id, int vol = -1, ulong motionPlay = 0) { RequestID = id; volumeLevel = vol; motionIDToPlay = motionPlay; }
public DeleteMotionRequest(RobotPacket.PacketID packetID, ulong motionID) { RequestID = packetID; MotionID = motionID; }
public override byte[] BuildRequest() { var packet = new RobotPacket(RobotPacket.PacketID.CloseMotionFile); return(packet.BuildPacket()); }
public override byte[] BuildRequest() { var packet = new RobotPacket(RequestID); return packet.BuildPacket(); }
public GetMotionInfoAtIndexRequest(RobotPacket.PacketID id, int index) { RequestID = id; Index = index; }
public override byte[] BuildRequest() { var packet = new RobotPacket(RobotPacket.PacketID.CancelTransferMotionPair); return(packet.BuildPacket()); }
public GetMotionCountRequest(RobotPacket.PacketID id) { RequestID = id; }
private int WriteData(byte[] data, RobotPacket.PacketID packetID) { crcCount++; if (CancelProcess) { SendCancel(); return 2; } var writeMotionDataRequest = new WriteDataRequest(data, packetID); //var bytes = writeMotionDataRequest.BuildRequest(); //SendData(bytes); //System.Threading.Thread.Sleep(5); //return 1; if (crcCount == WirelessConnection.MaxCrcRetry) { crcCount = 0; if (_writeProcess) { DebugHelper.WriteLine("WriteData: reach max crc"); _logger.Error("WriteData: reach max crc"); } return 0; } var reply = writeMotionDataRequest.Process() as RobotReplyData; if (reply == null) { if (_writeProcess) { DebugHelper.WriteLine("WriteData: reply is null"); _logger.Error("WriteData: reply is null"); } return 0; } // Check reply error if (reply.Type == RobotReplyData.ReplyType.CRC) { DebugHelper.WriteLine("WriteData: CRC error"); _logger.Error("WriteData: CRC error"); return WriteData(data, packetID); } else if (reply.Type != RobotReplyData.ReplyType.Success) { if (_writeProcess) { DebugHelper.WriteLine("WriteData: reply is not success"); _logger.Error("WriteData: reply is not success"); } return WriteData(data, packetID); //return 0; } if (reply.Data.Length == 0) { if (_writeProcess) _logger.Error("WriteData: reply data is null"); return 0; } if (GlobalFunction.LE4ToDec(reply.Data) != data.Length) { if (_writeProcess) { DebugHelper.WriteLine("WriteData: cannot write all data"); _logger.Error("WriteData: cannot write all data"); } return 0; } crcCount = 0; return 1; }
public override byte[] BuildRequest() { var packet = new RobotPacket(PacketID); packet.Parameters = Data; return packet.BuildPacket(); }
public WriteDataRequest(byte[] data, RobotPacket.PacketID packetID) { Data = data; PacketID = packetID; RequestID = packetID; }
public override byte[] BuildRequest() { var packet = new RobotPacket(RobotPacket.PacketID.CreateMotionPair); packet.Parameters = GlobalFunction.DecToLE8(MotionID); return packet.BuildPacket(); }
public override byte[] BuildRequest() { var packet = new RobotPacket(RobotPacket.PacketID.CloseMotionPair); return packet.BuildPacket(); }