Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add is_copper definition to cmis api #500

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Active cable is not passive media. Active cables like AEC have datapath state machine. @mihirpat1 can you check

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prgeor Confirmed that active cables like AEC have datapath state machine. Hence, this check needs to be modified.


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

Expand Down
Loading