Esempio n. 1
0
 /// <summary>
 /// Constructs a new ClientTransaction instance
 /// </summary>
 /// <param name="host">The host that initiated the transaction</param>
 /// <param name="manager">The transaction manager</param>
 /// <param name="handle">The handle used to control this transaction and process its response</param>
 /// <param name="invokeId">The invocation id for the transaction</param>
 /// <param name="deviceAddress">The address of the destination device</param>
 /// <param name="serviceChoice">The service choice of the request</param>
 /// <param name="request">The request content</param>
 public ClientTransaction(Host host, TransactionManager manager, ClientTransactionHandle handle, byte invokeId, Address deviceAddress, byte serviceChoice, byte[] request)
 {
     this._host          = host;
     this._manager       = manager;
     this._handle        = handle;
     this._invokeId      = invokeId;
     this._serviceChoice = serviceChoice;
     this._request       = request;
     this._state         = ClientState.GetDeviceInfo;
     this._handle.SetTransaction(this);
     host.SearchForDevice(deviceAddress, this);
 }
Esempio n. 2
0
        /// <summary>
        /// Sends a confirmed request
        /// </summary>
        /// <param name="handle">The transaction handle</param>
        /// <param name="deviceInstance">The destination address</param>
        /// <param name="serviceChoice">The service choice of the request</param>
        /// <param name="request">The request to send</param>
        public void SendConfirmedRequest(ClientTransactionHandle handle, uint deviceInstance, byte serviceChoice, byte[] request)
        {
            lock(_lock)
            {
                byte invokeId = _getClientInvokeId();

                var transaction = new ClientTransaction(
                    _host,
                    this,
                    handle,
                    invokeId,
                    deviceInstance,
                    serviceChoice,
                    request);

                this._clientTransactions.Add(transaction);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Constructs a new ClientTransaction instance
 /// </summary>
 /// <param name="host">The host that initiated the transaction</param>
 /// <param name="manager">The transaction manager</param>
 /// <param name="handle">The handle used to control this transaction and process its response</param>
 /// <param name="invokeId">The invocation id for the transaction</param>
 /// <param name="deviceAddress">The address of the destination device</param>
 /// <param name="serviceChoice">The service choice of the request</param>
 /// <param name="request">The request content</param>
 public ClientTransaction(Host host, TransactionManager manager, ClientTransactionHandle handle, byte invokeId, Address deviceAddress, byte serviceChoice, byte[] request)
 {
     this._host = host;
     this._manager = manager;
     this._handle = handle;
     this._invokeId = invokeId;
     this._serviceChoice = serviceChoice;
     this._request = request;
     this._state = ClientState.GetDeviceInfo;
     this._handle.SetTransaction(this);
     host.SearchForDevice(deviceAddress, this);
 }