File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,13 @@ export let SparkplugPayload = root.lookupType('com.cirruslink.sparkplug.protobuf
9
9
10
10
export const SparkplugDecoder = {
11
11
decode ( input : Buffer ) : Base64Message | undefined {
12
-
13
- // ! Longs are being decoded as Long { low: 2034658590, high: 390, unsigned: true } despite toNumber being called on them in the
14
- // ! translation app
15
- // console.log(SparkplugPayload.decode(new Uint8Array(input)));
16
12
try {
17
13
let message = Base64Message . fromString (
18
14
JSON . stringify (
19
- SparkplugPayload . toObject ( SparkplugPayload . decode ( new Uint8Array ( input ) ) )
15
+ SparkplugPayload . toObject ( SparkplugPayload . decode ( new Uint8Array ( input ) ) , { longs : Number } )
20
16
)
21
17
)
22
18
message . decoder = Decoder . SPARKPLUG
23
- // console.log(message);
24
19
return message
25
20
} catch {
26
21
// ignore
You can’t perform that action at this time.
0 commit comments