Exemplo n.º 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);
        }
Exemplo n.º 2
0
        private void EnableReaderNotification()
        {
            List<PARAM_EventNotificationState> eStateList = new List<PARAM_EventNotificationState>();

            PARAM_EventNotificationState aiEvent = new PARAM_EventNotificationState();
            aiEvent.EventType = ENUM_NotificationEventType.AISpec_Event;
            aiEvent.NotificationState = true;
            eStateList.Add(aiEvent);
            PARAM_EventNotificationState roEvent = new PARAM_EventNotificationState();
            roEvent.EventType = ENUM_NotificationEventType.ROSpec_Event;
            roEvent.NotificationState = true;
            eStateList.Add(roEvent);

            MSG_SET_READER_CONFIG setReaderConfig = new MSG_SET_READER_CONFIG();
            setReaderConfig.ReaderEventNotificationSpec = new PARAM_ReaderEventNotificationSpec();
            setReaderConfig.ReaderEventNotificationSpec.EventNotificationState = eStateList.ToArray();

            try
            {
                MSG_SET_READER_CONFIG_RESPONSE setReaderConfigResponse = (MSG_SET_READER_CONFIG_RESPONSE)SendLlrpMessage(setReaderConfig);
            }
            catch (Exception ex)
            {
                throw new ReaderException(ex.Message);
            }
        }