Description Go to top

The Remote Controller device contains a set of functions and variables for controlling the USB infrared remote controller emulator. The USB remote controller emulator is a control device for reception and transmission of infra-red remote commands. It is a USB powered device for receiving (recording) and transmitting IR commands.

The real usage example of the Remote Controller device can be seen at:

 

Device info Go to top

In order to initialize the USB remote controller (RC) emulator properly, several parameters must be set. The following example presents a proper definition of the USB RC emulator instance inside the test_env.ini (test environment description) configuration file.

MANDATORY INITIALIZATION:
[device]
alias = RemoteController
name = REMOTECONTROLLER
config = RemoteController.ini
cfgfile = RemoteController.rcc
OPTIONAL INITIALIZATION:
[device]
alias = RemoteController
name = REMOTECONTROLLER
config = RemoteController.ini
cfgfile = RemoteController.rcc
gap = 300
 

Device parameters Go to top

Details about the parameters that need to be set in order to correctly configure USB remote controller (RC) emulator device are provided here:

  • alias – is a tag name which will be used in the test case or in the API.
  • name – presents a unique identifier for the remote controller device and must be set as REMOTECONTROLLER.
  • config – is the name of the file which contains additional configuration (macro commands) related to the USB RC device (this parameter is optional but desirable). The example of the macro file is available here.
  • cfgfile – is the name of the file with remote control key codes (this file contains a list of key codes for specific remote controller with other parameters for the RC emulator regular operation). This file with all listed parameters will be created during the learning process of key codes using the RC Capture application. The value is the name of that configuration file with encoded control protocol. Depending on file name which is passed (i.e. extension type, .rcc or .cf), RCC or CF file type will be expected and used. The default value is an empty string.
  • gap – is a delay between two sequential commands in ms. The default value is 300 ms.

These parameters present a device configuration and they are described in the Remote Controller device section.

 

Device usage Go to top

When configuring and controlling devices from the test itself, such tests often become less readable as well as too large and very complicated for maintenance. To avoid this situation, the macros are used.

One example of the macro that can be used by the Remote Controller device is given here:

[OPEN_APPLICATIONS_MENU] "HOME 1 1000" "RIGHT 1 1000"

Every macro represents RC sequence of different RC key to be sent to the DUT (Device Under Test) in order to navigate it to the desired state. Every RC key used in macros is represented by it’s name (the names are created by using the RC Capture application), number of times that RC key should be pressed and the time delay in ms after every press.

You can note here that if you want to enter into the applications menu, you need to press the HOME button once, wait for 1 second while the command is executed. After that you need to press the RIGHT button once and wait for 1 second while the command is executed.

If you want to emulate the “press and hold” functionality of some key, you need to add the forth parameter to the macro command:

[OPEN_APPLICATIONS_MENU_OPTIONS] "HOME 1 1000" "RIGHT 1 1000" "OK 1 1000 50"

You can note here that after navigating to the applications menu, user emulates the long press of the OK button. The forth parameter here presents the number of impulses sent in one second, and that mostly depends on the physical remote controller device and the manufacturer.

 

RemoteController.ini Go to top

Here you can find a full example of the macro configuration file that is created for the previously described device.

****************************************************** Remote Controller macros ************************************************************************************
###################################################### RC KEYS #####################################################################################################
[0] "0 1 100"
[1] "1 1 100"
[2] "2 1 100"
[3] "3 1 100"
[4] "4 1 100"
[5] "5 1 100"
[6] "6 1 100"
[7] "7 1 100"
[8] "8 1 100"
[9] "9 1 100"
[CH+] "CH+ 1 100"
[CH-] "CH- 1 100"
[VOL+] "VOL+ 1 100"
[VOL-] "VOL- 1 100"
[BACK] "BACK 1 1000"
[EXIT] "EXIT 1 1000"
[UP] "UP 1 400"
[DOWN] "DOWN 1 400"
[LEFT] "LEFT 1 400"
[RIGHT] "RIGHT 1 400"
[OK] "OK 1 500"
[OK_0] "OK 1 0"
[MUTE] "MUTE 1 500"
[CH+_0] "CH+ 1 0"
[CH-_0] "CH+ 1 0"
[HOME_0] "HOME 1 0"
[BACK_0] "BACK 1 0"
[MUTE_0] "MUTE 1 0"
[DOWN_0] "DOWN 1 0"
[INFO] "INFO 1 500"
[POWER] "POWER 1 500"
[M@TV] "M@TV 1 500"
[GUIDE_BUTTON] "GUIDE 1 500"
[LIST] "LIST 1 500"
[VOD_BUTTON] "VOD 1 500"
[AV] "AV 1 500"
[FAST_FORWARD] "FAST_FORWARD 1 500"
[PLAY_PAUSE] "PLAY_PAUSE 1 500"
[RECORD] "RECORD 1 500"
[REWIND] "REWIND 1 500"
[STOP] "STOP 1 500"
[ZOOM] "ZOOM 1 500"
[PAUSE] "PLAY_PAUSE 1 1000"
[REC] "RECORD 1 1000"
[FWD]   "FAST_FORWARD 1 1000"
[FRW]   "REWIND 1 1000"
[OK_LONG] "OK 1 1000 50"
[UP_LONG] "UP 1 2000 20"
[DOWN_LONG] "DOWN 1 2000 20"
###################################################### DEFAULT COMMANDS ############################################################################################
[INIT] "HOME 1 500" "EXIT 1 1000"
[EXIT_CH_1] "HOME 1 500" "EXIT 1 1000" "1 1 4000" "EXIT 1 1000"
[HOME] "HOME 1 2000"
[POWER_OFF] "POWER 1 500" "RIGHT 2 500" "OK 1 1000"
###################################################### HOME MENU ###################################################################################################
[SERVICES] "HOME 1 2000" "DOWN 1 1000"
[CHANNELS] "HOME 1 2000" "LEFT 1 1000"
[HOME_APPS] "HOME 1 2000" "RIGHT 2 1000"
[HOME_SUGGESTIONS] "HOME 1 2000" "UP 1 1000"
###################################################### SERVICES MENU ###############################################################################################
[LIVE_TV] "HOME 1 2000" "DOWN 1 1000" "OK 1 2000"
[VOD] "HOME 1 2000" "DOWN 1 1000" "DOWN 1 500" "OK 1 2000"
[TV_REPLAY] "HOME 1 2000" "DOWN 1 1000" "DOWN 2 2000" "OK 1 2000"
[TV_REPLAY_NAVIGATE] "HOME 1 2000" "DOWN 1 1000" "DOWN 2 500"
[SUGGESTIONS] "HOME 1 2000" "DOWN 1 1000" "DOWN 3 500" "OK 1 2000"
[SETTINGS] "HOME 1 2000" "DOWN 1 1000" "DOWN 4 500" "OK 1 2000"
[MEDIA_CENTER] "HOME 1 2000" "DOWN 1 1000" "DOWN 5 500" "OK 1 2000"
[APPS] "HOME 1 2000" "DOWN 1 1000" "UP 2 500" "OK 1 2000"
[INSTALLED_APPS] "HOME 1 2000" "DOWN 1 1000" "UP 2 500" "OK 1 2000"
[GOOGLE] "HOME 1 2000" "DOWN 1 1000" "DOWN 7 500" "OK 1 2000"
###################################################### TUNE TO SELECTED CHANNEL ####################################################################################
[CH_1] "1 1 5000"
[CH_500] "5 1 500" "0 1 500" "0 1 500"
[CH_504] "5 1 500" "0 1 500" "4 1 500"
###################################################### SCAN_CHANNELS ###############################################################################################
[DVBT_SCAN]  "HOME 1 2000" "DOWN 1 1000" "UP 4 500" "OK 1 2000" "RIGHT 1 500" "DOWN 3 500" "RIGHT 2 500" "OK 1 1000" "OK 1 150000"
[OTT_SCAN]  "HOME 1 2000" "DOWN 1 1000" "UP 4 500" "OK 1 2000" "RIGHT 1 500" "DOWN 3 500" "RIGHT 2 500" "OK 1 1000" "DOWN 1 500" "OK 1 25000"
[EXIT_DVBT_SCAN]  "HOME 1 500" "EXIT 1 1000"
[EXIT_OTT_SCAN]  "HOME 1 500" "EXIT 1 1000"
###################################################### AUDIO/VIDEO_FOR_LIVE_TV #####################################################################################################
[SET_VOLUME_TO_MIDDLE] "VOL+ 10 1000" "VOL- 5 1000"
[SET_VOLUME_TO_MIN] "VOL- 10 1000" "VOL+ 1 1000"
[SET_VOLUME_TO_MAX] "VOL+ 10 1000"