interface/main.go : enhancement interface 27/204627/1
authorjaehoon.hyun <jaehoon.hyun@samsung.com>
Thu, 25 Apr 2019 06:32:06 +0000 (15:32 +0900)
committerjaehoon.hyun <jaehoon.hyun@samsung.com>
Thu, 25 Apr 2019 06:32:06 +0000 (15:32 +0900)
fix log orchestrationapi.go
fix log discovery_init.go

Change-Id: Ie5b3ee0bac7873835ab7fe75ba9a663967d012d2

src/discoverymgr/discovery_init.go
src/interface/main.go
src/orchestrationapi/orchstration_api.go

index 101e6ce..f09cfb4 100755 (executable)
@@ -158,11 +158,13 @@ func pollGettingOutBoundIP() (string, error) {
        ticker := time.NewTicker(time.Duration(1) * time.Second)
        defer func() { ticker.Stop() }()
 
+       var ip string
+
        for {
                select {
                case <-ticker.C:
-                       log.Println("pollGettingOutBoundIP")
-                       ip, gPollingError := common.GetOutboundIP()
+                       ip, gPollingError = common.GetOutboundIP()
+                       log.Println("pollGettingOutBoundIP : ", gPollingError)
                        if len(ip) != 0 {
                                return ip, gPollingError
                        }
index 848ce62..73743a7 100755 (executable)
@@ -110,17 +110,18 @@ func OrchestrationInit() (errCode C.int) {
        
        errCode = 0
        
-       log.Println(logPrefix, "orchestration init done")
-       
        //NOTE : CMain work init thread and requestservice thread seperatly.
        //NOTE : Need Ready variable.
        orcheEngine.Ready = true
 
+       log.Println(logPrefix, "orchestration init done")
+       
+
        return
 }
 
 //export OrchestrationRequestService
-func OrchestrationRequestService(cAppName *C.char, cArgs *C.char) (handle C.int) {
+func OrchestrationRequestService(cAppName *C.char, cArgs *C.char) C.int {
        log.Printf("[%s] OrchestrationRequestService", logPrefix)
 
        appName := C.GoString(cAppName)
@@ -132,11 +133,10 @@ func OrchestrationRequestService(cAppName *C.char, cArgs *C.char) (handle C.int)
        }
 
        log.Println("appName:", appName, "args:", argsArr)
-       orchestrationapi.RequestService(appName, argsArr)
-
-       errCode := 0
+       handle := orchestrationapi.RequestService(appName, argsArr)
+       log.Printf("requestService handle : %d\n", handle)
 
-       return C.int(errCode)
+       return C.int(handle)
 }
 
 var count int
index bce14fe..ad29e79 100755 (executable)
@@ -76,7 +76,6 @@ func Init(settingPath string) *Orche {
 func RequestService(appName string, args []string) (handle int) {
 
        if orcheEngine.Ready == false {
-               log.Println("AAAAAAAAADASDADDDS")
                return errormsg.ErrorNotReadyOrchestrationInit
        }
 
@@ -87,9 +86,6 @@ func RequestService(appName string, args []string) (handle int) {
        serviceClient := addServiceClient(handle, appName, args)
        go serviceClient.listenNotify()
        endpoints, err := getEndpointDevices(appName)
-       log.Println("getttttttttttttttEndpointDevicessssssssssss ", err)
-       log.Println(errormsg.ErrorTurnOffWifi)
-       log.Println(errormsg.ErrorDisconnectWifi)
        if err != nil {
                return errormsg.ToInt(err)
        }