Skip to content

Commit

Permalink
Support SFP Reset on AS5835-54X
Browse files Browse the repository at this point in the history
  • Loading branch information
PJHsieh committed Sep 5, 2024
1 parent 2c1e9a2 commit 189c646
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ class Sfp(PddfSfp):
0xe1 # QSFP28 EDFA
]

UNRESETTABLE_TYPE_LIST = [
'SFP',
'SFP+',
'SFP28'
]

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data)
self.index = index + 1
Expand Down Expand Up @@ -195,3 +201,25 @@ def get_error_description(self):
except NotImplementedError:
pass
return self.__get_error_description()

def get_reset_status(self):
"""
Retrieves the reset status of SFP
Returns:
A Boolean, True if reset enabled, False if disabled
"""
if self.sfp_type in self.UNRESETTABLE_TYPE_LIST:
return False
return super().get_reset_status()

def reset(self):
"""
Reset SFP and return all user module settings to their default srate.
Returns:
A boolean, True if successful, False if not
"""
if self.sfp_type in self.UNRESETTABLE_TYPE_LIST:
return False
return super().reset()

0 comments on commit 189c646

Please sign in to comment.