VOL-1280 Fixing BUG in generating SN
Change-Id: Ia90ef576bf66b691bdad8305b841ed791159523b
diff --git a/device/device_onu.go b/device/device_onu.go
index 6d3df40..e7b7c0c 100644
--- a/device/device_onu.go
+++ b/device/device_onu.go
@@ -17,7 +17,6 @@
package device
import (
- "fmt"
"log"
"gerrit.opencord.org/voltha-bbsim/protos"
"reflect"
@@ -38,8 +37,8 @@
OnuID uint32
}
-func createSN(oltid uint32, intfid uint32, onuid uint32) string {
- sn := fmt.Sprintf("%X%X%02X", oltid, intfid, onuid)
+func createSN(oltid uint32, intfid uint32, onuid uint32) []byte {
+ sn := []byte{0, byte(oltid % 256), byte(intfid), byte(onuid)}
return sn
}
@@ -52,7 +51,7 @@
onu.OperState = "up"
onu.SerialNumber = new(openolt.SerialNumber)
onu.SerialNumber.VendorId = []byte("NONE")
- onu.SerialNumber.VendorSpecific = []byte(createSN(oltid, intfid, uint32(i))) //FIX
+ onu.SerialNumber.VendorSpecific = createSN(oltid, intfid, uint32(i))
onus = append(onus, &onu)
}
return onus