You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
806 B
45 lines
806 B
import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
|
|
|
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
|
|
|
export class LoRaValidation implements Protobuf.Config_LoRaConfig {
|
|
@IsBoolean()
|
|
usePreset: boolean;
|
|
|
|
@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(1)
|
|
@Max(7)
|
|
hopLimit: number;
|
|
|
|
@IsBoolean()
|
|
txEnabled: boolean;
|
|
|
|
@IsInt()
|
|
@Min(0)
|
|
txPower: number;
|
|
|
|
@IsArray()
|
|
ignoreIncoming: number[];
|
|
}
|
|
|