本文整理汇总了TypeScript中SerialPort.parsers类的典型用法代码示例。如果您正苦于以下问题:TypeScript parsers类的具体用法?TypeScript parsers怎么用?TypeScript parsers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了parsers类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: test_connect_config
function test_connect_config() {
let port = new SerialPort("", {
baudrate: 0,
disconnectedCallback: function () { },
parser: SerialPort.parsers.readline("\n")
});
}
开发者ID:ArtemZag,项目名称:DefinitelyTyped,代码行数:7,代码来源:serialport-tests.ts
示例2: constructor
public constructor(realData: boolean, comPort:string) {
this.realData = realData;
if(this.realData) {
this.serialPort = new serial.SerialPort(comPort, {
baudrate: 9600,
parser: serial.parsers.readline('\r\n')
});
}
this.started = false;
this.status = new GpsPosition();
}
开发者ID:pierreca,项目名称:msshuttle,代码行数:11,代码来源:gpsreader.ts
示例3: test_connect_config
function test_connect_config() {
const port1 = new SerialPort('', {
baudRate: 0,
parser: SerialPort.parsers.Raw
}, (err: any) => {});
const port2 = new SerialPort('', {
baudRate: 0,
parser: SerialPort.parsers.Readline('\n', 'ascii')
}, (err: any) => {});
const port3 = new SerialPort('', {
baudRate: 0,
parser: SerialPort.parsers.ByteLength(7)
}, (err: any) => {});
const port4 = new SerialPort('', {
baudRate: 0,
parser: SerialPort.parsers.ByteDelimiter([3, 4, 5])
}, (err: any) => {});
const port5 = new SerialPort('', {
autoOpen: false,
lock: false,
baudRate: 115200,
dataBits: 5,
stopBits: 2,
parity: 'odd',
rtscts: true,
xon: true,
xoff: true,
bufferSize: 1024,
platformOptions: {
vmin: 1,
vtime: 1
}
}, (err: any) => {});
}
开发者ID:enlight,项目名称:DefinitelyTyped,代码行数:38,代码来源:serialport-tests.ts
示例4: require
socket = require('./routes/socket'),
http = require('http'),
path = require('path'),
jf = require('./services/jsonfile');
var config = jf.readFileSync("config.json");
var app = module.exports = express();
var server = require('http').createServer(app);
var io = require('socket.io').listen(server);
io.set('log level', 1);
var SerialPort = serialport.SerialPort;
serialPort = new SerialPort(config.serialPort,
{ baudrate: 115200,
parser: serialport.parsers.readline("\n") });
var portUp = false;
process.on('uncaughtException', function (err) {
console.error(err);
console.log("Continuing...");
});
/**
* Configuration
*/
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/../public/views');
app.set('view engine', 'jade');
开发者ID:chutungwnz,项目名称:gyro3d,代码行数:31,代码来源:server.ts
注:本文中的SerialPort.parsers类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论