@meshtastic/meshtasticjs
Advanced tools
Comparing version 0.9.4 to 0.9.5
@@ -640,2 +640,3 @@ import { Logger } from "tslog"; | ||
id: decodedMessage.id, | ||
rxTime: new Date(), | ||
from: decodedMessage.payloadVariant.nodeInfo.num, | ||
@@ -650,2 +651,3 @@ channel: ChannelNumber.PRIMARY, | ||
id: decodedMessage.id, | ||
rxTime: new Date(), | ||
from: decodedMessage.payloadVariant.nodeInfo.num, | ||
@@ -756,2 +758,8 @@ channel: ChannelNumber.PRIMARY, | ||
let routingPacket = undefined; | ||
const packetMetadata = { | ||
id: meshPacket.id, | ||
rxTime: new Date(meshPacket.rxTime * 1000), | ||
from: meshPacket.from, | ||
channel: meshPacket.channel | ||
}; | ||
this.log.trace(Types.Emitter[Types.Emitter.handleMeshPacket], `📦 Received ${Protobuf.PortNum[dataPacket.portnum]} packet`); | ||
@@ -761,5 +769,3 @@ switch (dataPacket.portnum) { | ||
this.events.onMessagePacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: new TextDecoder().decode(dataPacket.payload) | ||
@@ -770,5 +776,3 @@ }); | ||
this.events.onRemoteHardwarePacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: Protobuf.HardwareMessage.fromBinary(dataPacket.payload) | ||
@@ -779,5 +783,3 @@ }); | ||
this.events.onPositionPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: Protobuf.Position.fromBinary(dataPacket.payload) | ||
@@ -788,5 +790,3 @@ }); | ||
this.events.onUserPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: Protobuf.User.fromBinary(dataPacket.payload) | ||
@@ -798,5 +798,3 @@ }); | ||
this.events.onRoutingPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: routingPacket | ||
@@ -834,5 +832,3 @@ }); | ||
this.events.onUserPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: adminMessage.payloadVariant.getOwnerResponse | ||
@@ -849,5 +845,3 @@ }); | ||
this.events.onDeviceMetadataPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: adminMessage.payloadVariant.getDeviceMetadataResponse | ||
@@ -864,5 +858,3 @@ }); | ||
this.events.onWaypointPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: Protobuf.Waypoint.fromBinary(dataPacket.payload) | ||
@@ -873,5 +865,3 @@ }); | ||
this.events.onPingPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: dataPacket.payload //TODO: decode | ||
@@ -882,5 +872,3 @@ }); | ||
this.events.onIpTunnelPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: dataPacket.payload | ||
@@ -891,5 +879,3 @@ }); | ||
this.events.onSerialPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: dataPacket.payload | ||
@@ -900,5 +886,3 @@ }); | ||
this.events.onStoreForwardPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: dataPacket.payload | ||
@@ -909,5 +893,3 @@ }); | ||
this.events.onRangeTestPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: dataPacket.payload | ||
@@ -918,5 +900,3 @@ }); | ||
this.events.onTelemetryPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: Protobuf.Telemetry.fromBinary(dataPacket.payload) | ||
@@ -927,5 +907,3 @@ }); | ||
this.events.onPrivatePacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: dataPacket.payload | ||
@@ -936,5 +914,3 @@ }); | ||
this.events.onAtakPacket.emit({ | ||
id: meshPacket.id, | ||
from: meshPacket.from, | ||
channel: meshPacket.channel, | ||
...packetMetadata, | ||
data: dataPacket.payload | ||
@@ -941,0 +917,0 @@ }); |
@@ -47,2 +47,3 @@ /// <reference types="web-bluetooth" /> | ||
id: number; | ||
rxTime: Date; | ||
from: number; | ||
@@ -49,0 +50,0 @@ channel: ChannelNumber; |
{ | ||
"name": "@meshtastic/meshtasticjs", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"description": "Browser library for interfacing with meshtastic devices", | ||
@@ -5,0 +5,0 @@ "license": "GPL-3.0-only", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
551447
11588