/// <summary> /// <para>Sends a request for the NXT brick, and if applicable, receive the reply.</para> /// </summary> /// <param name="request">The request</param> /// <returns>The reply as a byte-array, or null</returns> protected override byte[] Send(byte[] request) { lock (usbLock) { usb.SendDataViaBulkTransfers(request); // 0x80 indicates that we should expect a reply. if ((request[0] & 0x80) == 0) { return(usb.ReadDataViaBulkTransfer()); } else { return(null); } } }