Guidelines for creating device drivers

The most important information you need to know before you begin to create your own Control4 device driver is to understand how your devices work. After that, you can use the Driver Wizard and/or the DriverWorks SDK or DriverEditor to create your own drivers. Contact Control4 Technical Support for details.

IMPORTANT! Before you begin, check the manufacturer's documentation to learn about the codes or customized macros required to support your device, and understand the inputs and outputs that your device supports and other details about the device as needed.

For best results, understand the following concepts and guidelines:

  • Supported commands and inputs/outputs of the device—Prior to starting the Driver Wizard, have a basic understanding of the device.
  • Discrete versus toggle—In the Driver Wizard, the term 'discrete' indicates a direct setting rather than a toggle option between settings. For example, a receiver might have 'discrete input select,' which lets you select the input directly (DVD) rather than using a toggle button that cycles through all the inputs (DVD, VCR, TV), such as Input Toggle.
  • IR codes versus macros—In the Driver Wizard, some IR codes complete the needed command; however, to complete the commands, you may need a macro (a sequence of codes).
  • Adding all options for AV connections—When adding AV connections, select all possible options for the device so all options are available for selection.
  • Power management options—A variety of supported Power-Management options are available to choose from, but the optimal method depends on the device. When no other option works, use the Assume the Device is Always On option, and leave it up to the user to ensure manually that the device is on. See “Guidelines for defining power management.”
  • Adding commands and custom commandsThe Driver Wizard supports a set of default commands for each device type, such as Television, VCR, DVD, etc. If a command you need does not appear on the Default Command list, click Add and use the pull-down menu to look for the command. You can also add custom commands if necessary.
  • Driver Wizard screens vary for device types—Because different devices, such as televisions, VCRs, and DVDs have different functionality, the Driver Wizard steps you through different questions as appropriate for that device type, and there are pre-defined generic Device Types that have a common set of commands with varying capabilities that you can use as a base. The Driver Wizard prompts you to select the appropriate commands from these basic commands, as well as identify any additional capabilities that the particular device is able to perform.
  • Example: All televisions have Up/Down channel and Up/Down volume commands, so these basic commands are already included in the generic TV device type. However, not all televisions have direct channel selection, where you can select a channel by pressing a sequence of numbered keys.

  • Creating or editing multi-featured device drivers—You can create only combination types that are listed in the Create New Driver wizard. Control4 recommends that you start with an existing driver in the Online Database, add it to your Local Database, and then edit it as needed to meet the new device-driver need. Be patient. You may need to change IR codes if a code doesn't work with your device.
  • DriverWorks can be used to create 2-way drivers for AV and non-AV devices. It requires some programming skills, however, but leverages the Lua-embeddable scripting language, a powerful, fast, and light-weight (when compared to other scripting languages). See “Creating a 2-way serial or TCP/IP-controlled driver.”
  • Tip: When a device driver is created, you may want to distribute it to multiple projects on different computers. To do this, copy the driver file from the default install directory: C:\Program Files\Control4\Composerxxx\Drivers\Virtual to the same directory on the other computers.

    This action makes this driver file available to all the projects stored on that computer. Driver files are named by device type, protocol, manufacturer, and model with a.c4i extension.

    Example: tv_ir_samsung_tx-p1430.c4i.

  • DriverEditor—This tool is designed to assist the dealer or driver developer in creating and maintaining their drivers for use with the Control4 system.