コード例 #1
0
 public void checkStatus()
 {
     foreach (String keonnSystemIPaddress in keonnSystemsIPaddress)
     {
         RESTUtil         util    = new RESTUtil(keonnSystemIPaddress, this.debug);
         HashSet <Device> devices = util.parseDevices(false);
         if (devices == null)
         {
             return;
         }
         foreach (Device d in devices)
         {
             Console.WriteLine("Status of " + d.id + " is " + util.isRunning(d, false));
         }
     }
 }
コード例 #2
0
        public void run()
        {
            /**
             * This application is meant to test each function of the RESTUtil java class
             */

            /**
             * PARSE DEVICES
             */
            try
            {
                devices = util.parseDevices(false);
                Console.WriteLine("[INFO] The function 'parseDevices' was successful");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine("[INFO] The function 'parseDevices' was a failure");
            }

            foreach (Device d in devices)
            {
                if (KEONN_FAMILY.AdvanReader.ToString().Equals(d.family) ||
                    KEONN_FAMILY.AdvanPay.ToString().Equals(d.family))
                {
                    /**
                     * CONNECT
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("connect"))
                        {
                            this.connect(d);
                        }
                    }
                    else
                    {
                        this.connect(d);
                    }

                    /**
                     * PRINT DEVICE
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("printDevice"))
                        {
                            this.printDevice(d);
                        }
                    }
                    else
                    {
                        this.printDevice(d);
                    }

                    /**
                     * GET READ MODE
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("getReadMode"))
                        {
                            this.getReadMode(d);
                        }
                    }
                    else
                    {
                        this.getReadMode(d);
                    }

                    /**
                     * START & STOP DEVICE
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("startStopDevice"))
                        {
                            this.startStopDevice(d);
                        }
                    }
                    else
                    {
                        this.startStopDevice(d);
                    }

                    /**
                     * PARSE DEVICE
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("parseDevice"))
                        {
                            this.parseDevice();
                        }
                    }
                    else
                    {
                        this.parseDevice();
                    }

                    /**
                     * GET INVENTORY
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("getInventory"))
                        {
                            this.getInventory(d);
                        }
                    }
                    else
                    {
                        this.getInventory(d);
                    }

                    /**
                     * GET LOCATION
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("getLocation"))
                        {
                            this.getLocation(d);
                        }
                    }
                    else
                    {
                        this.getLocation(d);
                    }

                    /**
                     * SET DEVICE MODE
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setDeviceMode"))
                        {
                            this.setDeviceMode(d);
                        }
                    }
                    else
                    {
                        this.setDeviceMode(d);
                    }

                    /**
                     * SET READ MODE
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setReadMode"))
                        {
                            this.setReadMode(d);
                        }
                    }
                    else
                    {
                        this.setReadMode(d);
                    }

                    /**
                     * SET POWER
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setPower"))
                        {
                            this.setPower(d);
                        }
                    }
                    else
                    {
                        this.setPower(d);
                    }

                    /**
                     * SET SENSITIVITY
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setSensitivity"))
                        {
                            this.setSensitivity(d);
                        }
                    }
                    else
                    {
                        this.setSensitivity(d);
                    }

                    /**
                     * CONFIGURE ANTENNA
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("configureAntenna"))
                        {
                            this.configureAntenna(d);
                        }
                    }
                    else
                    {
                        this.configureAntenna(d);
                    }

                    /**
                     * SET ANTENNA CONFIGURATION
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setAntennaConfiguration"))
                        {
                            this.setAntennaConfiguration(d);
                        }
                    }
                    else
                    {
                        this.setAntennaConfiguration(d);
                    }

                    /**
                     * PROCESS TCP DATA
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("processTCPData"))
                        {
                            this.processTCPData(d);
                        }
                    }
                    else
                    {
                        this.processTCPData(d);
                    }

                    /**
                     * PARSE ANTENNAS
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("parseAntennas"))
                        {
                            this.parseAntennas(d);
                        }
                    }
                    else
                    {
                        this.parseAntennas(d);
                    }

                    /**
                     * SET SEQUENTIAL READ TIME
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setSequentialReadTime"))
                        {
                            this.setSequentialReadTime(d);
                        }
                    }
                    else
                    {
                        this.setSequentialReadTime(d);
                    }

                    /**
                     * COMMISSION TAG OP
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("commissionTagOp"))
                        {
                            this.commissionTagOp(d);
                        }
                    }
                    else
                    {
                        this.commissionTagOp(d);
                    }

                    /**
                     * WRITE DATA OP
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("writeDataOp"))
                        {
                            this.writeDataOp(d);
                        }
                    }
                    else
                    {
                        this.writeDataOp(d);
                    }

                    /**
                     * READ DATA OP
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("readDataOp"))
                        {
                            this.readDataOp(d);
                        }
                    }
                    else
                    {
                        this.readDataOp(d);
                    }

                    /**
                     * LOCK OP
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("lockOp"))
                        {
                            this.lockOp(d);
                        }
                    }
                    else
                    {
                        this.lockOp(d);
                    }

                    /**
                     * NXP EAS CHECK
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("NXP_EASCheck"))
                        {
                            this.NXP_EASCheck(d);
                        }
                    }
                    else
                    {
                        this.NXP_EASCheck(d);
                    }

                    /**
                     * SET GPO
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setGPO"))
                        {
                            this.setGPO(d);
                        }
                    }
                    else
                    {
                        this.setGPO(d);
                    }

                    /**
                     * GET GPIO ALL
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("getGPIOAll"))
                        {
                            this.getGPIOAll(d);
                        }
                    }
                    else
                    {
                        this.getGPIOAll(d);
                    }

                    /**
                     * SPEAKER
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("speaker"))
                        {
                            this.speaker(d);
                        }
                    }
                    else
                    {
                        this.speaker(d);
                    }

                    /**
                     * BUZZER
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("buzzer"))
                        {
                            this.buzzer(d);
                        }
                    }
                    else
                    {
                        this.buzzer(d);
                    }

                    /**
                     * SET EPCGEN2 FILTER
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setEPCGen2Filter"))
                        {
                            this.setEPCGen2Filter(d);
                        }
                    }
                    else
                    {
                        this.setEPCGen2Filter(d);
                    }

                    /**
                     * SET ACTUATOR
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setActuator"))
                        {
                            this.setActuator(d);
                        }
                    }
                    else
                    {
                        this.setActuator(d);
                    }

                    /**
                     * ERASE ACTUATORS
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("eraseActuators"))
                        {
                            this.eraseActuators(d);
                        }
                    }
                    else
                    {
                        this.eraseActuators(d);
                    }

                    /**
                     * SET SQL PARAMETERS
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("setSQLParameters"))
                        {
                            this.setSQLParameters(d);
                        }
                    }
                    else
                    {
                        this.setSQLParameters(d);
                    }

                    /**
                     * PROCESS GPI DATA
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("processGPIdata"))
                        {
                            this.processGPIdata(d);
                        }
                    }
                    else
                    {
                        this.processGPIdata(d);
                    }

                    /**
                     * PARSE XML
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("parseXML"))
                        {
                            this.parseXML(d);
                        }
                    }
                    else
                    {
                        this.parseXML(d);
                    }

                    /**
                     * PROCESS ALARM MESSAGES
                     */
                    if (this.call != null)
                    {
                        if (this.call.Equals("processAlarmMessages"))
                        {
                            this.processAlarmMessages(d);
                        }
                    }
                    else
                    {
                        this.processAlarmMessages(d);
                    }
                    Console.WriteLine("Press a key to finish...");
                    Console.ReadLine();
                }
            }
        }