(n_bytes)
| 272 | # @param n_bytes number of bytes to read |
| 273 | # @return data |
| 274 | def readFile(n_bytes): |
| 275 | global file |
| 276 | |
| 277 | try: |
| 278 | logger.info("Read recording file") |
| 279 | data = bytearray(file.read(n_bytes)) |
| 280 | except Exception as e: |
| 281 | logger.debug(f"An error occurred when reading n_bytes = {n_bytes}: {e}") |
| 282 | data = bytearray() |
| 283 | |
| 284 | return data |
| 285 | |
| 286 | |
| 287 | ## Close sensor recording file |