This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SerialPort = require("serialport").SerialPort | |
var serialPort = new SerialPort("/dev/ttyS0", { | |
baudrate: 9600 | |
}); | |
serialPort.on("open", function() { | |
serialPort.on('data', function(data) { | |
console.log(data.toString()) | |
}) | |
var stdin = process.openStdin(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SerialPort = require("serialport").SerialPort | |
var serialPort = new SerialPort("/dev/ttyS0", { | |
baudrate: 9600 | |
}); | |
serialPort.on("open", function() { | |
serialPort.on('data', function(data) { | |
console.log(data.toString()) | |
}) | |
var stdin = process.openStdin(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var apc = require('os').networkInterfaces() | |
var fs = require('fs'); | |
var mac = apc.apcli0[0].mac | |
var SerialPort = require("serialport").SerialPort | |
// var serialPort = new SerialPort("/dev/ttyS0", { | |
// baudrate: 19200 | |
// }); | |
//var mac = apc.en1[0].mac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(id){ | |
id = id.toUpperCase() | |
if (!/^[A-Z][1-2][0-9]{8}$/.test(id)) | |
return false | |
var map = { | |
"A":1, | |
"B":10, | |
"C":19, | |
"D":28, | |
"E":37, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('start') | |
var SerialPort = require("serialport").SerialPort | |
console.log('new') | |
var serialPort = new SerialPort("/dev/ttyS0", { | |
baudrate: 9600 | |
}); | |
serialPort.on("open", function () { | |
console.log('open'); | |
serialPort.on('data', function(data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XPTemplate priority=personal | |
XPT rhead " Generate React HEAD | |
React = require \react | |
Router = require \react-router | |
{Link,RouteHandler} = Router | |
{header,h1,link, table, thead, tbody, tr, th, td, input, div, button, span, ul, li, a} = React.DOM | |
`cursor^ | |
..XPT |