remobe generated ts and load proto file directly
This commit is contained in:
10
backend/src/Model/sparkplugb.ts
Normal file
10
backend/src/Model/sparkplugb.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
const protobuf = require('protobufjs')
|
||||
const sparkplugBProto = require('../../../res/sparkplug_b.proto')
|
||||
|
||||
export let Payload = undefined
|
||||
|
||||
export function loadSparkplugBPayload() {
|
||||
protobuf.load(sparkplugBProto).then((root: any) => {
|
||||
Payload = root.lookupType('com.cirruslink.sparkplug.protobuf.Payload')
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user