Skip to content

Native application to test where dial is working fine in RDK environment.

License

Notifications You must be signed in to change notification settings

joseinweb/xdialtester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xdialtester

Native application to test DIAL functionality in RDK environment without an app manager or system UI. This implentation is based on XCast plugin and RDKShell for supporting app state management and reporting. By default YouTube & Netflix are supported based on Cobalt and Netflix thunder plugin callsign availability.

The Log Levels

The application uses color-coded logging for easy debug:

  • 🔴 ERROR (RED): Critical errors
  • 🟠 WARN (ORANGE): Warnings
  • 🟢 TRACE (GREEN): Debug trace information (enabled with --enable-trace)
  • INFO (DEFAULT): General information

Features

  • Real-time App Monitoring: Tracks application lifecycle events (launch, suspend, resume, terminate) with the help of RDKShell plugin events.
  • Debug Logging: Comprehensive logging with color-coded output along with option to enable extended debug logs.
  • JSON Configuration: Override option for app settings using optional /opt/appConfig.json - specifying app specific deeplink method and baseurl.
  • Friendly Name Configuration: Enables network friendly name settings with default format RDKE-<8DigitRandomNumber>

Build

Dependencies

  • boost
  • websocketpp
  • jsoncpp
  • cmake (for building)

Yocto Build

If you are building using Yocto, use this command to checkout:

devtool add --autorev xdialtester https://github.com/joseinweb/xdialtester.git --srcbranch main

Add the following line in the recipe:

DEPENDS += "jsoncpp websocketpp systemd boost"

Usage

Command Line Options

Option Description Example
--enable-apps=<apps> Comma-separated list of apps --enable-apps=YouTube,Netflix,Amazon
--enable-debug Enable detailed debug logging --enable-debug
--enable-trace Enable trace-level logging (most verbose) --enable-trace
--friendlyname=<Name> Provide custom friendly name --friendlyname=RDKE12345

Environment Variables

Variable Description Default
SMDEBUG Enable debug(if defined) and trace mode (when its exactly set as "TRACE") Not set

Basic Usage

Preconditions: Activate required plugins before running this test app.

curl -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc":"2.0","id":1,"method":"Controller.1.activate","params":{"callsign":"org.rdk.Xcast"}}'
curl -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc":"2.0","id":2,"method":"Controller.1.activate","params":{"callsign":"org.rdk.RDKShell"}}'
curl -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc":"2.0","id":3,"method":"Controller.1.activate","params":{"callsign":"org.rdk.System"}}'
# Use thunder plugin API if below binary is not available.
SetPowerState ON
curl -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc":"2.0","id":4,"method":"org.rdk.PowerManager.setPowerState","params":{"keyCode":30,"powerState":"ON","standbyReason":"User Initiated"}}'
# Run with default apps (YouTube, Netflix, Amazon)
./xdialtester

# Specify only required app
./xdialtester --enable-apps=YouTube

# Enable debug logging
./xdialtester --enable-debug

# Enable trace logging (most verbose)
./xdialtester --enable-trace

# Enable both debug and trace logging
./xdialtester --enable-debug --enable-trace

# Combination with specific apps
./xdialtester --enable-apps=Netflix --enable-debug --enable-trace

# Set custom friendly name
./xdialtester --friendlyname=RDKE12345

Configuration

App Configuration File (/opt/appConfig.json)

This can intake an optional app configuration /opt/appConfig.json on startup. This JSON file provides an option to adjust the app's base url and deeplink method. Default settings are as below

"YouTube" - "https://www.youtube.com/tv" and "Cobalt.1.deeplink"
"Netflix" - "https://www.netflix.com" and "Netflix.1.systemcommand"
"Amazon" - "https://www.amazon.com/gp/video" and "PrimeVideo.1.deeplink"

File Location and Permissions

  • Path: /opt/appConfig.json
  • Owner: Should be readable by the user running xdialtester
  • Format: Valid JSON with UTF-8 encoding

Sample appConfig.json Structure

{
  "appConfig": [
    {
      "name": "YouTube",
      "baseurl": "https://www.youtube.com/tv",
      "deeplinkmethod": "Cobalt.1.deeplink"
    },
    {
      "name": "Netflix",
      "baseurl": "https://www.netflix.com",
      "deeplinkmethod": "Netflix.1.systemcommand"
    },
    {
      "name": "Amazon",
      "baseurl": "https://www.amazon.com/gp/video",
      "deeplinkmethod": "PrimeVideo.1.deeplink"
    }
  ]
}

Details of Configuration Fields of /opt/appConfig.json

Field Type Required Description Example
name String Yes Application identifier used in DIAL requests and command line "YouTube", "Netflix"
baseurl String Yes Base URL for deep linking. Can include query parameters "https://www.youtube.com/tv"
deeplinkmethod String Optional Thunder method name for sending deep links "Cobalt.1.deeplink"

Log Levels

The application uses color-coded logging:

  • 🔴 ERROR (RED): Critical errors
  • 🟠 WARN (ORANGE): Warnings
  • 🟢 TRACE (GREEN): Debug trace information (enabled with --enable-trace)
  • INFO (DEFAULT): General information

Testing DIAL Functionality

The xdialtester works as a DIAL client that communicates with the RDK Thunder framework through the org.rdk.Xcast plugin.

Prerequisites

  1. Ensure the mobile app and DUT are on the same network
  2. Ensure Thunder framework is running on your device
  3. Set device IP environment variable:
  4. Ensure device is in proper power state (ON)
export DEVICEIP=192.168.1.100  # Replace with your device's IP address
  1. Activate required plugins:
# Activate XCast plugin (handles DIAL protocol)
curl -X POST http://$DEVICEIP:9998/jsonrpc -d '{"jsonrpc":"2.0","id":1,"method":"Controller.1.activate","params":{"callsign":"org.rdk.Xcast"}}'

# Activate RDKShell plugin (handles app lifecycle)
curl -X POST http://$DEVICEIP:9998/jsonrpc -d '{"jsonrpc":"2.0","id":2,"method":"Controller.1.activate","params":{"callsign":"org.rdk.RDKShell"}}'

# Activate System plugin (for setting friendly name etc)
curl -X POST http://$DEVICEIP:9998/jsonrpc -d '{"jsonrpc":"2.0","id":3,"method":"Controller.1.activate","params":{"callsign":"org.rdk.System"}}'

# Verify plugins are active
curl -X POST http://$DEVICEIP:9998/jsonrpc -d '{"jsonrpc":"2.0","id":4,"method":"Controller.1.status"}'

# Change device power state to ON if NOT
curl -X POST http://$DEVICEIP:9998/jsonrpc -d '{"jsonrpc":"2.0","id":5,"method":"org.rdk.PowerManager.setPowerState","params":{"keyCode":30,"powerState":"ON","standbyReason":"User Initiated"}}'

# Find the correct DIAL port (common ports: 56889 for REST, 56890 for SSDP)
netstat -tlnp | grep -E ":(56889|56890|56789)"
  1. Start xdialtester application:
./xdialtester --enable-apps=YouTube,Netflix
  1. Launch the Second screen mobile application to test the casting functionality on First screen.

About

Native application to test where dial is working fine in RDK environment.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •