🛜 Fixed wifi with protobuf, added rest message proto
This commit is contained in:
@@ -0,0 +1,626 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.10.1
|
||||
// protoc v6.33.2
|
||||
// source: rest_message.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import type { FileDescriptorProto } from "ts-proto-descriptors";
|
||||
import { KnownNetworkItem, protoMetadata as protoMetadata1 } from "./websocket_message";
|
||||
|
||||
export const protobufPackage = "rest_message";
|
||||
|
||||
export interface WifiStatus {
|
||||
status: number;
|
||||
localIp: string;
|
||||
macAddress: string;
|
||||
rssi: number;
|
||||
ssid: string;
|
||||
bssid: string;
|
||||
channel: number;
|
||||
subnetMask: string;
|
||||
gatewayIp: string;
|
||||
dnsIp1: string;
|
||||
dnsIp2?: string | undefined;
|
||||
}
|
||||
|
||||
export interface WifiSettings {
|
||||
hostname: string;
|
||||
priorityRssi: boolean;
|
||||
wifiNetworks: KnownNetworkItem[];
|
||||
}
|
||||
|
||||
function createBaseWifiStatus(): WifiStatus {
|
||||
return {
|
||||
status: 0,
|
||||
localIp: "",
|
||||
macAddress: "",
|
||||
rssi: 0,
|
||||
ssid: "",
|
||||
bssid: "",
|
||||
channel: 0,
|
||||
subnetMask: "",
|
||||
gatewayIp: "",
|
||||
dnsIp1: "",
|
||||
dnsIp2: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export const WifiStatus: MessageFns<WifiStatus> = {
|
||||
encode(message: WifiStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.status !== 0) {
|
||||
writer.uint32(8).int32(message.status);
|
||||
}
|
||||
if (message.localIp !== "") {
|
||||
writer.uint32(18).string(message.localIp);
|
||||
}
|
||||
if (message.macAddress !== "") {
|
||||
writer.uint32(26).string(message.macAddress);
|
||||
}
|
||||
if (message.rssi !== 0) {
|
||||
writer.uint32(37).float(message.rssi);
|
||||
}
|
||||
if (message.ssid !== "") {
|
||||
writer.uint32(42).string(message.ssid);
|
||||
}
|
||||
if (message.bssid !== "") {
|
||||
writer.uint32(50).string(message.bssid);
|
||||
}
|
||||
if (message.channel !== 0) {
|
||||
writer.uint32(56).uint32(message.channel);
|
||||
}
|
||||
if (message.subnetMask !== "") {
|
||||
writer.uint32(66).string(message.subnetMask);
|
||||
}
|
||||
if (message.gatewayIp !== "") {
|
||||
writer.uint32(74).string(message.gatewayIp);
|
||||
}
|
||||
if (message.dnsIp1 !== "") {
|
||||
writer.uint32(82).string(message.dnsIp1);
|
||||
}
|
||||
if (message.dnsIp2 !== undefined) {
|
||||
writer.uint32(90).string(message.dnsIp2);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): WifiStatus {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseWifiStatus();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.status = reader.int32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.localIp = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.macAddress = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 37) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.rssi = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 5: {
|
||||
if (tag !== 42) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.ssid = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 6: {
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.bssid = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 7: {
|
||||
if (tag !== 56) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.channel = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 8: {
|
||||
if (tag !== 66) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.subnetMask = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 9: {
|
||||
if (tag !== 74) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.gatewayIp = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 10: {
|
||||
if (tag !== 82) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.dnsIp1 = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 11: {
|
||||
if (tag !== 90) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.dnsIp2 = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): WifiStatus {
|
||||
return {
|
||||
status: isSet(object.status) ? globalThis.Number(object.status) : 0,
|
||||
localIp: isSet(object.localIp) ? globalThis.String(object.localIp) : "",
|
||||
macAddress: isSet(object.macAddress) ? globalThis.String(object.macAddress) : "",
|
||||
rssi: isSet(object.rssi) ? globalThis.Number(object.rssi) : 0,
|
||||
ssid: isSet(object.ssid) ? globalThis.String(object.ssid) : "",
|
||||
bssid: isSet(object.bssid) ? globalThis.String(object.bssid) : "",
|
||||
channel: isSet(object.channel) ? globalThis.Number(object.channel) : 0,
|
||||
subnetMask: isSet(object.subnetMask) ? globalThis.String(object.subnetMask) : "",
|
||||
gatewayIp: isSet(object.gatewayIp) ? globalThis.String(object.gatewayIp) : "",
|
||||
dnsIp1: isSet(object.dnsIp1) ? globalThis.String(object.dnsIp1) : "",
|
||||
dnsIp2: isSet(object.dnsIp2) ? globalThis.String(object.dnsIp2) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: WifiStatus): unknown {
|
||||
const obj: any = {};
|
||||
if (message.status !== 0) {
|
||||
obj.status = Math.round(message.status);
|
||||
}
|
||||
if (message.localIp !== "") {
|
||||
obj.localIp = message.localIp;
|
||||
}
|
||||
if (message.macAddress !== "") {
|
||||
obj.macAddress = message.macAddress;
|
||||
}
|
||||
if (message.rssi !== 0) {
|
||||
obj.rssi = message.rssi;
|
||||
}
|
||||
if (message.ssid !== "") {
|
||||
obj.ssid = message.ssid;
|
||||
}
|
||||
if (message.bssid !== "") {
|
||||
obj.bssid = message.bssid;
|
||||
}
|
||||
if (message.channel !== 0) {
|
||||
obj.channel = Math.round(message.channel);
|
||||
}
|
||||
if (message.subnetMask !== "") {
|
||||
obj.subnetMask = message.subnetMask;
|
||||
}
|
||||
if (message.gatewayIp !== "") {
|
||||
obj.gatewayIp = message.gatewayIp;
|
||||
}
|
||||
if (message.dnsIp1 !== "") {
|
||||
obj.dnsIp1 = message.dnsIp1;
|
||||
}
|
||||
if (message.dnsIp2 !== undefined) {
|
||||
obj.dnsIp2 = message.dnsIp2;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<WifiStatus>, I>>(base?: I): WifiStatus {
|
||||
return WifiStatus.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<WifiStatus>, I>>(object: I): WifiStatus {
|
||||
const message = createBaseWifiStatus();
|
||||
message.status = object.status ?? 0;
|
||||
message.localIp = object.localIp ?? "";
|
||||
message.macAddress = object.macAddress ?? "";
|
||||
message.rssi = object.rssi ?? 0;
|
||||
message.ssid = object.ssid ?? "";
|
||||
message.bssid = object.bssid ?? "";
|
||||
message.channel = object.channel ?? 0;
|
||||
message.subnetMask = object.subnetMask ?? "";
|
||||
message.gatewayIp = object.gatewayIp ?? "";
|
||||
message.dnsIp1 = object.dnsIp1 ?? "";
|
||||
message.dnsIp2 = object.dnsIp2 ?? undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseWifiSettings(): WifiSettings {
|
||||
return { hostname: "", priorityRssi: false, wifiNetworks: [] };
|
||||
}
|
||||
|
||||
export const WifiSettings: MessageFns<WifiSettings> = {
|
||||
encode(message: WifiSettings, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.hostname !== "") {
|
||||
writer.uint32(10).string(message.hostname);
|
||||
}
|
||||
if (message.priorityRssi !== false) {
|
||||
writer.uint32(16).bool(message.priorityRssi);
|
||||
}
|
||||
for (const v of message.wifiNetworks) {
|
||||
KnownNetworkItem.encode(v!, writer.uint32(26).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): WifiSettings {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseWifiSettings();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.hostname = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.priorityRssi = reader.bool();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.wifiNetworks.push(KnownNetworkItem.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): WifiSettings {
|
||||
return {
|
||||
hostname: isSet(object.hostname) ? globalThis.String(object.hostname) : "",
|
||||
priorityRssi: isSet(object.priorityRssi) ? globalThis.Boolean(object.priorityRssi) : false,
|
||||
wifiNetworks: globalThis.Array.isArray(object?.wifiNetworks)
|
||||
? object.wifiNetworks.map((e: any) => KnownNetworkItem.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: WifiSettings): unknown {
|
||||
const obj: any = {};
|
||||
if (message.hostname !== "") {
|
||||
obj.hostname = message.hostname;
|
||||
}
|
||||
if (message.priorityRssi !== false) {
|
||||
obj.priorityRssi = message.priorityRssi;
|
||||
}
|
||||
if (message.wifiNetworks?.length) {
|
||||
obj.wifiNetworks = message.wifiNetworks.map((e) => KnownNetworkItem.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<WifiSettings>, I>>(base?: I): WifiSettings {
|
||||
return WifiSettings.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<WifiSettings>, I>>(object: I): WifiSettings {
|
||||
const message = createBaseWifiSettings();
|
||||
message.hostname = object.hostname ?? "";
|
||||
message.priorityRssi = object.priorityRssi ?? false;
|
||||
message.wifiNetworks = object.wifiNetworks?.map((e) => KnownNetworkItem.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type ProtoMetaMessageOptions = {
|
||||
options?: { [key: string]: any };
|
||||
fields?: { [key: string]: { [key: string]: any } };
|
||||
oneof?: { [key: string]: { [key: string]: any } };
|
||||
nested?: { [key: string]: ProtoMetaMessageOptions };
|
||||
};
|
||||
|
||||
export interface ProtoMetadata {
|
||||
fileDescriptor: FileDescriptorProto;
|
||||
references: { [key: string]: any };
|
||||
dependencies?: ProtoMetadata[];
|
||||
options?: {
|
||||
options?: { [key: string]: any };
|
||||
services?: {
|
||||
[key: string]: { options?: { [key: string]: any }; methods?: { [key: string]: { [key: string]: any } } };
|
||||
};
|
||||
messages?: { [key: string]: ProtoMetaMessageOptions };
|
||||
enums?: { [key: string]: { options?: { [key: string]: any }; values?: { [key: string]: { [key: string]: any } } } };
|
||||
};
|
||||
}
|
||||
|
||||
export const protoMetadata: ProtoMetadata = {
|
||||
fileDescriptor: {
|
||||
"name": "rest_message.proto",
|
||||
"package": "rest_message",
|
||||
"dependency": ["websocket_message.proto"],
|
||||
"publicDependency": [],
|
||||
"weakDependency": [],
|
||||
"optionDependency": [],
|
||||
"messageType": [{
|
||||
"name": "WifiStatus",
|
||||
"field": [{
|
||||
"name": "status",
|
||||
"number": 1,
|
||||
"label": 1,
|
||||
"type": 5,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "status",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "local_ip",
|
||||
"number": 2,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "localIp",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "mac_address",
|
||||
"number": 3,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "macAddress",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "rssi",
|
||||
"number": 4,
|
||||
"label": 1,
|
||||
"type": 2,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "rssi",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "ssid",
|
||||
"number": 5,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "ssid",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "bssid",
|
||||
"number": 6,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "bssid",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "channel",
|
||||
"number": 7,
|
||||
"label": 1,
|
||||
"type": 13,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "channel",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "subnet_mask",
|
||||
"number": 8,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "subnetMask",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "gateway_ip",
|
||||
"number": 9,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "gatewayIp",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "dns_ip_1",
|
||||
"number": 10,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "dnsIp1",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "dns_ip_2",
|
||||
"number": 11,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "dnsIp2",
|
||||
"options": undefined,
|
||||
"proto3Optional": true,
|
||||
}],
|
||||
"extension": [],
|
||||
"nestedType": [],
|
||||
"enumType": [],
|
||||
"extensionRange": [],
|
||||
"oneofDecl": [{ "name": "_dns_ip_2", "options": undefined }],
|
||||
"options": undefined,
|
||||
"reservedRange": [],
|
||||
"reservedName": [],
|
||||
"visibility": 0,
|
||||
}, {
|
||||
"name": "WifiSettings",
|
||||
"field": [{
|
||||
"name": "hostname",
|
||||
"number": 1,
|
||||
"label": 1,
|
||||
"type": 9,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "hostname",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "priority_rssi",
|
||||
"number": 2,
|
||||
"label": 1,
|
||||
"type": 8,
|
||||
"typeName": "",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "priorityRssi",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}, {
|
||||
"name": "wifi_networks",
|
||||
"number": 3,
|
||||
"label": 3,
|
||||
"type": 11,
|
||||
"typeName": ".socket_message.KnownNetworkItem",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
"jsonName": "wifiNetworks",
|
||||
"options": undefined,
|
||||
"proto3Optional": false,
|
||||
}],
|
||||
"extension": [],
|
||||
"nestedType": [],
|
||||
"enumType": [],
|
||||
"extensionRange": [],
|
||||
"oneofDecl": [],
|
||||
"options": undefined,
|
||||
"reservedRange": [],
|
||||
"reservedName": [],
|
||||
"visibility": 0,
|
||||
}],
|
||||
"enumType": [],
|
||||
"service": [],
|
||||
"extension": [],
|
||||
"options": undefined,
|
||||
"sourceCodeInfo": {
|
||||
"location": [{
|
||||
"path": [2],
|
||||
"span": [5, 0, 21],
|
||||
"leadingComments":
|
||||
' Note: This is most likely a "temporary" proto that will be redone, as these endpoints are static for the esp32, which means we are forced to use WiFi for communication\n',
|
||||
"trailingComments": "",
|
||||
"leadingDetachedComments": [],
|
||||
}],
|
||||
},
|
||||
"syntax": "proto3",
|
||||
"edition": 0,
|
||||
},
|
||||
references: { ".rest_message.WifiStatus": WifiStatus, ".rest_message.WifiSettings": WifiSettings },
|
||||
dependencies: [protoMetadata1],
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
export interface MessageFns<T> {
|
||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||
fromJSON(object: any): T;
|
||||
toJSON(message: T): unknown;
|
||||
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
||||
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
||||
}
|
||||
@@ -2,13 +2,13 @@
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.10.1
|
||||
// protoc v6.33.2
|
||||
// source: platform_shared/websocket_message.proto
|
||||
// source: websocket_message.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import type { FileDescriptorProto } from "ts-proto-descriptors";
|
||||
|
||||
export const protobufPackage = "";
|
||||
export const protobufPackage = "socket_message";
|
||||
|
||||
export enum ModesEnum {
|
||||
DEACTIVATED = 0,
|
||||
@@ -3192,8 +3192,8 @@ export interface ProtoMetadata {
|
||||
|
||||
export const protoMetadata: ProtoMetadata = {
|
||||
fileDescriptor: {
|
||||
"name": "platform_shared/websocket_message.proto",
|
||||
"package": "",
|
||||
"name": "websocket_message.proto",
|
||||
"package": "socket_message",
|
||||
"dependency": [],
|
||||
"publicDependency": [],
|
||||
"weakDependency": [],
|
||||
@@ -3751,7 +3751,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 1,
|
||||
"label": 1,
|
||||
"type": 14,
|
||||
"typeName": ".ModesEnum",
|
||||
"typeName": ".socket_message.ModesEnum",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -3775,7 +3775,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 1,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".Vector",
|
||||
"typeName": ".socket_message.Vector",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -3787,7 +3787,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 2,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".Vector",
|
||||
"typeName": ".socket_message.Vector",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4039,7 +4039,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 1,
|
||||
"label": 3,
|
||||
"type": 11,
|
||||
"typeName": ".I2CDevice",
|
||||
"typeName": ".socket_message.I2CDevice",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4099,7 +4099,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 4,
|
||||
"label": 3,
|
||||
"type": 11,
|
||||
"typeName": ".PinConfig",
|
||||
"typeName": ".socket_message.PinConfig",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4147,7 +4147,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 3,
|
||||
"label": 3,
|
||||
"type": 11,
|
||||
"typeName": ".KnownNetworkItem",
|
||||
"typeName": ".socket_message.KnownNetworkItem",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4267,7 +4267,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 10,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".Vector",
|
||||
"typeName": ".socket_message.Vector",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4279,7 +4279,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 11,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".Vector",
|
||||
"typeName": ".socket_message.Vector",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4339,7 +4339,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 1,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".AnalyticsData",
|
||||
"typeName": ".socket_message.AnalyticsData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4351,7 +4351,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 2,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".StaticSystemInformation",
|
||||
"typeName": ".socket_message.StaticSystemInformation",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4375,7 +4375,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 1,
|
||||
"label": 1,
|
||||
"type": 14,
|
||||
"typeName": ".WalkGaits",
|
||||
"typeName": ".socket_message.WalkGaits",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4555,7 +4555,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 20,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".SubscribeNotification",
|
||||
"typeName": ".socket_message.SubscribeNotification",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4567,7 +4567,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 21,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".UnsubscribeNotification",
|
||||
"typeName": ".socket_message.UnsubscribeNotification",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4579,7 +4579,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 30,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".PingMsg",
|
||||
"typeName": ".socket_message.PingMsg",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4591,7 +4591,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 31,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".PongMsg",
|
||||
"typeName": ".socket_message.PongMsg",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4603,7 +4603,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 110,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".IMUData",
|
||||
"typeName": ".socket_message.IMUData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4615,7 +4615,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 120,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".IMUCalibrateData",
|
||||
"typeName": ".socket_message.IMUCalibrateData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4627,7 +4627,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 130,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".ModeData",
|
||||
"typeName": ".socket_message.ModeData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4639,7 +4639,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 140,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".ControllerInputData",
|
||||
"typeName": ".socket_message.ControllerInputData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4651,7 +4651,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 150,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".AnalyticsData",
|
||||
"typeName": ".socket_message.AnalyticsData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4663,7 +4663,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 170,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".AnglesData",
|
||||
"typeName": ".socket_message.AnglesData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4675,7 +4675,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 180,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".I2CScanData",
|
||||
"typeName": ".socket_message.I2CScanData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4687,7 +4687,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 190,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".PeripheralSettingsData",
|
||||
"typeName": ".socket_message.PeripheralSettingsData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4699,7 +4699,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 200,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".KinematicData",
|
||||
"typeName": ".socket_message.KinematicData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4711,7 +4711,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 240,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".WifiSettingsData",
|
||||
"typeName": ".socket_message.WifiSettingsData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4723,7 +4723,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 250,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".HumanInputData",
|
||||
"typeName": ".socket_message.HumanInputData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4735,7 +4735,7 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"number": 260,
|
||||
"label": 1,
|
||||
"type": 11,
|
||||
"typeName": ".RSSIData",
|
||||
"typeName": ".socket_message.RSSIData",
|
||||
"extendee": "",
|
||||
"defaultValue": "",
|
||||
"oneofIndex": 0,
|
||||
@@ -4785,13 +4785,13 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"sourceCodeInfo": {
|
||||
"location": [{
|
||||
"path": [4, 4],
|
||||
"span": [8, 0, 16, 1],
|
||||
"span": [12, 0, 20, 1],
|
||||
"leadingComments": " Individual message data types\n",
|
||||
"trailingComments": "",
|
||||
"leadingDetachedComments": [],
|
||||
}, {
|
||||
"path": [4, 25],
|
||||
"span": [105, 0, 124, 1],
|
||||
"span": [109, 0, 128, 1],
|
||||
"leadingComments": " WebSocket message wrapper\n Only ONE field will be set at a time (oneof ensures this)\n",
|
||||
"trailingComments": "",
|
||||
"leadingDetachedComments": [],
|
||||
@@ -4801,34 +4801,34 @@ export const protoMetadata: ProtoMetadata = {
|
||||
"edition": 0,
|
||||
},
|
||||
references: {
|
||||
".ModesEnum": ModesEnum,
|
||||
".WalkGaits": WalkGaits,
|
||||
".Vector": Vector,
|
||||
".I2CDevice": I2CDevice,
|
||||
".PinConfig": PinConfig,
|
||||
".KnownNetworkItem": KnownNetworkItem,
|
||||
".IMUData": IMUData,
|
||||
".StaticSystemInformation": StaticSystemInformation,
|
||||
".IMUCalibrateData": IMUCalibrateData,
|
||||
".ModeData": ModeData,
|
||||
".ControllerInputData": ControllerInputData,
|
||||
".AnalyticsData": AnalyticsData,
|
||||
".AnglesData": AnglesData,
|
||||
".I2CScanData": I2CScanData,
|
||||
".PeripheralSettingsData": PeripheralSettingsData,
|
||||
".WifiSettingsData": WifiSettingsData,
|
||||
".RSSIData": RSSIData,
|
||||
".DownloadOTAData": DownloadOTAData,
|
||||
".SonarData": SonarData,
|
||||
".HumanInputData": HumanInputData,
|
||||
".SystemInformation": SystemInformation,
|
||||
".WalkGaitData": WalkGaitData,
|
||||
".KinematicData": KinematicData,
|
||||
".SubscribeNotification": SubscribeNotification,
|
||||
".UnsubscribeNotification": UnsubscribeNotification,
|
||||
".PingMsg": PingMsg,
|
||||
".PongMsg": PongMsg,
|
||||
".WebsocketMessage": WebsocketMessage,
|
||||
".socket_message.ModesEnum": ModesEnum,
|
||||
".socket_message.WalkGaits": WalkGaits,
|
||||
".socket_message.Vector": Vector,
|
||||
".socket_message.I2CDevice": I2CDevice,
|
||||
".socket_message.PinConfig": PinConfig,
|
||||
".socket_message.KnownNetworkItem": KnownNetworkItem,
|
||||
".socket_message.IMUData": IMUData,
|
||||
".socket_message.StaticSystemInformation": StaticSystemInformation,
|
||||
".socket_message.IMUCalibrateData": IMUCalibrateData,
|
||||
".socket_message.ModeData": ModeData,
|
||||
".socket_message.ControllerInputData": ControllerInputData,
|
||||
".socket_message.AnalyticsData": AnalyticsData,
|
||||
".socket_message.AnglesData": AnglesData,
|
||||
".socket_message.I2CScanData": I2CScanData,
|
||||
".socket_message.PeripheralSettingsData": PeripheralSettingsData,
|
||||
".socket_message.WifiSettingsData": WifiSettingsData,
|
||||
".socket_message.RSSIData": RSSIData,
|
||||
".socket_message.DownloadOTAData": DownloadOTAData,
|
||||
".socket_message.SonarData": SonarData,
|
||||
".socket_message.HumanInputData": HumanInputData,
|
||||
".socket_message.SystemInformation": SystemInformation,
|
||||
".socket_message.WalkGaitData": WalkGaitData,
|
||||
".socket_message.KinematicData": KinematicData,
|
||||
".socket_message.SubscribeNotification": SubscribeNotification,
|
||||
".socket_message.UnsubscribeNotification": UnsubscribeNotification,
|
||||
".socket_message.PingMsg": PingMsg,
|
||||
".socket_message.PongMsg": PongMsg,
|
||||
".socket_message.WebsocketMessage": WebsocketMessage,
|
||||
},
|
||||
dependencies: [],
|
||||
};
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
} from '$lib/components/icons'
|
||||
import StatusItem from '$lib/components/StatusItem.svelte'
|
||||
import { KnownNetworkItem } from '$lib/platform_shared/websocket_message'
|
||||
import { WifiSettings, type WifiStatus } from '$lib/rest_message'
|
||||
|
||||
let networkEditable: KnownNetworkItem = $state( KnownNetworkItem.create() )
|
||||
|
||||
@@ -49,7 +50,7 @@
|
||||
|
||||
let showWifiDetails = $state(false)
|
||||
|
||||
let formField: Record<string, unknown> = $state()
|
||||
let formField: HTMLFormElement = $state()!
|
||||
|
||||
let formErrors = $state({
|
||||
ssid: false,
|
||||
@@ -79,19 +80,19 @@
|
||||
return
|
||||
}
|
||||
wifiSettings = result.inner
|
||||
dndNetworkList = wifiSettings.wifi_networks
|
||||
dndNetworkList = wifiSettings.wifiNetworks
|
||||
return wifiSettings
|
||||
}
|
||||
|
||||
onDestroy(() => socket.off(MessageTopic.WiFiSettings))
|
||||
|
||||
let unsub_obj: (() => void) | undefined = undefined;
|
||||
onMount(() => {
|
||||
socket.on<WifiSettings>(MessageTopic.WiFiSettings, data => {
|
||||
unsub_obj = socket.on<WifiSettings>(WifiSettings, data => {
|
||||
wifiSettings = data
|
||||
dndNetworkList = wifiSettings.wifi_networks
|
||||
dndNetworkList = wifiSettings.wifiNetworks
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
onDestroy(() => { if (unsub_obj) unsub_obj() } )
|
||||
async function postWiFiSettings(data: WifiSettings) {
|
||||
const result = await api.post<WifiSettings>('/api/wifi/sta/settings', data)
|
||||
if (result.isErr()) {
|
||||
@@ -110,7 +111,7 @@
|
||||
} else {
|
||||
formErrorhostname = false
|
||||
// Update global wifiSettings object
|
||||
wifiSettings.wifi_networks = dndNetworkList
|
||||
wifiSettings.wifiNetworks = dndNetworkList
|
||||
// Post to REST API
|
||||
postWiFiSettings(wifiSettings)
|
||||
console.log(wifiSettings)
|
||||
@@ -129,15 +130,15 @@
|
||||
formErrors.ssid = false
|
||||
}
|
||||
|
||||
networkEditable.static_ip_config = static_ip_config
|
||||
networkEditable.staticIp = static_ip_config
|
||||
|
||||
if (networkEditable.static_ip_config) {
|
||||
if (networkEditable.staticIp) {
|
||||
// RegEx for IPv4
|
||||
const regexExp =
|
||||
/\b(?:(?:2(?:[0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9])\.){3}(?:(?:2([0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9]))\b/
|
||||
|
||||
// Validate gateway IP
|
||||
if (!regexExp.test(networkEditable.gateway_ip!)) {
|
||||
if (!regexExp.test(networkEditable.gatewayIp!)) {
|
||||
valid = false
|
||||
formErrors.gateway_ip = true
|
||||
} else {
|
||||
@@ -145,7 +146,7 @@
|
||||
}
|
||||
|
||||
// Validate Subnet Mask
|
||||
if (!regexExp.test(networkEditable.subnet_mask!)) {
|
||||
if (!regexExp.test(networkEditable.subnetMask!)) {
|
||||
valid = false
|
||||
formErrors.subnet_mask = true
|
||||
} else {
|
||||
@@ -153,7 +154,7 @@
|
||||
}
|
||||
|
||||
// Validate local IP
|
||||
if (!regexExp.test(networkEditable.local_ip!)) {
|
||||
if (!regexExp.test(networkEditable.localIp!)) {
|
||||
valid = false
|
||||
formErrors.local_ip = true
|
||||
} else {
|
||||
@@ -161,7 +162,7 @@
|
||||
}
|
||||
|
||||
// Validate DNS 1
|
||||
if (!regexExp.test(networkEditable.dns_ip_1!)) {
|
||||
if (!regexExp.test(networkEditable.dnsIp1!)) {
|
||||
valid = false
|
||||
formErrors.dns_1 = true
|
||||
} else {
|
||||
@@ -169,7 +170,8 @@
|
||||
}
|
||||
|
||||
// Validate DNS 2
|
||||
if (!regexExp.test(networkEditable.dns_ip_2!)) {
|
||||
// TODO: This is optional, make sure to handle correctly?
|
||||
if (!regexExp.test(networkEditable.dnsIp2!)) {
|
||||
valid = false
|
||||
formErrors.dns_2 = true
|
||||
} else {
|
||||
@@ -211,12 +213,12 @@
|
||||
networkEditable = {
|
||||
ssid: '',
|
||||
password: '',
|
||||
static_ip_config: false,
|
||||
local_ip: undefined,
|
||||
subnet_mask: undefined,
|
||||
gateway_ip: undefined,
|
||||
dns_ip_1: undefined,
|
||||
dns_ip_2: undefined
|
||||
staticIp: false,
|
||||
localIp: undefined,
|
||||
subnetMask: undefined,
|
||||
gatewayIp: undefined,
|
||||
dnsIp1: undefined,
|
||||
dnsIp2: undefined
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +304,7 @@
|
||||
<StatusItem
|
||||
icon={Home}
|
||||
title="IP Address"
|
||||
description={wifiStatus.local_ip}
|
||||
description={wifiStatus.localIp}
|
||||
/>
|
||||
|
||||
<StatusItem icon={WiFi} title="RSSI" description={`${wifiStatus.rssi} dBm`}>
|
||||
@@ -333,7 +335,7 @@
|
||||
<StatusItem
|
||||
icon={MAC}
|
||||
title="MAC Address"
|
||||
description={wifiStatus.mac_address}
|
||||
description={wifiStatus.macAddress}
|
||||
/>
|
||||
|
||||
<StatusItem
|
||||
@@ -345,16 +347,16 @@
|
||||
<StatusItem
|
||||
icon={Gateway}
|
||||
title="Gateway IP"
|
||||
description={wifiStatus.gateway_ip}
|
||||
description={wifiStatus.gatewayIp}
|
||||
/>
|
||||
|
||||
<StatusItem
|
||||
icon={Subnet}
|
||||
title="Subnet Mask"
|
||||
description={wifiStatus.subnet_mask}
|
||||
description={wifiStatus.subnetMask}
|
||||
/>
|
||||
|
||||
<StatusItem icon={DNS} title="DNS" description={wifiStatus.dns_ip_1} />
|
||||
<StatusItem icon={DNS} title="DNS" description={wifiStatus.dnsIp1} />
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -471,7 +473,7 @@
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={wifiSettings.priority_RSSI}
|
||||
bind:checked={wifiSettings.priorityRssi}
|
||||
class="checkbox checkbox-primary sm:-mb-5"
|
||||
/>
|
||||
<span class="sm:-mb-5">Connect to strongest WiFi</span>
|
||||
@@ -545,7 +547,7 @@
|
||||
minlength="7"
|
||||
maxlength="15"
|
||||
size="15"
|
||||
bind:value={networkEditable.local_ip}
|
||||
bind:value={networkEditable.localIp}
|
||||
id="localIP"
|
||||
required
|
||||
/>
|
||||
@@ -574,7 +576,7 @@
|
||||
minlength="7"
|
||||
maxlength="15"
|
||||
size="15"
|
||||
bind:value={networkEditable.gateway_ip}
|
||||
bind:value={networkEditable.gatewayIp}
|
||||
required
|
||||
/>
|
||||
<label class="label" for="gateway">
|
||||
@@ -601,7 +603,7 @@
|
||||
minlength="7"
|
||||
maxlength="15"
|
||||
size="15"
|
||||
bind:value={networkEditable.subnet_mask}
|
||||
bind:value={networkEditable.subnetMask}
|
||||
required
|
||||
/>
|
||||
<label class="label" for="subnet">
|
||||
@@ -628,7 +630,7 @@
|
||||
minlength="7"
|
||||
maxlength="15"
|
||||
size="15"
|
||||
bind:value={networkEditable.dns_ip_1}
|
||||
bind:value={networkEditable.dnsIp1}
|
||||
required
|
||||
/>
|
||||
<label class="label" for="gateway">
|
||||
@@ -653,7 +655,7 @@
|
||||
minlength="7"
|
||||
maxlength="15"
|
||||
size="15"
|
||||
bind:value={networkEditable.dns_ip_2}
|
||||
bind:value={networkEditable.dnsIp2}
|
||||
required
|
||||
/>
|
||||
<label class="label" for="subnet">
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ This file is temporary, just to show how ot compile the proto files
|
||||
Make sure to actually create the output directories before executing the commands
|
||||
|
||||
TS:
|
||||
protoc --plugin="protoc-gen-ts_proto=$(Resolve-Path app\node_modules\.bin\protoc-gen-ts_proto.CMD)" --ts_proto_out="./app/src/lib" --ts_proto_opt=outputSchema=true --proto_path ".\platform_shared\" ".\platform_shared\websocket_message.proto"
|
||||
protoc --plugin="protoc-gen-ts_proto=$(Resolve-Path app\node_modules\.bin\protoc-gen-ts_proto.CMD)" --ts_proto_out="./app/src/lib" --ts_proto_opt=outputSchema=true --proto_path ".\platform_shared\" ".\platform_shared\rest_message.proto"
|
||||
protoc --plugin="protoc-gen-ts_proto=$(Resolve-Path app\node_modules\.bin\protoc-gen-ts_proto.CMD)" --ts_proto_out="./app/src/lib/platform_shared" --ts_proto_opt=outputSchema=true --proto_path ".\platform_shared\" ".\platform_shared\websocket_message.proto"
|
||||
protoc --plugin="protoc-gen-ts_proto=$(Resolve-Path app\node_modules\.bin\protoc-gen-ts_proto.CMD)" --ts_proto_out="./app/src/lib/platform_shared" --ts_proto_opt=outputSchema=true --proto_path ".\platform_shared\" ".\platform_shared\rest_message.proto"
|
||||
|
||||
C++:
|
||||
protoc -I=platform_shared --cpp_out=esp32/src/platform_shared platform_shared/example.proto
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "websocket_message.proto";
|
||||
|
||||
// Note: This is most likely a "temporary" proto that will be redone, as these endpoints are static for the esp32, which means we are forced to use WiFi for communication
|
||||
package rest_message;
|
||||
|
||||
|
||||
message WifiStatus {
|
||||
int32 status = 1;
|
||||
string local_ip = 2;
|
||||
string mac_address = 3;
|
||||
float rssi = 4;
|
||||
string ssid = 5;
|
||||
string bssid = 6;
|
||||
uint32 channel = 7;
|
||||
string subnet_mask = 8;
|
||||
string gateway_ip = 9;
|
||||
string dns_ip_1 = 10;
|
||||
optional string dns_ip_2 = 11;
|
||||
}
|
||||
|
||||
message WifiSettings {
|
||||
string hostname = 1;
|
||||
bool priority_rssi = 2;
|
||||
repeated socket_message.KnownNetworkItem wifi_networks = 3;
|
||||
}
|
||||
@@ -1,15 +1,7 @@
|
||||
syntax = "proto3";
|
||||
|
||||
|
||||
// REST MESSAGE TYPES
|
||||
// TODO: i am too lazy to create a new file and compile it manually, so move this to a new proto before merging
|
||||
|
||||
|
||||
// END REST MESSAGE TYPES
|
||||
|
||||
|
||||
|
||||
|
||||
package socket_message;
|
||||
|
||||
|
||||
message Vector { float x = 1; float y = 2; }
|
||||
|
||||
Reference in New Issue
Block a user