Пример #1
0
        /// <summary></summary>
        protected override void SetReaderConfig()
        {
            MSG_SET_READER_CONFIG msg = new MSG_SET_READER_CONFIG();

            // Keepalive
            PARAM_KeepaliveSpec pKeepalive = new PARAM_KeepaliveSpec();

            msg.KeepaliveSpec = pKeepalive;

            pKeepalive.KeepaliveTriggerType = ENUM_KeepaliveTriggerType.Periodic;
            pKeepalive.PeriodicTriggerValue = 30000;

            // Link monitor
            PARAM_ImpinjLinkMonitorConfiguration pLinkMonitor = new PARAM_ImpinjLinkMonitorConfiguration();

            pLinkMonitor.LinkMonitorMode   = ENUM_ImpinjLinkMonitorMode.Enabled;
            pLinkMonitor.LinkDownThreshold = 4;

            msg.Custom.Add(pLinkMonitor);

            // Event notification
            PARAM_ReaderEventNotificationSpec pNotificationSpec = new PARAM_ReaderEventNotificationSpec();

            msg.ReaderEventNotificationSpec = pNotificationSpec;

            pNotificationSpec.EventNotificationState = new PARAM_EventNotificationState[1];

            PARAM_EventNotificationState pROSpecState = new PARAM_EventNotificationState();

            pNotificationSpec.EventNotificationState[0] = pROSpecState;

            pROSpecState.NotificationState = true;
            pROSpecState.EventType         = ENUM_NotificationEventType.ROSpec_Event;

            //Console.Error.WriteLine($"{msg.ToString()}");

            MSG_ERROR_MESSAGE?msgErr = null;
            MSG_SET_READER_CONFIG_RESPONSE?msgResp = this.BaseClient?.SET_READER_CONFIG(
                msg: msg,
                msg_err: out msgErr,
                time_out: this.Timeout);

            LLRPHelper.CheckLLRPResponse(msgResp, msgErr);
        }
Пример #2
0
        /// <summary></summary>
        private void SetReaderConfig()
        {
            MSG_SET_READER_CONFIG msg = new MSG_SET_READER_CONFIG();

            PARAM_KeepaliveSpec pKeepalive = new PARAM_KeepaliveSpec();

            msg.KeepaliveSpec = pKeepalive;
            pKeepalive.KeepaliveTriggerType = ENUM_KeepaliveTriggerType.Periodic;
            pKeepalive.PeriodicTriggerValue = 15000;

            PARAM_ImpinjLinkMonitorConfiguration pLinkMonitor = new PARAM_ImpinjLinkMonitorConfiguration();

            pLinkMonitor.LinkDownThreshold = 4;
            pLinkMonitor.LinkMonitorMode   = ENUM_ImpinjLinkMonitorMode.Enabled;
            msg.Custom.Add(pLinkMonitor);

            //
            msg.AntennaConfiguration = new PARAM_AntennaConfiguration[1];
            var pAntConfig = new PARAM_AntennaConfiguration();

            msg.AntennaConfiguration[0] = pAntConfig;

            pAntConfig.AntennaID = 0;
            pAntConfig.AirProtocolInventoryCommandSettings = new UNION_AirProtocolInventoryCommandSettings();

            var pInventoryCommand = new PARAM_C1G2InventoryCommand();

            pAntConfig.AirProtocolInventoryCommandSettings.Add(pInventoryCommand);
            pInventoryCommand.TagInventoryStateAware = false;

            MSG_ERROR_MESSAGE?msgErr = null;
            var msgResp = this.BaseClient?.SET_READER_CONFIG(
                msg:      msg,
                msg_err:  out msgErr,
                time_out: 3000);

            this.CheckLLRPError(msgResp, msgErr);
        }
Пример #3
0
        private void SetKeepAlive()
        {
            PARAM_KeepaliveSpec kSpec = new PARAM_KeepaliveSpec();
            kSpec.KeepaliveTriggerType = ENUM_KeepaliveTriggerType.Periodic;
            kSpec.PeriodicTriggerValue = (uint)keepAliveTrigger;

            MSG_SET_READER_CONFIG readerConfig = new MSG_SET_READER_CONFIG();
            readerConfig.KeepaliveSpec = kSpec;

            llrp.OnKeepAlive += new delegateKeepAlive(OnKeepAliveRecieved);
            try
            {
                MSG_SET_READER_CONFIG_RESPONSE configResponse = (MSG_SET_READER_CONFIG_RESPONSE)SendLlrpMessage(readerConfig);
            }
            catch (Exception ex)
            {
                throw new ReaderException(ex.Message);
            }
            finally
            {
                kSpec = null;
                readerConfig = null;
            }
        }