定制 essb/tasnet 二次开发

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

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

essb/tasnet

Composer 安装命令:

composer require essb/tasnet

包简介

A small utility to interact with the Tascam MD4K blu-ray player over TCP.

README 文档

README

Control Tascam MP4K Bluray players over TCP network

A PHP library for communicating with the Tascam MP4K BluRay/DVD players. These players are workhorse units loved by theatres and A/V consultants.

This project is "just a bit more than enough to get the job done" . If I have time I will clean it up into a proper (and full implementation) library with a cli interface and IPC like server for instant and continuous queries.

Install

Composer

The easiest way to install Tasnet is by using composer:

composer global require essb/tasnet

Alternatively you can clone wherever is handy, and bestow execution privileges:

git clone https://git.sbcloud.cc/sb/tasnet.git

cd tasnet && chmod +x tasnet.php

If your PHP version is less than 8, you can strip function return types and the program will still work just fine.

Configuration

On first run it will ask for your projector's IP, and generate a data.json. You can then edit in your favourite text editor vim anytime you like!

Tasnet will attempt to discover the MAC address of the projector for you, but if you know it you can enter it manualy.

Make executable

Optionally you can make Tasnet executable, and rename it:

mv tasnet.php tasnet && chmod +x tasnet

Then you may call it just like an application:

./tasnet send play

Example:

{
    "ip": "192.168.1.10",
    "mac": "0D:E1:00:A0:7B",
    "broadcast": "192.168.1.255"
}

MacOS

Prior to v0.4, if on macOS you probably need to change the arp command flag from -a to -n.

tasnet.php Line 236:

   /**
     * Scooch the MAC out of the IP
     * @param string $ip the target IP
     */
    private function getRemoteMacAddr(string $ip): string
    {
        return strtoupper(exec("arp -n " . $ip . " | awk '{print $4 }'"));
    }

Configure

Setting the IP will allow communication with the device. For best results set a static IP on your unit.

php tasnet.php set ip 127.0.0.2

These parametres will be inferred and probably don't need to be manually added.

php tasnet.php set mac 00:03:ED:0F:BB

php tasnet.php set broadcast 10.10.10.255

Usage

Send a power on

php tasnet.php send on

Send Play

php tasnet.php send play

List of available commands

php tasnet.php send [command]

  • on/off
  • open/close
  • play/pause/stop
  • show_menu/hide_menu
  • next_track/prev_track
  • time_disc_elapsed
  • time_disc_remain
  • time_track_elapsed
  • time_track_remain
  • autoplay on/off/repeat

Power on feature

The on command is different from the other commands in that it uses a standard Wake-on-LAN message to turn on over UDP.

TODO

  • Implement the rest of the available commands
  • TCP implementation is pretty inefficent, and the connection should be made static.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-12