tree: 23a8d62574c594bedf561395c36af737f7b9106c [path history] [tgz]
  1. include/
  2. src/
  3. third_party/
  4. .gn
  5. args.gni
  6. BUILD.gn
  7. README.md
  8. tizen-manifest.xml
examples/lighting-app/tizen/README.md

CHIP Tizen Lighting Example

Building binary

Activating environment

source ./scripts/activate.sh

Generating tizen-arm-light

gn gen --check \
    --fail-on-unused-args \
    --export-compile-commands \
    --root=$PW_PROJECT_ROOT/examples/lighting-app/tizen \
    "--args=target_os=\"tizen\" target_cpu=\"arm\" tizen_sdk_root=\"$TIZEN_SDK_ROOT\" tizen_sdk_sysroot=\"$TIZEN_SDK_SYSROOT\"" \
    $PW_PROJECT_ROOT/out/tizen-arm-light

Building tizen-arm-light

ninja -C $PW_PROJECT_ROOT/out/tizen-arm-light

Preparing Tizen SDK certificate

For packaging the Tizen APP, there is a need to generate an author certificate and security profile using the commands described below. Change password and author data as needed.

$TIZEN_SDK_ROOT/tools/ide/bin/tizen certificate \
    --alias=CHIP \
    --name=CHIP \
    --email=chip@tizen.org \
    --password=chiptizen

$TIZEN_SDK_ROOT/tools/ide/bin/tizen security-profiles add \
    --active \
    --name=CHIP \
    --author=$HOME/tizen-sdk-data/keystore/author/author.p12 \
    --password=chiptizen

This is only one-time action. To regenerate the author certificate and security profile, you have to remove files from the $HOME directory using specified commands:

rm -r \
    $HOME/tizen-sdk-data \
    $HOME/.tizen-cli-config \
    $HOME/.secretsdb

After that, normally call scripts to generate the author certificate and security profile mentioned previously.

Important

Regenerating the author certificate and security profile makes it necessary to remove the previously installed Tizen app. You can't reinstall an application on the Tizen device with a different certificate.

pkgcmd -u -n org.tizen.matter.example.lighting

Packaging APP

ninja -C $PW_PROJECT_ROOT/out/tizen-arm-light chip-lighting-app:tpk

Installing TPK

Upload TPK package to device under test (DUT). Install it with pkgcmd as follows:

pkgcmd -i -t tpk -p org.tizen.matter.example.lighting-1.0.0.tpk

Launching application

For launching Tizen application one should use app_launcher. It is possible to pass user arguments from command line which might be used to control application behavior. However, passed strings cannot start with “-” (minus) character and all arguments have to consist of name and value. Boolean options (option without argument) should have value equal to “true”.

e.g.:

app_launcher --start=org.tizen.matter.example.lighting discriminator 43 wifi true

Vscode support

To run all commands below sdb has to be installed on computer and available in PATH. Also vscode has to have the augustocdias.tasks-shell-input extension installed.

Tasks

  1. Build app:
open the Command Palette (Ctrl+Shift+P) ->
    Tasks: Run Task ->
    Build LightingApp (Tizen)
  1. SDB connect to device: required to run Tizen commands below if device is debugged over network
open the Command Palette (Ctrl+Shift+P) ->
    Tasks: Run Task -> Connect to device (Tizen) ->
    insert IP address and port
  1. Install app: it is separated from build app step.
open the Command Palette (Ctrl+Shift+P) ->
    Tasks: Run Task ->
    Install LightingApp (Tizen)
  1. Launch LightingApp with gdbserver attached: require to install app previously.
open the Command Palette (Ctrl+Shift+P) ->
    Tasks: Run Task ->
    Launch LightingApp with gdbserver attached (Tizen)

Debug

To debug app using vscode gdbserver has to be available on the target device, run ./scripts/helpers/tizen_gdbserver_run.sh --help for more information.