const ftp = async (stream) => {
for await (const packet of stream) {
// do whatever with the packet
yield packet // or not if you don't fancy others seeing this packet can be used to create filters!
}
return result;
}
const reader = port
.pipe(new MavLinkPacketSplitter())
.pipe(new MavLinkPacketParser())
.pipe(ftp)
Inside the processing, let's implement a quick filter for the FTP-related packets and then the logic when to do what with the packets. This can also be linked with something like an "ftp client" to allow for a better DX.
Here's a crazy idea:
Inside the processing, let's implement a quick filter for the FTP-related packets and then the logic when to do what with the packets. This can also be linked with something like an "ftp client" to allow for a better DX.