How to configure and use the Emulator
Since the release of framework 1.7, the emulator now supports different 'start-up' configurations files. These files are designed to simulate the receiver behavior based on the set of APIs supported in that particular year.
Framework Version 2.0 onwards
The general launch command is - npm run <OS> <API Spec version> , where OS is the host operating system and API Spec version is the approved set of Receiver API cmds by year, as defined in A/344 Standards document.
Example launch commands are provided in the tables below:
|
Operating System |
Command |
Emulation |
|---|---|---|
|
Windows |
|
To emulate functions within |
|
Mac |
|
To emulate functions within |
|
Linux |
|
To emulate functions within |
Framework Version 1.7 onwards
The general launch command is - npm run <OS> <API Spec version> , where OS is the host operating system and API Spec version is the approved set of Receiver API cmds by year, as defined in A/344 Standards document.
Example launch commands are provided in the tables below:
Single Service (To emulate a single TV service with Broadcast Application)
|
Operation System |
Command |
Emulation |
|---|---|---|
|
Windows |
|
To emulate functions within 2019 API specs |
|
|
To emulate functions within 2020 API specs |
|
|
|
To emulate functions within 2021 API specs |
|
|
Mac |
|
To emulate functions within 2019 API specs |
|
|
To emulate functions within 2020 API specs |
|
|
|
To emulate functions within 2021 API specs |
|
|
Linux |
|
To emulate functions within 2019 API specs |
|
|
To emulate functions within 2020 API specs |
|
|
|
To emulate functions within 2021 API specs |
Framework v1.5 - 1.6
General basic launch command for these versions are - npm run <OS> up a3fa , where OS is the host operating system flag. Examples in the table below.
Single Service (To emulate a single TV service with Broadcast Application)
|
Operation System |
Command |
|---|---|
|
Windows |
|
|
Mac |
|
|
Linux |
|
Framework v1.4.x and below
General basic launch command for these versions are - npm run <OS> up op , where OS is the host operating system flag. Examples in the table below.
Single Service (To emulate a single TV service with Broadcast Application)
|
Operation System |
Command |
|---|---|
|
Windows |
|
|
Mac |
|
|
Linux |
|
Run the Application Locally in Multichannel Mode
With Multichannel mode we can use a custom configuration file to simulate multiple TV stations/channels. This will allow us to simulate channel changes within a browser window.
When running in multichannel mode, buttons “u“ and “d“ on your keyboard will move the channel up or down, like a TV remote would do.
As with single mode different framework versions use different commands to launch into multichannel mode. The information below will provide the command examples for each version.
Framework Version 1.7 onwards
To use the custom multichannel configuration add the conf='<path_to_file>' to the standard launch command. Examples shown below.
|
Operating System |
Command |
Emulation |
|---|---|---|
|
Windows |
|
To emulate functions within 2019 API specs |
|
|
To emulate functions within 2020 API specs |
|
|
|
To emulate functions within 2021 API specs |
|
|
|
To emulate functions within 2021 API specs using the latest 2022 release |
|
|
Mac |
|
To emulate functions within 2019 API specs |
|
|
To emulate functions within 2020 API specs |
|
|
|
To emulate functions within 2021 API specs |
|
|
|
To emulate functions within 2021 API specs using the latest 2022 release |
|
|
Linux |
|
To emulate functions within 2019 API specs |
|
|
To emulate functions within 2020 API specs |
|
|
|
To emulate functions within 2021 API specs |
|
|
|
To emulate functions within 2021 API specs using the latest 2022 release |
Legacy versions (1.6 and below)
|
Operating System |
Command |
|---|---|
|
Windows |
|
|
Mac |
|
|
Linux |
|
PORT Considerations
The emulator by default uses localhost and port 5001 to run the applications in a browser.
A port clash issue may result under the following circumstances:
-
The host computer is already using port 5001 for another application.
-
Multiple instances of the Emulator have been launched.
In these case problems might manifest in the application not loading or issues sharing 'localStorage'.
To resolve port clashes, an additional port=xxxx can be added to the application launch command to set the port to use.
In addition multiple node instances could be launched with fixed and different ports to avoid conflicts.
Examples
# On Windows OS
$ npm run win 2019 port=5001
$ npm run win 2019 port=5002
$ npm run win 2020 port=5003 # On Linux (with multichannel mode)
$ npm run linux 2020 conf="./emulator/atscCmd-2020.mc.json" port=8001
$ npm run linux 2020 conf="./emulator/atscCmd-2020.mc.json" port=8002
Local Simulator Commands
|
Command |
Description |
|---|---|
|
pin |
Show the PIN for local access. |
|
get service |
Shows the current global service identifier |
|
set service |
Changes the current channel to a new service prompting an application change based on the app.json. Enter the global service id when prompted. |
|
change |
Change the service id - send serviceChange notification. based on the clientId. Enter which connected clients are affected. all - for all clients 1 - for the first client id |
|
close |
stop the server from accepting new connections |
|
exit |
Force the local web server to close and shutdown |
Here is an example where once the simulator has started, the user can simulate a channel change by typing in “change” then type change all clients with the word “all”. Finally provide
$ change
$ Client id (cid): all
$ Service id: proto://atsc30/us/7034/78
Service change notify event sent to all connected clients.