[SEBA-843] Storing PortNo in the ONU Device struct so that it can be passed with the packetIndications
Change-Id: I28e0bf5721d11fc52d70c6072a6cf70586ba5f98
diff --git a/internal/bbsim/devices/pon.go b/internal/bbsim/devices/pon.go
index 0e67e51..374b1b9 100644
--- a/internal/bbsim/devices/pon.go
+++ b/internal/bbsim/devices/pon.go
@@ -28,7 +28,7 @@
// BBSIM Internals
ID uint32
NumOnu int
- Onus []Onu
+ Onus []*Onu
Olt OltDevice
// PON Attributes
@@ -41,7 +41,7 @@
func (p PonPort) getOnuBySn(sn *openolt.SerialNumber) (*Onu, error) {
for _, onu := range p.Onus {
if bytes.Equal(onu.SerialNumber.VendorSpecific, sn.VendorSpecific) {
- return &onu, nil
+ return onu, nil
}
}
return nil, errors.New(fmt.Sprintf("Cannot find Onu with serial number %d in PonPort %d", sn, p.ID))
@@ -50,7 +50,7 @@
func (p PonPort) getOnuById(id uint32) (*Onu, error) {
for _, onu := range p.Onus {
if onu.ID == id {
- return &onu, nil
+ return onu, nil
}
}
return nil, errors.New(fmt.Sprintf("Cannot find Onu with id %d in PonPort %d", id, p.ID))