久保です。
(緑川様より)
>シリアルポート(RS232C)を監視(具体的には、UPSが信号を
>上げるかを監視)することになったのですが、何か良いサンプルは
>ないでしょうか。
先日、UPS を設定する機会があって調べてみたのですが、もしかすると以下の
ものがお探しの目的に沿ったものではないかと思いましたので、ご紹介します。
-------------------------------------------
genpower-1.0.1 に付属している gentest.c
-------------------------------------------
以下、その抜粋です。
gentest.c
----------------------------------------------------------------------------
/* Purpose : Monitor the serial port connected to a UPS. */
/* : Allows DTR and/or RTS lines to be stet to */
/* : simulate genpowerd UPS monitoring software. */
/* : The gentest program will show the state of */
/* : the control lines in the serial connection. */
/* : */
/* : The primary purpose for gentest is to help */
/* : discover the settings for UPS monitoring */
/* : cables. */
----------------------------------------------------------------------------
このソフトの紹介が以下にありました。
------------------------------------------------------------------------
「Linux でも UPS を利用しよう!! genpowerd を使用した UPS の設定法」
Software Design 1999年4月号 p.150-159
------------------------------------------------------------------------
なお、私のほうは APC SMART UPS 1400RMJ だったのですが、この UPS
は apcupsd-3.6.2 ですんなり制御できてしまったので、gentest は使わず
じまいでした。
以上
--
久保正彦 (KUBO Masahiko)
(株)KDDコミュニケーションズ メディアクリエイティブ グループ
E-mail: kubo _at_ mc.kddcom.co.jp TEL:(03)3351-8064 FAX(G3):(03)3351-7332