Yazhong Liu yorkie @Rokid Learning & exploring

delete branch yodaos-project/yodart

delete branch : n/setup

delete time in 14 hours

push eventyodaos-project/yodart

LanFly

commit sha d4d041777005884d5c700acf124e4c913ca925c2

setup App for v8

view details

push time in 14 hours

push eventyodaos-project/yodart

LanFly

commit sha 360061ecd50ffc0f451589f4e16945871c3914fa

setup App for v8

view details

push time in 14 hours

create barnchyodaos-project/yodart

branch : n/setup

created branch time in 14 hours

delete branch yodaos-project/yodart

delete branch : n/setup

delete time in 18 hours

PR closed yodaos-project/yodart

setup App for v8

reset not implement yet.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
+395 -0

1 comment

7 changed files

LanFly

pr closed time in 18 hours

Pull request review commentyodaos-project/yodart

setup App for v8

+'use strict'++var logger = require('logger')('agent')

setup/agent

LanFly

comment created time in 18 hours

pull request commentRokid/docs

删除yodaOS下系统集成

@zhouyu1989 还是有冲突再解决一下。

zhouyu1989

comment created time in 18 hours

issue openedyodaos-project/yoda-monkey

support monkey via tcp

The flora supports TCP-based connection, so that we could run this program at MacOS.

created time in 20 hours

Pull request review commentyodaos-project/yodart

speech-synthesis: speech synthesizer

+#include <stdint.h>+#include "pulse/simple.h"+#include "pulse/error.h"+#include "pcm-player.h"++bool PcmPlayer::init(pa_sample_spec ss) {+  if (stream)+    return true;++  tp = new ThreadPool(1);+  drainp = new ThreadPool(1);+  int err;+  stream = pa_simple_new(nullptr, "speech-synthesizer", PA_STREAM_PLAYBACK,

Pulseaudio has a performance issue when connections are too many.

legendecas

comment created time in 2 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 07632fffc1e45a6318ca9a3d47a7e840a7c3acbd

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 2 days

push eventyodaos-project/yodaos

Yazhong Liu

commit sha 7d531bd46921481ebc5c52f99337bfca496fba2b

manifest: fix typo

view details

push time in 3 days

push eventyodaos-project/yodaos

Yazhong Liu

commit sha 00543d5f9dc3495fa15d83aed53a55b59ba52263

manifest: fix the extra space in bsp

view details

push time in 3 days

push eventyodaos-project/yodaos

Yazhong Liu

commit sha 16459388876cd44ce889553b664c0fae6605a473

update the kamino18 product version

view details

push time in 3 days

created tagyodaos-project/product-kamino18

tagv3.3.1

YODAOS Resources and configs for Kamino18

created time in 3 days

delete branch yodaos-project/yodaos

delete branch : add/vold

delete time in 3 days

push eventyodaos-project/yodaos

Yazhong Liu

commit sha 247731597abe364907fbbcfe8bba91ce56e02ae5

bsp: add vold project (#16)

view details

push time in 3 days

PR merged yodaos-project/yodaos

Reviewers
bsp: add vold project build
+2 -0

0 comment

1 changed file

yorkie

pr closed time in 3 days

issue commentyodaos-project/yodart

vui: voice ui component

This looks good on linear task, do we need a flow that do works in parallel?

legendecas

comment created time in 3 days

push eventyodaos-project/yodart

chen.zhang

commit sha 7029d4abccf5ab38b3e7b0016ac649f3f78f41ef

Revert "Revert "flora: add rpc call (#203)"" This reverts commit 7a061ab0984009a54103a748b9dd5b537fadffcc.

view details

legendecas

commit sha efd49ed45892faf4da0aa943ed5f12be895c950b

activity: fixes accessing error on namespace httpgw (#220)

view details

mingzc0508

commit sha bb5c64401428b38a4545201cc38348475b34e5dc

flora: conflicts on flora client name (#222)

view details

FeelyChau

commit sha d99978eb74153b7e813b206f574b6b0269cdc09a

dnd: global alpha factor for service[lightd] should be persistent. (#209)

view details

mingzc0508

commit sha 8ded031bda14b3e8b86d36e815a234d63f3727ad

add test cases for flora (#219) add test case for remote method call

view details

legendecas

commit sha abce3671719ec38fd61f5c4000df6a1c2630e6b6

httpgw: options to set request timeout (#224)

view details

legendecas

commit sha 7c7576f3f9df2cf02706da90b2251e7ae549879c

battery: battery component and query api (#221)

view details

legendecas

commit sha 094e25168c085f9f1e5557782817cb9059296581

battery: pick first of flora message array as message (#225)

view details

legendecas

commit sha 841f610eb380c847f7ecee0bab9466fb356dc0df

flora: install all js files under package root (#227)

view details

legendecas

commit sha bfe782acc1170c9e5037a1261c025df290daa5ab

wormhole: attach mqtt topic and text to url query (#226)

view details

legendecas

commit sha 31c08c42a7a2f683fe2a388719f480dccbaea1cf

battery: determine if battery is supported by field `batSupported` (#230)

view details

PuppiesMeat

commit sha af319db931db3899e478f1cfb1324386a02db4c7

battery-app: support battery interaction (#229)

view details

legendecas

commit sha aeb830a8ceba2193e4a922ad309ab0c20c89052a

lifetime: do not deactivate monopolist on speech error 8 (#228)

view details

legendecas

commit sha 67f69630f976f2964982d2b90610dacb6e24c344

tools: upgrade flora-emitter to new flora API (#233)

view details

Yazhong Liu

commit sha 8ec87ce95c31d8ed76964b5bb3af2df5af39840e

runtime: add "on-network-connected" notification (#231) This notifies when the device is connected to the network, developers could start to report a heartbeat, fetch a request. Note that, if your request expected the httpgw or logged in state, you should wait for "on-ready".

view details

legendecas

commit sha ddbec2e59c717e7bcace12b4a7cb6f9559cc40ae

battery: handle query battery info by wormhole (#234)

view details

FeelyChau

commit sha bda4971e67c741eab58374a3a3d59c7e716d47f3

custom-config: fix custom-wakeup-effects path check (#232)

view details

legendecas

commit sha fe2a05c86d345bd4b179eac5586668c5b7d71d58

runtime: add shutdown method (#238)

view details

legendecas

commit sha 9dabf0aac3d20f754e479b83672d8bf4bbb51973

turen, battery: wakeup interception of battery (#237)

view details

PuppiesMeat

commit sha 34a7b37abc39e1fcfa73fd76ada6dacbacb1c948

battery-app: light effects (#235)

view details

push time in 3 days

delete branch yodaos-project/yodart

delete branch : feature/storage

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : caps-void

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : speech-mqtt-pub

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : a113_double128

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : refactor/custodian

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : add-forwardbackward

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : fix-cloudappclient-offset

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : fix-lightd-rerender

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : fix-network-poweractivation

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : add/jenkinsfile

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : fix-compatibly-with-lua

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : skilloptions-builder

delete time in 3 days

delete branch yodaos-project/yodart

delete branch : add-component-stage

delete time in 3 days

PR closed yodaos-project/yodart

component: component loading stage component work-in-progress

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks. --> Loading all components took too much time. So it is divided into two stages of loading, the first stages is the loading of the base component, the second phase is the business component, which will be executed in the next tick.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
+210 -77

3 comments

7 changed files

FeelyChau

pr closed time in 3 days

pull request commentyodaos-project/yodart

component: component loading stage

Stale PR, just closing this.

FeelyChau

comment created time in 3 days

PR opened yodaos-project/yodaos

Reviewers
bsp: add vold project build
+2 -0

0 comment

1 changed file

pr created time in 3 days

create barnchyodaos-project/yodaos

branch : add/vold

created branch time in 3 days

delete branch yodaos-project/yodart

delete branch : fix/volume

delete time in 3 days

push eventyodaos-project/yodart

legendecas

commit sha 635fde94d41bc43949535822159592ea2a7db693

volume-app: deref context on url of context manager (#655)

view details

push time in 3 days

PR merged yodaos-project/yodart

volume-app: deref context on url of context manager app
Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] npm test passes
+4 -2

1 comment

1 changed file

legendecas

pr closed time in 3 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 83590b7bbb89fc5737f31cc40e9516b2a8277414

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 3 days

pull request commentyodaos-project/yodart

runtime: add setPhase for setup app

where can setup-app to set credential variable ?

SetupApp should manage this by itself.

yorkie

comment created time in 3 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 102686a03c4e799c63ecd1499124f081bfcb092b

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 5 days

Pull request review commentyodaos-project/yodart

vui: Sequential Flow

 var properties = {} ;[   { name: 'Application', path: './application' },   { name: 'AudioFocus', path: './audio-focus' },-  { name: 'Service', path: './service' }+  { name: 'Service', path: './service' },+  { name: 'vui', path: './vui' }

Change to "Vui"?

legendecas

comment created time in 5 days

delete branch yodaos-project/yodart

delete branch : fix/device-name

delete time in 5 days

push eventyodaos-project/yodart

Yazhong Liu

commit sha 100e25c076d0012d3bda001af442768c2c1335e9

bluetooth: fix the device name, it should in tel format (#651)

view details

push time in 5 days

PR merged yodaos-project/yodart

bluetooth: fix the device name, it should in tel format bluetooth

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks. -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
+1 -1

1 comment

1 changed file

yorkie

pr closed time in 5 days

PR opened yodaos-project/yodart

Reviewers
bluetooth: fix the device name, it should in tel format bluetooth

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks. -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
+1 -1

0 comment

1 changed file

pr created time in 5 days

create barnchyodaos-project/yodart

branch : fix/device-name

created branch time in 5 days

push eventyodaos-project/product-kamino18

Yorkie Liu

commit sha e311e1f48155a5d2179df19d4ee6f2e5be148b63

upgrade product

view details

push time in 6 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha c61eed56090ae96652ef066891191a0900e98cc9

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 6 days

Pull request review commentyodaos-project/yodart

runtime: add setPhase for setup app

 AppRuntime.prototype.init = function init () {     this.componentLoader.load(it)   })   this.descriptorLoader.load(path.join(__dirname, 'descriptor'))+  this.phaseToBooting()

Moved after the component did init.

yorkie

comment created time in 6 days

push eventyodaos-project/yodart

Yorkie Liu

commit sha a61f4b7647a311500514e52cf9b25d88520c80c4

move boot after component inited

view details

push time in 6 days

delete branch yodaos-project/yodart

delete branch : remove/log-switch

delete time in 7 days

push eventyodaos-project/yodart

Yazhong Liu

commit sha f7ae25770e91fa8b6ab57de7114560243d6c4676

apps: remove log switch from framework (#645)

view details

push time in 7 days

PR merged yodaos-project/yodart

apps: remove log switch from framework logger

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks. -->

Log Switch is a cloud-dependent module, will remove from the framework.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
+1 -100

1 comment

3 changed files

yorkie

pr closed time in 7 days

push eventyodaos-project/yodart

Yorkie Liu

commit sha 015657dbb8ed51f8f0e51f6b3224b579490cb938

runtime: add setPhase for setup app

view details

push time in 7 days

PR opened yodaos-project/yodart

Reviewers
apps: remove log switch from framework logger

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks. -->

Log Switch is a cloud-dependent module, will remove from the framework.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
+1 -100

0 comment

3 changed files

pr created time in 7 days

create barnchyodaos-project/yodart

branch : remove/log-switch

created branch time in 7 days

pull request commentyodaos-project/yodart

alarm:[BF]reminder do not speak tts when timeout

@lanyuqingri May I ask you to write a test case for your changes?

lanyuqingri

comment created time in 7 days

Pull request review commentyodaos-project/yodart

runtime: delegates app did exit events to components/descriptors

 AppRuntime.prototype.resetServices = function resetServices (options) {   return Promise.all(promises) } -AppRuntime.prototype.appPause = function appPause (appId) {-  logger.info('Pausing resources of app', appId)-  var promises = [-    this.component.light.stopSoundByAppId(appId),-    this.multimediaMethod('pause', [ appId ])-  ]-  return Promise.all(promises)-    .catch(err => logger.error('Unexpected error on pausing resources of app', appId, err.stack))-}--AppRuntime.prototype.appGC = function appGC (appId) {+AppRuntime.prototype.appDidExit = function appDidExit (appId) {   logger.info('Collecting resources of app', appId)   var promises = [-    this.component.light.stopByAppId(appId),-    this.component.light.stopSoundByAppId(appId),     this.multimediaMethod('stop', [ appId ]),-    this.ttsMethod('stop', [ appId ])+    this.ttsMethod('stop', [ appId ]),+    this.componentsInvoke('appDidExit', [ appId ]),+    this.descriptorsInvoke('appDidExit', [ appId ])

Invokes the descriptors looks a little bit weird, could we move the keyboard descriptor to its component?

legendecas

comment created time in 7 days

Pull request review commentyodaos-project/yodart

runtime: delegates app did exit events to components/descriptors

 AppRuntime.prototype.init = function init () {   // TODO: OPEN WAKEUP ENGINE   this.resetServices() -  /** 4. listen on lifetime events */-  this.component.lifetime.on('preemption', appId => {-    this.appPause(appId)-  })

The step number should be updated, too.

legendecas

comment created time in 7 days

push eventyodaos-project/yodart

Yorkie Liu

commit sha cdea231abbbdb9437f717575974acf84d5e03872

runtime: add setPhase for setup app

view details

push time in 7 days

push eventyodaos-project/yodart

Yorkie Liu

commit sha 37ad771f84fe1c32c45792361243e4ae90f9dd8b

runtime: add setPhase for setup app

view details

push time in 7 days

push eventyodaos-project/yodart

Yorkie Liu

commit sha 983e3d2895f16d2f9d35ddb11fe4f573e9b28e3d

runtime: add setPhase for setup app

view details

push time in 7 days

push eventyodaos-project/yodart

Yorkie Liu

commit sha bc9df841ebc6c3fbb5c511af84573751f04be331

runtime: add setPhase for setup app

view details

push time in 7 days

push eventyodaos-project/yodart

Yorkie Liu

commit sha 939117a9d0e14e5a7a6c694329b66fc0e15e111e

runtime: add setPhase for setup app

view details

push time in 7 days

PR opened yodaos-project/yodart

Reviewers
runtime: add setPhase for setup app

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks. -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
+37 -59

0 comment

2 changed files

pr created time in 7 days

create barnchyodaos-project/yodart

branch : add/phase-ready

created branch time in 7 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha d4ddb964e7e32c80b2976c3c22a76d7101df924f

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 8 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 549d6b0fed9e3a1beffb44614a1180ec678e5bd1

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 8 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha bfb654ed2838aa996be3b32197b2139c73f3b321

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 8 days

Pull request review commentyodaos-project/yodart

audio-focus: experimental client

+/**+ * @module @yodaos/audio-focus+ */++var id = 0+class AudioFocus {+  /**+   * AudioFocus+   *+   * @param {number} type+   * @example+   * var focus = new AudioFocus(AudioFocus.Type.TRANSIENT)+   * focus.resumeOnGain = false+   * focus.onGain = () => {+   *   focus.resumeOnGain = false+   *   var player = focus.player+   *   if (player == null) {+   *     player = focus.player = new MediaPlayer()+   *   }+   *   if (focus.resumeOnGain) {+   *     player.resume()+   *   } else {+   *     player.start('/opt/media/music.ogg')+   *   }+   * }+   * focus.onLoss = (transient, mayDuck) => {+   *   var player = focus.player+   *   if (transient) {+   *     player.pause()+   *     focus.resumeOnGain = true+   *   } else {+   *     player.stop()+   *   }+   * }+   *+   * focus.request()+   */+  constructor (type, api) {+    if (api == null) {+      this.api = global[Symbol.for('yoda#api')].audioFocus+    }+    this.id = ++id+    this.type = type+    this.api.on('gain', (id) => {+      if (id !== this.id) {+        return+      }+      this.onGain()+    })+    this.api.on('loss', (id, transient, mayDuck) => {+      if (id !== this.id) {+        return+      }+      this.onLoss(transient, mayDuck)+    })+  }++  request () {+    this.api.request({ id: this.id, gain: this.type })+  }++  abandon () {+    this.api.abandon(id)

Should we return the result from the internal api?

legendecas

comment created time in 9 days

Pull request review commentyodaos-project/yodart

audio-focus: experimental client

+/**+ * @module @yodaos/audio-focus+ */++var id = 0

Could this be duplicated when 2 same processes calls?

legendecas

comment created time in 9 days

Pull request review commentyodaos-project/yodart

audio-focus: experimental client

+/**+ * @module @yodaos/audio-focus

Should be @yodaos/application/audio-focus?

legendecas

comment created time in 9 days

Pull request review commentyodaos-project/yodart

yoda-service: direct app accesses to services

+var flora = require('@yoda/flora')++class AppSecretValidator {+  constructor (max, agent) {+    this.cache = {}+    this.lruList = []

This seems to be useless now.

legendecas

comment created time in 9 days

Pull request review commentyodaos-project/yodart

yoda-service: direct app accesses to services

 Flora.prototype.remoteMethods = {         logger.info('unexpected error on opening url', url, options, err.stack)         res.end(0, [ JSON.stringify({ ok: false, message: err.message, stack: err.stack }) ])       })+  },+  'yodart.decrypt-app-secret': function DecryptAppSecret (reqMsg, res) {

How about verify-app-secret?

legendecas

comment created time in 9 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 41d6a0841549240302ee01aa92b864ca067f36ae

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 9 days

issue commentdenoland/deno

Deno shouldn't use OpenSSL

More TLS alternative: mbed TLS (formerly known as PolarSSL) makes it trivially easy for developers to include cryptographic and SSL/TLS capabilities in their (embedded) products, facilitating this functionality with a minimal coding footprint.

rsp

comment created time in 9 days

startedaholstenson/miio

started time in 9 days

Pull request review commentyodaos-project/yodart

audio-focus: experimental client

+/**+ * @module @yodaos/experimental/audio-focus

suggest the name should be @yodaos/audio-focus.experimental.js

legendecas

comment created time in 9 days

startedfastly/lucet

started time in 9 days

Pull request review commentyodaos-project/yodart

network: Implement @yoda/network

+'use strict'++/**+ * @module @yoda/network+ * @description Provides classes to manage network functions on the device.+ */++var crypto = require('crypto')+var EventEmitter = require('events').EventEmitter+var FloraComp = require('@yoda/flora/comp')++/**+ * @class+ * @auguments EventEmitter+ * @param {boolean} subscribe - subscribe network.status or not+ * @memberof module:@yoda/network+ */+class NetworkAgent extends EventEmitter {+  constructor (subscribe) {+    super()++    this._callTarget = 'net_manager'+    this._callCommand = 'network.command'+    this._callTimeout = 60 * 1000++    this._fid = '@network' + crypto.randomBytes(2).toString('hex')+    this._flora = new FloraComp(this._fid)

Ok, sorry about that @yonzkon May I ask you to change to FloraAgent here :( And BTW, if we need a pair of classes just like: FloraClient and FloraService which based on FloraAgent?

yonzkon

comment created time in 10 days

Pull request review commentyodaos-project/yodart

network: Implement @yoda/network

+'use strict'++/**+ * @module @yoda/network+ * @description Provides classes to manage network functions on the device.+ */++var crypto = require('crypto')+var EventEmitter = require('events').EventEmitter+var FloraComp = require('@yoda/flora/comp')++/**+ * @class+ * @auguments EventEmitter+ * @param {boolean} subscribe - subscribe network.status or not+ * @memberof module:@yoda/network+ */+class NetworkAgent extends EventEmitter {+  constructor (subscribe) {+    super()++    this._callTarget = 'net_manager'+    this._callCommand = 'network.command'+    this._callTimeout = 60 * 1000++    this._fid = '@network' + crypto.randomBytes(2).toString('hex')+    this._flora = new FloraComp(this._fid)

Is FloraComp for server-side only?

yonzkon

comment created time in 10 days

Pull request review commentyodaos-project/yodart

network: Implement @yoda/network

+'use strict'++/**+ * @module @yoda/network+ * @description Provides classes to manage network functions on the device.+ */++var crypto = require('crypto')+var EventEmitter = require('events').EventEmitter+var FloraComp = require('@yoda/flora/comp')++/**+ * @class+ * @auguments EventEmitter+ * @param {boolean} subscribe - subscribe network.status or not+ * @memberof module:@yoda/network+ */+class NetworkAgent extends EventEmitter {+  constructor (subscribe) {+    super()++    this._callTarget = 'net_manager'+    this._callCommand = 'network.command'+    this._callTimeout = 60 * 1000++    this._fid = '@network' + crypto.randomBytes(2).toString('hex')+    this._flora = new FloraComp(this._fid)

I should call @yonzkon to use FloraComp, @legendecas could you explain why do not use comp here?

yonzkon

comment created time in 10 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 83ebefe9cf872389a8416c9f07d0f637ddb47853

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 10 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha a91678961f3219d6a57ea17be771b422cb19b853

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 10 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 025780bf06841ba851e9df4294d53e2d0a377765

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 10 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha 2a84a3e0ee859dbedbf236d3b7919061c5bb84d5

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 10 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha af2cba568d9287e7d2539b8c48438b36cab953c6

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 10 days

Pull request review commentyodaos-project/yodart

network: Implement @yoda/network

+'use strict'++/**+ * @module @yoda/network+ * @description Provides classes to manage network functions on the device.+ */++var crypto = require('crypto')+var EventEmitter = require('events').EventEmitter+var FloraComp = require('@yoda/flora/comp')++/**+ * @class+ * @auguments EventEmitter+ * @param {boolean} subscribe - subscribe network.status or not+ * @memberof module:@yoda/network+ */+class NetworkAgent extends EventEmitter {+  constructor (subscribe) {+    super()++    this._callTarget = 'net_manager'+    this._callCommand = 'network.command'+    this._callTimeout = 60 * 1000++    this._fid = '@network' + crypto.randomBytes(2).toString('hex')+    this._flora = new FloraComp(this._fid)+    if (subscribe) {+      this._flora.handlers = {+        'network.status': this._handleNetworkStatus.bind(this)+      }+    }+    this._flora.init()+  }++  /**+   * Destructor, release all resources.+   *+   * @function deinit+   */+  deinit () {+    this._flora.deinit()+    this._flora = null+  }++  /**+   * @private+   */+  _handleNetworkStatus (args) {+    var msg = JSON.parse(args[0])++    if (msg.network) {+      this.emit('network.status', msg.network)+    } else if (msg.wifi) {+      this.emit('wifi.status', msg.wifi)+    } else if (msg.ethernet) {+      this.emit('ethernet.status', msg.ethernet)+    } else if (msg.modem) {+      this.emit('modem.status', msg.modem)+    }+  }++  /**+   * @private+   */+  _call (device, command, params) {+    var data = {+      device: device,+      command: command+    }+    if (params) { data.params = params }++    return this._flora.call(+      this._callCommand,+      [JSON.stringify(data)],+      this._callTarget,+      this._callTimeout+    ).then(reply => {+      if (reply && reply.msg) {+        return JSON.parse(reply.msg[0])+      } else {+        throw reply+      }+    })+  }++  /**+   * Trigger network service to send command.status immediately.+   *+   * @function triggerStatus+   */+  triggerStatus () {+    return this._call('NETWORK', 'TRIGGER_STATUS')+  }++  /**+   * Get capacities of network service.+   *+   * @function getCapacities+   * @returns {PROMISE} - {+   *   "result": "OK|NOK",+   *   "reason": "...",+   *   "net_capacities": ["modem", "wifi", "ethernet"]+   * }+   */+  getCapacities () {+    return this._call('NETWORK', 'GET_CAPACITY')+  }++  /**+   * Get current network status.+   *+   * @function getNetworkStatus+   * @returns {PROMISE} - {+   *   "result": "OK|NOK",+   *   "reason": "...",+   *   "network": {+   *     "state": "CONNECTED|DISCONNECTED",+   *   }+   * }+   * @example+   * var network = require('@yoda/network')+   * var networkAgent = new network.NetworkAgent()+   * networkAgent.getNetworkStatus().then((reply) => {+   *   if (reply.network.state === network.CONNECTED) {+   *     console.log('Network is connected')+   *   }+   * })+   */+  getNetworkStatus () {+    return this._call('NETWORK', 'GET_STATUS')+  }++  /**+   * Get current wifi status.+   *+   * @function getWifiStatus+   * @returns {PROMISE} - {+   *   "result": "OK|NOK",+   *   "reason": "...",+   *   "wifi": {+   *     "state": "CONNECTED|DISCONNECTED",+   *   }+   * }

Ditto

yonzkon

comment created time in 10 days

Pull request review commentyodaos-project/yodart

network: Implement @yoda/network

+'use strict'++/**+ * @module @yoda/network+ * @description Provides classes to manage network functions on the device.+ */++var crypto = require('crypto')+var EventEmitter = require('events').EventEmitter+var FloraComp = require('@yoda/flora/comp')++/**+ * @class+ * @auguments EventEmitter+ * @param {boolean} subscribe - subscribe network.status or not+ * @memberof module:@yoda/network+ */+class NetworkAgent extends EventEmitter {+  constructor (subscribe) {+    super()++    this._callTarget = 'net_manager'+    this._callCommand = 'network.command'+    this._callTimeout = 60 * 1000++    this._fid = '@network' + crypto.randomBytes(2).toString('hex')+    this._flora = new FloraComp(this._fid)+    if (subscribe) {+      this._flora.handlers = {+        'network.status': this._handleNetworkStatus.bind(this)+      }+    }+    this._flora.init()+  }++  /**+   * Destructor, release all resources.+   *+   * @function deinit+   */+  deinit () {+    this._flora.deinit()+    this._flora = null+  }++  /**+   * @private+   */+  _handleNetworkStatus (args) {+    var msg = JSON.parse(args[0])++    if (msg.network) {+      this.emit('network.status', msg.network)+    } else if (msg.wifi) {+      this.emit('wifi.status', msg.wifi)+    } else if (msg.ethernet) {+      this.emit('ethernet.status', msg.ethernet)+    } else if (msg.modem) {+      this.emit('modem.status', msg.modem)+    }+  }++  /**+   * @private+   */+  _call (device, command, params) {+    var data = {+      device: device,+      command: command+    }+    if (params) { data.params = params }++    return this._flora.call(+      this._callCommand,+      [JSON.stringify(data)],+      this._callTarget,+      this._callTimeout+    ).then(reply => {+      if (reply && reply.msg) {+        return JSON.parse(reply.msg[0])+      } else {+        throw reply+      }+    })+  }++  /**+   * Trigger network service to send command.status immediately.+   *+   * @function triggerStatus+   */+  triggerStatus () {+    return this._call('NETWORK', 'TRIGGER_STATUS')+  }++  /**+   * Get capacities of network service.+   *+   * @function getCapacities+   * @returns {PROMISE} - {+   *   "result": "OK|NOK",+   *   "reason": "...",+   *   "net_capacities": ["modem", "wifi", "ethernet"]+   * }+   */+  getCapacities () {+    return this._call('NETWORK', 'GET_CAPACITY')+  }++  /**+   * Get current network status.+   *+   * @function getNetworkStatus+   * @returns {PROMISE} - {+   *   "result": "OK|NOK",+   *   "reason": "...",+   *   "network": {+   *     "state": "CONNECTED|DISCONNECTED",+   *   }+   * }

Could this be defined as @typedef?

yonzkon

comment created time in 10 days

Pull request review commentyodaos-project/yodart

[Proposal] @yodaos/application

+var path = require('path')+var _ = require('@yoda/util')._+var symbol = require('./symbol')++function invoke (target, optionProp, args) {+  var fn = target[symbol.options][optionProp]+  if (typeof fn === 'function') {+    return fn.apply(target, args)+  }+}++function fatalError (message) {+  console.error(message)+  process.exit(233)+}++function loadPackage (api, registry) {+  var appHome = api.appHome+  var packageJson = require(path.join(appHome, 'package.json'))+  var services = _.get(packageJson, 'manifest.services', [])+  var activities = _.get(packageJson, 'manifest.activities', [])++  services.forEach(it => {+    if (!Array.isArray(it)) {+      it = [ it ]+    }+    var name = it[0]+    if (typeof name !== 'string') {+      return+    }+    registry.service[name] = {+      path: path.join(appHome, _.get(it, '1.main', name))+    }+  })++  activities.forEach(it => {+    if (!Array.isArray(it)) {+      it = [ it ]+    }+    var name = it[0]+    if (typeof name !== 'string') {+      return+    }+    registry.activity[name] = {+      path: path.join(appHome, _.get(it, '1.main', name))+    }+  })+}++function getComponent (application, name, type) {+  var registry = application[symbol.registry]+  var entity = registry[type][name]+  if (entity == null) {+    fatalError(`Unknown app component '${type}:${name}'.`)+    return+  }+  var component = entity.mod+  if (component == null) {+    component = entity.mod = loadComponent(registry, name, type)+    component[symbol.componentName] = name+  }+  return component+}++function loadComponent (registry, name, type) {+  var entity = registry[type][name]+  var mod = require(entity.path)+  return mod+}++function Application (options, api) {+  if (api == null) {+    api = global[symbol.api]+  }+  var application = api[symbol.application]+  if (application != null) {+    throw Error('Multiple calls on Application.')

This seems to be an fatal error, so I'm +1 on throwing directly.

legendecas

comment created time in 10 days

created tagyodaos-project/ShadowNode

tagtest-deploy-name3

Use Node.js in your end devices :)

created time in 11 days

push eventyodaos-project/ShadowNode

Yorkie Liu

commit sha de8621ba0c38d4027f3aea5837c00c3043a8254d

ci skip: fix the travis deploy reponame

view details

push time in 11 days

push eventRokid/docs

Deployment Bot (from Travis CI)

commit sha c8f148e13a762edddc77be4897623d1bbf52bd5d

Deploy Rokid/docs to github.com/Rokid/docs.git:gh-pages

view details

push time in 11 days

created tagyodaos-project/ShadowNode

tagtest-deploy-name2

Use Node.js in your end devices :)

created time in 11 days

push eventyodaos-project/ShadowNode

Yorkie Liu

commit sha 051d1c225780d0b62801ec3d197c2c95a312f534

ci skip: fix the travis deploy reponame

view details

push time in 11 days

more