uart-commander
0.0.2 • Public • Published serial
A "DSL" to perform serial interchange (i.e. using AT-commands with modem on some UART port)
Use it to interact with some serial device on a port, represented by duplex stream.
var cmd = require('uart-commander');
var uart = getUARTStreamSomehow();
cmd(uart, function() {
linemode();
at('Z');
wait('OK');
label('waitIncoming');
timeout(60000);
wait('RING');
wait(/\+CLIP: "([^"]+)"/);
perform(function(line, match, match0) {
console.log('Incoming call from ' + match0);
return mustAcceptCall(match0);
});
ifNotOk('hangup');
at('A');
performAsync(function(done) {
playAudioAsync(done);
});
label('hangup');
at('H0');
goto('waitIncoming');
}, function(err) {
});
API
TODO To be documented ...
/uart-commander/
//
Package Sidebar
Install
Weekly Downloads