def parseDeviceReadRequest(self, deviceId: int, fileId: int, completionId: int, minorFunction: int, stream: BytesIO) -> DeviceReadRequestPDU: """ Starting at length, just before offset """ length = Uint32LE.unpack(stream) offset = Uint64LE.unpack(stream) return DeviceReadRequestPDU(deviceId, fileId, completionId, minorFunction, length, offset)
def parseDeviceReadRequest(self, deviceID: int, fileID: int, completionID: int, minorFunction: int, stream: BytesIO) -> DeviceReadRequestPDU: length = Uint32LE.unpack(stream) offset = Uint64LE.unpack(stream) stream.read(20) # Padding return DeviceReadRequestPDU(deviceID, fileID, completionID, minorFunction, length, offset)
def sendReadRequest(self): request = DeviceReadRequestPDU( self.deviceID, self.fileID, self.requestID, 0, 1024 * 16, self.offset ) self.sendIORequest(request)