/// <summary> /// 发送请求数据 /// </summary> /// <param name="sendFrameBase"></param> /// <returns></returns> private async Task <T> Request <T>(SendFrameBase sendFrameBase) where T : ReceiveFrameBase, new() { if (sendFrameBase == null) { throw new ArgumentNullException(nameof(sendFrameBase)); } var data = sendFrameBase.FullFrame; TXContainer container = new TXContainer(data); SerialPort.Write(container.FullFrame, 0, container.FullFrame.Length); WriteData?.Invoke(container.FullFrame); return(await GetRespond <T>()); }
private void KinectCursor_PositionDataUpdated(object sender, Data e) { WriteData?.Invoke(sender, e); }