/** * Constructor. Forms a device, identified by a connection_target, with * credentials connection_username and connection_password * * @param string $host MDM Server ip address, like 1.1.1.1 * @param int $port MDM Server port, like 34000 * @param string $connection Connection type, like * MDM_CONNECTION_TELNET * @param string $connection_target Something like 1.1.1.1:23 or * /dev/cuad0 * @param string $connection_username Username to log into device * @param string $connection_password Password to log into device * @param string $schemafile Absolute path to schema file used to * validate responses. * * @throws Exception on invalid arguments. * */ public function __construct($host, $port, $connection, $connection_target, $connection_username, $connection_password, $schemafile) { parent::__construct($host, $port, MDMZTE9xxx::$MDM_DEVICE_DSLAM_ZTE_9xxx, $connection, $connection_target, $connection_username, $connection_password, $schemafile); }
echo date('m/d/Y - H:i:s - ', time()) . 'HUAWEIMA5600 - ' . $msg . "\n"; return; } try { /* Instantiate devices. */ $connsCount = count($conns); $devices = array(); for ($i = 0; $i < $connsCount; $i++) { $devices[] = new MDMHUAWEIMA5600($argv[1], (int) $argv[2], $conns[$i], $tgts[$i], 'user', 'pass', SCHEMA); } /* Do. */ myLog('Start.'); $cmdCount = count($cmds); for ($j = 0; $j < $connsCount; $j++) { for ($i = 0; $i < $cmdCount; $i++) { myLog($descs[$i] . ' ' . ($args[$i] != null ? $args[$i] : '') . ' ' . '(' . intval($i) . ') ' . MDMDevice::getConnectionName($conns[$j])); $device = $devices[$j]; if (USE_SERVER) { $device->exec((int) $argv[3], (int) $argv[4], $cmds[$i], 300000, 300000, $args[$i]); $resultCode = $device->getResponseCode(); $resultMsg = $device->getResponseMessage(); myLog($device->getRawResponse()); if ($resultCode != 0) { throw new Exception('Command failed: ' . $resultCode . ': ' . $resultMsg); } if ($responses[$i] != null) { myLog(print_r($device->{$responses}[$i](), true)); } } else { $output = array(); $ret = 0;
/** * Constructor. Forms a device, identified by a connection_target, with * credentials connection_username and connection_password * * @param string $host MDM Server ip address, like 1.1.1.1 * @param int $port MDM Server port, like 34000 * @param string $connection Connection type, like * MDM_CONNECTION_TELNET * @param string $connection_target Something like 1.1.1.1:23 or * /dev/cuad0 * @param string $connection_username Username to log into device * @param string $connection_password Password to log into device * @param string $schemafile Absolute path to schema file used to * validate responses. * * @throws Exception on invalid arguments. * */ public function __construct($host, $port, $connection, $connection_target, $connection_username, $connection_password, $schemafile) { parent::__construct($host, $port, MDMHUAWEIMA5600::$MDM_DEVICE_DSLAM_HUAWEI_MA5600, $connection, $connection_target, $connection_username, $connection_password, $schemafile); }