File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import { readFileSync } from 'fs'
22import * as protobuf from 'protobufjs'
33import { Base64Message } from './Base64Message'
44import { Decoder } from './Decoder'
5+ import { protobufStr } from './sparkplugb_proto'
56
6- const buffer = readFileSync ( require . resolve ( '../../../../res/sparkplug_b.proto' ) )
7- const root = protobuf . parse ( buffer . toString ( ) ) . root
7+ const root = protobuf . parse ( protobufStr ) . root
88export let SparkplugPayload = root . lookupType ( 'com.cirruslink.sparkplug.protobuf.Payload' )
99
1010export const SparkplugDecoder = {
Original file line number Diff line number Diff line change 1+ export const protobufStr = `
12syntax = "proto2";
23
34//
@@ -195,3 +196,4 @@ message Payload {
195196 optional bytes body = 5; // To optionally bypass the whole definition above
196197 extensions 6 to max; // For third party extensions
197198}
199+ `
You can’t perform that action at this time.
0 commit comments