├── example ├── js │ ├── assets │ │ ├── .gitkeep │ │ └── .gitignore │ ├── package.json │ ├── index.js │ └── package-lock.json └── ts │ ├── assets │ ├── .gitkeep │ └── .gitignore │ ├── tsconfig.json │ ├── package.json │ ├── index.ts │ └── package-lock.json ├── .coveralls.yml ├── .gitignore ├── jestconfig.json ├── package.json ├── src ├── parser-state.enum.ts ├── index.ts ├── mavlink-v1 │ ├── __tests__ │ │ ├── mavlink-packer-v1.test.ts │ │ └── mavlink-parser-v1.test.ts │ ├── mavlink-packer-v1.ts │ └── mavlink-parser-v1.ts ├── mavlink-v2 │ ├── __tests__ │ │ ├── mavlink-packer-v2.test.ts │ │ └── mavlink-parser-v2.test.ts │ ├── mavlink-packer-v2.ts │ └── mavlink-parser-v2.ts ├── __tests__ │ └── mavlink-module.test.ts ├── mavlink-packer-base.ts ├── mavlink-module.ts ├── mavlink-parser-base.ts └── mavlink-message.ts ├── .github └── workflows │ └── npmpublish.yml ├── README.md ├── tsconfig.json └── LICENSE /example/js/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/ts/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: O2cud3lZS8IFjWQepCSJEPV6sCcR4gOLs 2 | -------------------------------------------------------------------------------- /example/js/assets/.gitignore: -------------------------------------------------------------------------------- 1 | enums 2 | messages 3 | message-registry.ts 4 | -------------------------------------------------------------------------------- /example/ts/assets/.gitignore: -------------------------------------------------------------------------------- 1 | enums 2 | messages 3 | message-registry.ts 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules 3 | src/enums 4 | src/messages 5 | .idea 6 | assets/ 7 | coverage/ 8 | common.xml 9 | pymavlink/ 10 | -------------------------------------------------------------------------------- /example/ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "declaration": true, 6 | "declarationMap": true, 7 | "sourceMap": true, 8 | "outDir": "./build", 9 | "strict": true, 10 | "esModuleInterop": true 11 | }, 12 | "include": [ 13 | "index.ts" 14 | ], 15 | "exclude": [ 16 | "node_modules" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /jestconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "transform": { 3 | "^.+\\.tsx?$": "ts-jest" 4 | }, 5 | "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", 6 | "moduleFileExtensions": [ 7 | "ts", 8 | "tsx", 9 | "js", 10 | "jsx", 11 | "json", 12 | "node" 13 | ], 14 | "collectCoverageFrom": [ 15 | "src/**/*.{ts,tsx}", 16 | "!examples/**", 17 | "!lib/**", 18 | "!assets/**" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /example/js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-mavlink-example-js", 3 | "version": "0.1.0", 4 | "description": "A javascript example for parsing and packing MAVLink 2 messages", 5 | "main": "index.js", 6 | "files": [ 7 | "lib/**/*" 8 | ], 9 | "scripts": { 10 | "start": "node index.js" 11 | }, 12 | "author": "Pascal Groß ", 13 | "license": "CC-BY-4.0", 14 | "dependencies": { 15 | "@ifrunistuttgart/node-mavlink": "^0.1.0", 16 | "serialport": "^7.1.4" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-mavlink-example-ts", 3 | "version": "0.1.0", 4 | "description": "A typescript example for parsing and packing MAVLink 2 messages", 5 | "main": "js/index.js", 6 | "types": "lib/index.d.ts", 7 | "files": [ 8 | "build/**/*" 9 | ], 10 | "scripts": { 11 | "start": "node build/index.js", 12 | "test": "jest --config jestconfig.json", 13 | "build": "tsc", 14 | "lint": "tslint -p tsconfig.json" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "github.com/ifrunistuttgart/node-mavlink" 19 | }, 20 | "author": "Pascal Groß ", 21 | "license": "CC-BY-4.0", 22 | "devDependencies": { 23 | "@types/node": "^11.11.6", 24 | "@types/serialport": "^7.0.2", 25 | "tslint": "^5.14.0", 26 | "typescript": "^3.3.4000" 27 | }, 28 | "dependencies": { 29 | "@ifrunistuttgart/node-mavlink": "^0.1.0", 30 | "serialport": "^7.1.4" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ifrunistuttgart/node-mavlink", 3 | "version": "0.1.2", 4 | "description": "A library for parsing and packing MAVLink 2 messages", 5 | "main": "lib/index.js", 6 | "types": "lib/index.d.ts", 7 | "files": [ 8 | "lib/**/*" 9 | ], 10 | "scripts": { 11 | "test": "jest --config jestconfig.json", 12 | "build": "tsc", 13 | "lint": "tslint -p tsconfig.json", 14 | "coveralls": "jest --config jestconfig.json --coverage && cat ./coverage/lcov.info | coveralls" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "github.com/ifrunistuttgart/node-mavlink" 19 | }, 20 | "author": "Pascal Groß ", 21 | "license": "LGPLv3", 22 | "dependencies": { 23 | "@types/node": "^11.11.6" 24 | }, 25 | "devDependencies": { 26 | "@types/jest": "^24.0.11", 27 | "coveralls": "^3.0.3", 28 | "jest": "^24.5.0", 29 | "ts-jest": "^24.0.0", 30 | "tslint": "^5.14.0", 31 | "typescript": "^3.3.4000" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/parser-state.enum.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * parser-state.enum.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | export enum ParserState { 25 | WaitingForMagicByte, 26 | WaitingForHeaderComplete, 27 | WaitingForMessageComplete 28 | } 29 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * index.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkModule} from "./mavlink-module"; 25 | import {MAVLinkMessage} from "./mavlink-message"; 26 | 27 | export default function f(messageRegistry: Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]>, system_id: number = 1, auto_negotiate: boolean = true) { 28 | return new MAVLinkModule(messageRegistry, system_id, auto_negotiate); 29 | } 30 | 31 | export {MAVLinkModule} from "./mavlink-module"; 32 | export {MAVLinkMessage, readInt64LE, readUInt64LE} from "./mavlink-message"; 33 | -------------------------------------------------------------------------------- /.github/workflows/npmpublish.yml: -------------------------------------------------------------------------------- 1 | name: Node.js Package 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v1 12 | - uses: actions/setup-node@v1 13 | with: 14 | node-version: 12 15 | - run: wget https://raw.githubusercontent.com/mavlink/mavlink/master/message_definitions/v1.0/common.xml 16 | - run: git clone https://github.com/ArduPilot/pymavlink.git 17 | - run: mkdir assets 18 | - run: pip install future 19 | - run: python pymavlink/tools/mavgen.py -o ./assets --lang TypeScript --wire-protocol 2.0 common.xml 20 | - run: npm ci 21 | - run: npm run build 22 | - run: cp -r lib node_modules/node-mavlink 23 | - run: npm run lint 24 | - run: npm test 25 | - run: npm run coveralls 26 | 27 | publish-npm: 28 | needs: build 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: actions/checkout@v1 32 | - uses: actions/setup-node@v1 33 | with: 34 | node-version: 12 35 | registry-url: https://registry.npmjs.org/ 36 | - run: npm install 37 | - run: npm run build 38 | - run: npm publish 39 | env: 40 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 41 | 42 | publish-gpr: 43 | needs: build 44 | runs-on: ubuntu-latest 45 | steps: 46 | - uses: actions/checkout@v1 47 | - uses: actions/setup-node@v1 48 | with: 49 | node-version: 12 50 | registry-url: https://npm.pkg.github.com/ 51 | scope: '@ifrunistuttgart' 52 | - run: npm install 53 | - run: npm run build 54 | - run: npm publish 55 | env: 56 | NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} 57 | -------------------------------------------------------------------------------- /example/js/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * index.js 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | var SerialPort = require('serialport'); 25 | var messageRegistry = require('./assets/messageRegistry'); 26 | var mavLink = require('@ifrunistuttgart/node-mavlink')(messageRegistry); 27 | 28 | var serialPort = new SerialPort('COM4', { 29 | baudRate: 57600 30 | }); 31 | 32 | serialPort.on('data', function (data) { 33 | mavLink.parse(data); 34 | }); 35 | 36 | mavLink.on('error', function (e) { 37 | //console.log(e); 38 | }); 39 | 40 | mavLink.on('message', function (message) { 41 | // event listener for all messages 42 | console.log(message); 43 | }); 44 | 45 | mavLink.on('COMMAND_LONG', function (bytes) { 46 | console.log('Sending COMMAND_LONG to PX4'); 47 | serialPort.write(bytes); 48 | }); 49 | 50 | mavLink.on('HIGHRES_IMU', function (message) { 51 | // event listener for HIGHRES_IMU message 52 | console.log(message); 53 | }); 54 | -------------------------------------------------------------------------------- /src/mavlink-v1/__tests__/mavlink-packer-v1.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-packer-v1.test.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkModule} from "../../mavlink-module"; 25 | import {CommandLong} from "../../../assets/messages/command-long"; 26 | import {MavCmd} from "../../../assets/enums/mav-cmd"; 27 | import {messageRegistry} from "../../../assets/message-registry"; 28 | 29 | let mavlinkModule: MAVLinkModule; 30 | 31 | beforeAll(() => { 32 | }); 33 | 34 | afterAll(() => { 35 | }); 36 | 37 | beforeEach(() => { 38 | mavlinkModule = new MAVLinkModule(messageRegistry, 1, false); 39 | }); 40 | 41 | afterEach(() => { 42 | }); 43 | 44 | test('MessagePackUnpack', async () => { 45 | const cmd = new CommandLong(1, 0); 46 | cmd.command = MavCmd.MAV_CMD_REQUEST_PROTOCOL_VERSION; 47 | const messages = await mavlinkModule.parse(mavlinkModule.pack([cmd])); 48 | // @ts-ignore 49 | expect(messages[0].command).toBe(MavCmd.MAV_CMD_REQUEST_PROTOCOL_VERSION); 50 | }); 51 | -------------------------------------------------------------------------------- /src/mavlink-v2/__tests__/mavlink-packer-v2.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-packer-v2.test.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {CommandLong} from "../../../assets/messages/command-long"; 25 | import {MavCmd} from "../../../assets/enums/mav-cmd"; 26 | import {MAVLinkModule} from "../../mavlink-module"; 27 | import {messageRegistry} from "../../../assets/message-registry"; 28 | 29 | let mavlinkModule: MAVLinkModule; 30 | 31 | beforeAll(() => { 32 | }); 33 | 34 | afterAll(() => { 35 | }); 36 | 37 | beforeEach(() => { 38 | mavlinkModule = new MAVLinkModule(messageRegistry, 1, false); 39 | mavlinkModule.upgradeLink(); 40 | }); 41 | 42 | afterEach(() => { 43 | }); 44 | 45 | test('MessagePackUnpack', async () => { 46 | const cmd = new CommandLong(1, 0); 47 | cmd.command = MavCmd.MAV_CMD_REQUEST_PROTOCOL_VERSION; 48 | const messages = await mavlinkModule.parse(mavlinkModule.pack([cmd])); 49 | // @ts-ignore 50 | expect(messages[0].command).toBe(MavCmd.MAV_CMD_REQUEST_PROTOCOL_VERSION); 51 | }); 52 | -------------------------------------------------------------------------------- /example/ts/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * index.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkModule, MAVLinkMessage} from '@ifrunistuttgart/node-mavlink'; 25 | import {messageRegistry} from './assets/message-registry'; 26 | 27 | import Serialport from 'serialport'; 28 | 29 | const mavLink = new MAVLinkModule(messageRegistry); 30 | const serialPort = new Serialport('COM4', { 31 | baudRate: 57600 32 | }); 33 | 34 | serialPort.on('data', function (data: Buffer) { 35 | mavLink.parse(data); 36 | }); 37 | 38 | mavLink.on('error', function (e: Error) { 39 | // event listener for node-mavlink ALL error message 40 | //console.log(e); 41 | }); 42 | 43 | mavLink.on('message', function (message: MAVLinkMessage) { 44 | // event listener for all messages 45 | console.log(message); 46 | }); 47 | 48 | mavLink.on('COMMAND_LONG', function (bytes: Buffer) { 49 | console.log('Sending COMMAND_LONG to PX4'); 50 | serialPort.write(bytes); 51 | }); 52 | 53 | mavLink.on('HIGHRES_IMU', function (message: MAVLinkMessage) { 54 | // event listener for HIGHRES_IMU message 55 | console.log(message); 56 | }); 57 | -------------------------------------------------------------------------------- /src/__tests__/mavlink-module.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-module.test.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkModule} from "../mavlink-module"; 25 | import {messageRegistry} from "../../assets/message-registry"; 26 | 27 | beforeAll(() => { 28 | }); 29 | 30 | afterAll(() => { 31 | }); 32 | 33 | beforeEach(() => { 34 | }); 35 | 36 | afterEach(() => { 37 | }); 38 | 39 | test('MAVLink1NoAutoNegotiation', () => { 40 | const mavlinkModule = new MAVLinkModule(messageRegistry, 1, false); 41 | expect(mavlinkModule.protocol_version).toBe(1.0); 42 | }); 43 | 44 | test('MAVLink1WithAutoNegotiation', () => { 45 | const mavlinkModule = new MAVLinkModule(messageRegistry, 1); 46 | expect(mavlinkModule.protocol_version).toBe(1.0); 47 | }); 48 | 49 | test('MAVLink2Upgraded', () => { 50 | const mavlinkModule = new MAVLinkModule(messageRegistry, 1); 51 | mavlinkModule.upgradeLink(); 52 | expect(mavlinkModule.protocol_version).toBe(2.0); 53 | }); 54 | 55 | test('MAVLink1Downgraded', () => { 56 | const mavlinkModule = new MAVLinkModule(messageRegistry, 1); 57 | mavlinkModule.upgradeLink(); 58 | mavlinkModule.downgradeLink(); 59 | expect(mavlinkModule.protocol_version).toBe(1.0); 60 | }); 61 | -------------------------------------------------------------------------------- /src/mavlink-packer-base.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-packer-base.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkMessage} from "./mavlink-message"; 25 | 26 | export abstract class MAVLinkPackerBase { 27 | protected abstract start_marker: number; 28 | private message_factory_tuples: Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]> = new Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]>(); 29 | 30 | protected constructor() { 31 | 32 | } 33 | 34 | abstract packMessage(message: MAVLinkMessage): Buffer; 35 | 36 | public register(message_id: number, constructorFn: new (system_id: number, component_id: number) => T) { 37 | this.message_factory_tuples.push([message_id, constructorFn]); 38 | } 39 | 40 | public instantiateMessage(system_id: number, component_id: number, message_id: number) { 41 | const message_factory_tuple = this.message_factory_tuples.find(message_factory_tuple => message_factory_tuple[0] == message_id); 42 | if (message_factory_tuple) { 43 | const constructorFn: (new (system_id: number, component_id: number) => MAVLinkMessage) = message_factory_tuple[1]; 44 | return new constructorFn(system_id, component_id); 45 | } 46 | throw new Error(`Unknown message ID.`); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/mavlink-v2/__tests__/mavlink-parser-v2.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-parser-v2.test.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkModule} from "../../mavlink-module"; 25 | import {ParserState} from "../../parser-state.enum"; 26 | import {messageRegistry} from "../../../assets/message-registry"; 27 | import {MAVLinkMessage} from "../../mavlink-message"; 28 | import {MessageInterval} from "../../../assets/messages/message-interval"; 29 | 30 | let mavlinkModule: MAVLinkModule; 31 | 32 | beforeAll(() => { 33 | }); 34 | 35 | afterAll(() => { 36 | }); 37 | 38 | beforeEach(() => { 39 | mavlinkModule = new MAVLinkModule(messageRegistry); 40 | mavlinkModule.upgradeLink(); 41 | }); 42 | 43 | afterEach(() => { 44 | }); 45 | 46 | test('MessageStart', () => { 47 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF, 0xFD, 0XFE])); 48 | // @ts-ignore 49 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForHeaderComplete); 50 | }); 51 | 52 | test('MessageStartTwoPass', () => { 53 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF])); 54 | mavlinkModule.parse(Buffer.from([0xFD, 0XFE])); 55 | // @ts-ignore 56 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForHeaderComplete); 57 | }); 58 | 59 | test('NoMessageStart', () => { 60 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF, 0XFE])); 61 | // @ts-ignore 62 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForMagicByte); 63 | }); 64 | 65 | test('MessageStartNotFound', () => { 66 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF])); 67 | // @ts-ignore 68 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForMagicByte); 69 | }); 70 | 71 | test('MessageStartNotFoundEmptyBuffer', () => { 72 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF])); 73 | // @ts-ignore 74 | expect(mavlinkModule.parser.buffer.length).toBe(0); 75 | }); 76 | 77 | test('MessageTruncated', () => { 78 | const testMessage = new MessageInterval(255, 0); 79 | testMessage.interval_us = 1; 80 | const message_id = 2; 81 | testMessage.message_id = message_id; 82 | const testMessages: MAVLinkMessage[] = Array(); 83 | testMessages.push(testMessage); 84 | 85 | const buffer = mavlinkModule.pack(testMessages); 86 | return mavlinkModule.parse(buffer).then(message => { 87 | expect.assertions(1); 88 | // @ts-ignore 89 | expect(message[0].message_id).toBe(message_id); 90 | }); 91 | }); 92 | -------------------------------------------------------------------------------- /src/mavlink-v1/mavlink-packer-v1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-packer-v1.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkPackerBase} from "../mavlink-packer-base"; 25 | import {MAVLinkMessage, writeInt64LE, writeUInt64LE} from "../mavlink-message"; 26 | 27 | export class MAVLinkPackerV1 extends MAVLinkPackerBase { 28 | protected start_marker: number = 0xFE; 29 | protected minimum_packet_length: number = 8; 30 | 31 | constructor() { 32 | super(); 33 | } 34 | 35 | packMessage(message: MAVLinkMessage): Buffer { 36 | const buffer = Buffer.alloc(this.minimum_packet_length + message._payload_length); 37 | buffer.writeUInt8(this.start_marker, 0); 38 | buffer.writeUInt8(message._payload_length, 1); 39 | buffer.writeUInt8(0, 2); 40 | buffer.writeUInt8(message._system_id, 3); 41 | buffer.writeUInt8(message._component_id, 4); 42 | buffer.writeUInt8(message._message_id, 5); 43 | 44 | let start = 0; 45 | for (const field of message._message_fields) { 46 | const field_name: string = field[0]; 47 | const field_type: string = field[1]; 48 | const extension_field: boolean = field[2]; 49 | const field_length = message.sizeof(field_type); 50 | if (!extension_field) { 51 | this.write(buffer, message[field_name], start + this.minimum_packet_length - 2, field_type); 52 | start += field_length; 53 | } 54 | } 55 | 56 | let actual = message.x25CRC(buffer.slice(1, this.minimum_packet_length + message._payload_length - 2)); 57 | 58 | buffer.writeUInt16LE(actual, this.minimum_packet_length + message._payload_length - 2); 59 | return buffer; 60 | } 61 | 62 | private write(bytes: Buffer, message_field: any, start: number, type: string) { 63 | switch (type) { 64 | case "uint8_t": 65 | return bytes.writeUInt8(message_field, start); 66 | case "uint16_t": 67 | return bytes.writeUInt16LE(message_field, start); 68 | case "uint32_t": 69 | return bytes.writeUInt32LE(message_field, start); 70 | case "uint64_t": 71 | return writeUInt64LE(bytes, message_field, start); 72 | case "int8_t": 73 | return bytes.writeInt8(message_field, start); 74 | case "int16_t": 75 | return bytes.writeInt16LE(message_field, start); 76 | case "int32_t": 77 | return bytes.writeInt32LE(message_field, start); 78 | case "int64_t": 79 | return writeInt64LE(bytes, message_field, start); 80 | case "float": 81 | return bytes.writeFloatLE(message_field, start); 82 | case "double": 83 | return bytes.writeDoubleLE(message_field, start); 84 | case "char": 85 | return bytes.write(message_field, start, 1, 'ascii'); 86 | } 87 | 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/mavlink-v2/mavlink-packer-v2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-packer-v2.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkPackerBase} from "../mavlink-packer-base"; 25 | import {MAVLinkMessage, writeInt64LE, writeUInt64LE} from "../mavlink-message"; 26 | 27 | export class MAVLinkPackerV2 extends MAVLinkPackerBase { 28 | protected start_marker: number = 0xFD; 29 | protected minimum_packet_length: number = 12; 30 | 31 | constructor() { 32 | super(); 33 | } 34 | 35 | packMessage(message: MAVLinkMessage): Buffer { 36 | const buffer = Buffer.alloc(this.minimum_packet_length + message._payload_length); 37 | buffer.writeUInt8(this.start_marker, 0); 38 | buffer.writeUInt8(message._payload_length, 1); 39 | buffer.writeUInt8(0, 2); 40 | buffer.writeUInt8(0, 3); 41 | buffer.writeUInt8(0, 4); 42 | buffer.writeUInt8(message._system_id, 5); 43 | buffer.writeUInt8(message._component_id, 6); 44 | buffer.writeUIntLE(message._message_id, 7, 3); 45 | 46 | let start = 0; 47 | for (const field of message._message_fields) { 48 | const field_name: string = field[0]; 49 | const field_type: string = field[1]; 50 | const extension_field: boolean = field[2]; 51 | const field_length = message.sizeof(field_type); 52 | if (!extension_field) { 53 | this.write(buffer, message[field_name], start + this.minimum_packet_length - 2, field_type); 54 | start += field_length; 55 | } 56 | } 57 | 58 | let actual = message.x25CRC(buffer.slice(1, this.minimum_packet_length + message._payload_length - 2)); 59 | 60 | buffer.writeUInt16LE(actual, this.minimum_packet_length + message._payload_length - 2); 61 | return buffer; 62 | } 63 | 64 | private write(bytes: Buffer, message_field: any, start: number, type: string) { 65 | switch (type) { 66 | case "uint8_t": 67 | return bytes.writeUInt8(message_field, start); 68 | case "uint16_t": 69 | return bytes.writeUInt16LE(message_field, start); 70 | case "uint32_t": 71 | return bytes.writeUInt32LE(message_field, start); 72 | case "uint64_t": 73 | return writeUInt64LE(bytes, message_field, start); 74 | case "int8_t": 75 | return bytes.writeInt8(message_field, start); 76 | case "int16_t": 77 | return bytes.writeInt16LE(message_field, start); 78 | case "int32_t": 79 | return bytes.writeInt32LE(message_field, start); 80 | case "int64_t": 81 | return writeInt64LE(bytes, message_field, start); 82 | case "float": 83 | return bytes.writeFloatLE(message_field, start); 84 | case "double": 85 | return bytes.writeDoubleLE(message_field, start); 86 | case "char": 87 | return bytes.write(message_field, start, 1, 'ascii'); 88 | } 89 | 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/ifrunistuttgart/node-mavlink.svg?branch=master)](https://travis-ci.org/ifrunistuttgart/node-mavlink) 2 | [![Coverage Status](https://coveralls.io/repos/github/ifrunistuttgart/node-mavlink/badge.svg?branch=master)](https://coveralls.io/github/ifrunistuttgart/node-mavlink?branch=master) 3 | # node-mavlink 4 | node-mavlink is a library for parsing and packing MAVLink 2 messages using TypeScript or, when transpiled, using JavaScript in NodeJS. This project is an typed alternative for [node-mavlink](https://github.com/omcaree/node-mavlink) with the additional support of MAVLink2. 5 | ### Limitations 6 | At this point, not supported are: 7 | * message signing 8 | * arrays 9 | 10 | ## Installation 11 | The module is published on npm. Install using: 12 | 13 | npm install @ifrunistuttgart/node-mavlink --save 14 | 15 | ## Usage 16 | To be able to use this module, the MAVLink message definitions need to be parsed using the official [pymavlink](https://github.com/ArduPilot/pymavlink), which creates the TypeScript classes. 17 | Using the command-line interface, the classes can be generated using 18 | 19 | python tools/mavgen.py -o ./assets --lang TypeScript --wire-protocol 2.0 20 | which will produce all needed TypeScript files in a folder called *assets*. Instead of ** you will probably use *common.xml*. 21 | Together with the all messages (*classes* directory) and enums (*enums* directory), a file *messageRegistry.ts* is created, which provides an array holding all message IDs and the respective constructor. 22 | 23 | If you want to use the library with pure JavaScript, you need to transpile the generated files. You can install the transpiler with: 24 | 25 | npm i typescript --save-dev 26 | Then run within the *assets* directory 27 | 28 | tsc 29 | to start the process. 30 | 31 | ## Examples 32 | ### TypeScript 33 | 34 | ```ts 35 | import {MAVLinkModule, MAVLinkMessage} from '@ifrunistuttgart/node-mavlink'; 36 | import {messageRegistry} from './assets/message-registry'; 37 | 38 | import Serialport from 'serialport'; 39 | 40 | const mavLink = new MAVLinkModule(messageRegistry); 41 | const serialPort = new Serialport('COM4', { 42 | baudRate: 57600 43 | }); 44 | 45 | serialPort.on('data', function (data: Buffer) { 46 | mavLink.parse(data); 47 | }); 48 | 49 | mavLink.on('error', function (e: Error) { 50 | // event listener for node-mavlink ALL error message 51 | //console.log(e); 52 | }); 53 | 54 | mavLink.on('message', function (message: MAVLinkMessage) { 55 | // event listener for all messages 56 | console.log(message); 57 | }); 58 | 59 | mavLink.on('COMMAND_LONG', function (bytes: Buffer) { 60 | console.log('Sending COMMAND_LONG to PX4'); 61 | serialPort.write(bytes); 62 | }); 63 | 64 | mavLink.on('HIGHRES_IMU', function (message: MAVLinkMessage) { 65 | // event listener for HIGHRES_IMU message 66 | console.log(message); 67 | }); 68 | ``` 69 | 70 | ### JavaScript 71 | ```js 72 | var SerialPort = require('serialport'); 73 | var messageRegistry = require('.assets/messageRegistry'); 74 | var mavLink = require('@ifrunistuttgart/node-mavlink')(messageRegistry); 75 | 76 | var serialPort = new SerialPort('COM4', { 77 | baudRate: 57600 78 | }); 79 | 80 | serialPort.on('data', function (data) { 81 | mavLink.parse(data); 82 | }); 83 | 84 | mavLink.on('error', function (e) { 85 | //console.log(e); 86 | }); 87 | 88 | mavLink.on('message', function (message) { 89 | // event listener for all messages 90 | console.log(message); 91 | }); 92 | 93 | mavLink.on('COMMAND_LONG', function (bytes) { 94 | console.log('Sending COMMAND_LONG to PX4'); 95 | serialPort.write(bytes); 96 | }); 97 | 98 | mavLink.on('HIGHRES_IMU', function (message) { 99 | // event listener for HIGHRES_IMU message 100 | console.log(message); 101 | }); 102 | ``` 103 | # License 104 | node-mavlink is released under the GNU Lesser General Public License v3 or later. 105 | 109 | -------------------------------------------------------------------------------- /src/mavlink-v1/mavlink-parser-v1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-parser-v1.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkParserBase} from "../mavlink-parser-base"; 25 | import {MAVLinkMessage, readInt64LE, readUInt64LE} from "../mavlink-message"; 26 | 27 | export class MAVLinkParserV1 extends MAVLinkParserBase { 28 | private last_seq: number = 0; 29 | 30 | constructor() { 31 | super(); 32 | } 33 | 34 | protected start_marker: number = 0xFE; 35 | protected minimum_packet_length: number = 8; 36 | 37 | protected calculate_packet_length(bytes: Buffer): number { 38 | return bytes.readUInt8(1) + this.minimum_packet_length; 39 | } 40 | 41 | protected parseMessage(bytes: Buffer): MAVLinkMessage | undefined { 42 | const len = bytes.readUInt8(1); 43 | const seq = bytes.readUInt8(2); 44 | const sysid = bytes.readUInt8(3); 45 | const compid = bytes.readUInt8(4); 46 | const msgid = bytes.readUInt8(5); 47 | if (bytes.length < len + this.minimum_packet_length) 48 | return undefined; 49 | const crc = bytes.readUInt16LE(len + this.minimum_packet_length - 2); 50 | 51 | let message; 52 | try { 53 | message = this.instantiateMessage(sysid, compid, msgid); 54 | 55 | let actual = message.x25CRC(bytes.slice(1, len + this.minimum_packet_length - 2)); 56 | if (actual !== crc) { 57 | throw new Error(`CRC error: expected ${crc} but found ${actual}.`); 58 | } 59 | 60 | if (this.last_seq > 0 && this.last_seq + 1 !== seq) { 61 | throw new Error(`Packet loss detected.`); 62 | } 63 | 64 | if (bytes.length < this.minimum_packet_length + len) { 65 | throw new Error('Not enough bytes in buffer to parse the message.'); 66 | } 67 | 68 | const payload = bytes.slice(this.minimum_packet_length - 2, len + this.minimum_packet_length - 2); 69 | 70 | let start = 0; 71 | for (const field of message._message_fields) { 72 | const field_name: string = field[0]; 73 | const field_type: string = field[1]; 74 | const extension_field: boolean = field[2]; 75 | const field_length = message.sizeof(field_type); 76 | if (!extension_field) { 77 | message[field_name] = this.read(payload, start, field_type); 78 | start += field_length; 79 | } 80 | } 81 | 82 | return message; 83 | } catch (e) { 84 | throw e; 85 | } 86 | } 87 | 88 | private read(bytes: Buffer, start: number, type: string): number | string | undefined { 89 | switch (type) { 90 | case "uint8_t": 91 | return bytes.readUInt8(start); 92 | case "uint16_t": 93 | return bytes.readUInt16LE(start); 94 | case "uint32_t": 95 | return bytes.readUInt32LE(start); 96 | case "uint64_t": 97 | return readUInt64LE(bytes, start); 98 | case "int8_t": 99 | return bytes.readInt8(start); 100 | case "int16_t": 101 | return bytes.readInt16LE(start); 102 | case "int32_t": 103 | return bytes.readInt32LE(start); 104 | case "int64_t": 105 | return readInt64LE(bytes, start); 106 | case "float": 107 | return bytes.readFloatLE(start); 108 | case "double": 109 | return bytes.readDoubleLE(start); 110 | case "char": 111 | return bytes.toString('ascii', start, 1); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/mavlink-module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-module.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkPackerBase} from "./mavlink-packer-base"; 25 | import {MAVLinkParserBase} from "./mavlink-parser-base"; 26 | import {MAVLinkPackerV1} from "./mavlink-v1/mavlink-packer-v1"; 27 | import {MAVLinkPackerV2} from "./mavlink-v2/mavlink-packer-v2"; 28 | import {MAVLinkMessage} from "./mavlink-message"; 29 | import {MAVLinkParserV1} from "./mavlink-v1/mavlink-parser-v1"; 30 | import {MAVLinkParserV2} from "./mavlink-v2/mavlink-parser-v2"; 31 | import {EventEmitter} from 'events'; 32 | 33 | export class MAVLinkModule extends EventEmitter { 34 | get protocol_version(): number { 35 | return this._protocol_version; 36 | } 37 | 38 | private packer: MAVLinkPackerBase = new MAVLinkPackerV1(); 39 | private parser: MAVLinkParserBase = new MAVLinkParserV1(); 40 | private _protocol_version: number = 1.0; 41 | 42 | constructor(private messageRegistry: Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]>, private system_id: number = 1, auto_negotiate: boolean = true) { 43 | super(); 44 | this.registerMessages(messageRegistry); 45 | if (auto_negotiate) { 46 | setTimeout(() => this.auto_negotiate(), 1000); 47 | } 48 | } 49 | 50 | registerMessages(messageRegistry: Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]>) { 51 | for (const message_factory_tuple of messageRegistry) { 52 | this.parser.register(message_factory_tuple[0], message_factory_tuple[1]); 53 | this.packer.register(message_factory_tuple[0], message_factory_tuple[1]); 54 | } 55 | } 56 | 57 | pack(messages: MAVLinkMessage[]): Buffer { 58 | let buffer = Buffer.alloc(0); 59 | for (const message of messages) { 60 | buffer = Buffer.concat([buffer, this.packer.packMessage(message)]); 61 | } 62 | return buffer; 63 | } 64 | 65 | async parse(bytes: Buffer): Promise { 66 | let messages: MAVLinkMessage[]; 67 | this.emit('test', {test: "test"}); 68 | try { 69 | messages = this.parser.parse(bytes); 70 | if (messages) { 71 | for (const message of messages) { 72 | this.emit(message._message_name, message); 73 | this.emit('message', message); 74 | } 75 | } 76 | return messages; 77 | } catch (e) { 78 | this.emit('error', e); 79 | } 80 | return []; 81 | } 82 | 83 | public upgradeLink() { 84 | console.log('Upgrading link to MAVLink 2.0'); 85 | this._protocol_version = 2.0; 86 | this.packer = new MAVLinkPackerV2(); 87 | this.parser = new MAVLinkParserV2(); 88 | this.registerMessages(this.messageRegistry); 89 | } 90 | 91 | public downgradeLink() { 92 | console.log('Downgrading link to MAVLink 1.0'); 93 | this._protocol_version = 1.0; 94 | this.packer = new MAVLinkPackerV1(); 95 | this.parser = new MAVLinkParserV1(); 96 | this.registerMessages(this.messageRegistry); 97 | } 98 | 99 | private async auto_negotiate() { 100 | if (this._protocol_version === 1.0) { 101 | // Hard-coded to remove dependency on assets 102 | const cmd = this.packer.instantiateMessage(0,0,76); // COMMAND_LONG 103 | cmd['command'] = 519; // MAV_CMD_REQUEST_PROTOCOL_VERSION 104 | 105 | let timer: NodeJS.Timeout; 106 | this.on('PROTOCOL_VERSION', function (message) { 107 | console.log('Received PROTOCOL_VERSION. Handshake complete.'); 108 | clearTimeout(timer); 109 | }); 110 | const bytes = this.packer.packMessage(cmd); 111 | timer = setTimeout(() => this.downgradeLink(), 1000); 112 | this.upgradeLink(); 113 | this.emit(cmd._message_name, bytes); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/mavlink-parser-base.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-parser-base.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkMessage} from "./mavlink-message"; 25 | import {ParserState} from "./parser-state.enum"; 26 | 27 | export abstract class MAVLinkParserBase { 28 | protected abstract start_marker: number; 29 | protected abstract minimum_packet_length: number; 30 | protected expected_packet_length: number = -1; 31 | private message_factory_tuples: Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]> = new Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]>(); 32 | 33 | private state: ParserState = ParserState.WaitingForMagicByte; 34 | protected buffer: Buffer = Buffer.alloc(0); 35 | 36 | protected constructor() { 37 | 38 | } 39 | 40 | public parse(bytes: Buffer): MAVLinkMessage[] { 41 | const messages: MAVLinkMessage[] = []; 42 | 43 | if (this.state == ParserState.WaitingForMagicByte) { 44 | // look for the defined magic byte 45 | let message_start = bytes.indexOf(this.start_marker); 46 | if (message_start > -1) { 47 | this.buffer = bytes.slice(message_start); 48 | this.state = ParserState.WaitingForHeaderComplete; 49 | } 50 | } else { 51 | this.buffer = Buffer.concat([this.buffer, bytes]); 52 | } 53 | 54 | if (this.state == ParserState.WaitingForHeaderComplete) { 55 | if (this.buffer.length >= this.minimum_packet_length) { 56 | this.state = ParserState.WaitingForMessageComplete; 57 | this.expected_packet_length = this.calculate_packet_length( 58 | this.buffer.slice(0, this.minimum_packet_length)); 59 | 60 | if (this.expected_packet_length < 0 || this.expected_packet_length < this.minimum_packet_length) { 61 | // something was wrong. drop the magic byte and restart. 62 | this.expected_packet_length = -1; 63 | this.state = ParserState.WaitingForMagicByte; 64 | this.buffer = this.buffer.slice(1); 65 | } 66 | } 67 | } 68 | 69 | if (this.state == ParserState.WaitingForMessageComplete) { 70 | if (this.buffer.length >= this.expected_packet_length) { 71 | try { 72 | const message = this.parseMessage(this.buffer.slice(0, this.expected_packet_length)); 73 | if (message) { 74 | messages.push(message); 75 | } 76 | } catch (e) { 77 | throw e; 78 | } finally { 79 | // something was complete. Regardless of a complete message, drop the magic byte and restart. 80 | this.expected_packet_length = -1; 81 | this.state = ParserState.WaitingForMagicByte; 82 | this.buffer = this.buffer.slice(1); 83 | } 84 | 85 | } 86 | } 87 | 88 | return messages; 89 | } 90 | 91 | protected abstract calculate_packet_length(bytes: Buffer): number; 92 | 93 | protected abstract parseMessage(bytes: Buffer): MAVLinkMessage | undefined; 94 | 95 | public register(message_id: number, constructorFn: new (system_id: number, component_id: number) => T) { 96 | this.message_factory_tuples.push([message_id, constructorFn]); 97 | } 98 | 99 | public instantiateMessage(system_id: number, component_id: number, message_id: number) { 100 | const message_factory_tuple = this.message_factory_tuples.find(message_factory_tuple => message_factory_tuple[0] == message_id); 101 | if (message_factory_tuple) { 102 | const constructorFn: (new (system_id: number, component_id: number) => MAVLinkMessage) = message_factory_tuple[1]; 103 | return new constructorFn(system_id, component_id); 104 | } 105 | throw new Error(`Unknown message ID.`); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | "target": "es5", 5 | /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ 6 | "module": "commonjs", 7 | /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 8 | // "lib": [], /* Specify library files to be included in the compilation. */ 9 | // "allowJs": true, /* Allow javascript files to be compiled. */ 10 | // "checkJs": true, /* Report errors in .js files. */ 11 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 12 | "declaration": true, 13 | /* Generates corresponding '.d.ts' file. */ 14 | "declarationMap": true, 15 | /* Generates a sourcemap for each corresponding '.d.ts' file. */ 16 | "sourceMap": true, 17 | /* Generates corresponding '.map' file. */ 18 | // "outFile": "./", /* Concatenate and emit output to single file. */ 19 | "outDir": "./lib", 20 | /* Redirect output structure to the directory. */ 21 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 22 | // "composite": true, /* Enable project compilation */ 23 | // "removeComments": true, /* Do not emit comments to output. */ 24 | // "noEmit": true, /* Do not emit outputs. */ 25 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 26 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 27 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 28 | 29 | /* Strict Type-Checking Options */ 30 | "strict": true, 31 | /* Enable all strict type-checking options. */ 32 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 33 | // "strictNullChecks": true, /* Enable strict null checks. */ 34 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 35 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 36 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 37 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 38 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 39 | 40 | /* Additional Checks */ 41 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 42 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 43 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 44 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 45 | 46 | /* Module Resolution Options */ 47 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 48 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 49 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 50 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 51 | // "typeRoots": [], /* List of folders to include type definitions from. */ 52 | // "types": [], /* Type declaration files to be included in compilation. */ 53 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 54 | "esModuleInterop": true, 55 | /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 56 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 57 | 58 | /* Source Map Options */ 59 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 60 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 61 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 62 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 63 | 64 | /* Experimental Options */ 65 | "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */ 66 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 67 | }, 68 | "include": [ 69 | "src" 70 | ], 71 | "exclude": [ 72 | "node_modules", 73 | "example", 74 | "**/__tests__/*" 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /src/mavlink-v2/mavlink-parser-v2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-parser-v2.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkParserBase} from "../mavlink-parser-base"; 25 | import {MAVLinkMessage, readInt64LE, readUInt64LE} from "../mavlink-message"; 26 | 27 | export class MAVLinkParserV2 extends MAVLinkParserBase { 28 | private last_seq: number = 0; 29 | 30 | constructor() { 31 | super(); 32 | } 33 | 34 | protected start_marker: number = 0xFD; 35 | protected minimum_packet_length: number = 12; 36 | 37 | protected calculate_packet_length(bytes: Buffer): number { 38 | return bytes.readUInt8(1) + this.minimum_packet_length; 39 | } 40 | 41 | protected parseMessage(bytes: Buffer): MAVLinkMessage | undefined { 42 | const len = bytes.readUInt8(1); 43 | const incompat_flags = bytes.readUInt8(2); 44 | const compat_flags = bytes.readUInt8(3); 45 | const seq = bytes.readUInt8(4); 46 | const sysid = bytes.readUInt8(5); 47 | const compid = bytes.readUInt8(6); 48 | const msgid = bytes.readUIntLE(7, 3); 49 | if (bytes.length < len + this.minimum_packet_length) 50 | return undefined; 51 | const crc = bytes.readUInt16LE(len + this.minimum_packet_length - 2); 52 | 53 | let message; 54 | try { 55 | message = this.instantiateMessage(sysid, compid, msgid); 56 | 57 | let actual = message.x25CRC(bytes.slice(1, len + this.minimum_packet_length - 2)); 58 | if (actual !== crc) { 59 | throw new Error(`CRC error: expected ${crc} but found ${actual}.`); 60 | } 61 | 62 | if (this.last_seq > 0 && this.last_seq + 1 !== seq) { 63 | throw new Error(`Packet loss detected.`); 64 | } 65 | 66 | if (bytes.length < this.minimum_packet_length + len) { 67 | throw new Error('Not enough bytes in buffer to parse the message.'); 68 | } 69 | 70 | const payload = bytes.slice(this.minimum_packet_length - 2, len + this.minimum_packet_length - 2); 71 | 72 | let start = 0; 73 | for (const field of message._message_fields) { 74 | const field_name: string = field[0]; 75 | const field_type: string = field[1]; 76 | const extension_field: boolean = field[2]; 77 | const field_length = message.sizeof(field_type); 78 | if (payload.length > start + field_length) { 79 | message[field_name] = this.read(payload, start, field_type); 80 | start += field_length; 81 | } else { 82 | if (payload.readUInt8(start) === 0) { // payload truncation (last field was zero) 83 | message[field_name] = 0; 84 | start += field_length; 85 | } else { // append the truncated zero bytes so that we can parse the last field 86 | const truncated: Buffer = payload.slice(start); 87 | const filler: Buffer = Buffer.alloc(field_length - truncated.length); 88 | const buf = Buffer.concat([truncated, filler]); 89 | message[field_name] = this.read(buf, 0, field_type); 90 | start += field_length; 91 | } 92 | } 93 | } 94 | 95 | return message; 96 | } catch (e) { 97 | throw e; 98 | } 99 | } 100 | 101 | private read(bytes: Buffer, start: number, type: string): number | string | undefined { 102 | switch (type) { 103 | case "uint8_t": 104 | return bytes.readUInt8(start); 105 | case "uint16_t": 106 | return bytes.readUInt16LE(start); 107 | case "uint32_t": 108 | return bytes.readUInt32LE(start); 109 | case "uint64_t": 110 | return readUInt64LE(bytes, start); 111 | case "int8_t": 112 | return bytes.readInt8(start); 113 | case "int16_t": 114 | return bytes.readInt16LE(start); 115 | case "int32_t": 116 | return bytes.readInt32LE(start); 117 | case "int64_t": 118 | return readInt64LE(bytes, start); 119 | case "float": 120 | return bytes.readFloatLE(start); 121 | case "double": 122 | return bytes.readDoubleLE(start); 123 | case "char": 124 | return bytes.toString('ascii', start, 1); 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/mavlink-v1/__tests__/mavlink-parser-v1.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-parser-v1.test.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | import {MAVLinkModule} from "../../mavlink-module"; 25 | import {ParserState} from "../../parser-state.enum"; 26 | import {messageRegistry} from "../../../assets/message-registry"; 27 | 28 | let mavlinkModule: MAVLinkModule; 29 | 30 | beforeAll(() => { 31 | }); 32 | 33 | afterAll(() => { 34 | }); 35 | 36 | beforeEach(() => { 37 | mavlinkModule = new MAVLinkModule(messageRegistry, 1, false); 38 | }); 39 | 40 | afterEach(() => { 41 | }); 42 | 43 | test('MessageStart', () => { 44 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF, 0xFD, 0XFE])); 45 | // @ts-ignore 46 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForHeaderComplete); 47 | }); 48 | 49 | test('MessageStartTwoPass', () => { 50 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF])); 51 | mavlinkModule.parse(Buffer.from([0xFD, 0XFE])); 52 | // @ts-ignore 53 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForHeaderComplete); 54 | }); 55 | 56 | test('MessageStartNotFound', () => { 57 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF, 0XFD])); 58 | // @ts-ignore 59 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForMagicByte); 60 | }); 61 | 62 | test('MessageStartNotFound', () => { 63 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF])); 64 | // @ts-ignore 65 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForMagicByte); 66 | }); 67 | 68 | test('MessageStartNotFoundEmptyBuffer', () => { 69 | mavlinkModule.parse(Buffer.from([0x02, 0x11, 0xFF])); 70 | // @ts-ignore 71 | expect(mavlinkModule.parser.buffer.length).toBe(0); 72 | }); 73 | 74 | test('MessageHeaderComplete', () => { 75 | // magic: 0xFE 76 | // len: 9 77 | // seq: 0 78 | // sysid: 1 79 | // compid: 0 80 | // msgid: 0 (HEARTBEAT) 81 | // CRC LB 82 | // CRC HB 83 | mavlinkModule.parse(Buffer.from([0xFE, 9, 0, 1, 0, 0, 0, 0])); 84 | // @ts-ignore 85 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForMessageComplete); 86 | }); 87 | 88 | test('MessageComplete', () => { 89 | mavlinkModule.parse(Buffer.from([0xFE, 0x3E, 0xBD, 0x01, 0x01, 0x69, 0x71, 0x01, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 90 | 0x42, 0xEA, 0x22, 0xBE, 0x03, 0xD6, 0xC3, 0x3C, 0xF6, 0xCF, 0x1C, 0xC1, 0xA2, 0x6C, 0xC3, 0x3A, 0xDE, 0xB6, 91 | 0x90, 0xB9, 0x9A, 0xB1, 0xC3, 0x3A, 0x7A, 0x89, 0xEF, 0x3E, 0x9D, 0xB5, 0x02, 0xBF, 0xD3, 0xDC, 0x3C, 0xBF, 92 | 0x00, 0x0A, 0xBD, 0x47, 0x00, 0x00, 0x00, 0x00, 0x78, 0x62, 0xC0, 0x43, 0x99, 0x99, 0x29, 0x42, 0xFF, 0x1B, 93 | 0x0E, 0x3A])); 94 | // @ts-ignore 95 | expect(mavlinkModule.parser.state).toBe(ParserState.WaitingForMagicByte); 96 | }); 97 | 98 | test('MessageParsed', async () => { 99 | const messages = await mavlinkModule.parse(Buffer.from([0xFE, 0x3E, 0xBD, 0x01, 0x01, 0x69, 0x71, 0x01, 0x4A, 0x00, 100 | 0x00, 0x00, 0x00, 0x00, 101 | 0x42, 0xEA, 0x22, 0xBE, 0x03, 0xD6, 0xC3, 0x3C, 0xF6, 0xCF, 0x1C, 0xC1, 0xA2, 0x6C, 0xC3, 0x3A, 0xDE, 0xB6, 102 | 0x90, 0xB9, 0x9A, 0xB1, 0xC3, 0x3A, 0x7A, 0x89, 0xEF, 0x3E, 0x9D, 0xB5, 0x02, 0xBF, 0xD3, 0xDC, 0x3C, 0xBF, 103 | 0x00, 0x0A, 0xBD, 0x47, 0x00, 0x00, 0x00, 0x00, 0x78, 0x62, 0xC0, 0x43, 0x99, 0x99, 0x29, 0x42, 0xFF, 0x1B, 104 | 0x0E, 0x3A])); 105 | // @ts-ignore 106 | expect(messages.length).toBe(1); 107 | }); 108 | 109 | test('MessageParsedHighResIMU', async () => { 110 | const messages = await mavlinkModule.parse(Buffer.from([0xFE, 0x3E, 0xBD, 0x01, 0x01, 0x69, 0x71, 0x01, 0x4A, 0x00, 111 | 0x00, 0x00, 0x00, 0x00, 112 | 0x42, 0xEA, 0x22, 0xBE, 0x03, 0xD6, 0xC3, 0x3C, 0xF6, 0xCF, 0x1C, 0xC1, 0xA2, 0x6C, 0xC3, 0x3A, 0xDE, 0xB6, 113 | 0x90, 0xB9, 0x9A, 0xB1, 0xC3, 0x3A, 0x7A, 0x89, 0xEF, 0x3E, 0x9D, 0xB5, 0x02, 0xBF, 0xD3, 0xDC, 0x3C, 0xBF, 114 | 0x00, 0x0A, 0xBD, 0x47, 0x00, 0x00, 0x00, 0x00, 0x78, 0x62, 0xC0, 0x43, 0x99, 0x99, 0x29, 0x42, 0xFF, 0x1B, 115 | 0x0E, 0x3A])); 116 | // @ts-ignore 117 | expect(messages[0]._message_name).toBe('HIGHRES_IMU'); 118 | }); 119 | 120 | test('MessageUInt64', async () => { 121 | const messages = await mavlinkModule.parse(Buffer.from([0xFE, 0x3E, 0xBD, 0x01, 0x01, 0x69, 0x71, 0x01, 0x4A, 0x00, 122 | 0x00, 0x00, 0x00, 0x00, 123 | 0x42, 0xEA, 0x22, 0xBE, 0x03, 0xD6, 0xC3, 0x3C, 0xF6, 0xCF, 0x1C, 0xC1, 0xA2, 0x6C, 0xC3, 0x3A, 0xDE, 0xB6, 124 | 0x90, 0xB9, 0x9A, 0xB1, 0xC3, 0x3A, 0x7A, 0x89, 0xEF, 0x3E, 0x9D, 0xB5, 0x02, 0xBF, 0xD3, 0xDC, 0x3C, 0xBF, 125 | 0x00, 0x0A, 0xBD, 0x47, 0x00, 0x00, 0x00, 0x00, 0x78, 0x62, 0xC0, 0x43, 0x99, 0x99, 0x29, 0x42, 0xFF, 0x1B, 126 | 0x0E, 0x3A])); 127 | // @ts-ignore 128 | expect(messages[0].time_usec).toBe(4850033); 129 | }); 130 | 131 | test('MessageWithExtensions', async () => { 132 | const messages = await mavlinkModule.parse(Buffer.from([0xfe, 0x15, 0xc2, 0x1, 0x1, 0x24, 0x15, 0x40, 0xf0, 0x4f, 133 | 0xdc, 0x5, 0xdc, 0x5, 0xdc, 0x5, 0xdc, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x97, 0x26])); 134 | expect(messages[0]._message_name).toBe('SERVO_OUTPUT_RAW'); 135 | }); 136 | 137 | 138 | test('MessageWithByteReordering', async () => { 139 | const messages = await mavlinkModule.parse(Buffer.from([0xfe, 0x15, 0xc2, 0x1, 0x1, 0x24, 0x15, 0x40, 0xf0, 0x4f, 140 | 0xdc, 0x5, 0xdc, 0x5, 0xdc, 0x5, 0xdc, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x97, 0x26])); 141 | // @ts-ignore 142 | expect(messages[0].port).toBe(1); 143 | }); 144 | -------------------------------------------------------------------------------- /src/mavlink-message.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * mavlink-message.ts 3 | * 4 | * Copyright (c) 2019, 5 | * Institute of Flight Mechanics and Control, University of Stuttgart. 6 | * Pascal Groß 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 3 of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | export function readUInt64LE(buffer: Buffer, offset: number): number { 25 | // adapted from https://github.com/dannycoates/int53 26 | offset = offset || 0; 27 | var low = buffer.readUInt32LE(offset); 28 | var high = buffer.readUInt32LE(offset + 4); 29 | return toDouble(high, low, false) 30 | } 31 | 32 | export function readInt64LE(buffer: Buffer, offset: number): number { 33 | // adapted from https://github.com/dannycoates/int53 34 | offset = offset || 0; 35 | var low = buffer.readUInt32LE(offset); 36 | var high = buffer.readUInt32LE(offset + 4); 37 | return toDouble(high, low, true) 38 | } 39 | 40 | export function writeInt64LE(buffer: Buffer, value: number, offset: number): void { 41 | offset = offset || 0; 42 | var hl = intHighLow(value); 43 | buffer.writeUInt32LE(hl[1], offset); 44 | buffer.writeUInt32LE(hl[0], offset + 4); 45 | } 46 | 47 | export function writeUInt64LE(buffer: Buffer, value: number, offset: number): void { 48 | offset = offset || 0; 49 | var hl = uintHighLow(value); 50 | buffer.writeUInt32LE(hl[1], offset); 51 | buffer.writeUInt32LE(hl[0], offset + 4); 52 | } 53 | 54 | function intHighLow(value: number) { 55 | const MAX_UINT32 = 0x00000000FFFFFFFF; 56 | if (value > -1) { 57 | return uintHighLow(value) 58 | } 59 | const hl = uintHighLow(-value); 60 | let high = onesComplement(hl[0]); 61 | let low = onesComplement(hl[1]); 62 | if (low === MAX_UINT32) { 63 | high += 1; 64 | low = 0 65 | } else { 66 | low += 1 67 | } 68 | return [high, low] 69 | } 70 | 71 | function uintHighLow(value: number) { 72 | const MAX_UINT32 = 0x00000000FFFFFFFF; 73 | const MAX_INT53 = 0x001FFFFFFFFFFFFF; 74 | assert(() => value > -1 && value <= MAX_INT53, "number out of range"); 75 | assert(() => Math.floor(value) === value, "number must be an integer"); 76 | let high = 0; 77 | const signbit = value & 0xFFFFFFFF; 78 | const low = signbit < 0 ? (value & 0x7FFFFFFF) + 0x80000000 : signbit; 79 | if (value > MAX_UINT32) { 80 | high = (value - low) / (MAX_UINT32 + 1); 81 | } 82 | return [high, low] 83 | } 84 | 85 | function toDouble(high: number, low: number, signed: boolean) { 86 | // adapted from https://github.com/dannycoates/int53 87 | const MAX_UINT32 = 0x00000000FFFFFFFF; 88 | 89 | if (signed && (high & 0x80000000) !== 0) { 90 | high = onesComplement(high); 91 | low = onesComplement(low); 92 | assert(() => high < 0x00200000, "number too small"); 93 | return -((high * (MAX_UINT32 + 1)) + low + 1) 94 | } else { //positive 95 | assert(() => high < 0x00200000, "number too large"); 96 | return (high * (MAX_UINT32 + 1)) + low 97 | } 98 | } 99 | 100 | function assert(test: () => boolean, message: string) { 101 | // adapted from https://github.com/dannycoates/int53 102 | if (!test) throw new Error(message) 103 | } 104 | 105 | function onesComplement(number: number) { 106 | // adapted from https://github.com/dannycoates/int53 107 | number = ~number; 108 | if (number < 0) { 109 | number = (number & 0x7FFFFFFF) + 0x80000000 110 | } 111 | return number 112 | } 113 | 114 | export interface IMAVLinkMessage { 115 | _system_id: number; 116 | _component_id: number; 117 | _message_id: number; 118 | _message_name: string; 119 | _message_fields: [string, string, boolean][]; 120 | _payload_length: number; 121 | _crc_extra: number; 122 | _extension_length: number; 123 | 124 | sizeof(type: string): number; 125 | } 126 | 127 | export interface IIndexable { 128 | [key: string]: any; 129 | } 130 | 131 | export abstract class MAVLinkMessage implements IMAVLinkMessage, IIndexable { 132 | public constructor(public _system_id: number, public _component_id: number) { 133 | } 134 | 135 | abstract _message_name: string; 136 | abstract _message_id: number; 137 | abstract _message_fields: [string, string, boolean][]; 138 | abstract _crc_extra: number; 139 | 140 | get _payload_length(): number { 141 | let length = 0; 142 | for (let field of this._message_fields.filter(field => !field[2])) { 143 | length += this.sizeof(field[1]); 144 | } 145 | return length; 146 | } 147 | 148 | get _extension_length(): number { 149 | let length = 0; 150 | for (let field of this._message_fields.filter(field => !field[2])) { 151 | length += this.sizeof(field[1]); 152 | } 153 | return length; 154 | } 155 | 156 | [key: string]: any; 157 | 158 | public sizeof(type: string): number { 159 | switch (type) { 160 | case "char": 161 | case "uint8_t": 162 | case "int8_t": 163 | return 1; 164 | case "uint16_t": 165 | case "int16_t": 166 | return 2; 167 | case "uint32_t": 168 | case "int32_t": 169 | return 4; 170 | case "int64_t": 171 | case "uint64_t": 172 | return 8; 173 | case "float": 174 | return 4; 175 | case "double": 176 | return 8; 177 | default: 178 | return 0; 179 | } 180 | 181 | } 182 | 183 | public x25CRC(bytes: Buffer) { 184 | let crc = 0xffff; 185 | bytes.forEach(function (b) { 186 | let tmp = (b & 0xff) ^ (crc & 0xff); 187 | tmp ^= tmp << 4; 188 | tmp &= 0xff; 189 | crc = (crc >> 8) ^ (tmp << 8) ^ (tmp << 3) ^ (tmp >> 4); 190 | crc &= 0xffff; 191 | }); 192 | 193 | if (this._crc_extra) { 194 | let tmp = (this._crc_extra & 0xff) ^ (crc & 0xff); 195 | tmp ^= tmp << 4; 196 | tmp &= 0xff; 197 | crc = (crc >> 8) ^ (tmp << 8) ^ (tmp << 3) ^ (tmp >> 4); 198 | crc &= 0xffff; 199 | } 200 | return crc; 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /example/js/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-mavlink-example-js", 3 | "version": "0.1.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@ifrunistuttgart/node-mavlink": { 8 | "version": "0.1.0", 9 | "resolved": "https://registry.npmjs.org/@ifrunistuttgart/node-mavlink/-/node-mavlink-0.1.0.tgz", 10 | "integrity": "sha512-+vJCTJC11AKFy5iJpy7FAHMdRTk/iH7gDgDgvafkMpouhfzqaAs4oqbUpNxnEEwoar7RZt0KyfjMUr0DlSaLFw==", 11 | "requires": { 12 | "@types/node": "^11.11.6" 13 | } 14 | }, 15 | "@serialport/binding-abstract": { 16 | "version": "2.0.5", 17 | "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-2.0.5.tgz", 18 | "integrity": "sha512-oRg0QRsXJFKHQbQjmo0regKLZ9JhjLmTqc47ocJgYM5UtU9Q1VFrVPh0B2lr2pfm/tr3aNvTLX1eiVAvXyZ/bg==", 19 | "requires": { 20 | "debug": "^4.1.1" 21 | } 22 | }, 23 | "@serialport/binding-mock": { 24 | "version": "2.0.5", 25 | "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-2.0.5.tgz", 26 | "integrity": "sha512-1kD1qI686pIIolGZ6TPjAtvy8c3XIUlE4OXRZf7ZHaZgGaOUHAUMLKZt4tNTxsfedRTFyiYyHoe5QAbx82R9pQ==", 27 | "requires": { 28 | "@serialport/binding-abstract": "^2.0.5", 29 | "debug": "^4.1.1" 30 | } 31 | }, 32 | "@serialport/bindings": { 33 | "version": "2.0.8", 34 | "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-2.0.8.tgz", 35 | "integrity": "sha512-paKLa9JkoH5FAy2sATTdXLCiKpuKn0pN15/etcCqzX8vi25fnQgJ8Yx9Z6zdbcKe1No7s/9PuH9yfjDR61fbOQ==", 36 | "requires": { 37 | "@serialport/binding-abstract": "^2.0.5", 38 | "@serialport/parser-readline": "^2.0.2", 39 | "bindings": "^1.3.0", 40 | "debug": "^4.1.1", 41 | "nan": "^2.13.2", 42 | "prebuild-install": "^5.2.1" 43 | } 44 | }, 45 | "@serialport/parser-byte-length": { 46 | "version": "2.0.2", 47 | "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-2.0.2.tgz", 48 | "integrity": "sha512-cUOprk1uRLucCJy6m+wAM4pwdBaB5D4ySi6juwRScP9DTjKUvGWYj5jzuqvftFBvYFmFza89aLj5K23xiiqj7Q==" 49 | }, 50 | "@serialport/parser-cctalk": { 51 | "version": "2.0.2", 52 | "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-2.0.2.tgz", 53 | "integrity": "sha512-5LMysRv7De+TeeoKzi4+sgouD4tqZEAn1agAVevw+7ILM0m30i1zgZLtchgxtCH7OoQRAkENEVEPc0OwhghKgw==" 54 | }, 55 | "@serialport/parser-delimiter": { 56 | "version": "2.0.2", 57 | "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-2.0.2.tgz", 58 | "integrity": "sha512-zB02LahFfyZmJqak9l37vP/F1K+KCUxd1KQj35OhD1+0q/unMjVTZmsfkxFSM4gkaxP9j7+8USk+LQJ3V8U26Q==" 59 | }, 60 | "@serialport/parser-readline": { 61 | "version": "2.0.2", 62 | "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-2.0.2.tgz", 63 | "integrity": "sha512-thL26dGEHB+eINNydJmzcLLhiqcBQkF+wNTbRaYblTP/6dm7JsfjYSud7bTkN63AgE0xpe9tKXBFqc8zgJ1VKg==", 64 | "requires": { 65 | "@serialport/parser-delimiter": "^2.0.2" 66 | } 67 | }, 68 | "@serialport/parser-ready": { 69 | "version": "2.0.2", 70 | "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-2.0.2.tgz", 71 | "integrity": "sha512-6ynQ+HIIkFQcEO2Hrq4Qmdz+hlJ7kjTHGQ1E7SRN7f70nnys1v3HSke8mjK3RzVw+SwL0rBYjftUdCTrU+7c+Q==" 72 | }, 73 | "@serialport/parser-regex": { 74 | "version": "2.0.2", 75 | "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-2.0.2.tgz", 76 | "integrity": "sha512-7qjYd7AdHUK8fJOmHpXlMRipqRCVMMyDFyf/5TQQiOt6q+BiFjLOtSpVXhakHwgnXanzDYKeRSB8zM0pZZg+LA==" 77 | }, 78 | "@serialport/stream": { 79 | "version": "2.0.5", 80 | "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-2.0.5.tgz", 81 | "integrity": "sha512-9gc3zPoAqs/04mvq8TdZ7GxtnacCDuw3/u0u18UXXHgC/5tNDYkY+hXFIJB1fQFnP5yyNB1L2XLfX974ySJg9Q==", 82 | "requires": { 83 | "@serialport/binding-mock": "^2.0.5", 84 | "debug": "^4.1.1" 85 | } 86 | }, 87 | "@types/node": { 88 | "version": "11.13.17", 89 | "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.17.tgz", 90 | "integrity": "sha512-7W3kSMa8diVH6s24a8Qrmvwu+vG3ahOC/flMHFdWSdnPYoQI0yPO84h5zOWYXAha2Npn3Pw3SSuQSwBUfaniyQ==" 91 | }, 92 | "ansi-regex": { 93 | "version": "2.1.1", 94 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 95 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 96 | }, 97 | "aproba": { 98 | "version": "1.2.0", 99 | "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", 100 | "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" 101 | }, 102 | "are-we-there-yet": { 103 | "version": "1.1.5", 104 | "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", 105 | "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", 106 | "requires": { 107 | "delegates": "^1.0.0", 108 | "readable-stream": "^2.0.6" 109 | } 110 | }, 111 | "bindings": { 112 | "version": "1.5.0", 113 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", 114 | "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", 115 | "requires": { 116 | "file-uri-to-path": "1.0.0" 117 | } 118 | }, 119 | "bl": { 120 | "version": "1.2.2", 121 | "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", 122 | "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", 123 | "requires": { 124 | "readable-stream": "^2.3.5", 125 | "safe-buffer": "^5.1.1" 126 | } 127 | }, 128 | "buffer-alloc": { 129 | "version": "1.2.0", 130 | "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", 131 | "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", 132 | "requires": { 133 | "buffer-alloc-unsafe": "^1.1.0", 134 | "buffer-fill": "^1.0.0" 135 | } 136 | }, 137 | "buffer-alloc-unsafe": { 138 | "version": "1.1.0", 139 | "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", 140 | "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" 141 | }, 142 | "buffer-fill": { 143 | "version": "1.0.0", 144 | "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", 145 | "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" 146 | }, 147 | "chownr": { 148 | "version": "1.1.2", 149 | "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", 150 | "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==" 151 | }, 152 | "code-point-at": { 153 | "version": "1.1.0", 154 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 155 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" 156 | }, 157 | "console-control-strings": { 158 | "version": "1.1.0", 159 | "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", 160 | "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" 161 | }, 162 | "core-util-is": { 163 | "version": "1.0.2", 164 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 165 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 166 | }, 167 | "debug": { 168 | "version": "4.1.1", 169 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 170 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 171 | "requires": { 172 | "ms": "^2.1.1" 173 | } 174 | }, 175 | "decompress-response": { 176 | "version": "3.3.0", 177 | "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", 178 | "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", 179 | "requires": { 180 | "mimic-response": "^1.0.0" 181 | } 182 | }, 183 | "deep-extend": { 184 | "version": "0.6.0", 185 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 186 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" 187 | }, 188 | "delegates": { 189 | "version": "1.0.0", 190 | "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", 191 | "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" 192 | }, 193 | "detect-libc": { 194 | "version": "1.0.3", 195 | "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", 196 | "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" 197 | }, 198 | "end-of-stream": { 199 | "version": "1.4.1", 200 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", 201 | "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", 202 | "requires": { 203 | "once": "^1.4.0" 204 | } 205 | }, 206 | "expand-template": { 207 | "version": "2.0.3", 208 | "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", 209 | "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" 210 | }, 211 | "file-uri-to-path": { 212 | "version": "1.0.0", 213 | "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", 214 | "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" 215 | }, 216 | "fs-constants": { 217 | "version": "1.0.0", 218 | "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", 219 | "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" 220 | }, 221 | "gauge": { 222 | "version": "2.7.4", 223 | "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", 224 | "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", 225 | "requires": { 226 | "aproba": "^1.0.3", 227 | "console-control-strings": "^1.0.0", 228 | "has-unicode": "^2.0.0", 229 | "object-assign": "^4.1.0", 230 | "signal-exit": "^3.0.0", 231 | "string-width": "^1.0.1", 232 | "strip-ansi": "^3.0.1", 233 | "wide-align": "^1.1.0" 234 | } 235 | }, 236 | "github-from-package": { 237 | "version": "0.0.0", 238 | "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", 239 | "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" 240 | }, 241 | "has-unicode": { 242 | "version": "2.0.1", 243 | "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", 244 | "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" 245 | }, 246 | "inherits": { 247 | "version": "2.0.4", 248 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 249 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 250 | }, 251 | "ini": { 252 | "version": "1.3.5", 253 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", 254 | "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" 255 | }, 256 | "is-fullwidth-code-point": { 257 | "version": "1.0.0", 258 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 259 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 260 | "requires": { 261 | "number-is-nan": "^1.0.0" 262 | } 263 | }, 264 | "isarray": { 265 | "version": "1.0.0", 266 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 267 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 268 | }, 269 | "mimic-response": { 270 | "version": "1.0.1", 271 | "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", 272 | "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" 273 | }, 274 | "minimist": { 275 | "version": "1.2.0", 276 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 277 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 278 | }, 279 | "mkdirp": { 280 | "version": "0.5.1", 281 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 282 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 283 | "requires": { 284 | "minimist": "0.0.8" 285 | }, 286 | "dependencies": { 287 | "minimist": { 288 | "version": "0.0.8", 289 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 290 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 291 | } 292 | } 293 | }, 294 | "ms": { 295 | "version": "2.1.2", 296 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 297 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 298 | }, 299 | "nan": { 300 | "version": "2.14.0", 301 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", 302 | "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" 303 | }, 304 | "napi-build-utils": { 305 | "version": "1.0.1", 306 | "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", 307 | "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==" 308 | }, 309 | "node-abi": { 310 | "version": "2.9.0", 311 | "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.9.0.tgz", 312 | "integrity": "sha512-jmEOvv0eanWjhX8dX1pmjb7oJl1U1oR4FOh0b2GnvALwSYoOdU7sj+kLDSAyjo4pfC9aj/IxkloxdLJQhSSQBA==", 313 | "requires": { 314 | "semver": "^5.4.1" 315 | } 316 | }, 317 | "noop-logger": { 318 | "version": "0.1.1", 319 | "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", 320 | "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" 321 | }, 322 | "npmlog": { 323 | "version": "4.1.2", 324 | "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", 325 | "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", 326 | "requires": { 327 | "are-we-there-yet": "~1.1.2", 328 | "console-control-strings": "~1.1.0", 329 | "gauge": "~2.7.3", 330 | "set-blocking": "~2.0.0" 331 | } 332 | }, 333 | "number-is-nan": { 334 | "version": "1.0.1", 335 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 336 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 337 | }, 338 | "object-assign": { 339 | "version": "4.1.1", 340 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 341 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 342 | }, 343 | "once": { 344 | "version": "1.4.0", 345 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 346 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 347 | "requires": { 348 | "wrappy": "1" 349 | } 350 | }, 351 | "os-homedir": { 352 | "version": "1.0.2", 353 | "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", 354 | "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" 355 | }, 356 | "prebuild-install": { 357 | "version": "5.3.0", 358 | "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.0.tgz", 359 | "integrity": "sha512-aaLVANlj4HgZweKttFNUVNRxDukytuIuxeK2boIMHjagNJCiVKWFsKF4tCE3ql3GbrD2tExPQ7/pwtEJcHNZeg==", 360 | "requires": { 361 | "detect-libc": "^1.0.3", 362 | "expand-template": "^2.0.3", 363 | "github-from-package": "0.0.0", 364 | "minimist": "^1.2.0", 365 | "mkdirp": "^0.5.1", 366 | "napi-build-utils": "^1.0.1", 367 | "node-abi": "^2.7.0", 368 | "noop-logger": "^0.1.1", 369 | "npmlog": "^4.0.1", 370 | "os-homedir": "^1.0.1", 371 | "pump": "^2.0.1", 372 | "rc": "^1.2.7", 373 | "simple-get": "^2.7.0", 374 | "tar-fs": "^1.13.0", 375 | "tunnel-agent": "^0.6.0", 376 | "which-pm-runs": "^1.0.0" 377 | } 378 | }, 379 | "process-nextick-args": { 380 | "version": "2.0.1", 381 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 382 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 383 | }, 384 | "pump": { 385 | "version": "2.0.1", 386 | "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", 387 | "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", 388 | "requires": { 389 | "end-of-stream": "^1.1.0", 390 | "once": "^1.3.1" 391 | } 392 | }, 393 | "rc": { 394 | "version": "1.2.8", 395 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 396 | "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 397 | "requires": { 398 | "deep-extend": "^0.6.0", 399 | "ini": "~1.3.0", 400 | "minimist": "^1.2.0", 401 | "strip-json-comments": "~2.0.1" 402 | } 403 | }, 404 | "readable-stream": { 405 | "version": "2.3.6", 406 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 407 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 408 | "requires": { 409 | "core-util-is": "~1.0.0", 410 | "inherits": "~2.0.3", 411 | "isarray": "~1.0.0", 412 | "process-nextick-args": "~2.0.0", 413 | "safe-buffer": "~5.1.1", 414 | "string_decoder": "~1.1.1", 415 | "util-deprecate": "~1.0.1" 416 | } 417 | }, 418 | "safe-buffer": { 419 | "version": "5.1.2", 420 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 421 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 422 | }, 423 | "semver": { 424 | "version": "5.7.0", 425 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", 426 | "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" 427 | }, 428 | "serialport": { 429 | "version": "7.1.5", 430 | "resolved": "https://registry.npmjs.org/serialport/-/serialport-7.1.5.tgz", 431 | "integrity": "sha512-NplGdqaY+ZL8t3t5egbT+3oqLW4d7WvDT/x1ACxAyWa1fSnx+KTAmlDHeCls39lXwu8voaOr3bPOW4bwM7PdAA==", 432 | "requires": { 433 | "@serialport/binding-mock": "^2.0.5", 434 | "@serialport/bindings": "^2.0.8", 435 | "@serialport/parser-byte-length": "^2.0.2", 436 | "@serialport/parser-cctalk": "^2.0.2", 437 | "@serialport/parser-delimiter": "^2.0.2", 438 | "@serialport/parser-readline": "^2.0.2", 439 | "@serialport/parser-ready": "^2.0.2", 440 | "@serialport/parser-regex": "^2.0.2", 441 | "@serialport/stream": "^2.0.5", 442 | "debug": "^4.1.1" 443 | } 444 | }, 445 | "set-blocking": { 446 | "version": "2.0.0", 447 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 448 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" 449 | }, 450 | "signal-exit": { 451 | "version": "3.0.2", 452 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 453 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" 454 | }, 455 | "simple-concat": { 456 | "version": "1.0.0", 457 | "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", 458 | "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" 459 | }, 460 | "simple-get": { 461 | "version": "2.8.1", 462 | "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", 463 | "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", 464 | "requires": { 465 | "decompress-response": "^3.3.0", 466 | "once": "^1.3.1", 467 | "simple-concat": "^1.0.0" 468 | } 469 | }, 470 | "string-width": { 471 | "version": "1.0.2", 472 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 473 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 474 | "requires": { 475 | "code-point-at": "^1.0.0", 476 | "is-fullwidth-code-point": "^1.0.0", 477 | "strip-ansi": "^3.0.0" 478 | } 479 | }, 480 | "string_decoder": { 481 | "version": "1.1.1", 482 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 483 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 484 | "requires": { 485 | "safe-buffer": "~5.1.0" 486 | } 487 | }, 488 | "strip-ansi": { 489 | "version": "3.0.1", 490 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 491 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 492 | "requires": { 493 | "ansi-regex": "^2.0.0" 494 | } 495 | }, 496 | "strip-json-comments": { 497 | "version": "2.0.1", 498 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 499 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" 500 | }, 501 | "tar-fs": { 502 | "version": "1.16.3", 503 | "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", 504 | "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", 505 | "requires": { 506 | "chownr": "^1.0.1", 507 | "mkdirp": "^0.5.1", 508 | "pump": "^1.0.0", 509 | "tar-stream": "^1.1.2" 510 | }, 511 | "dependencies": { 512 | "pump": { 513 | "version": "1.0.3", 514 | "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", 515 | "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", 516 | "requires": { 517 | "end-of-stream": "^1.1.0", 518 | "once": "^1.3.1" 519 | } 520 | } 521 | } 522 | }, 523 | "tar-stream": { 524 | "version": "1.6.2", 525 | "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", 526 | "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", 527 | "requires": { 528 | "bl": "^1.0.0", 529 | "buffer-alloc": "^1.2.0", 530 | "end-of-stream": "^1.0.0", 531 | "fs-constants": "^1.0.0", 532 | "readable-stream": "^2.3.0", 533 | "to-buffer": "^1.1.1", 534 | "xtend": "^4.0.0" 535 | } 536 | }, 537 | "to-buffer": { 538 | "version": "1.1.1", 539 | "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", 540 | "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" 541 | }, 542 | "tunnel-agent": { 543 | "version": "0.6.0", 544 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 545 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 546 | "requires": { 547 | "safe-buffer": "^5.0.1" 548 | } 549 | }, 550 | "util-deprecate": { 551 | "version": "1.0.2", 552 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 553 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 554 | }, 555 | "which-pm-runs": { 556 | "version": "1.0.0", 557 | "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", 558 | "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" 559 | }, 560 | "wide-align": { 561 | "version": "1.1.3", 562 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", 563 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", 564 | "requires": { 565 | "string-width": "^1.0.2 || 2" 566 | } 567 | }, 568 | "wrappy": { 569 | "version": "1.0.2", 570 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 571 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 572 | }, 573 | "xtend": { 574 | "version": "4.0.2", 575 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", 576 | "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" 577 | } 578 | } 579 | } 580 | -------------------------------------------------------------------------------- /example/ts/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-mavlink-example-ts", 3 | "version": "0.1.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@ifrunistuttgart/node-mavlink": { 8 | "version": "0.1.0", 9 | "resolved": "https://registry.npmjs.org/@ifrunistuttgart/node-mavlink/-/node-mavlink-0.1.0.tgz", 10 | "integrity": "sha512-+vJCTJC11AKFy5iJpy7FAHMdRTk/iH7gDgDgvafkMpouhfzqaAs4oqbUpNxnEEwoar7RZt0KyfjMUr0DlSaLFw==", 11 | "requires": { 12 | "@types/node": "^11.11.6" 13 | } 14 | }, 15 | "@serialport/binding-abstract": { 16 | "version": "2.0.4", 17 | "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-2.0.4.tgz", 18 | "integrity": "sha512-0ZcSB6Gdxal55R/5McB0O359coXrO/GrmJlZ13cwN67gLsvmhmexCsd8b+H9CQ7dAbLih4HZSbfG9v8crrB0Gg==", 19 | "requires": { 20 | "debug": "^4.1.0" 21 | } 22 | }, 23 | "@serialport/binding-mock": { 24 | "version": "2.0.4", 25 | "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-2.0.4.tgz", 26 | "integrity": "sha512-7c2dzVwwQIZKk+NFqC1mG0sTAwWR/GJY/4QbTn1Au3TnXhTj8nESYW/dURwsq6dGyl8+ZIPpKlRNu5Pr2tNxAQ==", 27 | "requires": { 28 | "@serialport/binding-abstract": "^2.0.4", 29 | "debug": "^4.1.0" 30 | } 31 | }, 32 | "@serialport/bindings": { 33 | "version": "2.0.7", 34 | "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-2.0.7.tgz", 35 | "integrity": "sha512-XNSad/Eh73Dx4gIG8cfwSwUeSznEmjBeaaU5PVAMztwNJrDd9DG0eBvbzxGbBc1ol5RR4sK82I01dCAOjseLAg==", 36 | "requires": { 37 | "@serialport/binding-abstract": "^2.0.4", 38 | "@serialport/parser-readline": "^2.0.2", 39 | "bindings": "^1.3.0", 40 | "debug": "^4.1.0", 41 | "nan": "^2.12.1", 42 | "prebuild-install": "^5.2.1" 43 | } 44 | }, 45 | "@serialport/parser-byte-length": { 46 | "version": "2.0.2", 47 | "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-2.0.2.tgz", 48 | "integrity": "sha512-cUOprk1uRLucCJy6m+wAM4pwdBaB5D4ySi6juwRScP9DTjKUvGWYj5jzuqvftFBvYFmFza89aLj5K23xiiqj7Q==" 49 | }, 50 | "@serialport/parser-cctalk": { 51 | "version": "2.0.2", 52 | "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-2.0.2.tgz", 53 | "integrity": "sha512-5LMysRv7De+TeeoKzi4+sgouD4tqZEAn1agAVevw+7ILM0m30i1zgZLtchgxtCH7OoQRAkENEVEPc0OwhghKgw==" 54 | }, 55 | "@serialport/parser-delimiter": { 56 | "version": "2.0.2", 57 | "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-2.0.2.tgz", 58 | "integrity": "sha512-zB02LahFfyZmJqak9l37vP/F1K+KCUxd1KQj35OhD1+0q/unMjVTZmsfkxFSM4gkaxP9j7+8USk+LQJ3V8U26Q==" 59 | }, 60 | "@serialport/parser-readline": { 61 | "version": "2.0.2", 62 | "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-2.0.2.tgz", 63 | "integrity": "sha512-thL26dGEHB+eINNydJmzcLLhiqcBQkF+wNTbRaYblTP/6dm7JsfjYSud7bTkN63AgE0xpe9tKXBFqc8zgJ1VKg==", 64 | "requires": { 65 | "@serialport/parser-delimiter": "^2.0.2" 66 | } 67 | }, 68 | "@serialport/parser-ready": { 69 | "version": "2.0.2", 70 | "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-2.0.2.tgz", 71 | "integrity": "sha512-6ynQ+HIIkFQcEO2Hrq4Qmdz+hlJ7kjTHGQ1E7SRN7f70nnys1v3HSke8mjK3RzVw+SwL0rBYjftUdCTrU+7c+Q==" 72 | }, 73 | "@serialport/parser-regex": { 74 | "version": "2.0.2", 75 | "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-2.0.2.tgz", 76 | "integrity": "sha512-7qjYd7AdHUK8fJOmHpXlMRipqRCVMMyDFyf/5TQQiOt6q+BiFjLOtSpVXhakHwgnXanzDYKeRSB8zM0pZZg+LA==" 77 | }, 78 | "@serialport/stream": { 79 | "version": "2.0.4", 80 | "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-2.0.4.tgz", 81 | "integrity": "sha512-x1OzTGGTA/ioE/wx7sM11KVxkZr5MqZNVTQXezl6wySCl5BkQTj1nc37e99p6aRQjMxAoY8BfIDJKXWwT5LSsA==", 82 | "requires": { 83 | "@serialport/binding-mock": "^2.0.4", 84 | "debug": "^4.1.0" 85 | } 86 | }, 87 | "@types/node": { 88 | "version": "11.13.2", 89 | "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.2.tgz", 90 | "integrity": "sha512-HOtU5KqROKT7qX/itKHuTtt5fV0iXbheQvrgbLNXFJQBY/eh+VS5vmmTAVlo3qIGMsypm0G4N1t2AXjy1ZicaQ==" 91 | }, 92 | "@types/serialport": { 93 | "version": "7.0.2", 94 | "resolved": "https://registry.npmjs.org/@types/serialport/-/serialport-7.0.2.tgz", 95 | "integrity": "sha512-a4tAdZXfhBcVZh4vm2R+GjXAQ8DMWCwshTyu2J2/Xw7uPdKiTmEfsr/4zd8WEFzXLioTooxtA1CTsP2E+4Iv7g==", 96 | "dev": true, 97 | "requires": { 98 | "@types/node": "*" 99 | } 100 | }, 101 | "ansi-regex": { 102 | "version": "2.1.1", 103 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 104 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 105 | }, 106 | "ansi-styles": { 107 | "version": "2.2.1", 108 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 109 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", 110 | "dev": true 111 | }, 112 | "aproba": { 113 | "version": "1.2.0", 114 | "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", 115 | "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" 116 | }, 117 | "are-we-there-yet": { 118 | "version": "1.1.5", 119 | "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", 120 | "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", 121 | "requires": { 122 | "delegates": "^1.0.0", 123 | "readable-stream": "^2.0.6" 124 | } 125 | }, 126 | "argparse": { 127 | "version": "1.0.10", 128 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 129 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 130 | "dev": true, 131 | "requires": { 132 | "sprintf-js": "~1.0.2" 133 | } 134 | }, 135 | "babel-code-frame": { 136 | "version": "6.26.0", 137 | "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", 138 | "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", 139 | "dev": true, 140 | "requires": { 141 | "chalk": "^1.1.3", 142 | "esutils": "^2.0.2", 143 | "js-tokens": "^3.0.2" 144 | }, 145 | "dependencies": { 146 | "chalk": { 147 | "version": "1.1.3", 148 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 149 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 150 | "dev": true, 151 | "requires": { 152 | "ansi-styles": "^2.2.1", 153 | "escape-string-regexp": "^1.0.2", 154 | "has-ansi": "^2.0.0", 155 | "strip-ansi": "^3.0.0", 156 | "supports-color": "^2.0.0" 157 | } 158 | } 159 | } 160 | }, 161 | "balanced-match": { 162 | "version": "1.0.0", 163 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 164 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 165 | "dev": true 166 | }, 167 | "bindings": { 168 | "version": "1.5.0", 169 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", 170 | "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", 171 | "requires": { 172 | "file-uri-to-path": "1.0.0" 173 | } 174 | }, 175 | "bl": { 176 | "version": "1.2.2", 177 | "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", 178 | "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", 179 | "requires": { 180 | "readable-stream": "^2.3.5", 181 | "safe-buffer": "^5.1.1" 182 | } 183 | }, 184 | "brace-expansion": { 185 | "version": "1.1.11", 186 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 187 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 188 | "dev": true, 189 | "requires": { 190 | "balanced-match": "^1.0.0", 191 | "concat-map": "0.0.1" 192 | } 193 | }, 194 | "buffer-alloc": { 195 | "version": "1.2.0", 196 | "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", 197 | "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", 198 | "requires": { 199 | "buffer-alloc-unsafe": "^1.1.0", 200 | "buffer-fill": "^1.0.0" 201 | } 202 | }, 203 | "buffer-alloc-unsafe": { 204 | "version": "1.1.0", 205 | "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", 206 | "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" 207 | }, 208 | "buffer-fill": { 209 | "version": "1.0.0", 210 | "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", 211 | "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" 212 | }, 213 | "builtin-modules": { 214 | "version": "1.1.1", 215 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", 216 | "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", 217 | "dev": true 218 | }, 219 | "chalk": { 220 | "version": "2.4.2", 221 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 222 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 223 | "dev": true, 224 | "requires": { 225 | "ansi-styles": "^3.2.1", 226 | "escape-string-regexp": "^1.0.5", 227 | "supports-color": "^5.3.0" 228 | }, 229 | "dependencies": { 230 | "ansi-styles": { 231 | "version": "3.2.1", 232 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 233 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 234 | "dev": true, 235 | "requires": { 236 | "color-convert": "^1.9.0" 237 | } 238 | }, 239 | "supports-color": { 240 | "version": "5.5.0", 241 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 242 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 243 | "dev": true, 244 | "requires": { 245 | "has-flag": "^3.0.0" 246 | } 247 | } 248 | } 249 | }, 250 | "chownr": { 251 | "version": "1.1.1", 252 | "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", 253 | "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" 254 | }, 255 | "code-point-at": { 256 | "version": "1.1.0", 257 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 258 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" 259 | }, 260 | "color-convert": { 261 | "version": "1.9.3", 262 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 263 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 264 | "dev": true, 265 | "requires": { 266 | "color-name": "1.1.3" 267 | } 268 | }, 269 | "color-name": { 270 | "version": "1.1.3", 271 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 272 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 273 | "dev": true 274 | }, 275 | "commander": { 276 | "version": "2.20.0", 277 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", 278 | "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", 279 | "dev": true 280 | }, 281 | "concat-map": { 282 | "version": "0.0.1", 283 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 284 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 285 | "dev": true 286 | }, 287 | "console-control-strings": { 288 | "version": "1.1.0", 289 | "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", 290 | "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" 291 | }, 292 | "core-util-is": { 293 | "version": "1.0.2", 294 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 295 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 296 | }, 297 | "debug": { 298 | "version": "4.1.1", 299 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 300 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 301 | "requires": { 302 | "ms": "^2.1.1" 303 | } 304 | }, 305 | "decompress-response": { 306 | "version": "3.3.0", 307 | "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", 308 | "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", 309 | "requires": { 310 | "mimic-response": "^1.0.0" 311 | } 312 | }, 313 | "deep-extend": { 314 | "version": "0.6.0", 315 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 316 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" 317 | }, 318 | "delegates": { 319 | "version": "1.0.0", 320 | "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", 321 | "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" 322 | }, 323 | "detect-libc": { 324 | "version": "1.0.3", 325 | "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", 326 | "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" 327 | }, 328 | "diff": { 329 | "version": "3.5.0", 330 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 331 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 332 | "dev": true 333 | }, 334 | "end-of-stream": { 335 | "version": "1.4.1", 336 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", 337 | "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", 338 | "requires": { 339 | "once": "^1.4.0" 340 | } 341 | }, 342 | "escape-string-regexp": { 343 | "version": "1.0.5", 344 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 345 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 346 | "dev": true 347 | }, 348 | "esprima": { 349 | "version": "4.0.1", 350 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 351 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 352 | "dev": true 353 | }, 354 | "esutils": { 355 | "version": "2.0.2", 356 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 357 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 358 | "dev": true 359 | }, 360 | "expand-template": { 361 | "version": "2.0.3", 362 | "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", 363 | "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" 364 | }, 365 | "file-uri-to-path": { 366 | "version": "1.0.0", 367 | "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", 368 | "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" 369 | }, 370 | "fs-constants": { 371 | "version": "1.0.0", 372 | "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", 373 | "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" 374 | }, 375 | "fs.realpath": { 376 | "version": "1.0.0", 377 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 378 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 379 | "dev": true 380 | }, 381 | "gauge": { 382 | "version": "2.7.4", 383 | "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", 384 | "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", 385 | "requires": { 386 | "aproba": "^1.0.3", 387 | "console-control-strings": "^1.0.0", 388 | "has-unicode": "^2.0.0", 389 | "object-assign": "^4.1.0", 390 | "signal-exit": "^3.0.0", 391 | "string-width": "^1.0.1", 392 | "strip-ansi": "^3.0.1", 393 | "wide-align": "^1.1.0" 394 | } 395 | }, 396 | "github-from-package": { 397 | "version": "0.0.0", 398 | "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", 399 | "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" 400 | }, 401 | "glob": { 402 | "version": "7.1.3", 403 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 404 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 405 | "dev": true, 406 | "requires": { 407 | "fs.realpath": "^1.0.0", 408 | "inflight": "^1.0.4", 409 | "inherits": "2", 410 | "minimatch": "^3.0.4", 411 | "once": "^1.3.0", 412 | "path-is-absolute": "^1.0.0" 413 | } 414 | }, 415 | "has-ansi": { 416 | "version": "2.0.0", 417 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 418 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", 419 | "dev": true, 420 | "requires": { 421 | "ansi-regex": "^2.0.0" 422 | } 423 | }, 424 | "has-flag": { 425 | "version": "3.0.0", 426 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 427 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 428 | "dev": true 429 | }, 430 | "has-unicode": { 431 | "version": "2.0.1", 432 | "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", 433 | "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" 434 | }, 435 | "inflight": { 436 | "version": "1.0.6", 437 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 438 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 439 | "dev": true, 440 | "requires": { 441 | "once": "^1.3.0", 442 | "wrappy": "1" 443 | } 444 | }, 445 | "inherits": { 446 | "version": "2.0.3", 447 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 448 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 449 | }, 450 | "ini": { 451 | "version": "1.3.5", 452 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", 453 | "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" 454 | }, 455 | "is-fullwidth-code-point": { 456 | "version": "1.0.0", 457 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 458 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 459 | "requires": { 460 | "number-is-nan": "^1.0.0" 461 | } 462 | }, 463 | "isarray": { 464 | "version": "1.0.0", 465 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 466 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 467 | }, 468 | "js-tokens": { 469 | "version": "3.0.2", 470 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", 471 | "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", 472 | "dev": true 473 | }, 474 | "js-yaml": { 475 | "version": "3.13.1", 476 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", 477 | "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", 478 | "dev": true, 479 | "requires": { 480 | "argparse": "^1.0.7", 481 | "esprima": "^4.0.0" 482 | } 483 | }, 484 | "mimic-response": { 485 | "version": "1.0.1", 486 | "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", 487 | "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" 488 | }, 489 | "minimatch": { 490 | "version": "3.0.4", 491 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 492 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 493 | "dev": true, 494 | "requires": { 495 | "brace-expansion": "^1.1.7" 496 | } 497 | }, 498 | "minimist": { 499 | "version": "1.2.0", 500 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 501 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 502 | }, 503 | "mkdirp": { 504 | "version": "0.5.1", 505 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 506 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 507 | "requires": { 508 | "minimist": "0.0.8" 509 | }, 510 | "dependencies": { 511 | "minimist": { 512 | "version": "0.0.8", 513 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 514 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 515 | } 516 | } 517 | }, 518 | "ms": { 519 | "version": "2.1.1", 520 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 521 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 522 | }, 523 | "nan": { 524 | "version": "2.13.2", 525 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", 526 | "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" 527 | }, 528 | "napi-build-utils": { 529 | "version": "1.0.1", 530 | "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", 531 | "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==" 532 | }, 533 | "node-abi": { 534 | "version": "2.7.1", 535 | "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.7.1.tgz", 536 | "integrity": "sha512-OV8Bq1OrPh6z+Y4dqwo05HqrRL9YNF7QVMRfq1/pguwKLG+q9UB/Lk0x5qXjO23JjJg+/jqCHSTaG1P3tfKfuw==", 537 | "requires": { 538 | "semver": "^5.4.1" 539 | } 540 | }, 541 | "noop-logger": { 542 | "version": "0.1.1", 543 | "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", 544 | "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" 545 | }, 546 | "npmlog": { 547 | "version": "4.1.2", 548 | "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", 549 | "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", 550 | "requires": { 551 | "are-we-there-yet": "~1.1.2", 552 | "console-control-strings": "~1.1.0", 553 | "gauge": "~2.7.3", 554 | "set-blocking": "~2.0.0" 555 | } 556 | }, 557 | "number-is-nan": { 558 | "version": "1.0.1", 559 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 560 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 561 | }, 562 | "object-assign": { 563 | "version": "4.1.1", 564 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 565 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 566 | }, 567 | "once": { 568 | "version": "1.4.0", 569 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 570 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 571 | "requires": { 572 | "wrappy": "1" 573 | } 574 | }, 575 | "os-homedir": { 576 | "version": "1.0.2", 577 | "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", 578 | "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" 579 | }, 580 | "path-is-absolute": { 581 | "version": "1.0.1", 582 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 583 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 584 | "dev": true 585 | }, 586 | "path-parse": { 587 | "version": "1.0.6", 588 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 589 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", 590 | "dev": true 591 | }, 592 | "prebuild-install": { 593 | "version": "5.2.5", 594 | "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.2.5.tgz", 595 | "integrity": "sha512-6uZgMVg7yDfqlP5CPurVhtq3hUKBFNufiar4J5hZrlHTo59DDBEtyxw01xCdFss9j0Zb9+qzFVf/s4niayba3w==", 596 | "requires": { 597 | "detect-libc": "^1.0.3", 598 | "expand-template": "^2.0.3", 599 | "github-from-package": "0.0.0", 600 | "minimist": "^1.2.0", 601 | "mkdirp": "^0.5.1", 602 | "napi-build-utils": "^1.0.1", 603 | "node-abi": "^2.7.0", 604 | "noop-logger": "^0.1.1", 605 | "npmlog": "^4.0.1", 606 | "os-homedir": "^1.0.1", 607 | "pump": "^2.0.1", 608 | "rc": "^1.2.7", 609 | "simple-get": "^2.7.0", 610 | "tar-fs": "^1.13.0", 611 | "tunnel-agent": "^0.6.0", 612 | "which-pm-runs": "^1.0.0" 613 | } 614 | }, 615 | "process-nextick-args": { 616 | "version": "2.0.0", 617 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", 618 | "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" 619 | }, 620 | "pump": { 621 | "version": "2.0.1", 622 | "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", 623 | "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", 624 | "requires": { 625 | "end-of-stream": "^1.1.0", 626 | "once": "^1.3.1" 627 | } 628 | }, 629 | "rc": { 630 | "version": "1.2.8", 631 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 632 | "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 633 | "requires": { 634 | "deep-extend": "^0.6.0", 635 | "ini": "~1.3.0", 636 | "minimist": "^1.2.0", 637 | "strip-json-comments": "~2.0.1" 638 | } 639 | }, 640 | "readable-stream": { 641 | "version": "2.3.6", 642 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 643 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 644 | "requires": { 645 | "core-util-is": "~1.0.0", 646 | "inherits": "~2.0.3", 647 | "isarray": "~1.0.0", 648 | "process-nextick-args": "~2.0.0", 649 | "safe-buffer": "~5.1.1", 650 | "string_decoder": "~1.1.1", 651 | "util-deprecate": "~1.0.1" 652 | } 653 | }, 654 | "resolve": { 655 | "version": "1.10.0", 656 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", 657 | "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", 658 | "dev": true, 659 | "requires": { 660 | "path-parse": "^1.0.6" 661 | } 662 | }, 663 | "safe-buffer": { 664 | "version": "5.1.2", 665 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 666 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 667 | }, 668 | "semver": { 669 | "version": "5.7.0", 670 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", 671 | "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" 672 | }, 673 | "serialport": { 674 | "version": "7.1.4", 675 | "resolved": "https://registry.npmjs.org/serialport/-/serialport-7.1.4.tgz", 676 | "integrity": "sha512-noYd5lfK5MZfyiuCx4o/3s/iaS076HaWDjmhsGJSfdNCGnxfVfDKQBK6xmXbtSlaJAwV7BPU12p844OTzHoA+Q==", 677 | "requires": { 678 | "@serialport/binding-mock": "^2.0.4", 679 | "@serialport/bindings": "^2.0.7", 680 | "@serialport/parser-byte-length": "^2.0.2", 681 | "@serialport/parser-cctalk": "^2.0.2", 682 | "@serialport/parser-delimiter": "^2.0.2", 683 | "@serialport/parser-readline": "^2.0.2", 684 | "@serialport/parser-ready": "^2.0.2", 685 | "@serialport/parser-regex": "^2.0.2", 686 | "@serialport/stream": "^2.0.4", 687 | "debug": "^4.1.0" 688 | } 689 | }, 690 | "set-blocking": { 691 | "version": "2.0.0", 692 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 693 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" 694 | }, 695 | "signal-exit": { 696 | "version": "3.0.2", 697 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 698 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" 699 | }, 700 | "simple-concat": { 701 | "version": "1.0.0", 702 | "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", 703 | "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" 704 | }, 705 | "simple-get": { 706 | "version": "2.8.1", 707 | "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", 708 | "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", 709 | "requires": { 710 | "decompress-response": "^3.3.0", 711 | "once": "^1.3.1", 712 | "simple-concat": "^1.0.0" 713 | } 714 | }, 715 | "sprintf-js": { 716 | "version": "1.0.3", 717 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 718 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 719 | "dev": true 720 | }, 721 | "string-width": { 722 | "version": "1.0.2", 723 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 724 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 725 | "requires": { 726 | "code-point-at": "^1.0.0", 727 | "is-fullwidth-code-point": "^1.0.0", 728 | "strip-ansi": "^3.0.0" 729 | } 730 | }, 731 | "string_decoder": { 732 | "version": "1.1.1", 733 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 734 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 735 | "requires": { 736 | "safe-buffer": "~5.1.0" 737 | } 738 | }, 739 | "strip-ansi": { 740 | "version": "3.0.1", 741 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 742 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 743 | "requires": { 744 | "ansi-regex": "^2.0.0" 745 | } 746 | }, 747 | "strip-json-comments": { 748 | "version": "2.0.1", 749 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 750 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" 751 | }, 752 | "supports-color": { 753 | "version": "2.0.0", 754 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 755 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", 756 | "dev": true 757 | }, 758 | "tar-fs": { 759 | "version": "1.16.3", 760 | "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", 761 | "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", 762 | "requires": { 763 | "chownr": "^1.0.1", 764 | "mkdirp": "^0.5.1", 765 | "pump": "^1.0.0", 766 | "tar-stream": "^1.1.2" 767 | }, 768 | "dependencies": { 769 | "pump": { 770 | "version": "1.0.3", 771 | "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", 772 | "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", 773 | "requires": { 774 | "end-of-stream": "^1.1.0", 775 | "once": "^1.3.1" 776 | } 777 | } 778 | } 779 | }, 780 | "tar-stream": { 781 | "version": "1.6.2", 782 | "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", 783 | "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", 784 | "requires": { 785 | "bl": "^1.0.0", 786 | "buffer-alloc": "^1.2.0", 787 | "end-of-stream": "^1.0.0", 788 | "fs-constants": "^1.0.0", 789 | "readable-stream": "^2.3.0", 790 | "to-buffer": "^1.1.1", 791 | "xtend": "^4.0.0" 792 | } 793 | }, 794 | "to-buffer": { 795 | "version": "1.1.1", 796 | "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", 797 | "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" 798 | }, 799 | "tslib": { 800 | "version": "1.9.3", 801 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", 802 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", 803 | "dev": true 804 | }, 805 | "tslint": { 806 | "version": "5.15.0", 807 | "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.15.0.tgz", 808 | "integrity": "sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==", 809 | "dev": true, 810 | "requires": { 811 | "babel-code-frame": "^6.22.0", 812 | "builtin-modules": "^1.1.1", 813 | "chalk": "^2.3.0", 814 | "commander": "^2.12.1", 815 | "diff": "^3.2.0", 816 | "glob": "^7.1.1", 817 | "js-yaml": "^3.13.0", 818 | "minimatch": "^3.0.4", 819 | "mkdirp": "^0.5.1", 820 | "resolve": "^1.3.2", 821 | "semver": "^5.3.0", 822 | "tslib": "^1.8.0", 823 | "tsutils": "^2.29.0" 824 | } 825 | }, 826 | "tsutils": { 827 | "version": "2.29.0", 828 | "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", 829 | "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", 830 | "dev": true, 831 | "requires": { 832 | "tslib": "^1.8.1" 833 | } 834 | }, 835 | "tunnel-agent": { 836 | "version": "0.6.0", 837 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 838 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 839 | "requires": { 840 | "safe-buffer": "^5.0.1" 841 | } 842 | }, 843 | "typescript": { 844 | "version": "3.4.3", 845 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.3.tgz", 846 | "integrity": "sha512-FFgHdPt4T/duxx6Ndf7hwgMZZjZpB+U0nMNGVCYPq0rEzWKjEDobm4J6yb3CS7naZ0yURFqdw9Gwc7UOh/P9oQ==", 847 | "dev": true 848 | }, 849 | "util-deprecate": { 850 | "version": "1.0.2", 851 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 852 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 853 | }, 854 | "which-pm-runs": { 855 | "version": "1.0.0", 856 | "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", 857 | "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" 858 | }, 859 | "wide-align": { 860 | "version": "1.1.3", 861 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", 862 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", 863 | "requires": { 864 | "string-width": "^1.0.2 || 2" 865 | } 866 | }, 867 | "wrappy": { 868 | "version": "1.0.2", 869 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 870 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 871 | }, 872 | "xtend": { 873 | "version": "4.0.1", 874 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", 875 | "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" 876 | } 877 | } 878 | } 879 | --------------------------------------------------------------------------------