View status of individual PON ports
Change-Id: I051799fe46828b8eda6db49c9765eb0a697a74be
diff --git a/core/grpc_service.go b/core/grpc_service.go
index e18dfa5..38f9539 100644
--- a/core/grpc_service.go
+++ b/core/grpc_service.go
@@ -318,6 +318,20 @@
return new(openolt.Empty), nil
}
+func (s *Server) GetPonIf(c context.Context, intf *openolt.Interface) (*openolt.IntfIndication, error){
+ logger.Debug("OLT %d receives GetPonIf().", s.Olt.ID)
+ stat := new(openolt.IntfIndication)
+
+ if intf.IntfId > (s.Olt.NumPonIntf-1){
+ logger.Error("PON ID %d out of bounds. %d ports total", intf.IntfId, s.Olt.NumPonIntf)
+ return stat, status.Errorf(codes.OutOfRange, "PON ID %d out of bounds. %d ports total (indexing starts at 0)", intf.IntfId, s.Olt.NumPonIntf)
+ } else{
+ stat.IntfId = intf.IntfId
+ stat.OperState = "up"
+ return stat, nil
+ }
+}
+
func (s *Server) DisablePonIf(c context.Context, intf *openolt.Interface) (*openolt.Empty, error) {
logger.Debug("OLT %d receives DisablePonIf().", s.Olt.ID)
return new(openolt.Empty), nil