Program Fact 6. To Control the Switch

FlexOTO takes complete control of setting the optical switch routes during testing. There is nothing for you to do.

However, what do you do if your switch is not supported by FlexOTO? The answer is you can write your own switch driver which will enable FlexOTO to communicate with and control your switch. It's really not that difficult and you can easily learn how to write the driver. Here's an example program.

A user-written switch driver should listen for commands from FlexOTO over stdin, handle them, and respond to them by writing to stdout. There are only four commands that the driver needs to handle:

  • get_description. Sends to FlexOTO a list of the switch's model number, serial number, and port names in the form of a JSON string.
  • set_routes. Receives from FlexOTO a list of switch routes to set on the switch.
  • set_wavelength. Receives from FlexOTO a wavelength to configure the switch wavelength setting, if available.
  • exit. Receives from FlexOTO the message to stop the switch driver.

To Use Your Switch Driver

Once you have written your driver, you'll use the following five FlexOTO commands install and run the driver: