Initial 1.3.x rework
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user