1.1.0版本
This commit is contained in:
21
UniTAP/dev/ports/modules/edid/edid_parser.py
Normal file
21
UniTAP/dev/ports/modules/edid/edid_parser.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from .edid_types import *
|
||||
|
||||
|
||||
class EdidParser:
|
||||
|
||||
__BLOCK_SIZE = 128
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def find_main_block(self, block_type: MainBlockType, data: bytearray) -> bytearray:
|
||||
for i in range(0, len(data), self.__BLOCK_SIZE):
|
||||
if data[i] == block_type.value:
|
||||
return data[i: i + self.__BLOCK_SIZE]
|
||||
return bytearray()
|
||||
|
||||
def find_additional_block(self, block_type: AdditionalBlockType, data: bytearray) -> bytearray:
|
||||
for i in range(0, len(data)):
|
||||
if data[i] == block_type.value:
|
||||
return data[i:]
|
||||
return bytearray()
|
||||
Reference in New Issue
Block a user