UNPKG

node-open-protocol-desoutter

Version:
39 lines (32 loc) 1.01 kB
/* Copyright 2018 Smart-Tech Controle e Automação Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ "use strict"; /*jshint esversion: 6, node: true*/ function parser(msg, opts, cb) { let buffer = msg.payload; msg.payload = buffer.toString("ascii"); cb(null, msg); } function serializer(msg, opts, cb) { let buf = Buffer.from(""); msg.payload = buf; cb(null, msg); } function revision() { return [1, 2, 3]; } module.exports = { parser, serializer, revision };