Neolithic Programming Machine
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

m3d-capture

0.1.0 • Public • Published

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

Downloadsweekly downloads

15

version

0.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar