@meshtastic/meshtasticjs
Advanced tools
Comparing version 0.6.92 to 0.6.94
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "admin.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "apponly.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "cannedmessages.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "channel.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "config.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "device_metadata.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "deviceonly.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "localonly.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -572,20 +572,13 @@ import { MessageType } from "@protobuf-ts/runtime"; | ||
emoji: number; | ||
/** | ||
* | ||
* Location structure | ||
* | ||
* @generated from protobuf field: Location location = 9; | ||
*/ | ||
location?: Location; | ||
} | ||
/** | ||
* | ||
* Location of a waypoint to associate with a message | ||
* Waypoint message, used to share arbitrary locations across the mesh | ||
* | ||
* @generated from protobuf message Location | ||
* @generated from protobuf message Waypoint | ||
*/ | ||
export interface Location { | ||
export interface Waypoint { | ||
/** | ||
* | ||
* Id of the location | ||
* Id of the waypoint | ||
* | ||
@@ -611,3 +604,3 @@ * @generated from protobuf field: uint32 id = 1; | ||
* | ||
* Time the location is to expire (epoch) | ||
* Time the waypoint is to expire (epoch) | ||
* | ||
@@ -619,3 +612,3 @@ * @generated from protobuf field: uint32 expire = 4; | ||
* | ||
* If true, only allow the original sender to update the location. | ||
* If true, only allow the original sender to update the waypoint. | ||
* | ||
@@ -627,3 +620,3 @@ * @generated from protobuf field: bool locked = 5; | ||
* | ||
* Name of the location - max 30 chars | ||
* Name of the waypoint - max 30 chars | ||
* | ||
@@ -635,3 +628,3 @@ * @generated from protobuf field: string name = 6; | ||
* * | ||
* Description of the location - max 100 chars | ||
* Description of the waypoint - max 100 chars | ||
* | ||
@@ -1767,9 +1760,9 @@ * @generated from protobuf field: string description = 7; | ||
export declare const Data: Data$Type; | ||
declare class Location$Type extends MessageType<Location> { | ||
declare class Waypoint$Type extends MessageType<Waypoint> { | ||
constructor(); | ||
} | ||
/** | ||
* @generated MessageType for protobuf message Location | ||
* @generated MessageType for protobuf message Waypoint | ||
*/ | ||
export declare const Location: Location$Type; | ||
export declare const Waypoint: Waypoint$Type; | ||
declare class MeshPacket$Type extends MessageType<MeshPacket> { | ||
@@ -1776,0 +1769,0 @@ constructor(); |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "mesh.proto" (syntax proto3) | ||
@@ -769,4 +769,3 @@ // tslint:disable | ||
{ no: 7, name: "reply_id", kind: "scalar", T: 7 /*ScalarType.FIXED32*/ }, | ||
{ no: 8, name: "emoji", kind: "scalar", T: 7 /*ScalarType.FIXED32*/ }, | ||
{ no: 9, name: "location", kind: "message", T: () => Location } | ||
{ no: 8, name: "emoji", kind: "scalar", T: 7 /*ScalarType.FIXED32*/ } | ||
]); | ||
@@ -780,5 +779,5 @@ } | ||
// @generated message type with reflection information, may provide speed optimized methods | ||
class Location$Type extends MessageType { | ||
class Waypoint$Type extends MessageType { | ||
constructor() { | ||
super("Location", [ | ||
super("Waypoint", [ | ||
{ no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, | ||
@@ -795,5 +794,5 @@ { no: 2, name: "latitude_i", kind: "scalar", T: 15 /*ScalarType.SFIXED32*/ }, | ||
/** | ||
* @generated MessageType for protobuf message Location | ||
* @generated MessageType for protobuf message Waypoint | ||
*/ | ||
export const Location = new Location$Type(); | ||
export const Waypoint = new Waypoint$Type(); | ||
// @generated message type with reflection information, may provide speed optimized methods | ||
@@ -800,0 +799,0 @@ class MeshPacket$Type extends MessageType { |
@@ -92,5 +92,5 @@ import { MessageType } from "@protobuf-ts/runtime"; | ||
* | ||
* @generated from protobuf field: bool disabled = 1; | ||
* @generated from protobuf field: bool enabled = 1; | ||
*/ | ||
disabled: boolean; | ||
enabled: boolean; | ||
/** | ||
@@ -97,0 +97,0 @@ * |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "module_config.proto" (syntax proto3) | ||
@@ -186,3 +186,3 @@ // tslint:disable | ||
super("ModuleConfig.MQTTConfig", [ | ||
{ no: 1, name: "disabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, | ||
{ no: 1, name: "enabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, | ||
{ no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, | ||
@@ -189,0 +189,0 @@ { no: 3, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "mqtt.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -87,2 +87,3 @@ /** | ||
* Waypoint payloads. | ||
* Payload is a [Waypoint](/docs/developers/protobufs/api#waypoint) message | ||
* | ||
@@ -89,0 +90,0 @@ * @generated from protobuf enum value: WAYPOINT_APP = 8; |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "portnums.proto" (syntax proto3) | ||
@@ -91,2 +91,3 @@ // tslint:disable | ||
* Waypoint payloads. | ||
* Payload is a [Waypoint](/docs/developers/protobufs/api#waypoint) message | ||
* | ||
@@ -93,0 +94,0 @@ * @generated from protobuf enum value: WAYPOINT_APP = 8; |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "remote_hardware.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "storeforward.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -1,2 +0,2 @@ | ||
// @generated by protobuf-ts 2.7.0 with parameter long_type_string | ||
// @generated by protobuf-ts 2.8.0 with parameter long_type_string | ||
// @generated from protobuf file "telemetry.proto" (syntax proto3) | ||
@@ -3,0 +3,0 @@ // tslint:disable |
@@ -191,8 +191,9 @@ import { SubEvent } from "sub-events"; | ||
* Sends a text over the radio | ||
* @param location Location to send | ||
* @param waypoint Desired waypoint to send | ||
* @param destinationNum Node number of the destination node | ||
* @param wantAck Whether or not acknowledgement is wanted | ||
* @param channel channel to send on default of 0 | ||
* @param callback If wantAck is true, callback is called when the ack is received | ||
*/ | ||
sendLocation(location: Protobuf.Location, destinationNum?: number, wantAck?: boolean, channel?: number, callback?: (id: number) => Promise<void>): Promise<void>; | ||
sendWaypoint(waypoint: Protobuf.Waypoint, destinationNum?: number, wantAck?: boolean, channel?: number, callback?: (id: number) => Promise<void>): Promise<void>; | ||
/** | ||
@@ -204,7 +205,10 @@ * Sends packet over the radio | ||
* @param wantAck Whether or not acknowledgement is wanted | ||
* @param channel channel to send on default of 0 | ||
* @param wantResponse Used for testing, requests recpipient to respond in kind with the same type of request | ||
* @param echoResponse Sends event back to client | ||
* @param callback If wantAck is true, callback is called when the ack is received | ||
* @param emoji used for message reactions | ||
* @param replyId used to reply to a message | ||
*/ | ||
sendPacket(byteData: Uint8Array, portNum: PortNum, destinationNum?: number, wantAck?: boolean, channel?: number, wantResponse?: boolean, echoResponse?: boolean, callback?: (id: number) => Promise<void>, emoji?: number, location?: Protobuf.Location, replyId?: number): Promise<void>; | ||
sendPacket(byteData: Uint8Array, portNum: PortNum, destinationNum?: number, wantAck?: boolean, channel?: number, wantResponse?: boolean, echoResponse?: boolean, callback?: (id: number) => Promise<void>, emoji?: number, replyId?: number): Promise<void>; | ||
/** | ||
@@ -211,0 +215,0 @@ * Sends raw packet over the radio |
import { SubEvent } from "sub-events"; | ||
import { BROADCAST_NUM, MIN_FW_VERSION } from "./constants.js"; | ||
import { AdminMessage } from "./generated/admin.js"; | ||
import { FromRadio, LogRecord_Level, MeshPacket, MyNodeInfo, Position, Routing, ToRadio, User } from "./generated/mesh.js"; | ||
import { FromRadio, LogRecord_Level, MeshPacket, MyNodeInfo, Position, Routing, ToRadio, User, Waypoint } from "./generated/mesh.js"; | ||
import { PortNum } from "./generated/portnums.js"; | ||
@@ -203,10 +203,11 @@ import { Protobuf, Types } from "./index.js"; | ||
* Sends a text over the radio | ||
* @param location Location to send | ||
* @param waypoint Desired waypoint to send | ||
* @param destinationNum Node number of the destination node | ||
* @param wantAck Whether or not acknowledgement is wanted | ||
* @param channel channel to send on default of 0 | ||
* @param callback If wantAck is true, callback is called when the ack is received | ||
*/ | ||
sendLocation(location, destinationNum, wantAck = false, channel = 0, callback) { | ||
this.log(Types.EmitterScope.iMeshDevice, Types.Emitter.sendLocation, `Sending location to ${destinationNum ?? "broadcast"} on channel ${channel}`, LogRecord_Level.DEBUG); | ||
return this.sendPacket(new Uint8Array(), PortNum.TEXT_MESSAGE_APP, destinationNum, wantAck, channel, undefined, true, callback, undefined, location); | ||
sendWaypoint(waypoint, destinationNum, wantAck = false, channel = 0, callback) { | ||
this.log(Types.EmitterScope.iMeshDevice, Types.Emitter.sendWaypoint, `Sending waypoint to ${destinationNum ?? "broadcast"} on channel ${channel}`, LogRecord_Level.DEBUG); | ||
return this.sendPacket(Waypoint.toBinary(waypoint), PortNum.WAYPOINT_APP, destinationNum, wantAck, channel, undefined, true, callback, undefined); | ||
} | ||
@@ -219,7 +220,10 @@ /** | ||
* @param wantAck Whether or not acknowledgement is wanted | ||
* @param channel channel to send on default of 0 | ||
* @param wantResponse Used for testing, requests recpipient to respond in kind with the same type of request | ||
* @param echoResponse Sends event back to client | ||
* @param callback If wantAck is true, callback is called when the ack is received | ||
* @param emoji used for message reactions | ||
* @param replyId used to reply to a message | ||
*/ | ||
async sendPacket(byteData, portNum, destinationNum, wantAck = false, channel = 0, wantResponse = false, echoResponse = false, callback, emoji = 0, location, replyId = 0) { | ||
async sendPacket(byteData, portNum, destinationNum, wantAck = false, channel = 0, wantResponse = false, echoResponse = false, callback, emoji = 0, replyId = 0) { | ||
this.log(Types.EmitterScope.iMeshDevice, Types.Emitter.sendPacket, `Sending ${Protobuf.PortNum[portNum] ?? "Unknown"} to ${destinationNum ?? "broadcast"}`, LogRecord_Level.TRACE); | ||
@@ -232,3 +236,2 @@ const meshPacket = MeshPacket.create({ | ||
wantResponse, | ||
location, | ||
emoji, | ||
@@ -726,4 +729,3 @@ replyId, | ||
packet: meshPacket, | ||
text: new TextDecoder().decode(dataPacket.payload), | ||
location: dataPacket.location | ||
text: new TextDecoder().decode(dataPacket.payload) | ||
}); | ||
@@ -730,0 +732,0 @@ break; |
/// <reference types="web-bluetooth" /> | ||
/// <reference types="w3c-web-serial" /> | ||
import type { IBLEConnection, IHTTPConnection, ISerialConnection, Protobuf } from "./index.js"; | ||
import type { Location, MeshPacket, NodeInfo, Position, Routing, User } from "./generated/mesh.js"; | ||
import type { MeshPacket, NodeInfo, Position, Routing, User } from "./generated/mesh.js"; | ||
export declare enum DeviceStatusEnum { | ||
@@ -73,3 +73,2 @@ DEVICE_RESTARTING = 0, | ||
text: string; | ||
location?: Location; | ||
} | ||
@@ -138,3 +137,3 @@ export interface PingPacket { | ||
"sendText" = 0, | ||
"sendLocation" = 1, | ||
"sendWaypoint" = 1, | ||
"sendPacket" = 2, | ||
@@ -141,0 +140,0 @@ "sendRaw" = 3, |
@@ -23,3 +23,3 @@ export var DeviceStatusEnum; | ||
Emitter[Emitter["sendText"] = 0] = "sendText"; | ||
Emitter[Emitter["sendLocation"] = 1] = "sendLocation"; | ||
Emitter[Emitter["sendWaypoint"] = 1] = "sendWaypoint"; | ||
Emitter[Emitter["sendPacket"] = 2] = "sendPacket"; | ||
@@ -26,0 +26,0 @@ Emitter[Emitter["sendRaw"] = 3] = "sendRaw"; |
{ | ||
"name": "@meshtastic/meshtasticjs", | ||
"version": "0.6.92", | ||
"version": "0.6.94", | ||
"description": "Browser library for interfacing with meshtastic devices", | ||
@@ -32,3 +32,3 @@ "license": "GPL-3.0-only", | ||
"@meshtastic/eslint-config": "^1.0.8", | ||
"@protobuf-ts/runtime": "^2.7.0", | ||
"@protobuf-ts/runtime": "^2.8.0", | ||
"@serialport/stream": "^10.3.0", | ||
@@ -40,8 +40,8 @@ "prettier": "^2.7.1", | ||
"devDependencies": { | ||
"@protobuf-ts/plugin": "2.7.0", | ||
"@protobuf-ts/plugin": "2.8.0", | ||
"@types/w3c-web-serial": "^1.0.2", | ||
"@types/web-bluetooth": "^0.0.15", | ||
"node-protoc": "^1.0.3", | ||
"typedoc": "^0.23.10", | ||
"typescript": "^4.7.4" | ||
"typedoc": "^0.23.11", | ||
"typescript": "^4.8.2" | ||
}, | ||
@@ -48,0 +48,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
519645
10710
Updated@protobuf-ts/runtime@^2.8.0