summaryrefslogtreecommitdiffstats
path: root/cmd-sdks.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-01-23 15:35:32 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-01-23 15:35:32 +0100
commit75fbc67b5acf3258b604fc53ec096f46fc743270 (patch)
treebc7bbb545610826618010087c3ef077616a5e89a /cmd-sdks.go
parent93f0511c5e5a215d27025510cf430c49ecf506cc (diff)
Used new SDK Management event.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'cmd-sdks.go')
-rw-r--r--cmd-sdks.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/cmd-sdks.go b/cmd-sdks.go
index 066e1dd..34f5409 100644
--- a/cmd-sdks.go
+++ b/cmd-sdks.go
@@ -235,13 +235,18 @@ func sdksInstall(ctx *cli.Context) error {
exitChan <- exitResult{errMsg, 2}
})
- IOsk.On(xaapiv1.EVTSDKInstall, func(ev xaapiv1.EventMsg) {
- sdkEvt, _ := ev.DecodeSDKMsg()
+ IOsk.On(xaapiv1.EVTSDKManagement, func(ev xaapiv1.EventMsg) {
+ sdkEvt, _ := ev.DecodeSDKMgtMsg()
- if sdkEvt.Stdout != "" {
+ if sdkEvt.Action != xaapiv1.SdkMgtActionInstall {
+ Log.Debugf("EVTSDKManagement (action %s) IGNORED", sdkEvt.Action)
+ return
+ }
+
+ if !shortOut && sdkEvt.Stdout != "" {
fmt.Printf("%s", sdkEvt.Stdout)
}
- if sdkEvt.Stderr != "" {
+ if !shortOut && sdkEvt.Stderr != "" {
fmt.Fprintf(os.Stderr, "%s", sdkEvt.Stderr)
}
@@ -250,7 +255,12 @@ func sdksInstall(ctx *cli.Context) error {
}
})
- evReg := xaapiv1.EventRegisterArgs{Name: xaapiv1.EVTSDKInstall}
+ IOsk.On(xaapiv1.EVTSDKStateChange, func(ev xaapiv1.EventMsg) {
+ sdk, _ := ev.DecodeSDKEvent()
+ Log.Debugf("EVTSDKStateChange: %v", sdk)
+ })
+
+ evReg := xaapiv1.EventRegisterArgs{Name: xaapiv1.EVTAll}
if err := HTTPCli.Post("/events/register", &evReg, nil); err != nil {
return cli.NewExitError(err, 1)
}