SEBA-910 Implementation of Create/Remove TrafficSchedulers
fix formating issue and bump verison to 0.0.16-dev
Updated Makefile fix proto dependency
print in table format
resolve merge conflict with igmp file
bump to 0.0.18-dev
remove overriding onu port no
rebase and update
Change-Id: Ie0dce516a7044cd4ed1de7bafcdcd292e5daf689
diff --git a/internal/bbsim/api/onus_handler.go b/internal/bbsim/api/onus_handler.go
index 2c16872..b9c697c 100644
--- a/internal/bbsim/api/onus_handler.go
+++ b/internal/bbsim/api/onus_handler.go
@@ -53,7 +53,6 @@
 
 func (s BBSimServer) GetONU(ctx context.Context, req *bbsim.ONURequest) (*bbsim.ONU, error) {
 	olt := devices.GetOLT()
-
 	onu, err := olt.FindOnuBySn(req.SerialNumber)
 
 	if err != nil {
@@ -76,7 +75,7 @@
 }
 
 func (s BBSimServer) ShutdownONU(ctx context.Context, req *bbsim.ONURequest) (*bbsim.Response, error) {
-	// NOTE this method is now sendying a Dying Gasp and then disabling the device (operState: down, adminState: up),
+	// NOTE this method is now sending a Dying Gasp and then disabling the device (operState: down, adminState: up),
 	// is this the only way to do? Should we address other cases?
 	// Investigate what happens when:
 	// - a fiber is pulled
@@ -209,8 +208,8 @@
 			event = "igmp_join_start"
 		case bbsim.SubActionTypes_LEAVE:
 			event = "igmp_leave"
-                case bbsim.SubActionTypes_JOINV3:
-                        event = "igmp_join_startv3"
+		case bbsim.SubActionTypes_JOINV3:
+			event = "igmp_join_startv3"
 		}
 
 		if igmpErr := onu.InternalState.Event(event); igmpErr != nil {
@@ -295,3 +294,21 @@
 
 	return res, nil
 }
+
+func (s BBSimServer) GetOnuTrafficSchedulers(ctx context.Context, req *bbsim.ONURequest) (*bbsim.ONUTrafficSchedulers, error) {
+	olt := devices.GetOLT()
+	ts := bbsim.ONUTrafficSchedulers{}
+
+	onu, err := olt.FindOnuBySn(req.SerialNumber)
+	if err != nil {
+		return &ts, err
+	}
+
+	if onu.TrafficSchedulers != nil {
+		ts.TraffSchedulers = onu.TrafficSchedulers
+		return &ts, nil
+	} else {
+		ts.TraffSchedulers = nil
+		return &ts, nil
+	}
+}