Skip to content

Named pipe and tshark support#140

Open
joelsernamoreno wants to merge 3 commits intoP1sec:masterfrom
joelsernamoreno:master
Open

Named pipe and tshark support#140
joelsernamoreno wants to merge 3 commits intoP1sec:masterfrom
joelsernamoreno:master

Conversation

@joelsernamoreno
Copy link
Copy Markdown

Hello

I have added tshark support:
./qcsuper.py --usb-modem /dev/ttyUSB0 --tshark

Additionally, you can now use external scripts to analyze packages:
./qcsuper.py --usb-modem /dev/ttyUSB0 --analyze | python3 processor.py

processor.py example:

import os

def read_from_pipe(pipe_path='/tmp/tshark_pipe'):
    if not os.path.exists(pipe_path):
        print(f"Error: The named pipe {pipe_path} does not exist. Make sure that TsharkLive has created it.")
        return

    try:
        with open(pipe_path, 'r') as pipe:
            for line in pipe:
                print(f"{line.strip()}")
    except KeyboardInterrupt:
        print("\n")
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    read_from_pipe()

@p1-mmr
Copy link
Copy Markdown
Member

p1-mmr commented Mar 9, 2026

Hello,

Sorry for the long response time, I was on leave at P1.

I think that the --analyze flag should be renamed to something more explicit like --named-pipe.

I think that the processor.py script file at the root of the repository should bear a more explicit name and be located somewhere else than the root of the repository, for example in the tests/ folder.

Do you agree?

@joelsernamoreno
Copy link
Copy Markdown
Author

Sure, it's your project :)

If you want, you can add this yourself with any changes you think are appropriate

Or if you want me to do it, let me know and I'll send another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants