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