VOL-1282 BBSim - Add reboot-related features
Change-Id: I9a1ce85eae18e42361956942aaf8d8fae0cc0802
diff --git a/device/device_onu.go b/device/device_onu.go
index e7b7c0c..3448799 100644
--- a/device/device_onu.go
+++ b/device/device_onu.go
@@ -30,7 +30,7 @@
)
type Onu struct {
- InternalState onuState
+ InternalState *onuState
IntfID uint32
OperState string
SerialNumber *openolt.SerialNumber
@@ -46,7 +46,8 @@
onus := []*Onu{}
for i := 0; i < int(nonus); i++ {
onu := Onu{}
- onu.InternalState = ONU_PRE_ACTIVATED
+ onu.InternalState = new(onuState)
+ *onu.InternalState = ONU_PRE_ACTIVATED
onu.IntfID = intfid
onu.OperState = "up"
onu.SerialNumber = new(openolt.SerialNumber)
@@ -57,6 +58,11 @@
return onus
}
+func (onu *Onu) InitializeStatus(){
+ onu.OperState = "up"
+ *onu.InternalState = ONU_PRE_ACTIVATED
+}
+
func ValidateONU(targetonu openolt.Onu, regonus map[uint32][]*Onu) bool {
for _, onus := range regonus {
for _, onu := range onus {