Skip to content

Commit

Permalink
[SONIC_SFP] adding abstract methods for reading and writing the eepro…
Browse files Browse the repository at this point in the history
…m address space within platform api (sonic-net#126)

* [sonic_sfp] adding abstract methods for platform api's

Signed-off-by: vaibhav-dahiya <[email protected]>
  • Loading branch information
vdahiya12 authored Oct 26, 2020
1 parent 848f4a6 commit a659219
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions sonic_platform_base/sfp_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,39 @@ def set_power_override(self, power_override, power_set):
False if not
"""
raise NotImplementedError

def read_eeprom(self, offset, num_bytes):
"""
read eeprom specfic bytes beginning from a random offset with size as num_bytes
Args:
offset :
Integer, the offset from which the read transaction will start
num_bytes:
Integer, the number of bytes to be read
Returns:
bytearray, if raw sequence of bytes are read correctly from the offset of size num_bytes
None, if the read_eeprom fails
"""
raise NotImplementedError

def write_eeprom(self, offset, num_bytes, write_buffer):
"""
write eeprom specfic bytes beginning from a random offset with size as num_bytes
and write_buffer as the required bytes
Args:
offset :
Integer, the offset from which the read transaction will start
num_bytes:
Integer, the number of bytes to be written
write_buffer:
bytearray, raw bytes buffer which is to be written beginning at the offset
Returns:
a Boolean, true if the write succeeded and false if it did not succeed.
"""
raise NotImplementedError


0 comments on commit a659219

Please sign in to comment.