Skip to content
Aqueous edited this page Feb 23, 2012 · 15 revisions

#Device Simulator Project

Rationale

This project is a step forward to enable local testing of roomtrol-daemon. In short, the project is to write a program in Ruby that simulates the behavior of a projector communicating with roomtrol-daemon on a serial device terminal such as /dev/ttys1.

This project will run as a separate process external from roomtrol-daemon. It will set up a pseudo terminal whose slave roomtrol-daemon will connect to (for example, /dev/pts/5 ). Thus it will "pretend" to be the projector to which roomtrol-daemon normally connects.

To Start

Understand Linux devices. Understand Linux terminals and pseudo terminals and the difference between the two. Play with minicom to see how roomtrol-daemon interacts with devices.

Helpful Links

http://linux.die.net/man/4/ptmx

Example usage

$ ./simulator --device_class EpsonProjector

Slave is on: /dev/pts/5 Master is on: /dev/ptmx/7 Slave: PWR=ON Master: OK Slave: PWR? Master PWR=01

*Note: this may not be what an actual conversation looks like

Deadline

April 15, 2012 at noon