SEBA-499: Sending OLT Serial Number from BBSIM in GetDeviceInfo response. Also change sleep unit before the ONUIndication, from second to millisecond
Change-Id: I6783fabad1e0b6db923ded4f92073cadbc8eccd3
diff --git a/core/grpc_service.go b/core/grpc_service.go
index fe88a5a..5f927d9 100644
--- a/core/grpc_service.go
+++ b/core/grpc_service.go
@@ -18,6 +18,7 @@
import (
"net"
+ "strconv"
"gerrit.opencord.org/voltha-bbsim/common/logger"
"gerrit.opencord.org/voltha-bbsim/common/utils"
@@ -70,6 +71,8 @@
devinfo.GemportIdEnd = 65535
devinfo.FlowIdStart = 1
devinfo.FlowIdEnd = 16383
+ devinfo.DeviceSerialNumber = "BBSIMOLT00"+strconv.FormatInt(int64(s.Olt.ID), 10)
+
return devinfo, nil
}
diff --git a/core/openolt_service.go b/core/openolt_service.go
index 4b13f3e..40d14e5 100644
--- a/core/openolt_service.go
+++ b/core/openolt_service.go
@@ -84,7 +84,7 @@
func sendOnuInd(stream openolt.Openolt_EnableIndicationServer, onus []*device.Onu, delay int) error {
for i, onu := range onus {
- time.Sleep(time.Duration(delay) * time.Second)
+ time.Sleep(time.Duration(delay) * time.Millisecond)
data := &openolt.Indication_OnuInd{&openolt.OnuIndication{IntfId: onu.IntfID, OnuId: onu.OnuID, OperState: "up", AdminState: "up", SerialNumber: onu.SerialNumber}}
if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
logger.Error("Failed to send ONUInd [id: %d]: %v", i, err)