Initial 1.3.x rework
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { IsBoolean, IsInt, Length } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class ChannelSettingsValidation implements Protobuf.ChannelSettings {
|
||||
@IsInt()
|
||||
channelNum: number;
|
||||
|
||||
psk: Uint8Array;
|
||||
|
||||
@Length(1, 30)
|
||||
name: string;
|
||||
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
@IsBoolean()
|
||||
uplinkEnabled: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
downlinkEnabled: boolean;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { IsBoolean, IsEnum, Length } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class DeviceValidation implements Protobuf.Config_DeviceConfig {
|
||||
@IsEnum(Protobuf.Config_DeviceConfig_Role)
|
||||
role: Protobuf.Config_DeviceConfig_Role;
|
||||
|
||||
@IsBoolean()
|
||||
serialDisabled: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
factoryReset: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
debugLogEnabled: boolean;
|
||||
|
||||
@Length(2, 30)
|
||||
ntpServer: string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class DisplayValidation implements Protobuf.Config_DisplayConfig {
|
||||
@IsInt()
|
||||
screenOnSecs: number;
|
||||
|
||||
@IsEnum(Protobuf.Config_DisplayConfig_GpsCoordinateFormat)
|
||||
gpsFormat: Protobuf.Config_DisplayConfig_GpsCoordinateFormat;
|
||||
|
||||
@IsInt()
|
||||
autoScreenCarouselSecs: number;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class LoRaValidation implements Protobuf.Config_LoRaConfig {
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(10)
|
||||
txPower: number;
|
||||
|
||||
@IsEnum(Protobuf.Config_LoRaConfig_ModemPreset)
|
||||
modemPreset: Protobuf.Config_LoRaConfig_ModemPreset;
|
||||
|
||||
@IsInt()
|
||||
bandwidth: number;
|
||||
|
||||
@IsInt()
|
||||
// @Min(7)
|
||||
@Max(12)
|
||||
spreadFactor: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(10)
|
||||
codingRate: number;
|
||||
|
||||
@IsInt()
|
||||
frequencyOffset: number;
|
||||
|
||||
@IsEnum(Protobuf.Config_LoRaConfig_RegionCode)
|
||||
region: Protobuf.Config_LoRaConfig_RegionCode;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(7)
|
||||
hopLimit: number;
|
||||
|
||||
@IsBoolean()
|
||||
txDisabled: boolean;
|
||||
|
||||
@IsArray()
|
||||
ignoreIncoming: number[];
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class PositionValidation implements Protobuf.Config_PositionConfig {
|
||||
@IsInt()
|
||||
positionBroadcastSecs: number;
|
||||
|
||||
@IsBoolean()
|
||||
positionBroadcastSmartDisabled: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
fixedPosition: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
gpsDisabled: boolean;
|
||||
|
||||
@IsInt()
|
||||
gpsUpdateInterval: number;
|
||||
|
||||
@IsInt()
|
||||
gpsAttemptTime: number;
|
||||
|
||||
@IsInt()
|
||||
positionFlags: number;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class PowerValidation implements Protobuf.Config_PowerConfig {
|
||||
@IsEnum(Protobuf.Config_PowerConfig_ChargeCurrent)
|
||||
chargeCurrent: Protobuf.Config_PowerConfig_ChargeCurrent;
|
||||
|
||||
@IsBoolean()
|
||||
isPowerSaving: boolean;
|
||||
|
||||
@IsInt()
|
||||
onBatteryShutdownAfterSecs: number;
|
||||
|
||||
@IsInt()
|
||||
adcMultiplierOverride: number;
|
||||
|
||||
@IsInt()
|
||||
waitBluetoothSecs: number;
|
||||
|
||||
@IsInt()
|
||||
meshSdsTimeoutSecs: number;
|
||||
|
||||
@IsInt()
|
||||
sdsSecs: number;
|
||||
|
||||
@IsInt()
|
||||
lsSecs: number;
|
||||
|
||||
@IsInt()
|
||||
minWakeSecs: number;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class UserValidation implements Omit<Protobuf.User, "macaddr"> {
|
||||
@Length(2, 30)
|
||||
id: string;
|
||||
|
||||
@Length(2, 30)
|
||||
longName: string;
|
||||
|
||||
@Length(1, 4)
|
||||
shortName: string;
|
||||
|
||||
@IsEnum(Protobuf.HardwareModel)
|
||||
hwModel: Protobuf.HardwareModel;
|
||||
|
||||
@IsBoolean()
|
||||
isLicensed: boolean;
|
||||
|
||||
@IsInt()
|
||||
txPowerDbm: number;
|
||||
|
||||
@IsInt()
|
||||
antGainDbi: number;
|
||||
|
||||
@IsInt()
|
||||
antAzimuth: number;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Length } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class WiFiValidation implements Protobuf.Config_WiFiConfig {
|
||||
@Length(1, 30)
|
||||
ssid: string;
|
||||
|
||||
@Length(8, 16)
|
||||
psk: string;
|
||||
|
||||
apMode: boolean;
|
||||
|
||||
apHidden: boolean;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class CannedMessageValidation
|
||||
implements Protobuf.ModuleConfig_CannedMessageConfig
|
||||
{
|
||||
@IsBoolean()
|
||||
rotary1Enabled: boolean;
|
||||
|
||||
@IsInt()
|
||||
inputbrokerPinA: number;
|
||||
|
||||
@IsInt()
|
||||
inputbrokerPinB: number;
|
||||
|
||||
@IsInt()
|
||||
inputbrokerPinPress: number;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventCw: Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventCcw: Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar)
|
||||
inputbrokerEventPress: Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar;
|
||||
|
||||
@IsBoolean()
|
||||
updown1Enabled: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@Length(2, 30)
|
||||
allowInputSource: string;
|
||||
|
||||
@IsBoolean()
|
||||
sendBell: boolean;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class ExternalNotificationValidation
|
||||
implements Protobuf.ModuleConfig_ExternalNotificationConfig
|
||||
{
|
||||
enabled: boolean;
|
||||
|
||||
@IsInt()
|
||||
outputMs: number;
|
||||
|
||||
@IsInt()
|
||||
output: number;
|
||||
|
||||
active: boolean;
|
||||
|
||||
alertMessage: boolean;
|
||||
|
||||
alertBell: boolean;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { IsBoolean, Length } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class MQTTValidation implements Protobuf.ModuleConfig_MQTTConfig {
|
||||
@IsBoolean()
|
||||
disabled: boolean;
|
||||
|
||||
@Length(0, 30)
|
||||
address: string;
|
||||
|
||||
@Length(0, 30)
|
||||
username: string;
|
||||
|
||||
@Length(0, 30)
|
||||
password: string;
|
||||
|
||||
@IsBoolean()
|
||||
encryptionEnabled: boolean;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class RangeTestValidation
|
||||
implements Protobuf.ModuleConfig_RangeTestConfig
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@IsInt()
|
||||
sender: number;
|
||||
|
||||
@IsBoolean()
|
||||
save: boolean;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class SerialValidation implements Protobuf.ModuleConfig_SerialConfig {
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
echo: boolean;
|
||||
|
||||
@IsInt()
|
||||
rxd: number;
|
||||
|
||||
@IsInt()
|
||||
txd: number;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_SerialConfig_Serial_Baud)
|
||||
baud: Protobuf.ModuleConfig_SerialConfig_Serial_Baud;
|
||||
|
||||
@IsInt()
|
||||
timeout: number;
|
||||
|
||||
@IsEnum(Protobuf.ModuleConfig_SerialConfig_Serial_Mode)
|
||||
mode: Protobuf.ModuleConfig_SerialConfig_Serial_Mode;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class StoreForwardValidation
|
||||
implements Protobuf.ModuleConfig_StoreForwardConfig
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
heartbeat: boolean;
|
||||
|
||||
@IsInt()
|
||||
records: number;
|
||||
|
||||
@IsInt()
|
||||
historyReturnMax: number;
|
||||
|
||||
@IsInt()
|
||||
historyReturnWindow: number;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class TelemetryValidation
|
||||
implements Protobuf.ModuleConfig_TelemetryConfig
|
||||
{
|
||||
@IsInt()
|
||||
deviceUpdateInterval: number;
|
||||
|
||||
@IsInt()
|
||||
environmentUpdateInterval: number;
|
||||
|
||||
@IsBoolean()
|
||||
environmentMeasurementEnabled: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
environmentScreenEnabled: boolean;
|
||||
|
||||
@IsInt()
|
||||
environmentReadErrorCountThreshold: number;
|
||||
|
||||
@IsInt()
|
||||
environmentRecoveryInterval: number;
|
||||
|
||||
@IsBoolean()
|
||||
environmentDisplayFahrenheit: boolean;
|
||||
|
||||
@IsEnum(Protobuf.TelemetrySensorType)
|
||||
environmentSensorType: Protobuf.TelemetrySensorType;
|
||||
|
||||
@IsInt()
|
||||
environmentSensorPin: number;
|
||||
}
|
||||
Reference in New Issue
Block a user