Skip to content

Commit 85edabb

Browse files
authored
[sfp_base] Update return value documentation of channel-specific methods (sonic-net#98)
Update docstrings of `get_rx_los()`, `get_tx_fault()` and `get_tx_disable()` methods to reflect that they should return a list of values where each value reflect the status of an individual SFP channel. Also add more detail to other channel-specific method docstrings.
1 parent 750cb81 commit 85edabb

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

sonic_platform_base/sfp_base.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ def get_rx_los(self):
118118
Retrieves the RX LOS (loss-of-signal) status of SFP
119119
120120
Returns:
121-
A Boolean, True if SFP has RX LOS, False if not.
121+
A list of boolean values, representing the RX LOS status
122+
of each available channel, value is True if SFP channel
123+
has RX LOS, False if not.
124+
E.g., for a tranceiver with four channels: [False, False, True, False]
122125
Note : RX LOS status is latched until a call to get_rx_los or a reset.
123126
"""
124127
raise NotImplementedError
@@ -128,7 +131,10 @@ def get_tx_fault(self):
128131
Retrieves the TX fault status of SFP
129132
130133
Returns:
131-
A Boolean, True if SFP has TX fault, False if not
134+
A list of boolean values, representing the TX fault status
135+
of each available channel, value is True if SFP channel
136+
has TX fault, False if not.
137+
E.g., for a tranceiver with four channels: [False, False, True, False]
132138
Note : TX fault status is lached until a call to get_tx_fault or a reset.
133139
"""
134140
raise NotImplementedError
@@ -138,7 +144,10 @@ def get_tx_disable(self):
138144
Retrieves the tx_disable status of this SFP
139145
140146
Returns:
141-
A Boolean, True if tx_disable is enabled, False if disabled
147+
A list of boolean values, representing the TX disable status
148+
of each available channel, value is True if SFP channel
149+
is TX disabled, False if not.
150+
E.g., for a tranceiver with four channels: [False, False, True, False]
142151
"""
143152
raise NotImplementedError
144153

@@ -198,7 +207,7 @@ def get_tx_bias(self):
198207
Returns:
199208
A list of floats, representing TX bias in mA
200209
for each available channel
201-
Ex. ['110.09', '111.12', '108.21', '112.09']
210+
E.g., for a tranceiver with four channels: ['110.09', '111.12', '108.21', '112.09']
202211
"""
203212
raise NotImplementedError
204213

@@ -209,7 +218,7 @@ def get_rx_power(self):
209218
Returns:
210219
A list of floats, representing received optical
211220
power in mW for each available channel
212-
Ex. ['1.77', '1.71', '1.68', '1.70']
221+
E.g., for a tranceiver with four channels: ['1.77', '1.71', '1.68', '1.70']
213222
"""
214223
raise NotImplementedError
215224

@@ -220,7 +229,7 @@ def get_tx_power(self):
220229
Returns:
221230
A list of floats, representing TX power in mW
222231
for each available channel
223-
Ex. ['1.86', '1.86', '1.86', '1.86']
232+
E.g., for a tranceiver with four channels: ['1.86', '1.86', '1.86', '1.86']
224233
"""
225234
raise NotImplementedError
226235

0 commit comments

Comments
 (0)