yodaRT. AppRuntime

new AppRuntime()

Members

shouldWelcome

reset should welcome so that welcome effect could be played on re-login

Methods

init() → {Promise.<void>}

Start AppRuntime

Returns:
Type:
Promise<void>

loadApps()

Load applications.

initiate()

Initiate/Re-initiate runtime configs

startDaemonApps()

Start the daemon apps.

handlePowerActivation()

Handle power button activation.

  • if not connected to network yet, disable bluetooth broadcast.
  • if there are apps actively running, terminates all apps.
  • otherwise set device actively pickup.

hibernate()

Put device into hibernation. Terminates apps in stack (i.e. apps in active and paused).

Also clears apps' contexts.

startForceUpdate()

Starts a force update on voice coming etc.

playLongPressMic()

play longPressMic.js if long press mic is bigger than 2 second.

stopLongPressMicLight()

Stop light if long press between 2 and 7 second.

resetNetwork(optionsopt)

Reset network and start procedure of configuring network.

Parameters:
Name Type Attributes Description
options object <optional>
Name Type Attributes Description
removeAll boolean <optional>

remove local wifi config?

startMonologue(appId)

Start a session of monologue. In session of monologue, no other apps could preempt top of stack.

Note that monologues automatically ends on unexpected exit of apps.

Parameters:
Name Type Description
appId string

stopMonologue(appId)

Stop a session of monologue started previously.

Parameters:
Name Type Description
appId string

openUrl(url, optionsopt) → {Promise.<boolean>}

Note: currently only yoda-skill: scheme is supported.

Parameters:
Name Type Attributes Description
url string
options object <optional>
Name Type Attributes Default Description
form 'cut' | 'scene' <optional>
'cut'
preemptive boolean <optional>
true
carrierId string <optional>
Returns:
Type:
Promise<boolean>

dispatchNotification(channel, params)

Dispatches a notification request to apps registered for the channel.

Parameters:
Name Type Description
channel string
params Array.<any>

setForegroundById(appId, optionsopt)

Parameters:
Name Type Attributes Description
appId string
options object <optional>
Name Type Attributes Default Description
form 'cut' | 'scene' <optional>
'cut'

running form of the activity.

skillId string <optional>

update cloud skill stack if specified.

setMicMute(muteopt)

Parameters:
Name Type Attributes Description
mute boolean <optional>

set mic to mute, switch mute if not given.

resetServices(optionsopt)

Parameters:
Name Type Attributes Description
options object <optional>
Name Type Attributes Default Description
lightd boolean <optional>
true
ttsd boolean <optional>
true
multimediad boolean <optional>
true

exitAppById(appId, optionsopt)

Parameters:
Name Type Attributes Description
appId string
options object <optional>
Name Type Attributes Description
clearContext boolean <optional>

also clears contexts

startApp(skillId, nlp, action, optionsopt)

Parameters:
Name Type Attributes Description
skillId string
nlp object
action object
options object <optional>
Name Type Attributes Description
preemptive boolean <optional>

onForward(message)

handle mqtt forward message

Parameters:
Name Type Description
message string

string receive from mqtt

unBindDevice()

handle mqtt unbind topic

onResetSettings()

recover the default settings, it reboots when the request is done.

setStartupFlag()

Set a flag which informs startup service that it is time to boot other services.

isStartupFlagExists() → {boolean}

Determines if startup flag has been set. WARNING: This is a synchronous function.

Returns:
Type:
boolean