Skip to content

Commit

Permalink
Add is_copper definition to cmis api
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbymcgonigle committed Sep 20, 2024
1 parent 174bbd4 commit b236656
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,13 @@ def get_voltage(self):
return None
return float("{:.3f}".format(voltage))

def is_copper(self):
'''
Returns True if the module is copper, False otherwise
'''
media_intf = self.get_module_media_type()
return media_intf == "passive_copper_media_interface" or media_intf == "active_cable_media_interface"

def is_flat_memory(self):
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD) is not False

Expand Down

0 comments on commit b236656

Please sign in to comment.