Skip to content

Commit a659219

Browse files
authored
[SONIC_SFP] adding abstract methods for reading and writing the eeprom address space within platform api (#126)
* [sonic_sfp] adding abstract methods for platform api's Signed-off-by: vaibhav-dahiya <[email protected]>
1 parent 848f4a6 commit a659219

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

sonic_platform_base/sfp_base.py

+36
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,39 @@ def set_power_override(self, power_override, power_set):
356356
False if not
357357
"""
358358
raise NotImplementedError
359+
360+
def read_eeprom(self, offset, num_bytes):
361+
"""
362+
read eeprom specfic bytes beginning from a random offset with size as num_bytes
363+
364+
Args:
365+
offset :
366+
Integer, the offset from which the read transaction will start
367+
num_bytes:
368+
Integer, the number of bytes to be read
369+
370+
Returns:
371+
bytearray, if raw sequence of bytes are read correctly from the offset of size num_bytes
372+
None, if the read_eeprom fails
373+
"""
374+
raise NotImplementedError
375+
376+
def write_eeprom(self, offset, num_bytes, write_buffer):
377+
"""
378+
write eeprom specfic bytes beginning from a random offset with size as num_bytes
379+
and write_buffer as the required bytes
380+
381+
Args:
382+
offset :
383+
Integer, the offset from which the read transaction will start
384+
num_bytes:
385+
Integer, the number of bytes to be written
386+
write_buffer:
387+
bytearray, raw bytes buffer which is to be written beginning at the offset
388+
389+
Returns:
390+
a Boolean, true if the write succeeded and false if it did not succeed.
391+
"""
392+
raise NotImplementedError
393+
394+

0 commit comments

Comments
 (0)