api - 投影仪控制 - RS232/USB?

标签 api controls serial-port projector

我注意到许多投影仪都有 RS232 或 USB 端口,可用于控制投影仪的功能,即切换输入以及开关电源。有谁知道是否有 API 可以通过编程方式控制这些功能?

我正在使用 Java,但尤其是 RS232,我猜这是无关紧要的,因为协议(protocol)将处于较低的级别。如果没有“标准”(我猜不会有),建议是什么?目前,我正在考虑为我想要的功能定义一个投影仪控制接口(interface),然后允许人们编写用于从外部控制投影仪的类并将它们放在适当的位置(也许使用新的 watchservice API 通过动态反射来拾取它们) .) 是否存在我没​​有发现的任何缺陷?

本质上,我正在寻找一个文档(如果存在)来描述用于在各种不同投影仪上执行基本功能的串行协议(protocol)。

最佳答案

Incredibly useful reply over on AVForums:

almost all gear is simple telnet rs232 of text strings. not all ascii but most is. you will read of calculated parity and checksum bytes.. but in reality you just need to send a string and the projector will do what its told. Some are easier to communicate by sending hex bytes, esp if they use odd non ascii characters, but most are simple ascii followed by a linefeed.. thing is, if you use hex, you can support every code, including ascii, if you are going open platform, start there.

lots of models have different iputs etc, but most the time all of a manufacturers proectors will use the same rs232 strings for on, off, input1-7 or hdmi 1-2-3 etc...

keep it simple if you can, just controlling the power state and input selection, and you stand a chance of getting 80% of common projectors without too much work.

ohh, and 9600, 8n1 for almost everything.

更多细节:

as promised... this is some on offs for optoma.. on is the following ascii text followed by a carriage return (incase you dont know.. there is no code for 'ENTER' key.. its represented by the old typewriter functions of a carriage return and a line feed. these are represented by hex values 0d for CR, and 0a for LF) hex

for letter 'I' is :49 and 'R' is :52

On

*0IR001 or in hex on next line..

2a 30 49 52 30 30 31 0d

Off is *0IR002 or 2a 30 49 52 30 30 32 0d

set to input HDMI1 *0IR017\r

2a 30 49 52 30 31 37 0d

Panasonic AX200.. different because it has text meaning, but with a hex only character to start a command '02' and hex '03' to end one.. the " are not used in the command, just to show its ascii text there inside them

ON

:02 "PON" :03

02 50 4f 4e 03

OFF

:02 "POF" :03

02 50 4f 46 03

HDMI1 set input

:02 "IIS:HD1" :03

02 49 49 53 3a 48 44 31 03

Sony is weird, no real ascii in there at all.. just a full stop and a question mark.. this is hex only..

Power On

a9 17 2e 00 00 00 3f 9a

Power Off

a9 17 2f 00 00 00 3f 9a

HDMI1

A9 00 01 00 00 04 05 9A

关于api - 投影仪控制 - RS232/USB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6801593/

相关文章:

c# - .NET 中的动态控件问题

c# - 如果正在使用的 USB COM 端口已被移除,SerialPort.Close() 会卡住应用程序

tcp - MODBUS,设备响应的最长时间是否有限制?

ruby-on-rails - Grape API (swagger doc) - 'desc' 的全局配置

api - 如何将分页添加到REST API?

api - Promise 拒绝 : No provider for UserDetails!(UserDetails 是 Model 类)

c# - 从串口读取字节

android - Android 应用程序崩溃后向服务器发送日志文件

python - 这个控制结构是代码味道吗?

.net - 不可见的标签页(标签控件)上的控件返回 Visible = false