Anviz device cloud PHP interface kit

========================================================================================================================
Support device
    C2 Pro/W1/W2/OA1000
    FaceDeep3/FaceDeep5/FaceDeep3-IRT/FaceDeep5-IRT/FacePass 7 Pro
    MBIO

Environmental requirements
    Apache + php(php version support 5.x/7.0)
    Extended requirements： php_soap/php-mcrypt
    support rewrite

Directory File Description
     lib            Library
        config.php          Configuration file
        Protocol.php        Protocol
        SoapDiscovery.php   PHP SOAP wsdl
        Tools.php           Method packets
        Webserver.php       Communction process
     logs              Logs Directory
     sample            Sample
        index.php      DEMO File
        1              Test FP template
     .htaccess         Distributed configuration file
     interface.php     Callback interface
     README            Description
     README.md         Markdown format Description
     Webserver.php     php soap server

Testing process
    Setp1. Deploy the Apache + php environment, Install"php_soap"Extended, "php-mcrypt"Extended and"rewrite"support
    Setp2. Put the directory file to site directory, input http://(site domain name)/webserver/wsdl.html in the browser, can be display wsdl pages means successful
    Setp3. Power on the ddevice,and setup device network setting connect internet
    Setp4. Enter into “network" - “cloud” menu follow the below setup
            User Name: (Any user name)
            Password：（Any Password）
            ServerIP：Mannual input
            Input IP: (Site domain name，The site domain name must same as WSDL link For example WSD link address is http://localhost/demo/webserver/wsdl.html，then the Site domain is:localhost/demo)
    Setp5.  Then on the device screen will display cloud connection ok
    Setp6.  And enter into site root directory log folder to check the device communicaiton logs with server

Develop Process
    1. Create a new custom callback and lead into interface.php,For example：
            Create a new demo.php
            <?php
                require_once("interface.php")
                class callback implements AnvizInterface{
                    ...
                    ...
                }
            ?>
            * Please reader interface.php to check the description of the callback
    2. Modify lib/config.php config file, the detail config please check  lib/config.php description
    3. Add application logic in demo.php

lib/config.php description
    KEY: Device communication key, enter device develop mode,the default develop KEY is "AnvizDevelopOpenKey" for test，when for business application please apply the official key from Anviz
    DEBUG: Debug mode，when enable debug mode will print out a lot of log information under logs folder
    TIMEZONE: Server time zone configuration
    CALLBACK_FILE: The path of the callback file ，The path is the absolute path of the step1 demo.php file in the develop process
    CALLBACK_CLASS: Name of callback it is defined named "callback" in develop process step1

interface.php the callback function description
    *  The detail description of Callback function please check `interface.php`
    getNextCommand: Every time the device communication with server need use this method to return the command which device need operate. When the teturn value is null the device will communication  with server in next 5 sec (heartbeat mode)，Packet method of the return instruction please refer to "Anviz Command" in interface.php folder
            For example add below method in callback when you create demo.php(the Develop Process step.1 ) to get the network config information
                    public function getNextCommand($device_id)
                    {
                        $AnvizCommand = new AnvizCommand();
                        $AnvizCommand->token = $this->getToken($device_id);     //Get current device Token value
                        $AnvizCommand->device_id = $device_id;
                        $AnvizCommand->task_id = substr(time(), -8);            //Current task flag NO.
                        return $AnvizCommand->getNetwork();
                    }
    *  Please check `interface.php` description for another device function
