Exemplo n.º 1
0
        /// <summary>
        /// UsbAdapterIo Constructor called by UsbAdapter class
        /// </summary>
        /// <param name="usbDevice"></param>
        /// <param name="usbstate"></param>
        /// <param name="owstate"></param>
        internal UsbAdapterIo(UsbDevice usbdevice, string deviceid, UsbAdapterState usbstate, OneWireState owstate)
        {
            usbDevice = usbdevice;
            deviceId  = deviceid;
            usbState  = usbstate;
            owState   = owstate;

            syncObject     = new object();
            ReadResultWait = new AutoResetEvent(false);
        }
Exemplo n.º 2
0
        //--------
        //-------- Constructors
        //--------

        /// <summary>
        /// Constructs a new USB packet builder.
        /// </summary>
        /// <param name="startUState">   the object that contains the DS2490 state
        ///                        which is reference when creating packets </param>
        public UsbPacketBuilder(UsbAdapterState startUState)
        {
            // get a reference to the USB adapter state
            UsbState = startUState;

            // create the buffer for the data
            packet = new RawSendPacket();

            // create the vector
            packetsVector = new List <RawSendPacket>();

            // restart the packet to initialize
            restart();
        }