Пример #1
0
            public async Task <EzspFrame> Wait()
            {
                // Register a listener
                _frameHandler.AddTransactionListener(this);

                // Send the transaction
                _frameHandler.QueueFrame(_ezspTransaction.GetRequest());

                _complete = await _tcs.Task;

                // Remove the listener
                _frameHandler.RemoveTransactionListener(this);

                return(_ezspTransaction.GetResponse());
            }
Пример #2
0
        public IEzspTransaction SendEzspTransaction(IEzspTransaction ezspTransaction)
        {
            try
            {
                Log.Debug("TX EZSP: {Request}", ezspTransaction.GetRequest());

                Task transactionTask = SendEzspRequestAsync(ezspTransaction);
                if (transactionTask == null)
                {
                    Log.Debug("ASH: Error sending EZSP transaction task is null");
                    return(null);
                }
                transactionTask.Wait();
            }
            catch (Exception ex)
            {
                Log.Debug(ex, "ASH: Error while sending EZSP transaction {Request}", ezspTransaction.GetRequest());
            }


            return(ezspTransaction);
        }