定制 mnsd47/onm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mnsd47/onm

Composer 安装命令:

composer require mnsd47/onm

包简介

Onm is a library for the management of optical network through TL1 protocol.

README 文档

README

Onm is a library for the management of optical network through TL1 protocol.

Usage

$nm = new onm\NetworkManager('172.16.0.2', 3337, 'admin', 'admin', 'cTag', onm\Fiberhome::class);

$devices = $nm->lstDevice()->response; // Get all OLT from network
$unregisteredOnu = $nm->lstUnregonu()->response; // Get all unregistered ONU
$allOnu = $nm->lstOnu(['OLTID' => '10.0.1.200'])->response; // Get all ONU from an OLT

// Register a ONU
$registerOnu = $nm->addOnu(['OLTID' => '10.0.1.200', 'PONID' => 'NA-NA-1-1'], 
['NAME' => 'test', 'AUTHTYPE' => 'SN', 'ONUID' => 'FHTT928B0000', 'ONUTYPE' => 'AN5506-01-A']); 

if($registerOnu->success) print('ONU registered was successfuly.');

// Get optical information of ONU or a PON
$getOpticalInfo = $nm->lstOmddm(['OLTID' => '10.0.1.200', 'PONID' => 'NA-NA-1-1',
'ONUIDTYPE' => 'MAC', 'ONUID' => 'FHTT928B0000']); 

if($getOpticalInfo->success) 
{
    print(sprintf('RxPower: %s; ', $getOpticalInfo->response['RxPower']));
    print(sprintf('Temperature: %s; ', $getOpticalInfo->response['Temperature']));
}

// Using callback
$nm->lstDevice()->success(function($responde) {
    foreach($response as $device) {
      print(sprintf('Name: %s; ', $device['DEVNAME']));
      print(sprintf('IP Address: %s; ', $device['DEVIP']));
      print(sprintf('Model: %s', $device['DT']));
      print(PHP_EOL);
    }
});

// Setting up a VLAN on the ONU
$nm->cfgLanport([
  'OLTID' => '10.0.1.200', 
  'PONID' => 'NA-NA-1-1', 
  'ONUIDTYPE' => 'SN', 
  'ONUID' => 'FHTT928B0000',
  'ONUPORT' => 'NA-NA-NA-1'
 ], [
  'PVID' => '1000', 
  'VLANMOD' => 'Tag'
])->success(function() {
  print('VLAN setting was successfuly.');
})->fail(function($err) {
  print('VLAN setting was not successfuly.'.PHP_EOL);
  print(sprintf('Error: %s', $err));
}); 

Installing

composer require mnsd47/onm

Supported vendors

Vendor Classname Instantiation
Fiberhome Fiberhome new NetworkManager($ems, $port, $user, $pass, $ctag, Fiberhome::class)
Multilaser Multilaser new NetworkManager($ems, $port, $user, $pass, $ctag, Multilaser::class)

UML

Class diagram

License

MIT License (MIT). License File

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-04-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固