Skip to content

An app to write to any existing app's Legato config tree using AirVantage API.

Notifications You must be signed in to change notification settings

JimmyHuang0904/writeConfigTreeApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

writeConfigTree App

Description

It is easy to use read and write operations on an existing app's config tree when you have access to the console. However, this is not always the case; Suppose I want to write to a config tree remotely without having physical access to the target. That is where AirVantage API comes in : A tool to allow me to manage my device and change configurations over-the-air!

This app was developed using:

There are some useful documentations on how the data can be exchanged in the Legato docs: http://legato.io/legato-docs/latest/avExchangeData.html

Usage

After running this app on your target, you can write to any config tree you want wirelessly(over-the-air). Suppose I want to write to /url in my app, trafficLight. From shell,

#!/bin/sh

server="https://eu.airvantage.net
access_token=< Associated with your device >
uid=< Associated with your device >
resource=/url                           #path/to/config/tree you want to write to
value="https://www.google.ca"           #value to write to
curl -X POST -s "${server}/api/v1/operations/systems/settings?access_token=${access_token}" -H 'Content-Type: application/json' -d "{\"reboot\":false,\"system\":{\"uids\":[\"${uid}\"]}, \"settings\":[{\"key\":\"${resource}\", \"value\":${value}}]}"

This will write https://www.google.ca to trafficLight:/url from CLI

About

An app to write to any existing app's Legato config tree using AirVantage API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published