mirror of
https://github.com/meshtastic/web.git
synced 2025-12-24 00:00:01 -05:00
update to namespaced protobufs
This commit is contained in:
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "meshtastic-web",
|
||||
"version": "2.2.16-0",
|
||||
"version": "2.2.17-0",
|
||||
"type": "module",
|
||||
"description": "Meshtastic web client",
|
||||
"license": "GPL-3.0-only",
|
||||
@@ -20,8 +20,9 @@
|
||||
},
|
||||
"homepage": "https://meshtastic.org",
|
||||
"dependencies": {
|
||||
"@bufbuild/protobuf": "^1.6.0",
|
||||
"@emeraldpay/hashicon-react": "^0.5.2",
|
||||
"@meshtastic/js": "2.2.16-0",
|
||||
"@meshtastic/js": "2.2.17-4",
|
||||
"@radix-ui/react-accordion": "^1.1.2",
|
||||
"@radix-ui/react-checkbox": "^1.0.4",
|
||||
"@radix-ui/react-dialog": "^1.0.5",
|
||||
@@ -41,10 +42,10 @@
|
||||
"class-transformer": "^0.5.1",
|
||||
"class-validator": "^0.14.0",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.0.0",
|
||||
"clsx": "^2.1.0",
|
||||
"cmdk": "^0.2.0",
|
||||
"immer": "^10.0.3",
|
||||
"lucide-react": "^0.302.0",
|
||||
"lucide-react": "^0.303.0",
|
||||
"mapbox-gl": "npm:empty-npm-package@^1.0.0",
|
||||
"maplibre-gl": "3.6.2",
|
||||
"react": "^18.2.0",
|
||||
@@ -59,9 +60,10 @@
|
||||
"zustand": "4.4.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@buf/meshtastic_protobufs.bufbuild_es": "1.6.0-20231227193150-3f9c1dfd2a29.1",
|
||||
"@types/chrome": "^0.0.254",
|
||||
"@types/node": "^20.10.5",
|
||||
"@types/react": "^18.2.45",
|
||||
"@types/node": "^20.10.6",
|
||||
"@types/react": "^18.2.46",
|
||||
"@types/react-dom": "^18.2.18",
|
||||
"@types/w3c-web-serial": "^1.0.6",
|
||||
"@types/web-bluetooth": "^0.0.20",
|
||||
@@ -70,7 +72,7 @@
|
||||
"biome": "^0.3.3",
|
||||
"gzipper": "^7.2.0",
|
||||
"postcss": "^8.4.32",
|
||||
"rollup-plugin-visualizer": "^5.11.0",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"tailwindcss": "^3.4.0",
|
||||
"tar": "^6.2.0",
|
||||
"tslib": "^2.6.2",
|
||||
|
||||
674
pnpm-lock.yaml
generated
674
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@ export const DeviceNameDialog = ({
|
||||
|
||||
const onSubmit = handleSubmit((data) => {
|
||||
connection?.setOwner(
|
||||
new Protobuf.User({
|
||||
new Protobuf.Mesh.User({
|
||||
...myNode?.user,
|
||||
...data,
|
||||
}),
|
||||
|
||||
@@ -19,7 +19,7 @@ import { useEffect, useState } from "react";
|
||||
export interface ImportDialogProps {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
loraConfig?: Protobuf.Config_LoRaConfig;
|
||||
loraConfig?: Protobuf.Config.Config_LoRaConfig;
|
||||
}
|
||||
|
||||
export const ImportDialog = ({
|
||||
@@ -27,7 +27,7 @@ export const ImportDialog = ({
|
||||
onOpenChange,
|
||||
}: ImportDialogProps): JSX.Element => {
|
||||
const [QRCodeURL, setQRCodeURL] = useState<string>("");
|
||||
const [channelSet, setChannelSet] = useState<Protobuf.ChannelSet>();
|
||||
const [channelSet, setChannelSet] = useState<Protobuf.AppOnly.ChannelSet>();
|
||||
const [validURL, setValidURL] = useState<boolean>(false);
|
||||
|
||||
const { connection } = useDevice();
|
||||
@@ -39,7 +39,9 @@ export const ImportDialog = ({
|
||||
.replace(/-/g, "+")
|
||||
.replace(/_/g, "/");
|
||||
try {
|
||||
setChannelSet(Protobuf.ChannelSet.fromBinary(toByteArray(paddedString)));
|
||||
setChannelSet(
|
||||
Protobuf.AppOnly.ChannelSet.fromBinary(toByteArray(paddedString)),
|
||||
);
|
||||
setValidURL(true);
|
||||
} catch (error) {
|
||||
setValidURL(false);
|
||||
@@ -50,12 +52,12 @@ export const ImportDialog = ({
|
||||
const apply = () => {
|
||||
channelSet?.settings.map((ch, index) => {
|
||||
connection?.setChannel(
|
||||
new Protobuf.Channel({
|
||||
new Protobuf.Channel.Channel({
|
||||
index,
|
||||
role:
|
||||
index === 0
|
||||
? Protobuf.Channel_Role.PRIMARY
|
||||
: Protobuf.Channel_Role.SECONDARY,
|
||||
? Protobuf.Channel.Channel_Role.PRIMARY
|
||||
: Protobuf.Channel.Channel_Role.SECONDARY,
|
||||
settings: ch,
|
||||
}),
|
||||
);
|
||||
@@ -63,7 +65,7 @@ export const ImportDialog = ({
|
||||
|
||||
if (channelSet?.loraConfig) {
|
||||
connection?.setConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "lora",
|
||||
value: channelSet.loraConfig,
|
||||
|
||||
@@ -18,8 +18,8 @@ import { QRCode } from "react-qrcode-logo";
|
||||
export interface QRDialogProps {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
loraConfig?: Protobuf.Config_LoRaConfig;
|
||||
channels: Map<Types.ChannelNumber, Protobuf.Channel>;
|
||||
loraConfig?: Protobuf.Config.Config_LoRaConfig;
|
||||
channels: Map<Types.ChannelNumber, Protobuf.Channel.Channel>;
|
||||
}
|
||||
|
||||
export const QRDialog = ({
|
||||
@@ -37,9 +37,9 @@ export const QRDialog = ({
|
||||
const channelsToEncode = allChannels
|
||||
.filter((ch) => selectedChannels.includes(ch.index))
|
||||
.map((channel) => channel.settings)
|
||||
.filter((ch): ch is Protobuf.ChannelSettings => !!ch);
|
||||
const encoded = new Protobuf.ChannelSet(
|
||||
new Protobuf.ChannelSet({
|
||||
.filter((ch): ch is Protobuf.Channel.ChannelSettings => !!ch);
|
||||
const encoded = new Protobuf.AppOnly.ChannelSet(
|
||||
new Protobuf.AppOnly.ChannelSet({
|
||||
loraConfig,
|
||||
settings: channelsToEncode,
|
||||
}),
|
||||
@@ -69,7 +69,7 @@ export const QRDialog = ({
|
||||
<Label>
|
||||
{channel.settings?.name.length
|
||||
? channel.settings.name
|
||||
: channel.role === Protobuf.Channel_Role.PRIMARY
|
||||
: channel.role === Protobuf.Channel.Channel_Role.PRIMARY
|
||||
? "Primary"
|
||||
: `Channel: ${channel.index}`}
|
||||
</Label>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Protobuf } from "@meshtastic/js";
|
||||
import { fromByteArray, toByteArray } from "base64-js";
|
||||
|
||||
export interface SettingsPanelProps {
|
||||
channel: Protobuf.Channel;
|
||||
channel: Protobuf.Channel.Channel;
|
||||
}
|
||||
|
||||
export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
|
||||
@@ -14,7 +14,7 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
|
||||
const { toast } = useToast();
|
||||
|
||||
const onSubmit = (data: ChannelValidation) => {
|
||||
const channel = new Protobuf.Channel({
|
||||
const channel = new Protobuf.Channel.Channel({
|
||||
...data,
|
||||
settings: {
|
||||
...data.settings,
|
||||
@@ -55,7 +55,7 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
|
||||
description:
|
||||
"Device telemetry is sent over PRIMARY. Only one PRIMARY allowed",
|
||||
properties: {
|
||||
enumValue: Protobuf.Channel_Role,
|
||||
enumValue: Protobuf.Channel.Channel_Role,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Bluetooth = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: BluetoothValidation) => {
|
||||
setWorkingConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "bluetooth",
|
||||
value: data,
|
||||
@@ -43,7 +43,7 @@ export const Bluetooth = (): JSX.Element => {
|
||||
},
|
||||
],
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_BluetoothConfig_PairingMode,
|
||||
enumValue: Protobuf.Config.Config_BluetoothConfig_PairingMode,
|
||||
formatEnumName: true,
|
||||
},
|
||||
},
|
||||
@@ -56,7 +56,8 @@ export const Bluetooth = (): JSX.Element => {
|
||||
{
|
||||
fieldName: "mode",
|
||||
selector:
|
||||
Protobuf.Config_BluetoothConfig_PairingMode.FIXED_PIN,
|
||||
Protobuf.Config.Config_BluetoothConfig_PairingMode
|
||||
.FIXED_PIN,
|
||||
invert: true,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Device = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: DeviceValidation) => {
|
||||
setWorkingConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "device",
|
||||
value: data,
|
||||
@@ -32,7 +32,7 @@ export const Device = (): JSX.Element => {
|
||||
label: "Role",
|
||||
description: "What role the device performs on the mesh",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_DeviceConfig_Role,
|
||||
enumValue: Protobuf.Config.Config_DeviceConfig_Role,
|
||||
formatEnumName: true,
|
||||
},
|
||||
},
|
||||
@@ -67,7 +67,7 @@ export const Device = (): JSX.Element => {
|
||||
label: "Rebroadcast Mode",
|
||||
description: "How to handle rebroadcasting",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_DeviceConfig_RebroadcastMode,
|
||||
enumValue: Protobuf.Config.Config_DeviceConfig_RebroadcastMode,
|
||||
formatEnumName: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Display = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: DisplayValidation) => {
|
||||
setWorkingConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "display",
|
||||
value: data,
|
||||
@@ -41,7 +41,8 @@ export const Display = (): JSX.Element => {
|
||||
label: "GPS Display Units",
|
||||
description: "Coordinate display format",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_DisplayConfig_GpsCoordinateFormat,
|
||||
enumValue:
|
||||
Protobuf.Config.Config_DisplayConfig_GpsCoordinateFormat,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -68,7 +69,7 @@ export const Display = (): JSX.Element => {
|
||||
label: "Display Units",
|
||||
description: "Display metric or imperial units",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_DisplayConfig_DisplayUnits,
|
||||
enumValue: Protobuf.Config.Config_DisplayConfig_DisplayUnits,
|
||||
formatEnumName: true,
|
||||
},
|
||||
},
|
||||
@@ -78,7 +79,7 @@ export const Display = (): JSX.Element => {
|
||||
label: "OLED Type",
|
||||
description: "Type of OLED screen attached to the device",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_DisplayConfig_OledType,
|
||||
enumValue: Protobuf.Config.Config_DisplayConfig_OledType,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -87,7 +88,7 @@ export const Display = (): JSX.Element => {
|
||||
label: "Display Mode",
|
||||
description: "Screen layout variant",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_DisplayConfig_DisplayMode,
|
||||
enumValue: Protobuf.Config.Config_DisplayConfig_DisplayMode,
|
||||
formatEnumName: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ export const LoRa = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: LoRaValidation) => {
|
||||
setWorkingConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "lora",
|
||||
value: data,
|
||||
@@ -32,7 +32,7 @@ export const LoRa = (): JSX.Element => {
|
||||
label: "Region",
|
||||
description: "Sets the region for your node",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_LoRaConfig_RegionCode,
|
||||
enumValue: Protobuf.Config.Config_LoRaConfig_RegionCode,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -70,7 +70,7 @@ export const LoRa = (): JSX.Element => {
|
||||
},
|
||||
],
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_LoRaConfig_ModemPreset,
|
||||
enumValue: Protobuf.Config.Config_LoRaConfig_ModemPreset,
|
||||
formatEnumName: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,12 +8,12 @@ export const Network = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: NetworkValidation) => {
|
||||
setWorkingConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "network",
|
||||
value: {
|
||||
...data,
|
||||
ipv4Config: new Protobuf.Config_NetworkConfig_IpV4Config(
|
||||
ipv4Config: new Protobuf.Config.Config_NetworkConfig_IpV4Config(
|
||||
data.ipv4Config,
|
||||
),
|
||||
},
|
||||
@@ -83,7 +83,7 @@ export const Network = (): JSX.Element => {
|
||||
label: "Address Mode",
|
||||
description: "Address assignment selection",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_NetworkConfig_AddressMode,
|
||||
enumValue: Protobuf.Config.Config_NetworkConfig_AddressMode,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -94,7 +94,8 @@ export const Network = (): JSX.Element => {
|
||||
disabledBy: [
|
||||
{
|
||||
fieldName: "addressMode",
|
||||
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
|
||||
selector:
|
||||
Protobuf.Config.Config_NetworkConfig_AddressMode.DHCP,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -106,7 +107,8 @@ export const Network = (): JSX.Element => {
|
||||
disabledBy: [
|
||||
{
|
||||
fieldName: "addressMode",
|
||||
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
|
||||
selector:
|
||||
Protobuf.Config.Config_NetworkConfig_AddressMode.DHCP,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -118,7 +120,8 @@ export const Network = (): JSX.Element => {
|
||||
disabledBy: [
|
||||
{
|
||||
fieldName: "addressMode",
|
||||
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
|
||||
selector:
|
||||
Protobuf.Config.Config_NetworkConfig_AddressMode.DHCP,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -130,7 +133,8 @@ export const Network = (): JSX.Element => {
|
||||
disabledBy: [
|
||||
{
|
||||
fieldName: "addressMode",
|
||||
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
|
||||
selector:
|
||||
Protobuf.Config.Config_NetworkConfig_AddressMode.DHCP,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Position = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: PositionValidation) => {
|
||||
setWorkingConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "position",
|
||||
value: data,
|
||||
@@ -52,7 +52,7 @@ export const Position = (): JSX.Element => {
|
||||
label: "Position Flags",
|
||||
description: "Configuration options for Position messages",
|
||||
properties: {
|
||||
enumValue: Protobuf.Config_PositionConfig_PositionFlags,
|
||||
enumValue: Protobuf.Config.Config_PositionConfig_PositionFlags,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Power = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: PowerValidation) => {
|
||||
setWorkingConfig(
|
||||
new Protobuf.Config({
|
||||
new Protobuf.Config.Config({
|
||||
payloadVariant: {
|
||||
case: "power",
|
||||
value: data,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { subscribeAll } from "@core/subscriptions.js";
|
||||
import { randId } from "@core/utils/randId.js";
|
||||
import { Constants, IBLEConnection } from "@meshtastic/js";
|
||||
import { Constants, BleConnection } from "@meshtastic/js";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
export const BLE = (): JSX.Element => {
|
||||
@@ -24,7 +24,7 @@ export const BLE = (): JSX.Element => {
|
||||
const id = randId();
|
||||
const device = addDevice(id);
|
||||
setSelectedDevice(id);
|
||||
const connection = new IBLEConnection(id);
|
||||
const connection = new BleConnection(id);
|
||||
await connection.connect({
|
||||
device: bleDevice,
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { subscribeAll } from "@core/subscriptions.js";
|
||||
import { randId } from "@core/utils/randId.js";
|
||||
import { IHTTPConnection } from "@meshtastic/js";
|
||||
import { HttpConnection } from "@meshtastic/js";
|
||||
import { Controller, useForm, useWatch } from "react-hook-form";
|
||||
|
||||
export const HTTP = (): JSX.Element => {
|
||||
@@ -36,7 +36,7 @@ export const HTTP = (): JSX.Element => {
|
||||
const id = randId();
|
||||
const device = addDevice(id);
|
||||
setSelectedDevice(id);
|
||||
const connection = new IHTTPConnection(id);
|
||||
const connection = new HttpConnection(id);
|
||||
// TODO: Promise never resolves
|
||||
await connection.connect({
|
||||
address: data.ip,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { subscribeAll } from "@core/subscriptions.js";
|
||||
import { randId } from "@core/utils/randId.js";
|
||||
import { ISerialConnection } from "@meshtastic/js";
|
||||
import { SerialConnection } from "@meshtastic/js";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
export const Serial = (): JSX.Element => {
|
||||
@@ -30,7 +30,7 @@ export const Serial = (): JSX.Element => {
|
||||
const id = randId();
|
||||
const device = addDevice(id);
|
||||
setSelectedDevice(id);
|
||||
const connection = new ISerialConnection(id);
|
||||
const connection = new SerialConnection(id);
|
||||
await connection
|
||||
.connect({
|
||||
port,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
export interface MessageProps {
|
||||
lastMsgSameUser: boolean;
|
||||
message: MessageWithState;
|
||||
sender?: Protobuf.NodeInfo;
|
||||
sender?: Protobuf.Mesh.NodeInfo;
|
||||
}
|
||||
|
||||
export const Message = ({
|
||||
|
||||
@@ -8,7 +8,7 @@ export const AmbientLighting = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: AmbientLightingValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "ambientLighting",
|
||||
value: data,
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Audio = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: AudioValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "audio",
|
||||
value: data,
|
||||
@@ -44,7 +44,8 @@ export const Audio = (): JSX.Element => {
|
||||
label: "Bitrate",
|
||||
description: "Bitrate to use for audio encoding",
|
||||
properties: {
|
||||
enumValue: Protobuf.ModuleConfig_AudioConfig_Audio_Baud,
|
||||
enumValue:
|
||||
Protobuf.ModuleConfig.ModuleConfig_AudioConfig_Audio_Baud,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ export const CannedMessage = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: CannedMessageValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "cannedMessage",
|
||||
value: data,
|
||||
@@ -63,7 +63,8 @@ export const CannedMessage = (): JSX.Element => {
|
||||
description: "Select input event.",
|
||||
properties: {
|
||||
enumValue:
|
||||
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar,
|
||||
Protobuf.ModuleConfig
|
||||
.ModuleConfig_CannedMessageConfig_InputEventChar,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -73,7 +74,8 @@ export const CannedMessage = (): JSX.Element => {
|
||||
description: "Select input event.",
|
||||
properties: {
|
||||
enumValue:
|
||||
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar,
|
||||
Protobuf.ModuleConfig
|
||||
.ModuleConfig_CannedMessageConfig_InputEventChar,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -83,7 +85,8 @@ export const CannedMessage = (): JSX.Element => {
|
||||
description: "Select input event",
|
||||
properties: {
|
||||
enumValue:
|
||||
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar,
|
||||
Protobuf.ModuleConfig
|
||||
.ModuleConfig_CannedMessageConfig_InputEventChar,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ export const DetectionSensor = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: DetectionSensorValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "detectionSensor",
|
||||
value: data,
|
||||
|
||||
@@ -8,7 +8,7 @@ export const ExternalNotification = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: ExternalNotificationValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "externalNotification",
|
||||
value: data,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||
import type { MQTTValidation } from "@app/validation/moduleConfig/mqtt.js";
|
||||
import type { MqttValidation } from "@app/validation/moduleConfig/mqtt.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
|
||||
export const MQTT = (): JSX.Element => {
|
||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||
|
||||
const onSubmit = (data: MQTTValidation) => {
|
||||
const onSubmit = (data: MqttValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "mqtt",
|
||||
value: data,
|
||||
@@ -18,7 +18,7 @@ export const MQTT = (): JSX.Element => {
|
||||
};
|
||||
|
||||
return (
|
||||
<DynamicForm<MQTTValidation>
|
||||
<DynamicForm<MqttValidation>
|
||||
onSubmit={onSubmit}
|
||||
defaultValues={moduleConfig.mqtt}
|
||||
fieldGroups={[
|
||||
|
||||
@@ -8,7 +8,7 @@ export const NeighborInfo = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: NeighborInfoValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "neighborInfo",
|
||||
value: data,
|
||||
|
||||
@@ -8,7 +8,7 @@ export const RangeTest = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: RangeTestValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "rangeTest",
|
||||
value: data,
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Serial = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: SerialValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "serial",
|
||||
value: data,
|
||||
@@ -78,7 +78,8 @@ export const Serial = (): JSX.Element => {
|
||||
},
|
||||
],
|
||||
properties: {
|
||||
enumValue: Protobuf.ModuleConfig_SerialConfig_Serial_Baud,
|
||||
enumValue:
|
||||
Protobuf.ModuleConfig.ModuleConfig_SerialConfig_Serial_Baud,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -109,7 +110,8 @@ export const Serial = (): JSX.Element => {
|
||||
},
|
||||
],
|
||||
properties: {
|
||||
enumValue: Protobuf.ModuleConfig_SerialConfig_Serial_Mode,
|
||||
enumValue:
|
||||
Protobuf.ModuleConfig.ModuleConfig_SerialConfig_Serial_Mode,
|
||||
formatEnumName: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ export const StoreForward = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: StoreForwardValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "storeForward",
|
||||
value: data,
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Telemetry = (): JSX.Element => {
|
||||
|
||||
const onSubmit = (data: TelemetryValidation) => {
|
||||
setWorkingModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
new Protobuf.ModuleConfig.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "telemetry",
|
||||
value: data,
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface MessageWithState extends Types.PacketMetadata<string> {
|
||||
state: MessageState;
|
||||
}
|
||||
|
||||
export type MessageState = "ack" | "waiting" | Protobuf.Routing_Error;
|
||||
export type MessageState = "ack" | "waiting" | Protobuf.Mesh.Routing_Error;
|
||||
|
||||
export interface ProcessPacketParams {
|
||||
from: number;
|
||||
@@ -29,14 +29,14 @@ export type DialogVariant =
|
||||
export interface Device {
|
||||
id: number;
|
||||
status: Types.DeviceStatusEnum;
|
||||
channels: Map<Types.ChannelNumber, Protobuf.Channel>;
|
||||
config: Protobuf.LocalConfig;
|
||||
moduleConfig: Protobuf.LocalModuleConfig;
|
||||
workingConfig: Protobuf.Config[];
|
||||
workingModuleConfig: Protobuf.ModuleConfig[];
|
||||
hardware: Protobuf.MyNodeInfo;
|
||||
nodes: Map<number, Protobuf.NodeInfo>;
|
||||
metadata: Map<number, Protobuf.DeviceMetadata>;
|
||||
channels: Map<Types.ChannelNumber, Protobuf.Channel.Channel>;
|
||||
config: Protobuf.LocalOnly.LocalConfig;
|
||||
moduleConfig: Protobuf.LocalOnly.LocalModuleConfig;
|
||||
workingConfig: Protobuf.Config.Config[];
|
||||
workingModuleConfig: Protobuf.ModuleConfig.ModuleConfig[];
|
||||
hardware: Protobuf.Mesh.MyNodeInfo;
|
||||
nodes: Map<number, Protobuf.Mesh.NodeInfo>;
|
||||
metadata: Map<number, Protobuf.Mesh.DeviceMetadata>;
|
||||
messages: {
|
||||
direct: Map<number, MessageWithState[]>;
|
||||
broadcast: Map<Types.ChannelNumber, MessageWithState[]>;
|
||||
@@ -44,7 +44,7 @@ export interface Device {
|
||||
connection?: Types.ConnectionType;
|
||||
activePage: Page;
|
||||
activePeer: number;
|
||||
waypoints: Protobuf.Waypoint[];
|
||||
waypoints: Protobuf.Mesh.Waypoint[];
|
||||
// currentMetrics: Protobuf.DeviceMetrics;
|
||||
pendingSettingsChanges: boolean;
|
||||
messageDraft: string;
|
||||
@@ -57,23 +57,23 @@ export interface Device {
|
||||
};
|
||||
|
||||
setStatus: (status: Types.DeviceStatusEnum) => void;
|
||||
setConfig: (config: Protobuf.Config) => void;
|
||||
setModuleConfig: (config: Protobuf.ModuleConfig) => void;
|
||||
setWorkingConfig: (config: Protobuf.Config) => void;
|
||||
setWorkingModuleConfig: (config: Protobuf.ModuleConfig) => void;
|
||||
setHardware: (hardware: Protobuf.MyNodeInfo) => void;
|
||||
setConfig: (config: Protobuf.Config.Config) => void;
|
||||
setModuleConfig: (config: Protobuf.ModuleConfig.ModuleConfig) => void;
|
||||
setWorkingConfig: (config: Protobuf.Config.Config) => void;
|
||||
setWorkingModuleConfig: (config: Protobuf.ModuleConfig.ModuleConfig) => void;
|
||||
setHardware: (hardware: Protobuf.Mesh.MyNodeInfo) => void;
|
||||
// setMetrics: (metrics: Types.PacketMetadata<Protobuf.Telemetry>) => void;
|
||||
setActivePage: (page: Page) => void;
|
||||
setActivePeer: (peer: number) => void;
|
||||
setPendingSettingsChanges: (state: boolean) => void;
|
||||
addChannel: (channel: Protobuf.Channel) => void;
|
||||
addWaypoint: (waypoint: Protobuf.Waypoint) => void;
|
||||
addNodeInfo: (nodeInfo: Protobuf.NodeInfo) => void;
|
||||
addUser: (user: Types.PacketMetadata<Protobuf.User>) => void;
|
||||
addPosition: (position: Types.PacketMetadata<Protobuf.Position>) => void;
|
||||
addChannel: (channel: Protobuf.Channel.Channel) => void;
|
||||
addWaypoint: (waypoint: Protobuf.Mesh.Waypoint) => void;
|
||||
addNodeInfo: (nodeInfo: Protobuf.Mesh.NodeInfo) => void;
|
||||
addUser: (user: Types.PacketMetadata<Protobuf.Mesh.User>) => void;
|
||||
addPosition: (position: Types.PacketMetadata<Protobuf.Mesh.Position>) => void;
|
||||
addConnection: (connection: Types.ConnectionType) => void;
|
||||
addMessage: (message: MessageWithState) => void;
|
||||
addMetadata: (from: number, metadata: Protobuf.DeviceMetadata) => void;
|
||||
addMetadata: (from: number, metadata: Protobuf.Mesh.DeviceMetadata) => void;
|
||||
setMessageState: (
|
||||
type: "direct" | "broadcast",
|
||||
channelIndex: Types.ChannelNumber,
|
||||
@@ -108,11 +108,11 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
id,
|
||||
status: Types.DeviceStatusEnum.DEVICE_DISCONNECTED,
|
||||
channels: new Map(),
|
||||
config: new Protobuf.LocalConfig(),
|
||||
moduleConfig: new Protobuf.LocalModuleConfig(),
|
||||
config: new Protobuf.LocalOnly.LocalConfig(),
|
||||
moduleConfig: new Protobuf.LocalOnly.LocalModuleConfig(),
|
||||
workingConfig: [],
|
||||
workingModuleConfig: [],
|
||||
hardware: new Protobuf.MyNodeInfo(),
|
||||
hardware: new Protobuf.Mesh.MyNodeInfo(),
|
||||
nodes: new Map(),
|
||||
metadata: new Map(),
|
||||
messages: {
|
||||
@@ -144,7 +144,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
}),
|
||||
);
|
||||
},
|
||||
setConfig: (config: Protobuf.Config) => {
|
||||
setConfig: (config: Protobuf.Config.Config) => {
|
||||
set(
|
||||
produce<DeviceState>((draft) => {
|
||||
const device = draft.devices.get(id);
|
||||
@@ -184,7 +184,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
}),
|
||||
);
|
||||
},
|
||||
setModuleConfig: (config: Protobuf.ModuleConfig) => {
|
||||
setModuleConfig: (config: Protobuf.ModuleConfig.ModuleConfig) => {
|
||||
set(
|
||||
produce<DeviceState>((draft) => {
|
||||
const device = draft.devices.get(id);
|
||||
@@ -248,7 +248,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
}),
|
||||
);
|
||||
},
|
||||
setWorkingConfig: (config: Protobuf.Config) => {
|
||||
setWorkingConfig: (config: Protobuf.Config.Config) => {
|
||||
set(
|
||||
produce<DeviceState>((draft) => {
|
||||
const device = draft.devices.get(id);
|
||||
@@ -266,7 +266,9 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
}),
|
||||
);
|
||||
},
|
||||
setWorkingModuleConfig: (moduleConfig: Protobuf.ModuleConfig) => {
|
||||
setWorkingModuleConfig: (
|
||||
moduleConfig: Protobuf.ModuleConfig.ModuleConfig,
|
||||
) => {
|
||||
set(
|
||||
produce<DeviceState>((draft) => {
|
||||
const device = draft.devices.get(id);
|
||||
@@ -288,7 +290,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
}),
|
||||
);
|
||||
},
|
||||
setHardware: (hardware: Protobuf.MyNodeInfo) => {
|
||||
setHardware: (hardware: Protobuf.Mesh.MyNodeInfo) => {
|
||||
set(
|
||||
produce<DeviceState>((draft) => {
|
||||
const device = draft.devices.get(id);
|
||||
@@ -362,7 +364,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
}),
|
||||
);
|
||||
},
|
||||
addChannel: (channel: Protobuf.Channel) => {
|
||||
addChannel: (channel: Protobuf.Channel.Channel) => {
|
||||
set(
|
||||
produce<DeviceState>((draft) => {
|
||||
const device = draft.devices.get(id);
|
||||
@@ -373,7 +375,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
}),
|
||||
);
|
||||
},
|
||||
addWaypoint: (waypoint: Protobuf.Waypoint) => {
|
||||
addWaypoint: (waypoint: Protobuf.Mesh.Waypoint) => {
|
||||
set(
|
||||
produce<DeviceState>((draft) => {
|
||||
const device = draft.devices.get(id);
|
||||
@@ -420,7 +422,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
return;
|
||||
}
|
||||
const currentNode =
|
||||
device.nodes.get(user.from) ?? new Protobuf.NodeInfo();
|
||||
device.nodes.get(user.from) ?? new Protobuf.Mesh.NodeInfo();
|
||||
currentNode.user = user.data;
|
||||
device.nodes.set(user.from, currentNode);
|
||||
}),
|
||||
@@ -434,7 +436,8 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
return;
|
||||
}
|
||||
const currentNode =
|
||||
device.nodes.get(position.from) ?? new Protobuf.NodeInfo();
|
||||
device.nodes.get(position.from) ??
|
||||
new Protobuf.Mesh.NodeInfo();
|
||||
currentNode.position = position.data;
|
||||
device.nodes.set(position.from, currentNode);
|
||||
}),
|
||||
@@ -557,7 +560,7 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
|
||||
} else {
|
||||
device.nodes.set(
|
||||
data.from,
|
||||
new Protobuf.NodeInfo({
|
||||
new Protobuf.Mesh.NodeInfo({
|
||||
num: data.from,
|
||||
lastHeard: data.time,
|
||||
snr: data.snr,
|
||||
|
||||
@@ -17,7 +17,9 @@ export const subscribeAll = (
|
||||
connection.events.onRoutingPacket.subscribe((routingPacket) => {
|
||||
switch (routingPacket.data.variant.case) {
|
||||
case "errorReason": {
|
||||
if (routingPacket.data.variant.value === Protobuf.Routing_Error.NONE) {
|
||||
if (
|
||||
routingPacket.data.variant.value === Protobuf.Mesh.Routing_Error.NONE
|
||||
) {
|
||||
return;
|
||||
}
|
||||
console.log(`Routing Error: ${routingPacket.data.variant.value}`);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Protobuf, Types } from "@meshtastic/js";
|
||||
import { ImportIcon, QrCodeIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
export const getChannelName = (channel: Protobuf.Channel) =>
|
||||
export const getChannelName = (channel: Protobuf.Channel.Channel) =>
|
||||
channel.settings?.name.length
|
||||
? channel.settings?.name
|
||||
: channel.index === 0
|
||||
|
||||
@@ -22,7 +22,7 @@ export const MessagesPage = (): JSX.Element => {
|
||||
);
|
||||
const allChannels = Array.from(channels.values());
|
||||
const filteredChannels = allChannels.filter(
|
||||
(ch) => ch.role !== Protobuf.Channel_Role.DISABLED,
|
||||
(ch) => ch.role !== Protobuf.Channel.Channel_Role.DISABLED,
|
||||
);
|
||||
const currentChannel = channels.get(activeChat);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export const PeersPage = (): JSX.Element => {
|
||||
: `UNK: ${node.num}`)}
|
||||
</h1>,
|
||||
|
||||
<Mono>{Protobuf.HardwareModel[node.user?.hwModel ?? 0]}</Mono>,
|
||||
<Mono>{Protobuf.Mesh.HardwareModel[node.user?.hwModel ?? 0]}</Mono>,
|
||||
<Mono>
|
||||
{base16
|
||||
.stringify(node.user?.macaddr ?? [])
|
||||
|
||||
@@ -6,24 +6,23 @@ import {
|
||||
IsString,
|
||||
Length,
|
||||
} from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class ChannelValidation
|
||||
implements Omit<Protobuf.Channel, keyof Protobuf.native.Message | "settings">
|
||||
implements Omit<Protobuf.Channel.Channel, keyof Message | "settings">
|
||||
{
|
||||
@IsNumber()
|
||||
index: number;
|
||||
|
||||
settings: Channel_SettingsValidation;
|
||||
|
||||
@IsEnum(Protobuf.Channel_Role)
|
||||
role: Protobuf.Channel_Role;
|
||||
@IsEnum(Protobuf.Channel.Channel_Role)
|
||||
role: Protobuf.Channel.Channel_Role;
|
||||
}
|
||||
|
||||
export class Channel_SettingsValidation
|
||||
implements
|
||||
Omit<Protobuf.ChannelSettings, keyof Protobuf.native.Message | "psk">
|
||||
implements Omit<Protobuf.Channel.ChannelSettings, keyof Message | "psk">
|
||||
{
|
||||
@IsNumber()
|
||||
channelNum: number;
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class BluetoothValidation
|
||||
implements
|
||||
Omit<Protobuf.Config_BluetoothConfig, keyof Protobuf.native.Message>
|
||||
implements Omit<Protobuf.Config.Config_BluetoothConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@IsEnum(Protobuf.Config_BluetoothConfig_PairingMode)
|
||||
mode: Protobuf.Config_BluetoothConfig_PairingMode;
|
||||
@IsEnum(Protobuf.Config.Config_BluetoothConfig_PairingMode)
|
||||
mode: Protobuf.Config.Config_BluetoothConfig_PairingMode;
|
||||
|
||||
@IsInt()
|
||||
fixedPin: number;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class DeviceValidation
|
||||
implements Omit<Protobuf.Config_DeviceConfig, keyof Protobuf.native.Message>
|
||||
implements Omit<Protobuf.Config.Config_DeviceConfig, keyof Message>
|
||||
{
|
||||
@IsEnum(Protobuf.Config_DeviceConfig_Role)
|
||||
role: Protobuf.Config_DeviceConfig_Role;
|
||||
@IsEnum(Protobuf.Config.Config_DeviceConfig_Role)
|
||||
role: Protobuf.Config.Config_DeviceConfig_Role;
|
||||
|
||||
@IsBoolean()
|
||||
serialEnabled: boolean;
|
||||
@@ -20,8 +20,8 @@ export class DeviceValidation
|
||||
@IsInt()
|
||||
buzzerGpio: number;
|
||||
|
||||
@IsEnum(Protobuf.Config_DeviceConfig_RebroadcastMode)
|
||||
rebroadcastMode: Protobuf.Config_DeviceConfig_RebroadcastMode;
|
||||
@IsEnum(Protobuf.Config.Config_DeviceConfig_RebroadcastMode)
|
||||
rebroadcastMode: Protobuf.Config.Config_DeviceConfig_RebroadcastMode;
|
||||
|
||||
@IsInt()
|
||||
nodeInfoBroadcastSecs: number;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class DisplayValidation
|
||||
implements Omit<Protobuf.Config_DisplayConfig, keyof Protobuf.native.Message>
|
||||
implements Omit<Protobuf.Config.Config_DisplayConfig, keyof Message>
|
||||
{
|
||||
@IsInt()
|
||||
screenOnSecs: number;
|
||||
|
||||
@IsEnum(Protobuf.Config_DisplayConfig_GpsCoordinateFormat)
|
||||
gpsFormat: Protobuf.Config_DisplayConfig_GpsCoordinateFormat;
|
||||
@IsEnum(Protobuf.Config.Config_DisplayConfig_GpsCoordinateFormat)
|
||||
gpsFormat: Protobuf.Config.Config_DisplayConfig_GpsCoordinateFormat;
|
||||
|
||||
@IsInt()
|
||||
autoScreenCarouselSecs: number;
|
||||
@@ -20,14 +20,14 @@ export class DisplayValidation
|
||||
@IsBoolean()
|
||||
flipScreen: boolean;
|
||||
|
||||
@IsEnum(Protobuf.Config_DisplayConfig_DisplayUnits)
|
||||
units: Protobuf.Config_DisplayConfig_DisplayUnits;
|
||||
@IsEnum(Protobuf.Config.Config_DisplayConfig_DisplayUnits)
|
||||
units: Protobuf.Config.Config_DisplayConfig_DisplayUnits;
|
||||
|
||||
@IsEnum(Protobuf.Config_DisplayConfig_OledType)
|
||||
oled: Protobuf.Config_DisplayConfig_OledType;
|
||||
@IsEnum(Protobuf.Config.Config_DisplayConfig_OledType)
|
||||
oled: Protobuf.Config.Config_DisplayConfig_OledType;
|
||||
|
||||
@IsEnum(Protobuf.Config_DisplayConfig_DisplayMode)
|
||||
displaymode: Protobuf.Config_DisplayConfig_DisplayMode;
|
||||
@IsEnum(Protobuf.Config.Config_DisplayConfig_DisplayMode)
|
||||
displaymode: Protobuf.Config.Config_DisplayConfig_DisplayMode;
|
||||
|
||||
@IsBoolean()
|
||||
headingBold: boolean;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class LoRaValidation
|
||||
implements Omit<Protobuf.Config_LoRaConfig, keyof Protobuf.native.Message>
|
||||
implements Omit<Protobuf.Config.Config_LoRaConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
usePreset: boolean;
|
||||
|
||||
@IsEnum(Protobuf.Config_LoRaConfig_ModemPreset)
|
||||
modemPreset: Protobuf.Config_LoRaConfig_ModemPreset;
|
||||
@IsEnum(Protobuf.Config.Config_LoRaConfig_ModemPreset)
|
||||
modemPreset: Protobuf.Config.Config_LoRaConfig_ModemPreset;
|
||||
|
||||
@IsInt()
|
||||
bandwidth: number;
|
||||
@@ -27,8 +27,8 @@ export class LoRaValidation
|
||||
@IsInt()
|
||||
frequencyOffset: number;
|
||||
|
||||
@IsEnum(Protobuf.Config_LoRaConfig_RegionCode)
|
||||
region: Protobuf.Config_LoRaConfig_RegionCode;
|
||||
@IsEnum(Protobuf.Config.Config_LoRaConfig_RegionCode)
|
||||
region: Protobuf.Config.Config_LoRaConfig_RegionCode;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
|
||||
@@ -6,15 +6,12 @@ import {
|
||||
IsString,
|
||||
Length,
|
||||
} from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class NetworkValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.Config_NetworkConfig,
|
||||
keyof Protobuf.native.Message | "ipv4Config"
|
||||
>
|
||||
Omit<Protobuf.Config.Config_NetworkConfig, keyof Message | "ipv4Config">
|
||||
{
|
||||
@IsBoolean()
|
||||
wifiEnabled: boolean;
|
||||
@@ -33,21 +30,18 @@ export class NetworkValidation
|
||||
@IsBoolean()
|
||||
ethEnabled: boolean;
|
||||
|
||||
@IsEnum(Protobuf.Config_NetworkConfig_AddressMode)
|
||||
addressMode: Protobuf.Config_NetworkConfig_AddressMode;
|
||||
@IsEnum(Protobuf.Config.Config_NetworkConfig_AddressMode)
|
||||
addressMode: Protobuf.Config.Config_NetworkConfig_AddressMode;
|
||||
|
||||
ipv4Config: NetworkValidation_IpV4Config;
|
||||
ipv4Config: NetworkValidationIpV4Config;
|
||||
|
||||
@IsString()
|
||||
rsyslogServer: string;
|
||||
}
|
||||
|
||||
export class NetworkValidation_IpV4Config
|
||||
export class NetworkValidationIpV4Config
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.Config_NetworkConfig_IpV4Config,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
Omit<Protobuf.Config.Config_NetworkConfig_IpV4Config, keyof Message>
|
||||
{
|
||||
@IsIP()
|
||||
@IsOptional()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { IsBoolean, IsInt, IsNumber } from "class-validator";
|
||||
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class PositionValidation
|
||||
implements Omit<Protobuf.Config_PositionConfig, keyof Protobuf.native.Message>
|
||||
implements Omit<Protobuf.Config.Config_PositionConfig, keyof Message>
|
||||
{
|
||||
@IsInt()
|
||||
positionBroadcastSecs: number;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { IsBoolean, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class PowerValidation
|
||||
implements Omit<Protobuf.Config_PowerConfig, keyof Protobuf.native.Message>
|
||||
implements Omit<Protobuf.Config.Config_PowerConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
isPowerSaving: boolean;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class AmbientLightingValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_AmbientLightingConfig,
|
||||
keyof Protobuf.native.Message
|
||||
Protobuf.ModuleConfig.ModuleConfig_AmbientLightingConfig,
|
||||
keyof Message
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class AudioValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_AudioConfig, keyof Protobuf.native.Message>
|
||||
implements Omit<Protobuf.ModuleConfig.ModuleConfig_AudioConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
codec2Enabled: boolean;
|
||||
@@ -12,8 +11,8 @@ export class AudioValidation
|
||||
@IsInt()
|
||||
pttPin: number;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_AudioConfig_Audio_Baud)
|
||||
bitrate: Protobuf.ModuleConfig_AudioConfig_Audio_Baud;
|
||||
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_AudioConfig_Audio_Baud)
|
||||
bitrate: Protobuf.ModuleConfig.ModuleConfig_AudioConfig_Audio_Baud;
|
||||
|
||||
@IsInt()
|
||||
i2sWs: number;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class CannedMessageValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_CannedMessageConfig,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
Omit<Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
rotary1Enabled: boolean;
|
||||
@@ -21,14 +18,14 @@ export class CannedMessageValidation
|
||||
@IsInt()
|
||||
inputbrokerPinPress: number;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventCw: Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventCw: Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventCcw: Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventCcw: Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventPress: Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventPress: Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
|
||||
@IsBoolean()
|
||||
updown1Enabled: boolean;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { IsBoolean, IsInt, Length } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class DetectionSensorValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_DetectionSensorConfig,
|
||||
keyof Protobuf.native.Message
|
||||
Protobuf.ModuleConfig.ModuleConfig_DetectionSensorConfig,
|
||||
keyof Message
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class ExternalNotificationValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_ExternalNotificationConfig,
|
||||
keyof Protobuf.native.Message
|
||||
Protobuf.ModuleConfig.ModuleConfig_ExternalNotificationConfig,
|
||||
keyof Message
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { IsBoolean, IsString, Length } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class MQTTValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_MQTTConfig, keyof Protobuf.native.Message>
|
||||
export class MqttValidation
|
||||
implements Omit<Protobuf.ModuleConfig.ModuleConfig_MQTTConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { IsBoolean, IsInt, Length } from "class-validator";
|
||||
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class NeighborInfoValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_NeighborInfoConfig,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
Omit<Protobuf.ModuleConfig.ModuleConfig_NeighborInfoConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class RangeTestValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_RangeTestConfig, keyof Protobuf.native.Message>
|
||||
Omit<Protobuf.ModuleConfig.ModuleConfig_RangeTestConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class SerialValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_SerialConfig, keyof Protobuf.native.Message>
|
||||
Omit<Protobuf.ModuleConfig.ModuleConfig_SerialConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
@@ -18,14 +18,14 @@ export class SerialValidation
|
||||
@IsInt()
|
||||
txd: number;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_SerialConfig_Serial_Baud)
|
||||
baud: Protobuf.ModuleConfig_SerialConfig_Serial_Baud;
|
||||
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_SerialConfig_Serial_Baud)
|
||||
baud: Protobuf.ModuleConfig.ModuleConfig_SerialConfig_Serial_Baud;
|
||||
|
||||
@IsInt()
|
||||
timeout: number;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_SerialConfig_Serial_Mode)
|
||||
mode: Protobuf.ModuleConfig_SerialConfig_Serial_Mode;
|
||||
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_SerialConfig_Serial_Mode)
|
||||
mode: Protobuf.ModuleConfig.ModuleConfig_SerialConfig_Serial_Mode;
|
||||
|
||||
@IsBoolean()
|
||||
overrideConsoleSerialPort: boolean;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class StoreForwardValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_StoreForwardConfig,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
Omit<Protobuf.ModuleConfig.ModuleConfig_StoreForwardConfig, keyof Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class TelemetryValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_TelemetryConfig, keyof Protobuf.native.Message>
|
||||
Omit<Protobuf.ModuleConfig.ModuleConfig_TelemetryConfig, keyof Message>
|
||||
{
|
||||
@IsInt()
|
||||
deviceUpdateInterval: number;
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
{
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"include": ["src"],
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"DOM.Iterable",
|
||||
"ESNext"
|
||||
],
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
@@ -24,30 +18,22 @@
|
||||
"jsx": "react-jsx",
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@app/*": [
|
||||
"./src/*"
|
||||
],
|
||||
"@pages/*": [
|
||||
"./src/pages/*"
|
||||
],
|
||||
"@components/*": [
|
||||
"./src/components/*"
|
||||
],
|
||||
"@core/*": [
|
||||
"./src/core/*"
|
||||
],
|
||||
"@layouts/*": [
|
||||
"./src/layouts/*"
|
||||
]
|
||||
"@app/*": ["./src/*"],
|
||||
"@pages/*": ["./src/pages/*"],
|
||||
"@components/*": ["./src/components/*"],
|
||||
"@core/*": ["./src/core/*"],
|
||||
"@layouts/*": ["./src/layouts/*"]
|
||||
},
|
||||
"importHelpers": true,
|
||||
"removeComments": true,
|
||||
"strictNullChecks": true,
|
||||
"types": [
|
||||
"vite/client",
|
||||
"node"
|
||||
"node",
|
||||
"@types/web-bluetooth",
|
||||
"@types/w3c-web-serial"
|
||||
],
|
||||
"strictPropertyInitialization": false,
|
||||
"experimentalDecorators": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user