Ejemplo n.º 1
0
 public EzspMultiResponseTransaction(EzspFrameRequest request, Type requiredResponse,
                                     HashSet <Type> relatedResponses)
 {
     this._request          = request;
     this._requiredResponse = requiredResponse;
     this._relatedResponses = relatedResponses;
 }
Ejemplo n.º 2
0
        private bool SendNextFrame()
        {
            // We're not allowed to send if we're not connected
            if (!_stateConnected)
            {
                return(false);
            }

            // Check how many frames are outstanding
            if (_sentQueue.Count >= TX_WINDOW)
            {
                // check timer task
                if (_timer == null)
                {
                    StartRetryTimer();
                }
                return(false);
            }

            EzspFrameRequest nextFrame = null;

            if (!_sendQueue.TryDequeue(out nextFrame) || nextFrame == null)
            {
                // Nothing to send
                return(false);
            }

            // Encapsulate the EZSP frame into the ASH packet
            Log.Verbose("TX ASH EZSP: {Frame}", nextFrame);
            AshFrameData ashFrame = new AshFrameData(nextFrame);

            _retries = 0;
            SendFrame(ashFrame);
            return(true);
        }
Ejemplo n.º 3
0
        public void QueueFrame(EzspFrameRequest request)
        {
            if (_parserCancellationToken.IsCancellationRequested)
            {
                Log.Debug("ASH: Handler is closed");
                return;
            }
            _sendQueue.Enqueue(request);

            Log.Debug("ASH: TX EZSP queue size: {Count}", _sendQueue.Count);

            SendNextFrame();
        }
Ejemplo n.º 4
0
 /**
  * Constructor to create an ASH Data frame for sending.
  *
  * @param ezspRequestFrame the {@link EzspFrameRequest} to send
  */
 public AshFrameData(EzspFrameRequest ezspRequestFrame)
 {
     _frameType  = FrameType.DATA;
     _dataBuffer = ezspRequestFrame.Serialize();
 }
 public EzspSingleResponseTransaction(EzspFrameRequest request, Type requiredResponse)
 {
     this._request          = request;
     this._requiredResponse = requiredResponse;
 }