private NXT(String uniqueID, NXTConnection nxtConn) { this.name = "Connecting..."; this.nxtConn = nxtConn; this.uniqueID = uniqueID; connected = false; commandQueue = new BlockingCollection<NXTCommand>(); commandExecuter = new BackgroundWorker(); commandExecuter.DoWork += new DoWorkEventHandler(ExecuteNextCommand); commandExecuter.RunWorkerAsync(); // Submit the request to get the device name NXTGetNameCommand getName = new NXTGetNameCommand(nxtConn); getName.ReceivedData += new NXTCommand.NXTReceivedDataHandler(getName_ReceivedData); commandQueue.Add(getName); }
private NXT(String uniqueID, NXTConnection nxtConn) { this.name = "Connecting..."; this.nxtConn = nxtConn; this.uniqueID = uniqueID; connected = false; commandQueue = new BlockingCollection <NXTCommand>(); commandExecuter = new BackgroundWorker(); commandExecuter.DoWork += new DoWorkEventHandler(ExecuteNextCommand); commandExecuter.RunWorkerAsync(); // Submit the request to get the device name NXTGetNameCommand getName = new NXTGetNameCommand(nxtConn); getName.ReceivedData += new NXTCommand.NXTReceivedDataHandler(getName_ReceivedData); commandQueue.Add(getName); }
public NXTWriteFileCommand(NXTConnection nxtConn, String filename, byte[] file) : base(nxtConn) { this.filename = filename; this.file = file; }
public PlaySoundCommand(NXTConnection nxtConn, int duration, int tone) : base(nxtConn) { this.duration = BitConverter.GetBytes(duration); this.tone = BitConverter.GetBytes(tone); }
public NXTCommand(NXTConnection nxtConn) { this.nxtConn = nxtConn; }
public NXTRunProgramCommand(NXTConnection nxtConn, String filename) : base(nxtConn) { this.filename = filename; }
public NXTSetNameCommand(NXTConnection nxtConn, String newName) : base(nxtConn) { this.newName = newName; }
public NXTGetNameCommand(NXTConnection nxtConn) : base(nxtConn) { }
public NXTStopProgramCommand(NXTConnection nxtConn) : base(nxtConn) { }