MCPcopy Create free account
hub / github.com/ARM-software/AVH / getData

Method getData

interface/sensor/python/vsi_sensor.py:79–98  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

77 # Extract requested number of bytes from data buffer
78 # If end of file is reached, return requested number of zeroes
79 def getData(self, size):
80 logger.info("Get Data from Record")
81
82 if len(self.data_buff) == 0:
83 self.__getRecord()
84
85 if len(self.data_buff) >= size:
86 data = self.data_buff[:size]
87 self.data_buff = self.data_buff[size:]
88 logger.debug(f"Requested Data size: {size}")
89
90 if self.active_record_size == 0:
91 self.active_record_size = self.data_size[self.cnt]
92 self.cnt += 1
93 self.active_record_size -= size
94 else:
95 logger.info("No Data in Record")
96 data = bytearray(size)
97
98 return data
99
100 # Read data file until current and last timestamp are at least WINDOW_SIZE apart
101 # or end of file is reached

Callers 2

timerEventFunction · 0.80
rdDataDMAFunction · 0.80

Calls 1

__getRecordMethod · 0.95

Tested by

no test coverage detected