Skip to content

Commit

Permalink
Add dummy get/set_lpmode API for SFF8472
Browse files Browse the repository at this point in the history
The get/set_lpmode API is not applicable to SFF8472 but it should be included
anyway to avoid AttributeErrors from SfpOptoeBase.get/set_lpmode.
  • Loading branch information
andywongarista authored and byu343 committed Nov 6, 2024
1 parent 59babf5 commit c0f5779
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion sonic_platform_base/sonic_xcvr/api/public/sff8472.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_transceiver_info(self):
if len > 0:
cable_len = len
cable_type = type

xcvr_info = {
"type": serial_id[consts.ID_FIELD],
"type_abbrv_name": serial_id[consts.ID_ABBRV_FIELD],
Expand Down Expand Up @@ -296,5 +296,26 @@ def get_lpmode_support(self):
def get_power_override_support(self):
return False

def get_lpmode(self):
'''
Retrieves low power mode status
Returns:
bool: True if module in low power else returns False.
'''
return False

def set_lpmode(self, lpmode):
'''
This function sets LPMode for the module.
Args:
lpmode (bool): False means LPMode Off, True means LPMode On
Returns:
bool: True if the provision succeeds, False if it fails
'''
return False

def is_copper(self):
return self.xcvr_eeprom.read(consts.SFP_CABLE_TECH_FIELD) == 'Passive Cable'

0 comments on commit c0f5779

Please sign in to comment.