Commit 4f885ffe authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed on iot-mgr.go & onem2m-mgr.go after TimyIoT experiments;...

Bug fixed on iot-mgr.go & onem2m-mgr.go after TimyIoT experiments; meep-iot-pltf updates; examples updates
parent 9c880f50
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
package main

import (
	"crypto/tls"
	"net/http"
	"os"
	"os/signal"
@@ -36,6 +37,11 @@ import (
	"github.com/gorilla/handlers"
)

const (
	certFile = "server.crt"
	keyFile  = "server.key"
)

// Initalize customized logger
func init() {
	log.MeepTextLogInit("Demo-3")
@@ -73,7 +79,13 @@ func main() {
		router := server.NewRouter()
		methods := handlers.AllowedMethods([]string{"OPTIONS", "DELETE", "GET", "HEAD", "POST", "PUT"})
		header := handlers.AllowedHeaders([]string{"content-type"})
		log.Fatal(http.ListenAndServe(port, handlers.CORS(methods, header)(router)))
		// Create HTTP client with TLS configuration
		httpClient := &http.Client{
			Transport: &http.Transport{
				TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
			},
		}
		log.Fatal(http.ListenAndServeTls(port, certFile, keyFile, handlers.CORS(methods, header)(router)))
		run = false
	}()

+9 −0
Original line number Diff line number Diff line
@@ -780,6 +780,7 @@ func amsNotificationCallback(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusInternalServerError)
		return
	}
	log.Debug("amsNotificationCallback: amsNotification: ", amsNotification)

	amsTargetId = amsNotification.TargetAppInfo.AppInstanceId
	targetDevice := amsNotification.AssociateId[0].Value
@@ -970,6 +971,9 @@ func updateAmsSubscription(subscriptionId string, device string, inlineSubscript

// Client request to sent context state transfer
func sendContextTransfer(notifyUrl string, device string, targetId string) error {
	log.Debug("sendContextTransfer: notifyUrl: ", notifyUrl)
	log.Debug("sendContextTransfer: device: ", device)
	log.Debug("sendContextTransfer: targetId: ", targetId)

	// Context state transfer
	var contextState ApplicationContextState
@@ -1024,6 +1028,11 @@ func amsSendService(appInstanceId string, device string) (string, error) {

// Update the Context Transfer State if the device is present else add ams device
func amsSetDevice(amsId string, registerationBody ams.RegistrationInfo, device string, contextState ams.ContextTransferState) (ams.RegistrationInfo, error) {
	log.Debug(">>> amsSetDevice: amsId: ", amsId)
	log.Debug(">>> amsSetDevice: registerationBody: ", registerationBody)
	log.Debug(">>> amsSetDevice: device: ", device)
	log.Debug(">>> amsSetDevice: contextState: ", contextState)

	var updated bool = false
	for i := range registerationBody.DeviceInformation {
		v := &registerationBody.DeviceInformation[i]
+0 −4
Original line number Diff line number Diff line
@@ -17,11 +17,7 @@ require (
	github.com/magiconair/properties v1.8.0 // indirect
	github.com/mitchellh/mapstructure v1.1.2 // indirect
	github.com/pelletier/go-toml v1.2.0 // indirect
	github.com/spf13/afero v1.1.2 // indirect
	github.com/spf13/cast v1.3.0 // indirect
	github.com/spf13/jwalterweatherman v1.0.0 // indirect
	github.com/spf13/pflag v1.0.3 // indirect
	golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a // indirect
	golang.org/x/text v0.3.0 // indirect
	gopkg.in/yaml.v2 v2.2.2 // indirect
)
+1549 −0

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ RUN echo "meep-acme-in-cse" > /etc/hostname \

WORKDIR /usr/src/app

RUN git clone --branch development https://github.com/ankraft/ACME-oneM2M-CSE.git ACME-oneM2M-CSE
#RUN git clone --branch development https://github.com/ankraft/ACME-oneM2M-CSE.git ACME-oneM2M-CSE
RUN git clone https://github.com/ankraft/ACME-oneM2M-CSE.git ACME-oneM2M-CSE

WORKDIR /usr/src/app/ACME-oneM2M-CSE

Loading