Exemplo n.º 1
0
        /// <summary>
        ///  Opens connection and request main data from device (e.g. Serial number)
        ///  If there is some data in event buffer - events will be raised
        /// </summary>
        public void Init(Boolean ignoreLastEvents = true)
        {
            _rawDev.Connection.Open();

            DeviceCategory = _rawDev.CmdRequestEquipmentCategory();
            if (DeviceCategory != CctalkDeviceTypes.CoinAcceptor)
            {
                throw new InvalidOperationException("Connected device is not a coin acceptor. " + DeviceCategory);
            }

            //_rawDev.CmdReset();
            _rawDev.CmdSetMasterInhibitStatus(IsInhibiting);
            _rawDev.CmdModifyInhibitStatus(Enumerable.Repeat(true, 16).ToArray());

            SerialNumber = _rawDev.CmdGetSerial();
            PollInterval = _rawDev.CmdRequestPollingPriority();
            Manufacturer = _rawDev.CmdRequestManufacturerId();
            ProductCode  = _rawDev.CmdRequestProductCode();

            var evBuf = _rawDev.CmdReadEventBuffer();

            if (!ignoreLastEvents)
            {
                RaiseLastEvents(evBuf);
            }
            _lastEvent    = evBuf.Counter;
            IsInitialized = true;
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Opens connection and request main data from device (e.g. Serial number)
        ///  If there is some data in event buffer - events will be raised
        /// </summary>
        public void Init(Boolean ignoreLastEvents = true)
        {
            _rawDev.Connection.Open();

            var res = _rawDev.CmdSimplePoll();

            DeviceCategory = _rawDev.CmdRequestEquipmentCategory();
            if (DeviceCategory != CctalkDeviceTypes.CoinAcceptor)
            {
                throw new InvalidOperationException("Connected device is not a coin acceptor. " + DeviceCategory);
            }

            ProductCode  = _rawDev.CmdRequestProductCode();
            SerialNumber = _rawDev.CmdGetSerial();
            Manufacturer = _rawDev.CmdRequestManufacturerId();
            PollInterval = _rawDev.CmdRequestPollingPriority();

            _rawDev.CmdModifyInhibitStatus(0, 0);

            //_rawDev.CmdReset();
            //_rawDev.CmdSetMasterInhibitStatus(IsInhibiting);

            //throw new InvalidOperationException("Msg: " + _rawDev.CmdGetMasterInhibitStatus().ToString()); - vraca false znaci da neInhibira.

            var sp = _rawDev.CmdRequestStatus();

            var evBuf = _rawDev.CmdReadEventBuffer();

            if (!ignoreLastEvents)
            {
                RaiseLastEvents(evBuf);
            }
            _lastEvent = evBuf.Counter;

            //_rawDev.TestSolenoids();

            //_rawDev.TestOutputLines();

            IsInitialized = true;
        }
Exemplo n.º 3
0
 public void ModifyInhibitStatus(int Data1 = 255, int Data2 = 0)
 {
     _rawDev.CmdModifyInhibitStatus(Data1, Data2);
 }