PHP code example of ocolin / uisp-extended

1. Go to this page and download the library: Download ocolin/uisp-extended library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ocolin / uisp-extended example snippets


// Minimal
$device = new Ocolin\UispExtended\Device( 
    ip: '192.168.1.100', password: 'rosebud' 
);

// Customized
$device = new Ocolin\UispExtended\Device( 
    ip: '192.168.1.100', password: 'rosebud', username: 'admin', port: 2222
)

$info = $device->getDeviceInfo();
print_r( $info );
/*
Ocolin\UispExtended\DTO\DeviceInfo Object
(
    [name] => PowerBeam 5AC
    [model] => PBE-5AC-Gen2
    [family] => WA
    [firmware] => 8.7.11
)
 */

$macs = $device->getMacTable();
print_r( $macs );
/*
Array
(
    [0] => Ocolin\UispExtended\DTO\MacEntry Object
        (
            [mac] => 00:0b:78:66:db:d0
            [interface] => eth0
            [isLocal] => 
            [agingTimer] => 2.11
        )

    [1] => Ocolin\UispExtended\DTO\MacEntry Object
        (
            [mac] => 04:f1:7d:05:07:c7
            [interface] => eth0
            [isLocal] => 
            [agingTimer] => 289.92
        )
)
 */

$device->changePassword( newPassword: 'myUpdatedPassword' );

$device->changePasswordWave( newPassword: 'myUpdatedPassword' );

$device->changePasswordAirOS( newPassword: 'myUpdatedPassword' );

$device->reboot();