0.1.0 • Published 8 years ago

m3d-capture v0.1.0

Weekly downloads
9
License
MIT
Repository
github
Last release
8 years ago

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

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago