github-actions[bot]
chore: deploy from GitHub Actions (2026-03-08T13:13:40Z)
d9d886e
Raw History Blame Contribute Delete
725 Bytes
const fs = require('fs')
const { Readable } = require('stream')
const { parsePBTlog } = require('../tlogParsers/pbTlogParser.js')
const { parseMavTlog } = require('./tools/mavTlogReader.js')
/* TODO:
- use another way to identify Mavlink or PB file instead of using filename
*/
const parseTlog = (fileName, responseCallback) => {
fs.readFile(`../Adhyasta-MavPyRedis/logs/${fileName}.tlog`, (err, file) => {
if (err) {
console.error('Error reading directory:', file)
return
}
if (String(fileName).startsWith('pb-')) {
parsePBTlog(fileName, responseCallback)
return
}
const _file = Readable.from(file)
parseMavTlog(_file, responseCallback)
})
}
module.exports = parseTlog