Exemple #1
0
        static public UdbusConnector CreateHelloed(IUdbusTransport transport, uint serial, out string name, HelloRecvDelegate helloRecv)
        {
            UdbusConnector connectorCreate = CreateAuthorised(transport);

            // We won't bother to raise an exception since Hello() should do it for us.
            int helloResult = connectorCreate.HelloSend(serial, out name, helloRecv);

            return(connectorCreate);
        }
Exemple #2
0
        protected const UInt32 XHT_DEFAULT_TIMEOUT = INFINITE;//20000;

        public UdbusConnector(IUdbusTransport transport)
        {
            //if (transport.PopulateDbio(out this.dbio) == false) // If failed to populate dbio
            if (transport.PopulateDbio(ref this.dbio) == false) // If failed to populate dbio
            {
                throw Exceptions.TransportFailureException.Create(transport);
            } // Ends if failed to populate dbio

            this.transport = transport;
        }
        public UdbusConnector(IUdbusTransport transport)
        {
            //if (transport.PopulateDbio(out this.dbio) == false) // If failed to populate dbio
            if (transport.PopulateDbio(ref this.dbio) == false) // If failed to populate dbio
            {
                throw Exceptions.TransportFailureException.Create(transport);

            } // Ends if failed to populate dbio

            this.transport = transport;
        }
Exemple #4
0
        /// Factory functions
        static public UdbusConnector CreateAuthorised(IUdbusTransport transport)
        {
            UdbusConnector connectorCreate = new UdbusConnector(transport);

            int authoriseResult = connectorCreate.Authorise();

            if (authoriseResult != 0) // If error occurred
            {
                throw Exceptions.UdbusAuthorisationException.CreateWithErrorCode();
            } // Ends if error occurred

            return(connectorCreate);
        }
        /// Factory functions
        public static UdbusConnector CreateAuthorised(IUdbusTransport transport)
        {
            UdbusConnector connectorCreate = new UdbusConnector(transport);

            int authoriseResult = connectorCreate.Authorise();

            if (authoriseResult != 0) // If error occurred
            {
                throw Exceptions.UdbusAuthorisationException.CreateWithErrorCode();

            } // Ends if error occurred

            return connectorCreate;
        }
 protected static string CreateMessage(IUdbusTransport transport)
 {
     return string.Format("Error with transport: {0}", transport.ToString());
 }
 public static TransportFailureException Create(IUdbusTransport transport, string message)
 {
     return new TransportFailureException(CreateMessage(transport) + ". " + message);
 }
 /// Factory functions
 public static TransportFailureException Create(IUdbusTransport transport)
 {
     return new TransportFailureException(CreateMessage(transport));
 }
        public static UdbusConnector CreateHelloed(IUdbusTransport transport, uint serial, out string name, HelloRecvDelegate helloRecv)
        {
            UdbusConnector connectorCreate = CreateAuthorised(transport);

            // We won't bother to raise an exception since Hello() should do it for us.
            int helloResult = connectorCreate.HelloSend(serial, out name, helloRecv);

            return connectorCreate;
        }
 /// <summary>
 /// Default is a no-op implementation that says there's always data to read.
 /// </summary>
 /// <param name="transport">Transport interface being implemented.</param>
 /// <param name="milliseconds">Number of milliseconds to wait.</param>
 /// <returns>true if data arrived to be read, otherwise false.</returns>
 public static WaitForReadResult WaitForRead(IUdbusTransport transport, UInt32 milliseconds)
 {
     return WaitForReadResult.Succeeded;
 }
 /// <summary>
 /// Not implemented.
 /// </summary>
 /// <param name="pdbus_io"></param>
 /// <returns></returns>
 public static bool PopulateDbio(IUdbusTransport transport, out ManagedDbusIo pdbus_io)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Default is a no-op implementation that says there's always data to read.
 /// </summary>
 /// <param name="transport">Transport interface being implemented.</param>
 /// <param name="milliseconds">Number of milliseconds to wait.</param>
 /// <returns>true if data arrived to be read, otherwise false.</returns>
 public static WaitForReadResult WaitForRead(IUdbusTransport transport, UInt32 milliseconds)
 {
     return(WaitForReadResult.Succeeded);
 }
 /// <summary>
 /// Not implemented.
 /// </summary>
 /// <param name="pdbus_io"></param>
 /// <returns></returns>
 public static bool PopulateDbio(IUdbusTransport transport, out ManagedDbusIo pdbus_io)
 {
     throw new NotImplementedException();
 }