Skip to content

yulian5/dab-adapter-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

259 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAB <==> RDK Adapter

This software is a RUST application that enables compatibility with DAB 2.0 specification to devices based on Reference Design Kit (RDK). The DAB <-> RDK adapter can be executed both on the RDK device or using an external PC.

Building

For Development/Testing - Option 1: Build on a PC and execute on a RDK device

Use the cross tool to build dab-adapter for the target architecture.

In a PC, install cross:

$ cargo install cross

Build the application targeting the armv7-unknown-linux-gnueabihf architecture:

$ cross build --target armv7-unknown-linux-gnueabihf --release

The binary application will be the target/armv7-unknown-linux-gnueabihf/release/dab-adapter file.

Copy the application to the RDK device.

$ scp -O -v -oHostKeyAlgorithms=+ssh-rsa target/armv7-unknown-linux-gnueabihf/release/dab-adapter root@<rdk-device-ip>:/usr/bin/

Reboot the RDK device. If the RDK image was previously built with dab-adapter, the systemd service will auto-start the application after boot.

Development on macOS with M-series SOC: Disable SSL for paho dependency by changing features from vendored-ssl to bundled.

paho-mqtt = { version = "0.12", default-features = false, features = ["bundled"] }

Also make sure docker-desktop is running.

For Development/Testing - Option 2: Build on a PC and Running on a PC

Since this software uses Cargo package manager, the building process is straightforward:

$ cargo build

To execute dab-adapter in your PC, be sure you have mosquitto broker installed, and point to the target board IP.

$ cargo run -- -d <rdk-device-ip>

Note: The voice operators will not be available when running dab-adapter on PC. To use the voice operators, run dab-adapter on a RDK device.

For Deployment

Install cargo bitbake and create a bitbake recipe and integrate it on Yocto build of RDK.

$ cargo install --locked cargo-bitbake
$ cargo bitbake

Usage

dab-adapter --help

USAGE:
    dab-adapter [OPTIONS]

OPTIONS:
    -b, --broker <MQTT_HOST>    The MQTT broker host name or IP (default: localhost)
    -d, --device <DEVICE>       The device host name or IP (default: localhost)
    -h, --help                  Print help information
    -p, --port <MQTT_PORT>      The MQTT broker port (default: 1883)
    -v, --version               Print the version information

Settings

To configure dab-adapter a configuration file /etc/dab/settings.json can be used, with the following structure:

{
    "supported_languages": ["en-US", "es-US"],
    "audio_volume_range": {
     "max": 110,
     "min": 50
    }
}

Available settings

  1. supported_languages It must be in a form of an array of RFC 5646 language tags. If this field is not provided, or if the deserialization of settings fails, supported_languagess falls back to en-US.

  2. audio_volume_range It is a object with min and max fields. This is used to indicate possible audio volume range. If this field is not provided, or if the deserialization of settings fails, audio_volume_range falls back to {min: 0, max: 100}.

Features

Since DAB2.1 specification and implementation is not yet ready, a feature flag has been introduced to enable development and testing. Pass --features 2_1 to a cross command to enable DAB2.1 experimental features.

Device ID

In this implementation for RDK, the Device ID as specified by DAB is given by the `org.rdk.System.getDeviceInfo`` method of RDK plugin.

Implementations

This adapter supports the three full protocol implementation types:

Option 1: "On Device" Implementation

Option 1: "On Device" Implementation

$ dab-adapter

Option 2: Remote Broker Implementation

Option 2: Remote Broker Implementation

Let's suppose 192.168.0.100 as the MQTT Broker IP address:

$ dab-adapter -b 192.168.0.100

Option 3: "Bridge" Implementation

Option 3: "Bridge" Implementation

Let's suppose 192.168.0.200 as the RDK Device (Device Under Test) IP address:

$ dab-adapter -d 192.168.0.200

DAB Operations Currently Supported

This version currently supports the following DAB operations:

Applications

Request Topic Supported
applications/list Yes
applications/launch Yes
applications/launch-with-content Yes
applications/get-state Yes
applications/exit Yes
device/info Yes
system/restart Yes
system/settings/list Yes
system/settings/get Yes
system/settings/set Yes
input/key/list Yes
input/key-press Yes
input/long-key-press Yes
output/image Yes
device-telemetry/start -
device-telemetry/stop -
app-telemetry/start -
app-telemetry/stop -
health-check/get Yes
voice/list Yes
voice/send-audio Yes
voice/send-text Yes

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%