Neurotic and Probably Misinformed
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    m3d-capturepublic

    m3d-capture npm version

    m3d-capture supports you to capture packets from micro 3d printer.

    Dependency

    pcap2 : Used for capturing packets

    Intro

    # Install
    $ npm install --save-dev m3d-capture

    Sample

    import m3dcap from './m3d-capture';
     
    m3dcap.on(m3dcap.EVENT_DATA_RECEIVE, (obj) => {
        console.log(`# data recv serialnumber:${obj.serialnumber}`)
    });
     
    m3dcap.on(m3dcap.EVENT_JOB_START, (obj) => {
        console.log('# started job')
    });
     
    m3dcap.on(m3dcap.EVENT_JOB_CHANGE_STATUS, (newStatus, oldStatus, obj) => {
        console.log(`# changed job status ${oldStatus} => ${newStatus}`);
    });
     
    m3dcap.on(m3dcap.EVENT_JOB_FINISH, (obj) => {
        console.log('# finished job')
    });
     
    m3dcap.on(m3dcap.EVENT_PRINTER_CHANGE_STATUS, (newStatus, oldStatus, obj) => {
        console.log(`# changed printer status ${oldStatus} => ${newStatus}`);
    });
     
    m3dcap.run('lo0', {})

    Tips

    Printer status transition

    Idle > Ready > Idle > Printing > Ready > Executing > Idle > Executing

    Job status transition

    Nothing => Queued => Heating <=> Printing => Nothing

    License

    MIT

    Keywords

    install

    npm i m3d-capture

    Downloadslast 7 days

    0

    version

    0.1.0

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar