From f2fce99d6d60a98a8978f5923bde467f140b220f Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Tue, 19 Nov 2024 15:23:36 +0000 Subject: [PATCH] Implement web-interface UI for device-profiles management. --- Makefile | 13 +- README.md | 108 +- docker-compose.yml | 3 + interface/Cargo.lock | 159 + interface/Cargo.toml | 2 + interface/api/api.proto | 177 +- interface/api/grpc-web/api_grpc_web_pb.d.ts | 156 +- interface/api/grpc-web/api_grpc_web_pb.js | 747 +- interface/api/grpc-web/api_pb.d.ts | 605 ++ interface/api/grpc-web/api_pb.js | 6377 +++++++++++++++-- interface/src/api.rs | 426 +- {test-runner => interface}/src/js/mod.rs | 29 +- .../src/js/vendor_base64_js.rs | 0 .../src/js/vendor_buffer.rs | 0 .../src/js/vendor_ieee754.rs | 0 interface/src/main.rs | 56 +- interface/src/storage.rs | 133 +- interface/src/structs.rs | 260 + interface/ui/package.json | 5 +- interface/ui/src/App.tsx | 17 +- interface/ui/src/components/CodeEditor.tsx | 35 +- interface/ui/src/components/Menu.tsx | 13 +- interface/ui/src/index.css | 4 - interface/ui/src/index.tsx | 2 - interface/ui/src/stores/DeviceProfileStore.ts | 221 +- interface/ui/src/views/codecs/CodecForm.tsx | 65 +- interface/ui/src/views/codecs/CreateCodec.tsx | 84 + interface/ui/src/views/codecs/EditCodec.tsx | 38 +- interface/ui/src/views/codecs/ListCodecs.tsx | 7 +- .../ui/src/views/devices/CreateDevice.tsx | 48 + interface/ui/src/views/devices/DeviceForm.tsx | 157 + interface/ui/src/views/devices/EditDevice.tsx | 83 + .../ui/src/views/devices/ListDevices.tsx | 64 + .../ui/src/views/profiles/CreateProfile.tsx | 49 + .../ui/src/views/profiles/EditProfile.tsx | 83 + .../ui/src/views/profiles/ListProfiles.tsx | 64 + .../ui/src/views/profiles/ProfileForm.tsx | 235 + interface/ui/src/views/vendors/EditVendor.tsx | 36 +- interface/ui/src/views/vendors/VendorForm.tsx | 85 +- interface/ui/yarn.lock | 73 +- taplo.toml | 5 - test-runner/.gitignore | 1 - test-runner/Cargo.lock | 419 -- test-runner/Cargo.toml | 10 - test-runner/src/main.rs | 109 - test-runner/src/structs.rs | 105 - 46 files changed, 9639 insertions(+), 1729 deletions(-) rename {test-runner => interface}/src/js/mod.rs (73%) rename {test-runner => interface}/src/js/vendor_base64_js.rs (100%) rename {test-runner => interface}/src/js/vendor_buffer.rs (100%) rename {test-runner => interface}/src/js/vendor_ieee754.rs (100%) create mode 100644 interface/ui/src/views/codecs/CreateCodec.tsx create mode 100644 interface/ui/src/views/devices/CreateDevice.tsx create mode 100644 interface/ui/src/views/devices/DeviceForm.tsx create mode 100644 interface/ui/src/views/devices/EditDevice.tsx create mode 100644 interface/ui/src/views/devices/ListDevices.tsx create mode 100644 interface/ui/src/views/profiles/CreateProfile.tsx create mode 100644 interface/ui/src/views/profiles/EditProfile.tsx create mode 100644 interface/ui/src/views/profiles/ListProfiles.tsx create mode 100644 interface/ui/src/views/profiles/ProfileForm.tsx delete mode 100644 taplo.toml delete mode 100644 test-runner/.gitignore delete mode 100644 test-runner/Cargo.lock delete mode 100644 test-runner/Cargo.toml delete mode 100644 test-runner/src/main.rs delete mode 100644 test-runner/src/structs.rs diff --git a/Makefile b/Makefile index fc2f86e..239076c 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ -.PHONY: test fmt devshell +.PHONY: test nix-start nix-test test: - docker compose run --rm lorawan-device-profiles --run 'cd test-runner && cargo run' + docker compose run --rm lorawan-device-profiles --run 'make nix-test' -fmt: - docker compose run --rm lorawan-device-profiles --run 'taplo fmt' +nix-start: + cd interface/ui && yarn build + cd interface && cargo run -devshell: - docker-compose run --rm lorawan-device-profiles +nix-test: + cd interface && cargo run run-tests diff --git a/README.md b/README.md index 0b2c2f1..feddf80 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,52 @@ repository into their database. The goal of this repository is to provide an open-source database of LoRaWAN device-profiles that can be freely imported. +## Adding a new device-profile + +### Fork and clone + +* Create a fork of this repository (if not done already). +* Clone your local fork to your computer. + +### Starting the web-interface + +* Please make sure that you have Docker Compose installed. +* In the root of this repository, execute `docker compose up`. +* Once `Starting server, bind: 0.0.0.0:8090` appears, open the web-interface in your browser by navigating to [http://localhost:8090](http://localhost:8090). + +### Add Vendor(s) + +* In the left menu, click the _Add vendor_ button. +* Fill in the form and click _Submit_. + +### Add profile(s) + +* Select a vendor in the left menu (if no vendor is selected). +* Click _Profiles_ in the left menu. +* Click the _Create profile_ button. +* Fill in the form and click _Submit_. + +### Add codec(s) + +* Select a vendor in the left menu (if no vendor is selected). +* Click _Codecs_ in the left menu. +* Click the _Create codec_ button. +* Fill in the form, before clicking _Submit_ it is a good idea to click _Run codec tests_. + +### Add device(s) + +* Select a vendor in the left menu (if no vendor is selected). +* Click _Devices_ in the left menu. +* Click the _Create device_ button. +* Fill in the form and add at least one firmware version by clicking the _Add firmware version_ button. + * For each firmware version you can select one or multiple profiles and optionally a codec. + +### Create pull-request + +Once you have added the vendor(s), profile(s), codec(s) and device(s) you wish +to add to this repository you must commit the changes using `git`, push these +to your fork of this repository and create a pull-request in GitHub. + ## Structure Example structure for an `example-vendor` with an `example` device: @@ -65,68 +111,6 @@ configuration. This directory contains the profiles. These profiles can be used by one or multiple devices. The profile also defines the region. -## Adding a new device-profile - -In summary, these are the steps to create a new device-profile. - -1. **Add a new vendor directory in `vendors/`.** This directory should be - lower-cased, and spaces must be replaced by `-`. For example for - _My Vendor_ you would create a directory `vendors/my-vendor/`. - -2. **Create `vendor.toml` file.** Inside the directory created in the previous - step, create a `vendor.toml` file (e.g. `vendors/my-vendor/vendor.toml`). - Please use `vendors/example-vendor/vendor.toml` as an example. Under `devices` - you want to refer to the devices (that you will add in the next steps). - If you have a temperature and a humidity sensor device (thus two devices), - your `devices` configuration could look like: - `devices = ["temperature.toml", "humidity.toml"]` - -3. **Create device file(s).** In this step you need to create a file for each - device that you configured in the previous step under `devices`. To - continue with the previous example, you would create two files: - * `vendors/my-vendor/devices/temperature.toml` - * `vendors/my-vendor/devices/humidity.toml` - You can use `vendors/example-vendor/devices/example.toml` as an example. - For each firmware version (if there are multiple), make sure to also - configure the `profiles` and `codec` options (if you provide a payload) - codec. For example your `temperature.toml` device configuration could - contain `profiles= ["temperature-eu868.toml", "temperature-us915.toml"]` and - `codec = "temperature.js"` if there a a codec for this device. - -4. **Create profile file(s).** In this step you need to create a file for - each profile that you configured in the previous step for your device(s). - To continue with the previous example, you would create: - * `vendors/my-vendor/profiles/temperature-eu868.toml` - * `vendors/my-vendor/profiles/temperature-us915.toml` - You can use `vendors/example-vendor/profiles/example-EU868.toml` as an - example. - -5. **Create codec file(s).** If you have configured any `codec` options, you - must create these codec files. To continue with the previous example, you - would create a file named `vendors/my-vendor/codecs/temperature.js`. You - can use `vendors/example-vendor/codecs/example.js` as an example. - -6. **Add codec tests (optional).** To validate that the codec returns the - expected output given a certain input you can add tests to your codecs. - To continue with the previous example, you would create two files: - * `vendors/my-vendor/codecs/test_decode_temperature.json` - * `vendors/my-vendor/codecs/test_encode_temperature.json` - Please see `test_decode_example.json` and `test_encode_example.json` in - the `vendors/example-vendor/codecs` directory. - -7. **Run tests.** This validates that the above configuration can be parsed - correctly and that the codec return the expected output. - -## Running the test - -To run the test-runner, execute: - -``` -make test -``` - -This will run all tests within a Docker Compose environment. - ## License This repository is distributed under the MIT license. See also `LICENSE`. diff --git a/docker-compose.yml b/docker-compose.yml index 85a9aa6..b0a9113 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,5 +2,8 @@ services: lorawan-device-profiles: build: context: . + command: --run 'make nix-start' + ports: + - 8090:8090 volumes: - ./:/lorawan-device-profiles diff --git a/interface/Cargo.lock b/interface/Cargo.lock index e78c99a..fdad2ec 100644 --- a/interface/Cargo.lock +++ b/interface/Cargo.lock @@ -229,6 +229,15 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +[[package]] +name = "cc" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +dependencies = [ + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -635,6 +644,7 @@ checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown 0.15.1", + "serde", ] [[package]] @@ -689,8 +699,10 @@ dependencies = [ "mime_guess", "pin-project", "prost", + "rquickjs", "rust-embed", "serde", + "serde_valid", "tokio", "toml", "tonic", @@ -754,6 +766,15 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "object" version = "0.36.5" @@ -769,6 +790,12 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -836,6 +863,27 @@ dependencies = [ "syn", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", +] + [[package]] name = "proc-macro2" version = "1.0.89" @@ -966,6 +1014,40 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "rquickjs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545164e1f038a9d7c774e29e1bb7dd9ad256c18ac920d334ac30e54bd612b5ba" +dependencies = [ + "rquickjs-core", +] + +[[package]] +name = "rquickjs-core" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b253a01317f09a37434b0b7b746711986ab45c2a2f121e7515ce8061eb6b13b0" +dependencies = [ + "relative-path", + "rquickjs-sys", +] + +[[package]] +name = "rquickjs-sys" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec610066ede8fb917e62bd2ff6870451e1b6fa457cf9475ada2edcbf4ddf754c" +dependencies = [ + "cc", +] + [[package]] name = "rust-embed" version = "8.5.0" @@ -1103,6 +1185,51 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_valid" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5766a432e0c90becd28272fed5f24cd42aea2dbddf2d86059aeaee20b16ace57" +dependencies = [ + "indexmap 2.6.0", + "itertools", + "num-traits", + "once_cell", + "paste", + "regex", + "serde", + "serde_json", + "serde_valid_derive", + "serde_valid_literal", + "thiserror", + "unicode-segmentation", +] + +[[package]] +name = "serde_valid_derive" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68d5b451c72740399084db5f2b8e5f54fde555f9b5f3c1a6146f5b9d58516d18" +dependencies = [ + "itertools", + "paste", + "proc-macro-error2", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "serde_valid_literal" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eb34d9e44058a02f71eb285d915179b501efe999b716d437c38b0effc4c2ee" +dependencies = [ + "paste", + "regex", +] + [[package]] name = "sha2" version = "0.10.8" @@ -1114,6 +1241,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "slab" version = "0.4.9" @@ -1181,6 +1314,26 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio" version = "1.41.0" @@ -1450,6 +1603,12 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "utf8parse" version = "0.2.2" diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 1ba2bd3..e5db4f7 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -12,6 +12,7 @@ [dependencies] clap = { version = "4.5", features = ["derive"] } serde = { version = "1.0", features = ["derive"] } + serde_valid = "0.25" toml = "0.8" tonic = "0.12" tonic-web = "0.12" @@ -26,6 +27,7 @@ mime_guess = "2.0" axum = "0.7" anyhow = "1.0" + rquickjs = { version = "0.8", features = ["loader", "array-buffer"] } [build-dependencies] tonic-build = "0.12" diff --git a/interface/api/api.proto b/interface/api/api.proto index c9a9b1a..72c5739 100644 --- a/interface/api/api.proto +++ b/interface/api/api.proto @@ -5,8 +5,8 @@ package api; import "google/protobuf/empty.proto"; service DeviceProfileService { - rpc GetVendor(GetVendorRequest) returns (GetVendorResponse) {} rpc CreateVendor(CreateVendorRequest) returns (google.protobuf.Empty) {} + rpc GetVendor(GetVendorRequest) returns (GetVendorResponse) {} rpc UpdateVendor(UpdateVendorRequest) returns (google.protobuf.Empty) {} rpc ListVendors(google.protobuf.Empty) returns (ListVendorsResponse) {} rpc DeleteVendor(DeleteVendorRequest) returns (google.protobuf.Empty) {} @@ -16,6 +16,55 @@ service DeviceProfileService { rpc UpdateCodec(UpdateCodecRequest) returns (google.protobuf.Empty) {} rpc ListCodecs(ListCodecsRequest) returns (ListCodecsResponse) {} rpc DeleteCodec(DeleteCodecRequest) returns (google.protobuf.Empty) {} + rpc TestCodec(TestCodecRequest) returns (TestCodecResponse) {} + + rpc CreateProfile(CreateProfileRequest) returns (google.protobuf.Empty) {} + rpc GetProfile(GetProfileRequest) returns (GetProfileResponse) {} + rpc UpdateProfile(UpdateProfileRequest) returns (google.protobuf.Empty) {} + rpc ListProfiles(ListProfilesRequest) returns (ListProfilesResponse) {} + rpc DeleteProfile(DeleteProfileRequest) returns (google.protobuf.Empty) {} + + rpc CreateDevice(CreateDeviceRequest) returns (google.protobuf.Empty) {} + rpc GetDevice(GetDeviceRequest) returns (GetDeviceResponse) {} + rpc UpdateDevice(UpdateDeviceRequest) returns (google.protobuf.Empty) {} + rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse) {} + rpc DeleteDevice(DeleteDeviceRequest) returns (google.protobuf.Empty) {} +} + +enum Region { + EU868 = 0; + US915 = 2; + CN779 = 3; + EU433 = 4; + AU915 = 5; + CN470 = 6; + AS923 = 7; + AS923_2 = 12; + AS923_3 = 13; + AS923_4 = 14; + KR920 = 8; + IN865 = 9; + RU864 = 10; + ISM2400 = 11; +} + +enum MacVersion { + LORAWAN_1_0_0 = 0; + LORAWAN_1_0_1 = 1; + LORAWAN_1_0_2 = 2; + LORAWAN_1_0_3 = 3; + LORAWAN_1_0_4 = 4; + LORAWAN_1_1_0 = 5; +} + +enum RegParamsRevision { + A = 0; + B = 1; + RP002_1_0_0 = 2; + RP002_1_0_1 = 3; + RP002_1_0_2 = 4; + RP002_1_0_3 = 5; + RP002_1_0_4 = 6; } message Vendor { @@ -93,3 +142,129 @@ message DeleteCodecRequest { string vendor_dir = 1; string file = 2; } + +message TestCodecRequest { + Codec codec = 1; +} + +message TestCodecResponse { + string error = 1; +} + +message Profile { + string vendor_dir = 1; + string file = 2; + + uint32 id = 3; + Region region = 4; + MacVersion mac_version = 5; + RegParamsRevision reg_params_revision = 6; + bool supports_otaa = 7; + bool supports_class_b = 8; + bool supports_class_c = 9; + uint32 max_eirp = 10; + AbpParams abp = 11; + ClassBParams class_b = 12; + ClassCParams class_c = 13; +} + +message AbpParams { + uint32 rx1_delay = 1; + uint32 rx1_dr_offset = 2; + uint32 rx2_dr = 3; + uint32 rx2_freq = 4; +} + +message ClassBParams { + uint32 timeout_secs = 1; + uint32 ping_slot_nb_k = 2; + uint32 ping_slot_dr = 3; + uint32 ping_slot_freq = 4; +} + +message ClassCParams { + uint32 timeout_secs = 1; +} + +message CreateProfileRequest { + Profile profile = 1; +} + +message GetProfileRequest { + string vendor_dir = 1; + string file = 2; +} + +message GetProfileResponse { + Profile profile = 1; +} + +message UpdateProfileRequest { + Profile profile = 1; +} + +message ListProfilesRequest { + string vendor_dir = 1; +} + +message ListProfilesResponse { + uint32 total_count = 1; + repeated Profile result = 2; +} + +message DeleteProfileRequest { + string vendor_dir = 1; + string file = 2; +} + +message Device { + string vendor_dir = 1; + string file = 2; + + string name = 3; + string description = 4; + repeated DeviceFirmware firmware = 5; + DeviceMetadata metadata = 6; +} + +message DeviceFirmware { + string version = 1; + repeated string profiles = 2; + string codec = 3; +} + +message DeviceMetadata { + string product_url = 1; + string documentation_url = 2; +} + +message CreateDeviceRequest { + Device device = 1; +} + +message GetDeviceRequest { + string vendor_dir = 1; + string file = 2; +} + +message GetDeviceResponse { + Device device = 1; +} + +message UpdateDeviceRequest { + Device device = 1; +} + +message ListDevicesRequest { + string vendor_dir = 1; +} + +message ListDevicesResponse { + uint32 total_count = 1; + repeated Device result = 2; +} + +message DeleteDeviceRequest { + string vendor_dir = 1; + string file = 2; +} diff --git a/interface/api/grpc-web/api_grpc_web_pb.d.ts b/interface/api/grpc-web/api_grpc_web_pb.d.ts index bb2ef74..de16527 100644 --- a/interface/api/grpc-web/api_grpc_web_pb.d.ts +++ b/interface/api/grpc-web/api_grpc_web_pb.d.ts @@ -9,13 +9,6 @@ export class DeviceProfileServiceClient { credentials?: null | { [index: string]: string; }, options?: null | { [index: string]: any; }); - getVendor( - request: api_pb.GetVendorRequest, - metadata: grpcWeb.Metadata | undefined, - callback: (err: grpcWeb.RpcError, - response: api_pb.GetVendorResponse) => void - ): grpcWeb.ClientReadableStream; - createVendor( request: api_pb.CreateVendorRequest, metadata: grpcWeb.Metadata | undefined, @@ -23,6 +16,13 @@ export class DeviceProfileServiceClient { response: google_protobuf_empty_pb.Empty) => void ): grpcWeb.ClientReadableStream; + getVendor( + request: api_pb.GetVendorRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: api_pb.GetVendorResponse) => void + ): grpcWeb.ClientReadableStream; + updateVendor( request: api_pb.UpdateVendorRequest, metadata: grpcWeb.Metadata | undefined, @@ -79,6 +79,83 @@ export class DeviceProfileServiceClient { response: google_protobuf_empty_pb.Empty) => void ): grpcWeb.ClientReadableStream; + testCodec( + request: api_pb.TestCodecRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: api_pb.TestCodecResponse) => void + ): grpcWeb.ClientReadableStream; + + createProfile( + request: api_pb.CreateProfileRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: google_protobuf_empty_pb.Empty) => void + ): grpcWeb.ClientReadableStream; + + getProfile( + request: api_pb.GetProfileRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: api_pb.GetProfileResponse) => void + ): grpcWeb.ClientReadableStream; + + updateProfile( + request: api_pb.UpdateProfileRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: google_protobuf_empty_pb.Empty) => void + ): grpcWeb.ClientReadableStream; + + listProfiles( + request: api_pb.ListProfilesRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: api_pb.ListProfilesResponse) => void + ): grpcWeb.ClientReadableStream; + + deleteProfile( + request: api_pb.DeleteProfileRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: google_protobuf_empty_pb.Empty) => void + ): grpcWeb.ClientReadableStream; + + createDevice( + request: api_pb.CreateDeviceRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: google_protobuf_empty_pb.Empty) => void + ): grpcWeb.ClientReadableStream; + + getDevice( + request: api_pb.GetDeviceRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: api_pb.GetDeviceResponse) => void + ): grpcWeb.ClientReadableStream; + + updateDevice( + request: api_pb.UpdateDeviceRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: google_protobuf_empty_pb.Empty) => void + ): grpcWeb.ClientReadableStream; + + listDevices( + request: api_pb.ListDevicesRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: api_pb.ListDevicesResponse) => void + ): grpcWeb.ClientReadableStream; + + deleteDevice( + request: api_pb.DeleteDeviceRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: google_protobuf_empty_pb.Empty) => void + ): grpcWeb.ClientReadableStream; + } export class DeviceProfileServicePromiseClient { @@ -86,16 +163,16 @@ export class DeviceProfileServicePromiseClient { credentials?: null | { [index: string]: string; }, options?: null | { [index: string]: any; }); - getVendor( - request: api_pb.GetVendorRequest, - metadata?: grpcWeb.Metadata - ): Promise; - createVendor( request: api_pb.CreateVendorRequest, metadata?: grpcWeb.Metadata ): Promise; + getVendor( + request: api_pb.GetVendorRequest, + metadata?: grpcWeb.Metadata + ): Promise; + updateVendor( request: api_pb.UpdateVendorRequest, metadata?: grpcWeb.Metadata @@ -136,5 +213,60 @@ export class DeviceProfileServicePromiseClient { metadata?: grpcWeb.Metadata ): Promise; + testCodec( + request: api_pb.TestCodecRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + createProfile( + request: api_pb.CreateProfileRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + getProfile( + request: api_pb.GetProfileRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + updateProfile( + request: api_pb.UpdateProfileRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + listProfiles( + request: api_pb.ListProfilesRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + deleteProfile( + request: api_pb.DeleteProfileRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + createDevice( + request: api_pb.CreateDeviceRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + getDevice( + request: api_pb.GetDeviceRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + updateDevice( + request: api_pb.UpdateDeviceRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + listDevices( + request: api_pb.ListDevicesRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + deleteDevice( + request: api_pb.DeleteDeviceRequest, + metadata?: grpcWeb.Metadata + ): Promise; + } diff --git a/interface/api/grpc-web/api_grpc_web_pb.js b/interface/api/grpc-web/api_grpc_web_pb.js index d8468b1..48eccfa 100644 --- a/interface/api/grpc-web/api_grpc_web_pb.js +++ b/interface/api/grpc-web/api_grpc_web_pb.js @@ -79,122 +79,122 @@ proto.api.DeviceProfileServicePromiseClient = /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.api.GetVendorRequest, - * !proto.api.GetVendorResponse>} + * !proto.api.CreateVendorRequest, + * !proto.google.protobuf.Empty>} */ -const methodDescriptor_DeviceProfileService_GetVendor = new grpc.web.MethodDescriptor( - '/api.DeviceProfileService/GetVendor', +const methodDescriptor_DeviceProfileService_CreateVendor = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/CreateVendor', grpc.web.MethodType.UNARY, - proto.api.GetVendorRequest, - proto.api.GetVendorResponse, + proto.api.CreateVendorRequest, + google_protobuf_empty_pb.Empty, /** - * @param {!proto.api.GetVendorRequest} request + * @param {!proto.api.CreateVendorRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - proto.api.GetVendorResponse.deserializeBinary + google_protobuf_empty_pb.Empty.deserializeBinary ); /** - * @param {!proto.api.GetVendorRequest} request The + * @param {!proto.api.CreateVendorRequest} request The * request proto * @param {?Object} metadata User defined * call metadata - * @param {function(?grpc.web.RpcError, ?proto.api.GetVendorResponse)} + * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} + * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ -proto.api.DeviceProfileServiceClient.prototype.getVendor = +proto.api.DeviceProfileServiceClient.prototype.createVendor = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + - '/api.DeviceProfileService/GetVendor', + '/api.DeviceProfileService/CreateVendor', request, metadata || {}, - methodDescriptor_DeviceProfileService_GetVendor, + methodDescriptor_DeviceProfileService_CreateVendor, callback); }; /** - * @param {!proto.api.GetVendorRequest} request The + * @param {!proto.api.CreateVendorRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata - * @return {!Promise} + * @return {!Promise} * Promise that resolves to the response */ -proto.api.DeviceProfileServicePromiseClient.prototype.getVendor = +proto.api.DeviceProfileServicePromiseClient.prototype.createVendor = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + - '/api.DeviceProfileService/GetVendor', + '/api.DeviceProfileService/CreateVendor', request, metadata || {}, - methodDescriptor_DeviceProfileService_GetVendor); + methodDescriptor_DeviceProfileService_CreateVendor); }; /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.api.CreateVendorRequest, - * !proto.google.protobuf.Empty>} + * !proto.api.GetVendorRequest, + * !proto.api.GetVendorResponse>} */ -const methodDescriptor_DeviceProfileService_CreateVendor = new grpc.web.MethodDescriptor( - '/api.DeviceProfileService/CreateVendor', +const methodDescriptor_DeviceProfileService_GetVendor = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/GetVendor', grpc.web.MethodType.UNARY, - proto.api.CreateVendorRequest, - google_protobuf_empty_pb.Empty, + proto.api.GetVendorRequest, + proto.api.GetVendorResponse, /** - * @param {!proto.api.CreateVendorRequest} request + * @param {!proto.api.GetVendorRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - google_protobuf_empty_pb.Empty.deserializeBinary + proto.api.GetVendorResponse.deserializeBinary ); /** - * @param {!proto.api.CreateVendorRequest} request The + * @param {!proto.api.GetVendorRequest} request The * request proto * @param {?Object} metadata User defined * call metadata - * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} + * @param {function(?grpc.web.RpcError, ?proto.api.GetVendorResponse)} * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} + * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ -proto.api.DeviceProfileServiceClient.prototype.createVendor = +proto.api.DeviceProfileServiceClient.prototype.getVendor = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + - '/api.DeviceProfileService/CreateVendor', + '/api.DeviceProfileService/GetVendor', request, metadata || {}, - methodDescriptor_DeviceProfileService_CreateVendor, + methodDescriptor_DeviceProfileService_GetVendor, callback); }; /** - * @param {!proto.api.CreateVendorRequest} request The + * @param {!proto.api.GetVendorRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata - * @return {!Promise} + * @return {!Promise} * Promise that resolves to the response */ -proto.api.DeviceProfileServicePromiseClient.prototype.createVendor = +proto.api.DeviceProfileServicePromiseClient.prototype.getVendor = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + - '/api.DeviceProfileService/CreateVendor', + '/api.DeviceProfileService/GetVendor', request, metadata || {}, - methodDescriptor_DeviceProfileService_CreateVendor); + methodDescriptor_DeviceProfileService_GetVendor); }; @@ -686,5 +686,676 @@ proto.api.DeviceProfileServicePromiseClient.prototype.deleteCodec = }; +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.TestCodecRequest, + * !proto.api.TestCodecResponse>} + */ +const methodDescriptor_DeviceProfileService_TestCodec = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/TestCodec', + grpc.web.MethodType.UNARY, + proto.api.TestCodecRequest, + proto.api.TestCodecResponse, + /** + * @param {!proto.api.TestCodecRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.TestCodecResponse.deserializeBinary +); + + +/** + * @param {!proto.api.TestCodecRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.api.TestCodecResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.testCodec = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/TestCodec', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_TestCodec, + callback); +}; + + +/** + * @param {!proto.api.TestCodecRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.testCodec = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/TestCodec', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_TestCodec); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.CreateProfileRequest, + * !proto.google.protobuf.Empty>} + */ +const methodDescriptor_DeviceProfileService_CreateProfile = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/CreateProfile', + grpc.web.MethodType.UNARY, + proto.api.CreateProfileRequest, + google_protobuf_empty_pb.Empty, + /** + * @param {!proto.api.CreateProfileRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.api.CreateProfileRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.createProfile = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/CreateProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_CreateProfile, + callback); +}; + + +/** + * @param {!proto.api.CreateProfileRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.createProfile = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/CreateProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_CreateProfile); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.GetProfileRequest, + * !proto.api.GetProfileResponse>} + */ +const methodDescriptor_DeviceProfileService_GetProfile = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/GetProfile', + grpc.web.MethodType.UNARY, + proto.api.GetProfileRequest, + proto.api.GetProfileResponse, + /** + * @param {!proto.api.GetProfileRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.GetProfileResponse.deserializeBinary +); + + +/** + * @param {!proto.api.GetProfileRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.api.GetProfileResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.getProfile = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/GetProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_GetProfile, + callback); +}; + + +/** + * @param {!proto.api.GetProfileRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.getProfile = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/GetProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_GetProfile); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.UpdateProfileRequest, + * !proto.google.protobuf.Empty>} + */ +const methodDescriptor_DeviceProfileService_UpdateProfile = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/UpdateProfile', + grpc.web.MethodType.UNARY, + proto.api.UpdateProfileRequest, + google_protobuf_empty_pb.Empty, + /** + * @param {!proto.api.UpdateProfileRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.api.UpdateProfileRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.updateProfile = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/UpdateProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_UpdateProfile, + callback); +}; + + +/** + * @param {!proto.api.UpdateProfileRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.updateProfile = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/UpdateProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_UpdateProfile); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.ListProfilesRequest, + * !proto.api.ListProfilesResponse>} + */ +const methodDescriptor_DeviceProfileService_ListProfiles = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/ListProfiles', + grpc.web.MethodType.UNARY, + proto.api.ListProfilesRequest, + proto.api.ListProfilesResponse, + /** + * @param {!proto.api.ListProfilesRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.ListProfilesResponse.deserializeBinary +); + + +/** + * @param {!proto.api.ListProfilesRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.api.ListProfilesResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.listProfiles = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/ListProfiles', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_ListProfiles, + callback); +}; + + +/** + * @param {!proto.api.ListProfilesRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.listProfiles = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/ListProfiles', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_ListProfiles); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.DeleteProfileRequest, + * !proto.google.protobuf.Empty>} + */ +const methodDescriptor_DeviceProfileService_DeleteProfile = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/DeleteProfile', + grpc.web.MethodType.UNARY, + proto.api.DeleteProfileRequest, + google_protobuf_empty_pb.Empty, + /** + * @param {!proto.api.DeleteProfileRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.api.DeleteProfileRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.deleteProfile = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/DeleteProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_DeleteProfile, + callback); +}; + + +/** + * @param {!proto.api.DeleteProfileRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.deleteProfile = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/DeleteProfile', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_DeleteProfile); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.CreateDeviceRequest, + * !proto.google.protobuf.Empty>} + */ +const methodDescriptor_DeviceProfileService_CreateDevice = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/CreateDevice', + grpc.web.MethodType.UNARY, + proto.api.CreateDeviceRequest, + google_protobuf_empty_pb.Empty, + /** + * @param {!proto.api.CreateDeviceRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.api.CreateDeviceRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.createDevice = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/CreateDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_CreateDevice, + callback); +}; + + +/** + * @param {!proto.api.CreateDeviceRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.createDevice = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/CreateDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_CreateDevice); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.GetDeviceRequest, + * !proto.api.GetDeviceResponse>} + */ +const methodDescriptor_DeviceProfileService_GetDevice = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/GetDevice', + grpc.web.MethodType.UNARY, + proto.api.GetDeviceRequest, + proto.api.GetDeviceResponse, + /** + * @param {!proto.api.GetDeviceRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.GetDeviceResponse.deserializeBinary +); + + +/** + * @param {!proto.api.GetDeviceRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.api.GetDeviceResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.getDevice = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/GetDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_GetDevice, + callback); +}; + + +/** + * @param {!proto.api.GetDeviceRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.getDevice = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/GetDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_GetDevice); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.UpdateDeviceRequest, + * !proto.google.protobuf.Empty>} + */ +const methodDescriptor_DeviceProfileService_UpdateDevice = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/UpdateDevice', + grpc.web.MethodType.UNARY, + proto.api.UpdateDeviceRequest, + google_protobuf_empty_pb.Empty, + /** + * @param {!proto.api.UpdateDeviceRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.api.UpdateDeviceRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.updateDevice = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/UpdateDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_UpdateDevice, + callback); +}; + + +/** + * @param {!proto.api.UpdateDeviceRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.updateDevice = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/UpdateDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_UpdateDevice); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.ListDevicesRequest, + * !proto.api.ListDevicesResponse>} + */ +const methodDescriptor_DeviceProfileService_ListDevices = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/ListDevices', + grpc.web.MethodType.UNARY, + proto.api.ListDevicesRequest, + proto.api.ListDevicesResponse, + /** + * @param {!proto.api.ListDevicesRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.ListDevicesResponse.deserializeBinary +); + + +/** + * @param {!proto.api.ListDevicesRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.api.ListDevicesResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.listDevices = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/ListDevices', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_ListDevices, + callback); +}; + + +/** + * @param {!proto.api.ListDevicesRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.listDevices = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/ListDevices', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_ListDevices); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.DeleteDeviceRequest, + * !proto.google.protobuf.Empty>} + */ +const methodDescriptor_DeviceProfileService_DeleteDevice = new grpc.web.MethodDescriptor( + '/api.DeviceProfileService/DeleteDevice', + grpc.web.MethodType.UNARY, + proto.api.DeleteDeviceRequest, + google_protobuf_empty_pb.Empty, + /** + * @param {!proto.api.DeleteDeviceRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.api.DeleteDeviceRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceProfileServiceClient.prototype.deleteDevice = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceProfileService/DeleteDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_DeleteDevice, + callback); +}; + + +/** + * @param {!proto.api.DeleteDeviceRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceProfileServicePromiseClient.prototype.deleteDevice = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceProfileService/DeleteDevice', + request, + metadata || {}, + methodDescriptor_DeviceProfileService_DeleteDevice); +}; + + module.exports = proto.api; diff --git a/interface/api/grpc-web/api_pb.d.ts b/interface/api/grpc-web/api_pb.d.ts index 1a92317..260e044 100644 --- a/interface/api/grpc-web/api_pb.d.ts +++ b/interface/api/grpc-web/api_pb.d.ts @@ -359,3 +359,608 @@ export namespace DeleteCodecRequest { } } +export class TestCodecRequest extends jspb.Message { + getCodec(): Codec | undefined; + setCodec(value?: Codec): TestCodecRequest; + hasCodec(): boolean; + clearCodec(): TestCodecRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TestCodecRequest.AsObject; + static toObject(includeInstance: boolean, msg: TestCodecRequest): TestCodecRequest.AsObject; + static serializeBinaryToWriter(message: TestCodecRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TestCodecRequest; + static deserializeBinaryFromReader(message: TestCodecRequest, reader: jspb.BinaryReader): TestCodecRequest; +} + +export namespace TestCodecRequest { + export type AsObject = { + codec?: Codec.AsObject, + } +} + +export class TestCodecResponse extends jspb.Message { + getError(): string; + setError(value: string): TestCodecResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TestCodecResponse.AsObject; + static toObject(includeInstance: boolean, msg: TestCodecResponse): TestCodecResponse.AsObject; + static serializeBinaryToWriter(message: TestCodecResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TestCodecResponse; + static deserializeBinaryFromReader(message: TestCodecResponse, reader: jspb.BinaryReader): TestCodecResponse; +} + +export namespace TestCodecResponse { + export type AsObject = { + error: string, + } +} + +export class Profile extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): Profile; + + getFile(): string; + setFile(value: string): Profile; + + getId(): number; + setId(value: number): Profile; + + getRegion(): Region; + setRegion(value: Region): Profile; + + getMacVersion(): MacVersion; + setMacVersion(value: MacVersion): Profile; + + getRegParamsRevision(): RegParamsRevision; + setRegParamsRevision(value: RegParamsRevision): Profile; + + getSupportsOtaa(): boolean; + setSupportsOtaa(value: boolean): Profile; + + getSupportsClassB(): boolean; + setSupportsClassB(value: boolean): Profile; + + getSupportsClassC(): boolean; + setSupportsClassC(value: boolean): Profile; + + getMaxEirp(): number; + setMaxEirp(value: number): Profile; + + getAbp(): AbpParams | undefined; + setAbp(value?: AbpParams): Profile; + hasAbp(): boolean; + clearAbp(): Profile; + + getClassB(): ClassBParams | undefined; + setClassB(value?: ClassBParams): Profile; + hasClassB(): boolean; + clearClassB(): Profile; + + getClassC(): ClassCParams | undefined; + setClassC(value?: ClassCParams): Profile; + hasClassC(): boolean; + clearClassC(): Profile; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Profile.AsObject; + static toObject(includeInstance: boolean, msg: Profile): Profile.AsObject; + static serializeBinaryToWriter(message: Profile, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Profile; + static deserializeBinaryFromReader(message: Profile, reader: jspb.BinaryReader): Profile; +} + +export namespace Profile { + export type AsObject = { + vendorDir: string, + file: string, + id: number, + region: Region, + macVersion: MacVersion, + regParamsRevision: RegParamsRevision, + supportsOtaa: boolean, + supportsClassB: boolean, + supportsClassC: boolean, + maxEirp: number, + abp?: AbpParams.AsObject, + classB?: ClassBParams.AsObject, + classC?: ClassCParams.AsObject, + } +} + +export class AbpParams extends jspb.Message { + getRx1Delay(): number; + setRx1Delay(value: number): AbpParams; + + getRx1DrOffset(): number; + setRx1DrOffset(value: number): AbpParams; + + getRx2Dr(): number; + setRx2Dr(value: number): AbpParams; + + getRx2Freq(): number; + setRx2Freq(value: number): AbpParams; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AbpParams.AsObject; + static toObject(includeInstance: boolean, msg: AbpParams): AbpParams.AsObject; + static serializeBinaryToWriter(message: AbpParams, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AbpParams; + static deserializeBinaryFromReader(message: AbpParams, reader: jspb.BinaryReader): AbpParams; +} + +export namespace AbpParams { + export type AsObject = { + rx1Delay: number, + rx1DrOffset: number, + rx2Dr: number, + rx2Freq: number, + } +} + +export class ClassBParams extends jspb.Message { + getTimeoutSecs(): number; + setTimeoutSecs(value: number): ClassBParams; + + getPingSlotNbK(): number; + setPingSlotNbK(value: number): ClassBParams; + + getPingSlotDr(): number; + setPingSlotDr(value: number): ClassBParams; + + getPingSlotFreq(): number; + setPingSlotFreq(value: number): ClassBParams; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClassBParams.AsObject; + static toObject(includeInstance: boolean, msg: ClassBParams): ClassBParams.AsObject; + static serializeBinaryToWriter(message: ClassBParams, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClassBParams; + static deserializeBinaryFromReader(message: ClassBParams, reader: jspb.BinaryReader): ClassBParams; +} + +export namespace ClassBParams { + export type AsObject = { + timeoutSecs: number, + pingSlotNbK: number, + pingSlotDr: number, + pingSlotFreq: number, + } +} + +export class ClassCParams extends jspb.Message { + getTimeoutSecs(): number; + setTimeoutSecs(value: number): ClassCParams; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClassCParams.AsObject; + static toObject(includeInstance: boolean, msg: ClassCParams): ClassCParams.AsObject; + static serializeBinaryToWriter(message: ClassCParams, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClassCParams; + static deserializeBinaryFromReader(message: ClassCParams, reader: jspb.BinaryReader): ClassCParams; +} + +export namespace ClassCParams { + export type AsObject = { + timeoutSecs: number, + } +} + +export class CreateProfileRequest extends jspb.Message { + getProfile(): Profile | undefined; + setProfile(value?: Profile): CreateProfileRequest; + hasProfile(): boolean; + clearProfile(): CreateProfileRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateProfileRequest.AsObject; + static toObject(includeInstance: boolean, msg: CreateProfileRequest): CreateProfileRequest.AsObject; + static serializeBinaryToWriter(message: CreateProfileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateProfileRequest; + static deserializeBinaryFromReader(message: CreateProfileRequest, reader: jspb.BinaryReader): CreateProfileRequest; +} + +export namespace CreateProfileRequest { + export type AsObject = { + profile?: Profile.AsObject, + } +} + +export class GetProfileRequest extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): GetProfileRequest; + + getFile(): string; + setFile(value: string): GetProfileRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetProfileRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetProfileRequest): GetProfileRequest.AsObject; + static serializeBinaryToWriter(message: GetProfileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetProfileRequest; + static deserializeBinaryFromReader(message: GetProfileRequest, reader: jspb.BinaryReader): GetProfileRequest; +} + +export namespace GetProfileRequest { + export type AsObject = { + vendorDir: string, + file: string, + } +} + +export class GetProfileResponse extends jspb.Message { + getProfile(): Profile | undefined; + setProfile(value?: Profile): GetProfileResponse; + hasProfile(): boolean; + clearProfile(): GetProfileResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetProfileResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetProfileResponse): GetProfileResponse.AsObject; + static serializeBinaryToWriter(message: GetProfileResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetProfileResponse; + static deserializeBinaryFromReader(message: GetProfileResponse, reader: jspb.BinaryReader): GetProfileResponse; +} + +export namespace GetProfileResponse { + export type AsObject = { + profile?: Profile.AsObject, + } +} + +export class UpdateProfileRequest extends jspb.Message { + getProfile(): Profile | undefined; + setProfile(value?: Profile): UpdateProfileRequest; + hasProfile(): boolean; + clearProfile(): UpdateProfileRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UpdateProfileRequest.AsObject; + static toObject(includeInstance: boolean, msg: UpdateProfileRequest): UpdateProfileRequest.AsObject; + static serializeBinaryToWriter(message: UpdateProfileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UpdateProfileRequest; + static deserializeBinaryFromReader(message: UpdateProfileRequest, reader: jspb.BinaryReader): UpdateProfileRequest; +} + +export namespace UpdateProfileRequest { + export type AsObject = { + profile?: Profile.AsObject, + } +} + +export class ListProfilesRequest extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): ListProfilesRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListProfilesRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListProfilesRequest): ListProfilesRequest.AsObject; + static serializeBinaryToWriter(message: ListProfilesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListProfilesRequest; + static deserializeBinaryFromReader(message: ListProfilesRequest, reader: jspb.BinaryReader): ListProfilesRequest; +} + +export namespace ListProfilesRequest { + export type AsObject = { + vendorDir: string, + } +} + +export class ListProfilesResponse extends jspb.Message { + getTotalCount(): number; + setTotalCount(value: number): ListProfilesResponse; + + getResultList(): Array; + setResultList(value: Array): ListProfilesResponse; + clearResultList(): ListProfilesResponse; + addResult(value?: Profile, index?: number): Profile; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListProfilesResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListProfilesResponse): ListProfilesResponse.AsObject; + static serializeBinaryToWriter(message: ListProfilesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListProfilesResponse; + static deserializeBinaryFromReader(message: ListProfilesResponse, reader: jspb.BinaryReader): ListProfilesResponse; +} + +export namespace ListProfilesResponse { + export type AsObject = { + totalCount: number, + resultList: Array, + } +} + +export class DeleteProfileRequest extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): DeleteProfileRequest; + + getFile(): string; + setFile(value: string): DeleteProfileRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeleteProfileRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeleteProfileRequest): DeleteProfileRequest.AsObject; + static serializeBinaryToWriter(message: DeleteProfileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeleteProfileRequest; + static deserializeBinaryFromReader(message: DeleteProfileRequest, reader: jspb.BinaryReader): DeleteProfileRequest; +} + +export namespace DeleteProfileRequest { + export type AsObject = { + vendorDir: string, + file: string, + } +} + +export class Device extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): Device; + + getFile(): string; + setFile(value: string): Device; + + getName(): string; + setName(value: string): Device; + + getDescription(): string; + setDescription(value: string): Device; + + getFirmwareList(): Array; + setFirmwareList(value: Array): Device; + clearFirmwareList(): Device; + addFirmware(value?: DeviceFirmware, index?: number): DeviceFirmware; + + getMetadata(): DeviceMetadata | undefined; + setMetadata(value?: DeviceMetadata): Device; + hasMetadata(): boolean; + clearMetadata(): Device; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Device.AsObject; + static toObject(includeInstance: boolean, msg: Device): Device.AsObject; + static serializeBinaryToWriter(message: Device, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Device; + static deserializeBinaryFromReader(message: Device, reader: jspb.BinaryReader): Device; +} + +export namespace Device { + export type AsObject = { + vendorDir: string, + file: string, + name: string, + description: string, + firmwareList: Array, + metadata?: DeviceMetadata.AsObject, + } +} + +export class DeviceFirmware extends jspb.Message { + getVersion(): string; + setVersion(value: string): DeviceFirmware; + + getProfilesList(): Array; + setProfilesList(value: Array): DeviceFirmware; + clearProfilesList(): DeviceFirmware; + addProfiles(value: string, index?: number): DeviceFirmware; + + getCodec(): string; + setCodec(value: string): DeviceFirmware; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeviceFirmware.AsObject; + static toObject(includeInstance: boolean, msg: DeviceFirmware): DeviceFirmware.AsObject; + static serializeBinaryToWriter(message: DeviceFirmware, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeviceFirmware; + static deserializeBinaryFromReader(message: DeviceFirmware, reader: jspb.BinaryReader): DeviceFirmware; +} + +export namespace DeviceFirmware { + export type AsObject = { + version: string, + profilesList: Array, + codec: string, + } +} + +export class DeviceMetadata extends jspb.Message { + getProductUrl(): string; + setProductUrl(value: string): DeviceMetadata; + + getDocumentationUrl(): string; + setDocumentationUrl(value: string): DeviceMetadata; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeviceMetadata.AsObject; + static toObject(includeInstance: boolean, msg: DeviceMetadata): DeviceMetadata.AsObject; + static serializeBinaryToWriter(message: DeviceMetadata, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeviceMetadata; + static deserializeBinaryFromReader(message: DeviceMetadata, reader: jspb.BinaryReader): DeviceMetadata; +} + +export namespace DeviceMetadata { + export type AsObject = { + productUrl: string, + documentationUrl: string, + } +} + +export class CreateDeviceRequest extends jspb.Message { + getDevice(): Device | undefined; + setDevice(value?: Device): CreateDeviceRequest; + hasDevice(): boolean; + clearDevice(): CreateDeviceRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateDeviceRequest.AsObject; + static toObject(includeInstance: boolean, msg: CreateDeviceRequest): CreateDeviceRequest.AsObject; + static serializeBinaryToWriter(message: CreateDeviceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateDeviceRequest; + static deserializeBinaryFromReader(message: CreateDeviceRequest, reader: jspb.BinaryReader): CreateDeviceRequest; +} + +export namespace CreateDeviceRequest { + export type AsObject = { + device?: Device.AsObject, + } +} + +export class GetDeviceRequest extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): GetDeviceRequest; + + getFile(): string; + setFile(value: string): GetDeviceRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDeviceRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceRequest): GetDeviceRequest.AsObject; + static serializeBinaryToWriter(message: GetDeviceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceRequest; + static deserializeBinaryFromReader(message: GetDeviceRequest, reader: jspb.BinaryReader): GetDeviceRequest; +} + +export namespace GetDeviceRequest { + export type AsObject = { + vendorDir: string, + file: string, + } +} + +export class GetDeviceResponse extends jspb.Message { + getDevice(): Device | undefined; + setDevice(value?: Device): GetDeviceResponse; + hasDevice(): boolean; + clearDevice(): GetDeviceResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDeviceResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceResponse): GetDeviceResponse.AsObject; + static serializeBinaryToWriter(message: GetDeviceResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceResponse; + static deserializeBinaryFromReader(message: GetDeviceResponse, reader: jspb.BinaryReader): GetDeviceResponse; +} + +export namespace GetDeviceResponse { + export type AsObject = { + device?: Device.AsObject, + } +} + +export class UpdateDeviceRequest extends jspb.Message { + getDevice(): Device | undefined; + setDevice(value?: Device): UpdateDeviceRequest; + hasDevice(): boolean; + clearDevice(): UpdateDeviceRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UpdateDeviceRequest.AsObject; + static toObject(includeInstance: boolean, msg: UpdateDeviceRequest): UpdateDeviceRequest.AsObject; + static serializeBinaryToWriter(message: UpdateDeviceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UpdateDeviceRequest; + static deserializeBinaryFromReader(message: UpdateDeviceRequest, reader: jspb.BinaryReader): UpdateDeviceRequest; +} + +export namespace UpdateDeviceRequest { + export type AsObject = { + device?: Device.AsObject, + } +} + +export class ListDevicesRequest extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): ListDevicesRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListDevicesRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListDevicesRequest): ListDevicesRequest.AsObject; + static serializeBinaryToWriter(message: ListDevicesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListDevicesRequest; + static deserializeBinaryFromReader(message: ListDevicesRequest, reader: jspb.BinaryReader): ListDevicesRequest; +} + +export namespace ListDevicesRequest { + export type AsObject = { + vendorDir: string, + } +} + +export class ListDevicesResponse extends jspb.Message { + getTotalCount(): number; + setTotalCount(value: number): ListDevicesResponse; + + getResultList(): Array; + setResultList(value: Array): ListDevicesResponse; + clearResultList(): ListDevicesResponse; + addResult(value?: Device, index?: number): Device; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListDevicesResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListDevicesResponse): ListDevicesResponse.AsObject; + static serializeBinaryToWriter(message: ListDevicesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListDevicesResponse; + static deserializeBinaryFromReader(message: ListDevicesResponse, reader: jspb.BinaryReader): ListDevicesResponse; +} + +export namespace ListDevicesResponse { + export type AsObject = { + totalCount: number, + resultList: Array, + } +} + +export class DeleteDeviceRequest extends jspb.Message { + getVendorDir(): string; + setVendorDir(value: string): DeleteDeviceRequest; + + getFile(): string; + setFile(value: string): DeleteDeviceRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeleteDeviceRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeleteDeviceRequest): DeleteDeviceRequest.AsObject; + static serializeBinaryToWriter(message: DeleteDeviceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeleteDeviceRequest; + static deserializeBinaryFromReader(message: DeleteDeviceRequest, reader: jspb.BinaryReader): DeleteDeviceRequest; +} + +export namespace DeleteDeviceRequest { + export type AsObject = { + vendorDir: string, + file: string, + } +} + +export enum Region { + EU868 = 0, + US915 = 2, + CN779 = 3, + EU433 = 4, + AU915 = 5, + CN470 = 6, + AS923 = 7, + AS923_2 = 12, + AS923_3 = 13, + AS923_4 = 14, + KR920 = 8, + IN865 = 9, + RU864 = 10, + ISM2400 = 11, +} +export enum MacVersion { + LORAWAN_1_0_0 = 0, + LORAWAN_1_0_1 = 1, + LORAWAN_1_0_2 = 2, + LORAWAN_1_0_3 = 3, + LORAWAN_1_0_4 = 4, + LORAWAN_1_1_0 = 5, +} +export enum RegParamsRevision { + A = 0, + B = 1, + RP002_1_0_0 = 2, + RP002_1_0_1 = 3, + RP002_1_0_2 = 4, + RP002_1_0_3 = 5, + RP002_1_0_4 = 6, +} diff --git a/interface/api/grpc-web/api_pb.js b/interface/api/grpc-web/api_pb.js index 1304d33..f340fbe 100644 --- a/interface/api/grpc-web/api_pb.js +++ b/interface/api/grpc-web/api_pb.js @@ -23,19 +23,45 @@ var global = (function() { var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); goog.object.extend(proto, google_protobuf_empty_pb); +goog.exportSymbol('proto.api.AbpParams', null, global); +goog.exportSymbol('proto.api.ClassBParams', null, global); +goog.exportSymbol('proto.api.ClassCParams', null, global); goog.exportSymbol('proto.api.Codec', null, global); goog.exportSymbol('proto.api.CreateCodecRequest', null, global); +goog.exportSymbol('proto.api.CreateDeviceRequest', null, global); +goog.exportSymbol('proto.api.CreateProfileRequest', null, global); goog.exportSymbol('proto.api.CreateVendorRequest', null, global); goog.exportSymbol('proto.api.DeleteCodecRequest', null, global); +goog.exportSymbol('proto.api.DeleteDeviceRequest', null, global); +goog.exportSymbol('proto.api.DeleteProfileRequest', null, global); goog.exportSymbol('proto.api.DeleteVendorRequest', null, global); +goog.exportSymbol('proto.api.Device', null, global); +goog.exportSymbol('proto.api.DeviceFirmware', null, global); +goog.exportSymbol('proto.api.DeviceMetadata', null, global); goog.exportSymbol('proto.api.GetCodecRequest', null, global); goog.exportSymbol('proto.api.GetCodecResponse', null, global); +goog.exportSymbol('proto.api.GetDeviceRequest', null, global); +goog.exportSymbol('proto.api.GetDeviceResponse', null, global); +goog.exportSymbol('proto.api.GetProfileRequest', null, global); +goog.exportSymbol('proto.api.GetProfileResponse', null, global); goog.exportSymbol('proto.api.GetVendorRequest', null, global); goog.exportSymbol('proto.api.GetVendorResponse', null, global); goog.exportSymbol('proto.api.ListCodecsRequest', null, global); goog.exportSymbol('proto.api.ListCodecsResponse', null, global); +goog.exportSymbol('proto.api.ListDevicesRequest', null, global); +goog.exportSymbol('proto.api.ListDevicesResponse', null, global); +goog.exportSymbol('proto.api.ListProfilesRequest', null, global); +goog.exportSymbol('proto.api.ListProfilesResponse', null, global); goog.exportSymbol('proto.api.ListVendorsResponse', null, global); +goog.exportSymbol('proto.api.MacVersion', null, global); +goog.exportSymbol('proto.api.Profile', null, global); +goog.exportSymbol('proto.api.RegParamsRevision', null, global); +goog.exportSymbol('proto.api.Region', null, global); +goog.exportSymbol('proto.api.TestCodecRequest', null, global); +goog.exportSymbol('proto.api.TestCodecResponse', null, global); goog.exportSymbol('proto.api.UpdateCodecRequest', null, global); +goog.exportSymbol('proto.api.UpdateDeviceRequest', null, global); +goog.exportSymbol('proto.api.UpdateProfileRequest', null, global); goog.exportSymbol('proto.api.UpdateVendorRequest', null, global); goog.exportSymbol('proto.api.Vendor', null, global); goog.exportSymbol('proto.api.VendorMetadata', null, global); @@ -375,13 +401,4566 @@ if (goog.DEBUG && !COMPILED) { */ proto.api.DeleteCodecRequest.displayName = 'proto.api.DeleteCodecRequest'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.TestCodecRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.TestCodecRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.TestCodecRequest.displayName = 'proto.api.TestCodecRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.TestCodecResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.TestCodecResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.TestCodecResponse.displayName = 'proto.api.TestCodecResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.Profile = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.Profile, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.Profile.displayName = 'proto.api.Profile'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.AbpParams = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.AbpParams, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.AbpParams.displayName = 'proto.api.AbpParams'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.ClassBParams = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.ClassBParams, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.ClassBParams.displayName = 'proto.api.ClassBParams'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.ClassCParams = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.ClassCParams, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.ClassCParams.displayName = 'proto.api.ClassCParams'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.CreateProfileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.CreateProfileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.CreateProfileRequest.displayName = 'proto.api.CreateProfileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetProfileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetProfileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetProfileRequest.displayName = 'proto.api.GetProfileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetProfileResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetProfileResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetProfileResponse.displayName = 'proto.api.GetProfileResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.UpdateProfileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.UpdateProfileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.UpdateProfileRequest.displayName = 'proto.api.UpdateProfileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.ListProfilesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.ListProfilesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.ListProfilesRequest.displayName = 'proto.api.ListProfilesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.ListProfilesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.ListProfilesResponse.repeatedFields_, null); +}; +goog.inherits(proto.api.ListProfilesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.ListProfilesResponse.displayName = 'proto.api.ListProfilesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.DeleteProfileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.DeleteProfileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.DeleteProfileRequest.displayName = 'proto.api.DeleteProfileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.Device = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Device.repeatedFields_, null); +}; +goog.inherits(proto.api.Device, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.Device.displayName = 'proto.api.Device'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.DeviceFirmware = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.DeviceFirmware.repeatedFields_, null); +}; +goog.inherits(proto.api.DeviceFirmware, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.DeviceFirmware.displayName = 'proto.api.DeviceFirmware'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.DeviceMetadata = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.DeviceMetadata, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.DeviceMetadata.displayName = 'proto.api.DeviceMetadata'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.CreateDeviceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.CreateDeviceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.CreateDeviceRequest.displayName = 'proto.api.CreateDeviceRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetDeviceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetDeviceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetDeviceRequest.displayName = 'proto.api.GetDeviceRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetDeviceResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetDeviceResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetDeviceResponse.displayName = 'proto.api.GetDeviceResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.UpdateDeviceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.UpdateDeviceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.UpdateDeviceRequest.displayName = 'proto.api.UpdateDeviceRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.ListDevicesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.ListDevicesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.ListDevicesRequest.displayName = 'proto.api.ListDevicesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.ListDevicesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.ListDevicesResponse.repeatedFields_, null); +}; +goog.inherits(proto.api.ListDevicesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.ListDevicesResponse.displayName = 'proto.api.ListDevicesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.DeleteDeviceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.DeleteDeviceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.DeleteDeviceRequest.displayName = 'proto.api.DeleteDeviceRequest'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.api.Vendor.repeatedFields_ = [4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.Vendor.prototype.toObject = function(opt_includeInstance) { + return proto.api.Vendor.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Vendor} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Vendor.toObject = function(includeInstance, msg) { + var f, obj = { + dir: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + loraAllianceVendorId: jspb.Message.getFieldWithDefault(msg, 3, 0), + ouisList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + metadata: (f = msg.getMetadata()) && proto.api.VendorMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.Vendor} + */ +proto.api.Vendor.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.Vendor; + return proto.api.Vendor.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.Vendor} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.Vendor} + */ +proto.api.Vendor.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setDir(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLoraAllianceVendorId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addOuis(value); + break; + case 5: + var value = new proto.api.VendorMetadata; + reader.readMessage(value,proto.api.VendorMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.Vendor.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.Vendor.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.Vendor} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Vendor.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getLoraAllianceVendorId(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } + f = message.getOuisList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.api.VendorMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string dir = 1; + * @return {string} + */ +proto.api.Vendor.prototype.getDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Vendor} returns this + */ +proto.api.Vendor.prototype.setDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.api.Vendor.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Vendor} returns this + */ +proto.api.Vendor.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional uint32 lora_alliance_vendor_id = 3; + * @return {number} + */ +proto.api.Vendor.prototype.getLoraAllianceVendorId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.Vendor} returns this + */ +proto.api.Vendor.prototype.setLoraAllianceVendorId = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * repeated string ouis = 4; + * @return {!Array} + */ +proto.api.Vendor.prototype.getOuisList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.api.Vendor} returns this + */ +proto.api.Vendor.prototype.setOuisList = function(value) { + return jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.api.Vendor} returns this + */ +proto.api.Vendor.prototype.addOuis = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.api.Vendor} returns this + */ +proto.api.Vendor.prototype.clearOuisList = function() { + return this.setOuisList([]); +}; + + +/** + * optional VendorMetadata metadata = 5; + * @return {?proto.api.VendorMetadata} + */ +proto.api.Vendor.prototype.getMetadata = function() { + return /** @type{?proto.api.VendorMetadata} */ ( + jspb.Message.getWrapperField(this, proto.api.VendorMetadata, 5)); +}; + + +/** + * @param {?proto.api.VendorMetadata|undefined} value + * @return {!proto.api.Vendor} returns this +*/ +proto.api.Vendor.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Vendor} returns this + */ +proto.api.Vendor.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Vendor.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.VendorMetadata.prototype.toObject = function(opt_includeInstance) { + return proto.api.VendorMetadata.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.VendorMetadata} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.VendorMetadata.toObject = function(includeInstance, msg) { + var f, obj = { + homepage: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.VendorMetadata} + */ +proto.api.VendorMetadata.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.VendorMetadata; + return proto.api.VendorMetadata.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.VendorMetadata} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.VendorMetadata} + */ +proto.api.VendorMetadata.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setHomepage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.VendorMetadata.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.VendorMetadata.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.VendorMetadata} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.VendorMetadata.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHomepage(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string homepage = 1; + * @return {string} + */ +proto.api.VendorMetadata.prototype.getHomepage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.VendorMetadata} returns this + */ +proto.api.VendorMetadata.prototype.setHomepage = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetVendorRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetVendorRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetVendorRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVendorRequest.toObject = function(includeInstance, msg) { + var f, obj = { + dir: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetVendorRequest} + */ +proto.api.GetVendorRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetVendorRequest; + return proto.api.GetVendorRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetVendorRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetVendorRequest} + */ +proto.api.GetVendorRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setDir(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetVendorRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetVendorRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetVendorRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVendorRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string dir = 1; + * @return {string} + */ +proto.api.GetVendorRequest.prototype.getDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.GetVendorRequest} returns this + */ +proto.api.GetVendorRequest.prototype.setDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetVendorResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetVendorResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetVendorResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVendorResponse.toObject = function(includeInstance, msg) { + var f, obj = { + vendor: (f = msg.getVendor()) && proto.api.Vendor.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetVendorResponse} + */ +proto.api.GetVendorResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetVendorResponse; + return proto.api.GetVendorResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetVendorResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetVendorResponse} + */ +proto.api.GetVendorResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.Vendor; + reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); + msg.setVendor(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetVendorResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetVendorResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetVendorResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVendorResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendor(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.Vendor.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Vendor vendor = 1; + * @return {?proto.api.Vendor} + */ +proto.api.GetVendorResponse.prototype.getVendor = function() { + return /** @type{?proto.api.Vendor} */ ( + jspb.Message.getWrapperField(this, proto.api.Vendor, 1)); +}; + + +/** + * @param {?proto.api.Vendor|undefined} value + * @return {!proto.api.GetVendorResponse} returns this +*/ +proto.api.GetVendorResponse.prototype.setVendor = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetVendorResponse} returns this + */ +proto.api.GetVendorResponse.prototype.clearVendor = function() { + return this.setVendor(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetVendorResponse.prototype.hasVendor = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.UpdateVendorRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.UpdateVendorRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.UpdateVendorRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.UpdateVendorRequest.toObject = function(includeInstance, msg) { + var f, obj = { + vendor: (f = msg.getVendor()) && proto.api.Vendor.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.UpdateVendorRequest} + */ +proto.api.UpdateVendorRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.UpdateVendorRequest; + return proto.api.UpdateVendorRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.UpdateVendorRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.UpdateVendorRequest} + */ +proto.api.UpdateVendorRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.Vendor; + reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); + msg.setVendor(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.UpdateVendorRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.UpdateVendorRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.UpdateVendorRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.UpdateVendorRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendor(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.Vendor.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Vendor vendor = 1; + * @return {?proto.api.Vendor} + */ +proto.api.UpdateVendorRequest.prototype.getVendor = function() { + return /** @type{?proto.api.Vendor} */ ( + jspb.Message.getWrapperField(this, proto.api.Vendor, 1)); +}; + + +/** + * @param {?proto.api.Vendor|undefined} value + * @return {!proto.api.UpdateVendorRequest} returns this +*/ +proto.api.UpdateVendorRequest.prototype.setVendor = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.UpdateVendorRequest} returns this + */ +proto.api.UpdateVendorRequest.prototype.clearVendor = function() { + return this.setVendor(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.UpdateVendorRequest.prototype.hasVendor = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.CreateVendorRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.CreateVendorRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.CreateVendorRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.CreateVendorRequest.toObject = function(includeInstance, msg) { + var f, obj = { + vendor: (f = msg.getVendor()) && proto.api.Vendor.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.CreateVendorRequest} + */ +proto.api.CreateVendorRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.CreateVendorRequest; + return proto.api.CreateVendorRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.CreateVendorRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.CreateVendorRequest} + */ +proto.api.CreateVendorRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.Vendor; + reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); + msg.setVendor(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.CreateVendorRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.CreateVendorRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.CreateVendorRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.CreateVendorRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendor(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.Vendor.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Vendor vendor = 1; + * @return {?proto.api.Vendor} + */ +proto.api.CreateVendorRequest.prototype.getVendor = function() { + return /** @type{?proto.api.Vendor} */ ( + jspb.Message.getWrapperField(this, proto.api.Vendor, 1)); +}; + + +/** + * @param {?proto.api.Vendor|undefined} value + * @return {!proto.api.CreateVendorRequest} returns this +*/ +proto.api.CreateVendorRequest.prototype.setVendor = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.CreateVendorRequest} returns this + */ +proto.api.CreateVendorRequest.prototype.clearVendor = function() { + return this.setVendor(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.CreateVendorRequest.prototype.hasVendor = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.api.ListVendorsResponse.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.ListVendorsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.ListVendorsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.ListVendorsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ListVendorsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + totalCount: jspb.Message.getFieldWithDefault(msg, 1, 0), + resultList: jspb.Message.toObjectList(msg.getResultList(), + proto.api.Vendor.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.ListVendorsResponse} + */ +proto.api.ListVendorsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.ListVendorsResponse; + return proto.api.ListVendorsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.ListVendorsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.ListVendorsResponse} + */ +proto.api.ListVendorsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setTotalCount(value); + break; + case 2: + var value = new proto.api.Vendor; + reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); + msg.addResult(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.ListVendorsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.ListVendorsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.ListVendorsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ListVendorsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTotalCount(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getResultList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.api.Vendor.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint32 total_count = 1; + * @return {number} + */ +proto.api.ListVendorsResponse.prototype.getTotalCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.ListVendorsResponse} returns this + */ +proto.api.ListVendorsResponse.prototype.setTotalCount = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated Vendor result = 2; + * @return {!Array} + */ +proto.api.ListVendorsResponse.prototype.getResultList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.api.Vendor, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.api.ListVendorsResponse} returns this +*/ +proto.api.ListVendorsResponse.prototype.setResultList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.api.Vendor=} opt_value + * @param {number=} opt_index + * @return {!proto.api.Vendor} + */ +proto.api.ListVendorsResponse.prototype.addResult = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.api.Vendor, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.api.ListVendorsResponse} returns this + */ +proto.api.ListVendorsResponse.prototype.clearResultList = function() { + return this.setResultList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.DeleteVendorRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeleteVendorRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.DeleteVendorRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.DeleteVendorRequest.toObject = function(includeInstance, msg) { + var f, obj = { + dir: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.DeleteVendorRequest} + */ +proto.api.DeleteVendorRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.DeleteVendorRequest; + return proto.api.DeleteVendorRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.DeleteVendorRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.DeleteVendorRequest} + */ +proto.api.DeleteVendorRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setDir(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.DeleteVendorRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.DeleteVendorRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.DeleteVendorRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.DeleteVendorRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string dir = 1; + * @return {string} + */ +proto.api.DeleteVendorRequest.prototype.getDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.DeleteVendorRequest} returns this + */ +proto.api.DeleteVendorRequest.prototype.setDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.Codec.prototype.toObject = function(opt_includeInstance) { + return proto.api.Codec.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Codec} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Codec.toObject = function(includeInstance, msg) { + var f, obj = { + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), + file: jspb.Message.getFieldWithDefault(msg, 2, ""), + codec: jspb.Message.getFieldWithDefault(msg, 3, ""), + decodeTests: jspb.Message.getFieldWithDefault(msg, 4, ""), + encodeTests: jspb.Message.getFieldWithDefault(msg, 5, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.Codec} + */ +proto.api.Codec.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.Codec; + return proto.api.Codec.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.Codec} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.Codec} + */ +proto.api.Codec.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFile(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setCodec(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDecodeTests(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setEncodeTests(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.Codec.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.Codec.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.Codec} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Codec.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getFile(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getCodec(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getDecodeTests(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getEncodeTests(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } +}; + + +/** + * optional string vendor_dir = 1; + * @return {string} + */ +proto.api.Codec.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Codec} returns this + */ +proto.api.Codec.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string file = 2; + * @return {string} + */ +proto.api.Codec.prototype.getFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Codec} returns this + */ +proto.api.Codec.prototype.setFile = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string codec = 3; + * @return {string} + */ +proto.api.Codec.prototype.getCodec = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Codec} returns this + */ +proto.api.Codec.prototype.setCodec = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string decode_tests = 4; + * @return {string} + */ +proto.api.Codec.prototype.getDecodeTests = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Codec} returns this + */ +proto.api.Codec.prototype.setDecodeTests = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string encode_tests = 5; + * @return {string} + */ +proto.api.Codec.prototype.getEncodeTests = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Codec} returns this + */ +proto.api.Codec.prototype.setEncodeTests = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.CreateCodecRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.CreateCodecRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.CreateCodecRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.CreateCodecRequest.toObject = function(includeInstance, msg) { + var f, obj = { + codec: (f = msg.getCodec()) && proto.api.Codec.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.CreateCodecRequest} + */ +proto.api.CreateCodecRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.CreateCodecRequest; + return proto.api.CreateCodecRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.CreateCodecRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.CreateCodecRequest} + */ +proto.api.CreateCodecRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.Codec; + reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); + msg.setCodec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.CreateCodecRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.CreateCodecRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.CreateCodecRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.CreateCodecRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCodec(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.Codec.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Codec codec = 1; + * @return {?proto.api.Codec} + */ +proto.api.CreateCodecRequest.prototype.getCodec = function() { + return /** @type{?proto.api.Codec} */ ( + jspb.Message.getWrapperField(this, proto.api.Codec, 1)); +}; + + +/** + * @param {?proto.api.Codec|undefined} value + * @return {!proto.api.CreateCodecRequest} returns this +*/ +proto.api.CreateCodecRequest.prototype.setCodec = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.CreateCodecRequest} returns this + */ +proto.api.CreateCodecRequest.prototype.clearCodec = function() { + return this.setCodec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.CreateCodecRequest.prototype.hasCodec = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetCodecRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetCodecRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetCodecRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetCodecRequest.toObject = function(includeInstance, msg) { + var f, obj = { + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), + file: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetCodecRequest} + */ +proto.api.GetCodecRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetCodecRequest; + return proto.api.GetCodecRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetCodecRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetCodecRequest} + */ +proto.api.GetCodecRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFile(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetCodecRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetCodecRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetCodecRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetCodecRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getFile(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string vendor_dir = 1; + * @return {string} + */ +proto.api.GetCodecRequest.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.GetCodecRequest} returns this + */ +proto.api.GetCodecRequest.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string file = 2; + * @return {string} + */ +proto.api.GetCodecRequest.prototype.getFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.GetCodecRequest} returns this + */ +proto.api.GetCodecRequest.prototype.setFile = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetCodecResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetCodecResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetCodecResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetCodecResponse.toObject = function(includeInstance, msg) { + var f, obj = { + codec: (f = msg.getCodec()) && proto.api.Codec.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetCodecResponse} + */ +proto.api.GetCodecResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetCodecResponse; + return proto.api.GetCodecResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetCodecResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetCodecResponse} + */ +proto.api.GetCodecResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.Codec; + reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); + msg.setCodec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetCodecResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetCodecResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetCodecResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetCodecResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCodec(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.Codec.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Codec codec = 1; + * @return {?proto.api.Codec} + */ +proto.api.GetCodecResponse.prototype.getCodec = function() { + return /** @type{?proto.api.Codec} */ ( + jspb.Message.getWrapperField(this, proto.api.Codec, 1)); +}; + + +/** + * @param {?proto.api.Codec|undefined} value + * @return {!proto.api.GetCodecResponse} returns this +*/ +proto.api.GetCodecResponse.prototype.setCodec = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetCodecResponse} returns this + */ +proto.api.GetCodecResponse.prototype.clearCodec = function() { + return this.setCodec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetCodecResponse.prototype.hasCodec = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.UpdateCodecRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.UpdateCodecRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.UpdateCodecRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.UpdateCodecRequest.toObject = function(includeInstance, msg) { + var f, obj = { + codec: (f = msg.getCodec()) && proto.api.Codec.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.UpdateCodecRequest} + */ +proto.api.UpdateCodecRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.UpdateCodecRequest; + return proto.api.UpdateCodecRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.UpdateCodecRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.UpdateCodecRequest} + */ +proto.api.UpdateCodecRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.Codec; + reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); + msg.setCodec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.UpdateCodecRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.UpdateCodecRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.UpdateCodecRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.UpdateCodecRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCodec(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.Codec.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Codec codec = 1; + * @return {?proto.api.Codec} + */ +proto.api.UpdateCodecRequest.prototype.getCodec = function() { + return /** @type{?proto.api.Codec} */ ( + jspb.Message.getWrapperField(this, proto.api.Codec, 1)); +}; + + +/** + * @param {?proto.api.Codec|undefined} value + * @return {!proto.api.UpdateCodecRequest} returns this +*/ +proto.api.UpdateCodecRequest.prototype.setCodec = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.UpdateCodecRequest} returns this + */ +proto.api.UpdateCodecRequest.prototype.clearCodec = function() { + return this.setCodec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.UpdateCodecRequest.prototype.hasCodec = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.ListCodecsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.ListCodecsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.ListCodecsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ListCodecsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.ListCodecsRequest} + */ +proto.api.ListCodecsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.ListCodecsRequest; + return proto.api.ListCodecsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.ListCodecsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.ListCodecsRequest} + */ +proto.api.ListCodecsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.ListCodecsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.ListCodecsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.ListCodecsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ListCodecsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string vendor_dir = 1; + * @return {string} + */ +proto.api.ListCodecsRequest.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.ListCodecsRequest} returns this + */ +proto.api.ListCodecsRequest.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.api.ListCodecsResponse.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.ListCodecsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.ListCodecsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.ListCodecsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ListCodecsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + totalCount: jspb.Message.getFieldWithDefault(msg, 1, 0), + resultList: jspb.Message.toObjectList(msg.getResultList(), + proto.api.Codec.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.ListCodecsResponse} + */ +proto.api.ListCodecsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.ListCodecsResponse; + return proto.api.ListCodecsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.ListCodecsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.ListCodecsResponse} + */ +proto.api.ListCodecsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setTotalCount(value); + break; + case 2: + var value = new proto.api.Codec; + reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); + msg.addResult(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.ListCodecsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.ListCodecsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.ListCodecsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ListCodecsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTotalCount(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getResultList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.api.Codec.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint32 total_count = 1; + * @return {number} + */ +proto.api.ListCodecsResponse.prototype.getTotalCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.ListCodecsResponse} returns this + */ +proto.api.ListCodecsResponse.prototype.setTotalCount = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated Codec result = 2; + * @return {!Array} + */ +proto.api.ListCodecsResponse.prototype.getResultList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.api.Codec, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.api.ListCodecsResponse} returns this +*/ +proto.api.ListCodecsResponse.prototype.setResultList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.api.Codec=} opt_value + * @param {number=} opt_index + * @return {!proto.api.Codec} + */ +proto.api.ListCodecsResponse.prototype.addResult = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.api.Codec, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.api.ListCodecsResponse} returns this + */ +proto.api.ListCodecsResponse.prototype.clearResultList = function() { + return this.setResultList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.DeleteCodecRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeleteCodecRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.DeleteCodecRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.DeleteCodecRequest.toObject = function(includeInstance, msg) { + var f, obj = { + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), + file: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.DeleteCodecRequest} + */ +proto.api.DeleteCodecRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.DeleteCodecRequest; + return proto.api.DeleteCodecRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.DeleteCodecRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.DeleteCodecRequest} + */ +proto.api.DeleteCodecRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFile(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.DeleteCodecRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.DeleteCodecRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.DeleteCodecRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.DeleteCodecRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getFile(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string vendor_dir = 1; + * @return {string} + */ +proto.api.DeleteCodecRequest.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.DeleteCodecRequest} returns this + */ +proto.api.DeleteCodecRequest.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string file = 2; + * @return {string} + */ +proto.api.DeleteCodecRequest.prototype.getFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.DeleteCodecRequest} returns this + */ +proto.api.DeleteCodecRequest.prototype.setFile = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.TestCodecRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.TestCodecRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.TestCodecRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.TestCodecRequest.toObject = function(includeInstance, msg) { + var f, obj = { + codec: (f = msg.getCodec()) && proto.api.Codec.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.TestCodecRequest} + */ +proto.api.TestCodecRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.TestCodecRequest; + return proto.api.TestCodecRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.TestCodecRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.TestCodecRequest} + */ +proto.api.TestCodecRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.api.Codec; + reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); + msg.setCodec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.TestCodecRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.TestCodecRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.TestCodecRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.TestCodecRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCodec(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.api.Codec.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Codec codec = 1; + * @return {?proto.api.Codec} + */ +proto.api.TestCodecRequest.prototype.getCodec = function() { + return /** @type{?proto.api.Codec} */ ( + jspb.Message.getWrapperField(this, proto.api.Codec, 1)); +}; + + +/** + * @param {?proto.api.Codec|undefined} value + * @return {!proto.api.TestCodecRequest} returns this +*/ +proto.api.TestCodecRequest.prototype.setCodec = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.TestCodecRequest} returns this + */ +proto.api.TestCodecRequest.prototype.clearCodec = function() { + return this.setCodec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.TestCodecRequest.prototype.hasCodec = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.TestCodecResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.TestCodecResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.TestCodecResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.TestCodecResponse.toObject = function(includeInstance, msg) { + var f, obj = { + error: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.TestCodecResponse} + */ +proto.api.TestCodecResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.TestCodecResponse; + return proto.api.TestCodecResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.TestCodecResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.TestCodecResponse} + */ +proto.api.TestCodecResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setError(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.TestCodecResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.TestCodecResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.TestCodecResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.TestCodecResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getError(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string error = 1; + * @return {string} + */ +proto.api.TestCodecResponse.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.TestCodecResponse} returns this + */ +proto.api.TestCodecResponse.prototype.setError = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.Profile.prototype.toObject = function(opt_includeInstance) { + return proto.api.Profile.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Profile} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Profile.toObject = function(includeInstance, msg) { + var f, obj = { + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), + file: jspb.Message.getFieldWithDefault(msg, 2, ""), + id: jspb.Message.getFieldWithDefault(msg, 3, 0), + region: jspb.Message.getFieldWithDefault(msg, 4, 0), + macVersion: jspb.Message.getFieldWithDefault(msg, 5, 0), + regParamsRevision: jspb.Message.getFieldWithDefault(msg, 6, 0), + supportsOtaa: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + supportsClassB: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + supportsClassC: jspb.Message.getBooleanFieldWithDefault(msg, 9, false), + maxEirp: jspb.Message.getFieldWithDefault(msg, 10, 0), + abp: (f = msg.getAbp()) && proto.api.AbpParams.toObject(includeInstance, f), + classB: (f = msg.getClassB()) && proto.api.ClassBParams.toObject(includeInstance, f), + classC: (f = msg.getClassC()) && proto.api.ClassCParams.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.Profile} + */ +proto.api.Profile.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.Profile; + return proto.api.Profile.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.Profile} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.Profile} + */ +proto.api.Profile.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFile(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setId(value); + break; + case 4: + var value = /** @type {!proto.api.Region} */ (reader.readEnum()); + msg.setRegion(value); + break; + case 5: + var value = /** @type {!proto.api.MacVersion} */ (reader.readEnum()); + msg.setMacVersion(value); + break; + case 6: + var value = /** @type {!proto.api.RegParamsRevision} */ (reader.readEnum()); + msg.setRegParamsRevision(value); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupportsOtaa(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupportsClassB(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupportsClassC(value); + break; + case 10: + var value = /** @type {number} */ (reader.readUint32()); + msg.setMaxEirp(value); + break; + case 11: + var value = new proto.api.AbpParams; + reader.readMessage(value,proto.api.AbpParams.deserializeBinaryFromReader); + msg.setAbp(value); + break; + case 12: + var value = new proto.api.ClassBParams; + reader.readMessage(value,proto.api.ClassBParams.deserializeBinaryFromReader); + msg.setClassB(value); + break; + case 13: + var value = new proto.api.ClassCParams; + reader.readMessage(value,proto.api.ClassCParams.deserializeBinaryFromReader); + msg.setClassC(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.Profile.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.Profile.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.Profile} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Profile.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getFile(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getId(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } + f = message.getRegion(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } + f = message.getMacVersion(); + if (f !== 0.0) { + writer.writeEnum( + 5, + f + ); + } + f = message.getRegParamsRevision(); + if (f !== 0.0) { + writer.writeEnum( + 6, + f + ); + } + f = message.getSupportsOtaa(); + if (f) { + writer.writeBool( + 7, + f + ); + } + f = message.getSupportsClassB(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getSupportsClassC(); + if (f) { + writer.writeBool( + 9, + f + ); + } + f = message.getMaxEirp(); + if (f !== 0) { + writer.writeUint32( + 10, + f + ); + } + f = message.getAbp(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.api.AbpParams.serializeBinaryToWriter + ); + } + f = message.getClassB(); + if (f != null) { + writer.writeMessage( + 12, + f, + proto.api.ClassBParams.serializeBinaryToWriter + ); + } + f = message.getClassC(); + if (f != null) { + writer.writeMessage( + 13, + f, + proto.api.ClassCParams.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string vendor_dir = 1; + * @return {string} + */ +proto.api.Profile.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string file = 2; + * @return {string} + */ +proto.api.Profile.prototype.getFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setFile = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional uint32 id = 3; + * @return {number} + */ +proto.api.Profile.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional Region region = 4; + * @return {!proto.api.Region} + */ +proto.api.Profile.prototype.getRegion = function() { + return /** @type {!proto.api.Region} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {!proto.api.Region} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setRegion = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); +}; + + +/** + * optional MacVersion mac_version = 5; + * @return {!proto.api.MacVersion} + */ +proto.api.Profile.prototype.getMacVersion = function() { + return /** @type {!proto.api.MacVersion} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {!proto.api.MacVersion} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setMacVersion = function(value) { + return jspb.Message.setProto3EnumField(this, 5, value); +}; + + +/** + * optional RegParamsRevision reg_params_revision = 6; + * @return {!proto.api.RegParamsRevision} + */ +proto.api.Profile.prototype.getRegParamsRevision = function() { + return /** @type {!proto.api.RegParamsRevision} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {!proto.api.RegParamsRevision} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setRegParamsRevision = function(value) { + return jspb.Message.setProto3EnumField(this, 6, value); +}; + + +/** + * optional bool supports_otaa = 7; + * @return {boolean} + */ +proto.api.Profile.prototype.getSupportsOtaa = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setSupportsOtaa = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + +/** + * optional bool supports_class_b = 8; + * @return {boolean} + */ +proto.api.Profile.prototype.getSupportsClassB = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setSupportsClassB = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); +}; + + +/** + * optional bool supports_class_c = 9; + * @return {boolean} + */ +proto.api.Profile.prototype.getSupportsClassC = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setSupportsClassC = function(value) { + return jspb.Message.setProto3BooleanField(this, 9, value); +}; + + +/** + * optional uint32 max_eirp = 10; + * @return {number} + */ +proto.api.Profile.prototype.getMaxEirp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.setMaxEirp = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional AbpParams abp = 11; + * @return {?proto.api.AbpParams} + */ +proto.api.Profile.prototype.getAbp = function() { + return /** @type{?proto.api.AbpParams} */ ( + jspb.Message.getWrapperField(this, proto.api.AbpParams, 11)); +}; + + +/** + * @param {?proto.api.AbpParams|undefined} value + * @return {!proto.api.Profile} returns this +*/ +proto.api.Profile.prototype.setAbp = function(value) { + return jspb.Message.setWrapperField(this, 11, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.clearAbp = function() { + return this.setAbp(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Profile.prototype.hasAbp = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional ClassBParams class_b = 12; + * @return {?proto.api.ClassBParams} + */ +proto.api.Profile.prototype.getClassB = function() { + return /** @type{?proto.api.ClassBParams} */ ( + jspb.Message.getWrapperField(this, proto.api.ClassBParams, 12)); +}; + + +/** + * @param {?proto.api.ClassBParams|undefined} value + * @return {!proto.api.Profile} returns this +*/ +proto.api.Profile.prototype.setClassB = function(value) { + return jspb.Message.setWrapperField(this, 12, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.clearClassB = function() { + return this.setClassB(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Profile.prototype.hasClassB = function() { + return jspb.Message.getField(this, 12) != null; +}; + + +/** + * optional ClassCParams class_c = 13; + * @return {?proto.api.ClassCParams} + */ +proto.api.Profile.prototype.getClassC = function() { + return /** @type{?proto.api.ClassCParams} */ ( + jspb.Message.getWrapperField(this, proto.api.ClassCParams, 13)); +}; + + +/** + * @param {?proto.api.ClassCParams|undefined} value + * @return {!proto.api.Profile} returns this +*/ +proto.api.Profile.prototype.setClassC = function(value) { + return jspb.Message.setWrapperField(this, 13, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.Profile} returns this + */ +proto.api.Profile.prototype.clearClassC = function() { + return this.setClassC(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.Profile.prototype.hasClassC = function() { + return jspb.Message.getField(this, 13) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.AbpParams.prototype.toObject = function(opt_includeInstance) { + return proto.api.AbpParams.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.AbpParams} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.AbpParams.toObject = function(includeInstance, msg) { + var f, obj = { + rx1Delay: jspb.Message.getFieldWithDefault(msg, 1, 0), + rx1DrOffset: jspb.Message.getFieldWithDefault(msg, 2, 0), + rx2Dr: jspb.Message.getFieldWithDefault(msg, 3, 0), + rx2Freq: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.AbpParams} + */ +proto.api.AbpParams.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.AbpParams; + return proto.api.AbpParams.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.AbpParams} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.AbpParams} + */ +proto.api.AbpParams.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setRx1Delay(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setRx1DrOffset(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setRx2Dr(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setRx2Freq(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.AbpParams.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.AbpParams.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.AbpParams} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.AbpParams.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRx1Delay(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getRx1DrOffset(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getRx2Dr(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } + f = message.getRx2Freq(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } +}; + + +/** + * optional uint32 rx1_delay = 1; + * @return {number} + */ +proto.api.AbpParams.prototype.getRx1Delay = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.AbpParams} returns this + */ +proto.api.AbpParams.prototype.setRx1Delay = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 rx1_dr_offset = 2; + * @return {number} + */ +proto.api.AbpParams.prototype.getRx1DrOffset = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.AbpParams} returns this + */ +proto.api.AbpParams.prototype.setRx1DrOffset = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint32 rx2_dr = 3; + * @return {number} + */ +proto.api.AbpParams.prototype.getRx2Dr = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.AbpParams} returns this + */ +proto.api.AbpParams.prototype.setRx2Dr = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint32 rx2_freq = 4; + * @return {number} + */ +proto.api.AbpParams.prototype.getRx2Freq = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.AbpParams} returns this + */ +proto.api.AbpParams.prototype.setRx2Freq = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.ClassBParams.prototype.toObject = function(opt_includeInstance) { + return proto.api.ClassBParams.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.ClassBParams} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ClassBParams.toObject = function(includeInstance, msg) { + var f, obj = { + timeoutSecs: jspb.Message.getFieldWithDefault(msg, 1, 0), + pingSlotNbK: jspb.Message.getFieldWithDefault(msg, 2, 0), + pingSlotDr: jspb.Message.getFieldWithDefault(msg, 3, 0), + pingSlotFreq: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.ClassBParams} + */ +proto.api.ClassBParams.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.ClassBParams; + return proto.api.ClassBParams.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.ClassBParams} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.ClassBParams} + */ +proto.api.ClassBParams.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setTimeoutSecs(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setPingSlotNbK(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setPingSlotDr(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setPingSlotFreq(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.ClassBParams.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.ClassBParams.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.ClassBParams} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ClassBParams.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTimeoutSecs(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getPingSlotNbK(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getPingSlotDr(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } + f = message.getPingSlotFreq(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } +}; + + +/** + * optional uint32 timeout_secs = 1; + * @return {number} + */ +proto.api.ClassBParams.prototype.getTimeoutSecs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.ClassBParams} returns this + */ +proto.api.ClassBParams.prototype.setTimeoutSecs = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 ping_slot_nb_k = 2; + * @return {number} + */ +proto.api.ClassBParams.prototype.getPingSlotNbK = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.ClassBParams} returns this + */ +proto.api.ClassBParams.prototype.setPingSlotNbK = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint32 ping_slot_dr = 3; + * @return {number} + */ +proto.api.ClassBParams.prototype.getPingSlotDr = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.ClassBParams} returns this + */ +proto.api.ClassBParams.prototype.setPingSlotDr = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint32 ping_slot_freq = 4; + * @return {number} + */ +proto.api.ClassBParams.prototype.getPingSlotFreq = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.ClassBParams} returns this + */ +proto.api.ClassBParams.prototype.setPingSlotFreq = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.ClassCParams.prototype.toObject = function(opt_includeInstance) { + return proto.api.ClassCParams.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.ClassCParams} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ClassCParams.toObject = function(includeInstance, msg) { + var f, obj = { + timeoutSecs: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.ClassCParams} + */ +proto.api.ClassCParams.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.ClassCParams; + return proto.api.ClassCParams.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.ClassCParams} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.ClassCParams} + */ +proto.api.ClassCParams.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setTimeoutSecs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.api.Vendor.repeatedFields_ = [4]; +proto.api.ClassCParams.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.ClassCParams.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.ClassCParams} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ClassCParams.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTimeoutSecs(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } +}; + + +/** + * optional uint32 timeout_secs = 1; + * @return {number} + */ +proto.api.ClassCParams.prototype.getTimeoutSecs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.api.ClassCParams} returns this + */ +proto.api.ClassCParams.prototype.setTimeoutSecs = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + @@ -398,8 +4977,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.Vendor.prototype.toObject = function(opt_includeInstance) { - return proto.api.Vendor.toObject(opt_includeInstance, this); +proto.api.CreateProfileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.CreateProfileRequest.toObject(opt_includeInstance, this); }; @@ -408,17 +4987,13 @@ proto.api.Vendor.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.Vendor} msg The msg instance to transform. + * @param {!proto.api.CreateProfileRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Vendor.toObject = function(includeInstance, msg) { +proto.api.CreateProfileRequest.toObject = function(includeInstance, msg) { var f, obj = { - dir: jspb.Message.getFieldWithDefault(msg, 1, ""), - name: jspb.Message.getFieldWithDefault(msg, 2, ""), - loraAllianceVendorId: jspb.Message.getFieldWithDefault(msg, 3, 0), - ouisList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, - metadata: (f = msg.getMetadata()) && proto.api.VendorMetadata.toObject(includeInstance, f) + profile: (f = msg.getProfile()) && proto.api.Profile.toObject(includeInstance, f) }; if (includeInstance) { @@ -432,23 +5007,23 @@ proto.api.Vendor.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.Vendor} + * @return {!proto.api.CreateProfileRequest} */ -proto.api.Vendor.deserializeBinary = function(bytes) { +proto.api.CreateProfileRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Vendor; - return proto.api.Vendor.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.CreateProfileRequest; + return proto.api.CreateProfileRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.Vendor} msg The message object to deserialize into. + * @param {!proto.api.CreateProfileRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.Vendor} + * @return {!proto.api.CreateProfileRequest} */ -proto.api.Vendor.deserializeBinaryFromReader = function(msg, reader) { +proto.api.CreateProfileRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -456,25 +5031,9 @@ proto.api.Vendor.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDir(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLoraAllianceVendorId(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.addOuis(value); - break; - case 5: - var value = new proto.api.VendorMetadata; - reader.readMessage(value,proto.api.VendorMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); + var value = new proto.api.Profile; + reader.readMessage(value,proto.api.Profile.deserializeBinaryFromReader); + msg.setProfile(value); break; default: reader.skipField(); @@ -489,9 +5048,9 @@ proto.api.Vendor.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Vendor.prototype.serializeBinary = function() { +proto.api.CreateProfileRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.Vendor.serializeBinaryToWriter(this, writer); + proto.api.CreateProfileRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -499,176 +5058,217 @@ proto.api.Vendor.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.Vendor} message + * @param {!proto.api.CreateProfileRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Vendor.serializeBinaryToWriter = function(message, writer) { +proto.api.CreateProfileRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDir(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getLoraAllianceVendorId(); - if (f !== 0) { - writer.writeUint32( - 3, - f - ); - } - f = message.getOuisList(); - if (f.length > 0) { - writer.writeRepeatedString( - 4, - f - ); - } - f = message.getMetadata(); + f = message.getProfile(); if (f != null) { writer.writeMessage( - 5, + 1, f, - proto.api.VendorMetadata.serializeBinaryToWriter + proto.api.Profile.serializeBinaryToWriter ); } }; /** - * optional string dir = 1; - * @return {string} + * optional Profile profile = 1; + * @return {?proto.api.Profile} */ -proto.api.Vendor.prototype.getDir = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.api.CreateProfileRequest.prototype.getProfile = function() { + return /** @type{?proto.api.Profile} */ ( + jspb.Message.getWrapperField(this, proto.api.Profile, 1)); }; /** - * @param {string} value - * @return {!proto.api.Vendor} returns this + * @param {?proto.api.Profile|undefined} value + * @return {!proto.api.CreateProfileRequest} returns this +*/ +proto.api.CreateProfileRequest.prototype.setProfile = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.CreateProfileRequest} returns this */ -proto.api.Vendor.prototype.setDir = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.api.CreateProfileRequest.prototype.clearProfile = function() { + return this.setProfile(undefined); }; /** - * optional string name = 2; - * @return {string} + * Returns whether this field is set. + * @return {boolean} */ -proto.api.Vendor.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.api.CreateProfileRequest.prototype.hasProfile = function() { + return jspb.Message.getField(this, 1) != null; }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * @param {string} value - * @return {!proto.api.Vendor} returns this + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.api.Vendor.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.api.GetProfileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetProfileRequest.toObject(opt_includeInstance, this); }; /** - * optional uint32 lora_alliance_vendor_id = 3; - * @return {number} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetProfileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Vendor.prototype.getLoraAllianceVendorId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.api.GetProfileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), + file: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * @param {number} value - * @return {!proto.api.Vendor} returns this + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetProfileRequest} */ -proto.api.Vendor.prototype.setLoraAllianceVendorId = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); +proto.api.GetProfileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetProfileRequest; + return proto.api.GetProfileRequest.deserializeBinaryFromReader(msg, reader); }; /** - * repeated string ouis = 4; - * @return {!Array} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetProfileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetProfileRequest} */ -proto.api.Vendor.prototype.getOuisList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +proto.api.GetProfileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFile(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * @param {!Array} value - * @return {!proto.api.Vendor} returns this + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.api.Vendor.prototype.setOuisList = function(value) { - return jspb.Message.setField(this, 4, value || []); +proto.api.GetProfileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetProfileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.api.Vendor} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetProfileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Vendor.prototype.addOuis = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 4, value, opt_index); +proto.api.GetProfileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getFile(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } }; /** - * Clears the list making it empty but non-null. - * @return {!proto.api.Vendor} returns this + * optional string vendor_dir = 1; + * @return {string} */ -proto.api.Vendor.prototype.clearOuisList = function() { - return this.setOuisList([]); +proto.api.GetProfileRequest.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional VendorMetadata metadata = 5; - * @return {?proto.api.VendorMetadata} + * @param {string} value + * @return {!proto.api.GetProfileRequest} returns this */ -proto.api.Vendor.prototype.getMetadata = function() { - return /** @type{?proto.api.VendorMetadata} */ ( - jspb.Message.getWrapperField(this, proto.api.VendorMetadata, 5)); -}; - - -/** - * @param {?proto.api.VendorMetadata|undefined} value - * @return {!proto.api.Vendor} returns this -*/ -proto.api.Vendor.prototype.setMetadata = function(value) { - return jspb.Message.setWrapperField(this, 5, value); +proto.api.GetProfileRequest.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.api.Vendor} returns this + * optional string file = 2; + * @return {string} */ -proto.api.Vendor.prototype.clearMetadata = function() { - return this.setMetadata(undefined); +proto.api.GetProfileRequest.prototype.getFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {string} value + * @return {!proto.api.GetProfileRequest} returns this */ -proto.api.Vendor.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 5) != null; +proto.api.GetProfileRequest.prototype.setFile = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; @@ -688,8 +5288,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.VendorMetadata.prototype.toObject = function(opt_includeInstance) { - return proto.api.VendorMetadata.toObject(opt_includeInstance, this); +proto.api.GetProfileResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetProfileResponse.toObject(opt_includeInstance, this); }; @@ -698,13 +5298,13 @@ proto.api.VendorMetadata.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.VendorMetadata} msg The msg instance to transform. + * @param {!proto.api.GetProfileResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.VendorMetadata.toObject = function(includeInstance, msg) { +proto.api.GetProfileResponse.toObject = function(includeInstance, msg) { var f, obj = { - homepage: jspb.Message.getFieldWithDefault(msg, 1, "") + profile: (f = msg.getProfile()) && proto.api.Profile.toObject(includeInstance, f) }; if (includeInstance) { @@ -718,23 +5318,23 @@ proto.api.VendorMetadata.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.VendorMetadata} + * @return {!proto.api.GetProfileResponse} */ -proto.api.VendorMetadata.deserializeBinary = function(bytes) { +proto.api.GetProfileResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.VendorMetadata; - return proto.api.VendorMetadata.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetProfileResponse; + return proto.api.GetProfileResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.VendorMetadata} msg The message object to deserialize into. + * @param {!proto.api.GetProfileResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.VendorMetadata} + * @return {!proto.api.GetProfileResponse} */ -proto.api.VendorMetadata.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetProfileResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -742,8 +5342,9 @@ proto.api.VendorMetadata.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setHomepage(value); + var value = new proto.api.Profile; + reader.readMessage(value,proto.api.Profile.deserializeBinaryFromReader); + msg.setProfile(value); break; default: reader.skipField(); @@ -758,9 +5359,9 @@ proto.api.VendorMetadata.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.VendorMetadata.prototype.serializeBinary = function() { +proto.api.GetProfileResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.VendorMetadata.serializeBinaryToWriter(this, writer); + proto.api.GetProfileResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -768,37 +5369,57 @@ proto.api.VendorMetadata.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.VendorMetadata} message + * @param {!proto.api.GetProfileResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.VendorMetadata.serializeBinaryToWriter = function(message, writer) { +proto.api.GetProfileResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getHomepage(); - if (f.length > 0) { - writer.writeString( + f = message.getProfile(); + if (f != null) { + writer.writeMessage( 1, - f + f, + proto.api.Profile.serializeBinaryToWriter ); } }; /** - * optional string homepage = 1; - * @return {string} + * optional Profile profile = 1; + * @return {?proto.api.Profile} */ -proto.api.VendorMetadata.prototype.getHomepage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.api.GetProfileResponse.prototype.getProfile = function() { + return /** @type{?proto.api.Profile} */ ( + jspb.Message.getWrapperField(this, proto.api.Profile, 1)); }; /** - * @param {string} value - * @return {!proto.api.VendorMetadata} returns this + * @param {?proto.api.Profile|undefined} value + * @return {!proto.api.GetProfileResponse} returns this +*/ +proto.api.GetProfileResponse.prototype.setProfile = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetProfileResponse} returns this */ -proto.api.VendorMetadata.prototype.setHomepage = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.api.GetProfileResponse.prototype.clearProfile = function() { + return this.setProfile(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetProfileResponse.prototype.hasProfile = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -818,8 +5439,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetVendorRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetVendorRequest.toObject(opt_includeInstance, this); +proto.api.UpdateProfileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.UpdateProfileRequest.toObject(opt_includeInstance, this); }; @@ -828,13 +5449,13 @@ proto.api.GetVendorRequest.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetVendorRequest} msg The msg instance to transform. + * @param {!proto.api.UpdateProfileRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetVendorRequest.toObject = function(includeInstance, msg) { +proto.api.UpdateProfileRequest.toObject = function(includeInstance, msg) { var f, obj = { - dir: jspb.Message.getFieldWithDefault(msg, 1, "") + profile: (f = msg.getProfile()) && proto.api.Profile.toObject(includeInstance, f) }; if (includeInstance) { @@ -848,23 +5469,23 @@ proto.api.GetVendorRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetVendorRequest} + * @return {!proto.api.UpdateProfileRequest} */ -proto.api.GetVendorRequest.deserializeBinary = function(bytes) { +proto.api.UpdateProfileRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetVendorRequest; - return proto.api.GetVendorRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.UpdateProfileRequest; + return proto.api.UpdateProfileRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetVendorRequest} msg The message object to deserialize into. + * @param {!proto.api.UpdateProfileRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetVendorRequest} + * @return {!proto.api.UpdateProfileRequest} */ -proto.api.GetVendorRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.UpdateProfileRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -872,8 +5493,9 @@ proto.api.GetVendorRequest.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDir(value); + var value = new proto.api.Profile; + reader.readMessage(value,proto.api.Profile.deserializeBinaryFromReader); + msg.setProfile(value); break; default: reader.skipField(); @@ -888,9 +5510,9 @@ proto.api.GetVendorRequest.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetVendorRequest.prototype.serializeBinary = function() { +proto.api.UpdateProfileRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.GetVendorRequest.serializeBinaryToWriter(this, writer); + proto.api.UpdateProfileRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -898,37 +5520,57 @@ proto.api.GetVendorRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.GetVendorRequest} message + * @param {!proto.api.UpdateProfileRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetVendorRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.UpdateProfileRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDir(); - if (f.length > 0) { - writer.writeString( + f = message.getProfile(); + if (f != null) { + writer.writeMessage( 1, - f + f, + proto.api.Profile.serializeBinaryToWriter ); } }; /** - * optional string dir = 1; - * @return {string} + * optional Profile profile = 1; + * @return {?proto.api.Profile} */ -proto.api.GetVendorRequest.prototype.getDir = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.api.UpdateProfileRequest.prototype.getProfile = function() { + return /** @type{?proto.api.Profile} */ ( + jspb.Message.getWrapperField(this, proto.api.Profile, 1)); }; /** - * @param {string} value - * @return {!proto.api.GetVendorRequest} returns this + * @param {?proto.api.Profile|undefined} value + * @return {!proto.api.UpdateProfileRequest} returns this +*/ +proto.api.UpdateProfileRequest.prototype.setProfile = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.UpdateProfileRequest} returns this */ -proto.api.GetVendorRequest.prototype.setDir = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.api.UpdateProfileRequest.prototype.clearProfile = function() { + return this.setProfile(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.UpdateProfileRequest.prototype.hasProfile = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -948,8 +5590,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetVendorResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetVendorResponse.toObject(opt_includeInstance, this); +proto.api.ListProfilesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.ListProfilesRequest.toObject(opt_includeInstance, this); }; @@ -958,13 +5600,13 @@ proto.api.GetVendorResponse.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetVendorResponse} msg The msg instance to transform. + * @param {!proto.api.ListProfilesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetVendorResponse.toObject = function(includeInstance, msg) { +proto.api.ListProfilesRequest.toObject = function(includeInstance, msg) { var f, obj = { - vendor: (f = msg.getVendor()) && proto.api.Vendor.toObject(includeInstance, f) + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { @@ -978,23 +5620,23 @@ proto.api.GetVendorResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetVendorResponse} + * @return {!proto.api.ListProfilesRequest} */ -proto.api.GetVendorResponse.deserializeBinary = function(bytes) { +proto.api.ListProfilesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetVendorResponse; - return proto.api.GetVendorResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.ListProfilesRequest; + return proto.api.ListProfilesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetVendorResponse} msg The message object to deserialize into. + * @param {!proto.api.ListProfilesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetVendorResponse} + * @return {!proto.api.ListProfilesRequest} */ -proto.api.GetVendorResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.api.ListProfilesRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1002,9 +5644,8 @@ proto.api.GetVendorResponse.deserializeBinaryFromReader = function(msg, reader) var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.api.Vendor; - reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); - msg.setVendor(value); + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); break; default: reader.skipField(); @@ -1019,9 +5660,9 @@ proto.api.GetVendorResponse.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetVendorResponse.prototype.serializeBinary = function() { +proto.api.ListProfilesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.GetVendorResponse.serializeBinaryToWriter(this, writer); + proto.api.ListProfilesRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1029,60 +5670,47 @@ proto.api.GetVendorResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.GetVendorResponse} message + * @param {!proto.api.ListProfilesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetVendorResponse.serializeBinaryToWriter = function(message, writer) { +proto.api.ListProfilesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getVendor(); - if (f != null) { - writer.writeMessage( + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( 1, - f, - proto.api.Vendor.serializeBinaryToWriter + f ); } }; /** - * optional Vendor vendor = 1; - * @return {?proto.api.Vendor} + * optional string vendor_dir = 1; + * @return {string} */ -proto.api.GetVendorResponse.prototype.getVendor = function() { - return /** @type{?proto.api.Vendor} */ ( - jspb.Message.getWrapperField(this, proto.api.Vendor, 1)); -}; - - -/** - * @param {?proto.api.Vendor|undefined} value - * @return {!proto.api.GetVendorResponse} returns this -*/ -proto.api.GetVendorResponse.prototype.setVendor = function(value) { - return jspb.Message.setWrapperField(this, 1, value); +proto.api.ListProfilesRequest.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * Clears the message field making it undefined. - * @return {!proto.api.GetVendorResponse} returns this + * @param {string} value + * @return {!proto.api.ListProfilesRequest} returns this */ -proto.api.GetVendorResponse.prototype.clearVendor = function() { - return this.setVendor(undefined); +proto.api.ListProfilesRequest.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; + /** - * Returns whether this field is set. - * @return {boolean} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.api.GetVendorResponse.prototype.hasVendor = function() { - return jspb.Message.getField(this, 1) != null; -}; - - +proto.api.ListProfilesResponse.repeatedFields_ = [2]; @@ -1099,8 +5727,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.UpdateVendorRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.UpdateVendorRequest.toObject(opt_includeInstance, this); +proto.api.ListProfilesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.ListProfilesResponse.toObject(opt_includeInstance, this); }; @@ -1109,13 +5737,15 @@ proto.api.UpdateVendorRequest.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.UpdateVendorRequest} msg The msg instance to transform. + * @param {!proto.api.ListProfilesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.UpdateVendorRequest.toObject = function(includeInstance, msg) { +proto.api.ListProfilesResponse.toObject = function(includeInstance, msg) { var f, obj = { - vendor: (f = msg.getVendor()) && proto.api.Vendor.toObject(includeInstance, f) + totalCount: jspb.Message.getFieldWithDefault(msg, 1, 0), + resultList: jspb.Message.toObjectList(msg.getResultList(), + proto.api.Profile.toObject, includeInstance) }; if (includeInstance) { @@ -1129,23 +5759,23 @@ proto.api.UpdateVendorRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.UpdateVendorRequest} + * @return {!proto.api.ListProfilesResponse} */ -proto.api.UpdateVendorRequest.deserializeBinary = function(bytes) { +proto.api.ListProfilesResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.UpdateVendorRequest; - return proto.api.UpdateVendorRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.ListProfilesResponse; + return proto.api.ListProfilesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.UpdateVendorRequest} msg The message object to deserialize into. + * @param {!proto.api.ListProfilesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.UpdateVendorRequest} + * @return {!proto.api.ListProfilesResponse} */ -proto.api.UpdateVendorRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.ListProfilesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1153,84 +5783,114 @@ proto.api.UpdateVendorRequest.deserializeBinaryFromReader = function(msg, reader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.api.Vendor; - reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); - msg.setVendor(value); + var value = /** @type {number} */ (reader.readUint32()); + msg.setTotalCount(value); + break; + case 2: + var value = new proto.api.Profile; + reader.readMessage(value,proto.api.Profile.deserializeBinaryFromReader); + msg.addResult(value); break; default: reader.skipField(); break; } } - return msg; + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.ListProfilesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.ListProfilesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.ListProfilesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.ListProfilesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTotalCount(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getResultList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.api.Profile.serializeBinaryToWriter + ); + } }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * optional uint32 total_count = 1; + * @return {number} */ -proto.api.UpdateVendorRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.UpdateVendorRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.api.ListProfilesResponse.prototype.getTotalCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.api.UpdateVendorRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {number} value + * @return {!proto.api.ListProfilesResponse} returns this */ -proto.api.UpdateVendorRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVendor(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.api.Vendor.serializeBinaryToWriter - ); - } +proto.api.ListProfilesResponse.prototype.setTotalCount = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); }; /** - * optional Vendor vendor = 1; - * @return {?proto.api.Vendor} + * repeated Profile result = 2; + * @return {!Array} */ -proto.api.UpdateVendorRequest.prototype.getVendor = function() { - return /** @type{?proto.api.Vendor} */ ( - jspb.Message.getWrapperField(this, proto.api.Vendor, 1)); +proto.api.ListProfilesResponse.prototype.getResultList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.api.Profile, 2)); }; /** - * @param {?proto.api.Vendor|undefined} value - * @return {!proto.api.UpdateVendorRequest} returns this + * @param {!Array} value + * @return {!proto.api.ListProfilesResponse} returns this */ -proto.api.UpdateVendorRequest.prototype.setVendor = function(value) { - return jspb.Message.setWrapperField(this, 1, value); +proto.api.ListProfilesResponse.prototype.setResultList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.api.UpdateVendorRequest} returns this + * @param {!proto.api.Profile=} opt_value + * @param {number=} opt_index + * @return {!proto.api.Profile} */ -proto.api.UpdateVendorRequest.prototype.clearVendor = function() { - return this.setVendor(undefined); +proto.api.ListProfilesResponse.prototype.addResult = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.api.Profile, opt_index); }; /** - * Returns whether this field is set. - * @return {boolean} + * Clears the list making it empty but non-null. + * @return {!proto.api.ListProfilesResponse} returns this */ -proto.api.UpdateVendorRequest.prototype.hasVendor = function() { - return jspb.Message.getField(this, 1) != null; +proto.api.ListProfilesResponse.prototype.clearResultList = function() { + return this.setResultList([]); }; @@ -1250,8 +5910,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.CreateVendorRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.CreateVendorRequest.toObject(opt_includeInstance, this); +proto.api.DeleteProfileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeleteProfileRequest.toObject(opt_includeInstance, this); }; @@ -1260,13 +5920,14 @@ proto.api.CreateVendorRequest.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.CreateVendorRequest} msg The msg instance to transform. + * @param {!proto.api.DeleteProfileRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.CreateVendorRequest.toObject = function(includeInstance, msg) { +proto.api.DeleteProfileRequest.toObject = function(includeInstance, msg) { var f, obj = { - vendor: (f = msg.getVendor()) && proto.api.Vendor.toObject(includeInstance, f) + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), + file: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -1280,23 +5941,23 @@ proto.api.CreateVendorRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.CreateVendorRequest} + * @return {!proto.api.DeleteProfileRequest} */ -proto.api.CreateVendorRequest.deserializeBinary = function(bytes) { +proto.api.DeleteProfileRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.CreateVendorRequest; - return proto.api.CreateVendorRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.DeleteProfileRequest; + return proto.api.DeleteProfileRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.CreateVendorRequest} msg The message object to deserialize into. + * @param {!proto.api.DeleteProfileRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.CreateVendorRequest} + * @return {!proto.api.DeleteProfileRequest} */ -proto.api.CreateVendorRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.DeleteProfileRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1304,9 +5965,12 @@ proto.api.CreateVendorRequest.deserializeBinaryFromReader = function(msg, reader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.api.Vendor; - reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); - msg.setVendor(value); + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFile(value); break; default: reader.skipField(); @@ -1321,9 +5985,9 @@ proto.api.CreateVendorRequest.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.CreateVendorRequest.prototype.serializeBinary = function() { +proto.api.DeleteProfileRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.CreateVendorRequest.serializeBinaryToWriter(this, writer); + proto.api.DeleteProfileRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1331,57 +5995,62 @@ proto.api.CreateVendorRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.CreateVendorRequest} message + * @param {!proto.api.DeleteProfileRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.CreateVendorRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.DeleteProfileRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getVendor(); - if (f != null) { - writer.writeMessage( + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( 1, - f, - proto.api.Vendor.serializeBinaryToWriter + f + ); + } + f = message.getFile(); + if (f.length > 0) { + writer.writeString( + 2, + f ); } }; /** - * optional Vendor vendor = 1; - * @return {?proto.api.Vendor} + * optional string vendor_dir = 1; + * @return {string} */ -proto.api.CreateVendorRequest.prototype.getVendor = function() { - return /** @type{?proto.api.Vendor} */ ( - jspb.Message.getWrapperField(this, proto.api.Vendor, 1)); +proto.api.DeleteProfileRequest.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {?proto.api.Vendor|undefined} value - * @return {!proto.api.CreateVendorRequest} returns this -*/ -proto.api.CreateVendorRequest.prototype.setVendor = function(value) { - return jspb.Message.setWrapperField(this, 1, value); + * @param {string} value + * @return {!proto.api.DeleteProfileRequest} returns this + */ +proto.api.DeleteProfileRequest.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.api.CreateVendorRequest} returns this + * optional string file = 2; + * @return {string} */ -proto.api.CreateVendorRequest.prototype.clearVendor = function() { - return this.setVendor(undefined); +proto.api.DeleteProfileRequest.prototype.getFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {string} value + * @return {!proto.api.DeleteProfileRequest} returns this */ -proto.api.CreateVendorRequest.prototype.hasVendor = function() { - return jspb.Message.getField(this, 1) != null; +proto.api.DeleteProfileRequest.prototype.setFile = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; @@ -1391,7 +6060,7 @@ proto.api.CreateVendorRequest.prototype.hasVendor = function() { * @private {!Array} * @const */ -proto.api.ListVendorsResponse.repeatedFields_ = [2]; +proto.api.Device.repeatedFields_ = [5]; @@ -1408,8 +6077,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.ListVendorsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.ListVendorsResponse.toObject(opt_includeInstance, this); +proto.api.Device.prototype.toObject = function(opt_includeInstance) { + return proto.api.Device.toObject(opt_includeInstance, this); }; @@ -1418,15 +6087,19 @@ proto.api.ListVendorsResponse.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.ListVendorsResponse} msg The msg instance to transform. + * @param {!proto.api.Device} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.ListVendorsResponse.toObject = function(includeInstance, msg) { +proto.api.Device.toObject = function(includeInstance, msg) { var f, obj = { - totalCount: jspb.Message.getFieldWithDefault(msg, 1, 0), - resultList: jspb.Message.toObjectList(msg.getResultList(), - proto.api.Vendor.toObject, includeInstance) + vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), + file: jspb.Message.getFieldWithDefault(msg, 2, ""), + name: jspb.Message.getFieldWithDefault(msg, 3, ""), + description: jspb.Message.getFieldWithDefault(msg, 4, ""), + firmwareList: jspb.Message.toObjectList(msg.getFirmwareList(), + proto.api.DeviceFirmware.toObject, includeInstance), + metadata: (f = msg.getMetadata()) && proto.api.DeviceMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -1440,23 +6113,23 @@ proto.api.ListVendorsResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.ListVendorsResponse} + * @return {!proto.api.Device} */ -proto.api.ListVendorsResponse.deserializeBinary = function(bytes) { +proto.api.Device.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.ListVendorsResponse; - return proto.api.ListVendorsResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.Device; + return proto.api.Device.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.ListVendorsResponse} msg The message object to deserialize into. + * @param {!proto.api.Device} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.ListVendorsResponse} + * @return {!proto.api.Device} */ -proto.api.ListVendorsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Device.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1464,13 +6137,30 @@ proto.api.ListVendorsResponse.deserializeBinaryFromReader = function(msg, reader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setTotalCount(value); + var value = /** @type {string} */ (reader.readString()); + msg.setVendorDir(value); break; case 2: - var value = new proto.api.Vendor; - reader.readMessage(value,proto.api.Vendor.deserializeBinaryFromReader); - msg.addResult(value); + var value = /** @type {string} */ (reader.readString()); + msg.setFile(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 5: + var value = new proto.api.DeviceFirmware; + reader.readMessage(value,proto.api.DeviceFirmware.deserializeBinaryFromReader); + msg.addFirmware(value); + break; + case 6: + var value = new proto.api.DeviceMetadata; + reader.readMessage(value,proto.api.DeviceMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); break; default: reader.skipField(); @@ -1485,9 +6175,9 @@ proto.api.ListVendorsResponse.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.ListVendorsResponse.prototype.serializeBinary = function() { +proto.api.Device.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.ListVendorsResponse.serializeBinaryToWriter(this, writer); + proto.api.Device.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1495,87 +6185,214 @@ proto.api.ListVendorsResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.ListVendorsResponse} message + * @param {!proto.api.Device} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.ListVendorsResponse.serializeBinaryToWriter = function(message, writer) { +proto.api.Device.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTotalCount(); - if (f !== 0) { - writer.writeUint32( + f = message.getVendorDir(); + if (f.length > 0) { + writer.writeString( 1, f ); } - f = message.getResultList(); + f = message.getFile(); if (f.length > 0) { - writer.writeRepeatedMessage( + writer.writeString( 2, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getFirmwareList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, f, - proto.api.Vendor.serializeBinaryToWriter + proto.api.DeviceFirmware.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.api.DeviceMetadata.serializeBinaryToWriter ); } }; /** - * optional uint32 total_count = 1; - * @return {number} + * optional string vendor_dir = 1; + * @return {string} + */ +proto.api.Device.prototype.getVendorDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Device} returns this + */ +proto.api.Device.prototype.setVendorDir = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string file = 2; + * @return {string} + */ +proto.api.Device.prototype.getFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Device} returns this + */ +proto.api.Device.prototype.setFile = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string name = 3; + * @return {string} + */ +proto.api.Device.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Device} returns this + */ +proto.api.Device.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string description = 4; + * @return {string} + */ +proto.api.Device.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Device} returns this + */ +proto.api.Device.prototype.setDescription = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * repeated DeviceFirmware firmware = 5; + * @return {!Array} + */ +proto.api.Device.prototype.getFirmwareList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.api.DeviceFirmware, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.api.Device} returns this +*/ +proto.api.Device.prototype.setFirmwareList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.api.DeviceFirmware=} opt_value + * @param {number=} opt_index + * @return {!proto.api.DeviceFirmware} */ -proto.api.ListVendorsResponse.prototype.getTotalCount = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.api.Device.prototype.addFirmware = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.api.DeviceFirmware, opt_index); }; /** - * @param {number} value - * @return {!proto.api.ListVendorsResponse} returns this + * Clears the list making it empty but non-null. + * @return {!proto.api.Device} returns this */ -proto.api.ListVendorsResponse.prototype.setTotalCount = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.api.Device.prototype.clearFirmwareList = function() { + return this.setFirmwareList([]); }; /** - * repeated Vendor result = 2; - * @return {!Array} + * optional DeviceMetadata metadata = 6; + * @return {?proto.api.DeviceMetadata} */ -proto.api.ListVendorsResponse.prototype.getResultList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.Vendor, 2)); +proto.api.Device.prototype.getMetadata = function() { + return /** @type{?proto.api.DeviceMetadata} */ ( + jspb.Message.getWrapperField(this, proto.api.DeviceMetadata, 6)); }; /** - * @param {!Array} value - * @return {!proto.api.ListVendorsResponse} returns this + * @param {?proto.api.DeviceMetadata|undefined} value + * @return {!proto.api.Device} returns this */ -proto.api.ListVendorsResponse.prototype.setResultList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 2, value); +proto.api.Device.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 6, value); }; /** - * @param {!proto.api.Vendor=} opt_value - * @param {number=} opt_index - * @return {!proto.api.Vendor} + * Clears the message field making it undefined. + * @return {!proto.api.Device} returns this */ -proto.api.ListVendorsResponse.prototype.addResult = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.api.Vendor, opt_index); +proto.api.Device.prototype.clearMetadata = function() { + return this.setMetadata(undefined); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.api.ListVendorsResponse} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.api.ListVendorsResponse.prototype.clearResultList = function() { - return this.setResultList([]); +proto.api.Device.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 6) != null; }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.api.DeviceFirmware.repeatedFields_ = [2]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1591,8 +6408,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.DeleteVendorRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.DeleteVendorRequest.toObject(opt_includeInstance, this); +proto.api.DeviceFirmware.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeviceFirmware.toObject(opt_includeInstance, this); }; @@ -1601,13 +6418,15 @@ proto.api.DeleteVendorRequest.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.DeleteVendorRequest} msg The msg instance to transform. + * @param {!proto.api.DeviceFirmware} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.DeleteVendorRequest.toObject = function(includeInstance, msg) { +proto.api.DeviceFirmware.toObject = function(includeInstance, msg) { var f, obj = { - dir: jspb.Message.getFieldWithDefault(msg, 1, "") + version: jspb.Message.getFieldWithDefault(msg, 1, ""), + profilesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + codec: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { @@ -1621,23 +6440,23 @@ proto.api.DeleteVendorRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.DeleteVendorRequest} + * @return {!proto.api.DeviceFirmware} */ -proto.api.DeleteVendorRequest.deserializeBinary = function(bytes) { +proto.api.DeviceFirmware.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.DeleteVendorRequest; - return proto.api.DeleteVendorRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.DeviceFirmware; + return proto.api.DeviceFirmware.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.DeleteVendorRequest} msg The message object to deserialize into. + * @param {!proto.api.DeviceFirmware} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.DeleteVendorRequest} + * @return {!proto.api.DeviceFirmware} */ -proto.api.DeleteVendorRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.DeviceFirmware.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1646,7 +6465,15 @@ proto.api.DeleteVendorRequest.deserializeBinaryFromReader = function(msg, reader switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setDir(value); + msg.setVersion(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addProfiles(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setCodec(value); break; default: reader.skipField(); @@ -1661,9 +6488,9 @@ proto.api.DeleteVendorRequest.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.DeleteVendorRequest.prototype.serializeBinary = function() { +proto.api.DeviceFirmware.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.DeleteVendorRequest.serializeBinaryToWriter(this, writer); + proto.api.DeviceFirmware.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1671,40 +6498,109 @@ proto.api.DeleteVendorRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.DeleteVendorRequest} message + * @param {!proto.api.DeviceFirmware} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.DeleteVendorRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.DeviceFirmware.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDir(); + f = message.getVersion(); if (f.length > 0) { writer.writeString( 1, f ); } + f = message.getProfilesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getCodec(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } }; /** - * optional string dir = 1; + * optional string version = 1; * @return {string} */ -proto.api.DeleteVendorRequest.prototype.getDir = function() { +proto.api.DeviceFirmware.prototype.getVersion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.api.DeleteVendorRequest} returns this + * @return {!proto.api.DeviceFirmware} returns this */ -proto.api.DeleteVendorRequest.prototype.setDir = function(value) { +proto.api.DeviceFirmware.prototype.setVersion = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; +/** + * repeated string profiles = 2; + * @return {!Array} + */ +proto.api.DeviceFirmware.prototype.getProfilesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.api.DeviceFirmware} returns this + */ +proto.api.DeviceFirmware.prototype.setProfilesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.api.DeviceFirmware} returns this + */ +proto.api.DeviceFirmware.prototype.addProfiles = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.api.DeviceFirmware} returns this + */ +proto.api.DeviceFirmware.prototype.clearProfilesList = function() { + return this.setProfilesList([]); +}; + + +/** + * optional string codec = 3; + * @return {string} + */ +proto.api.DeviceFirmware.prototype.getCodec = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.DeviceFirmware} returns this + */ +proto.api.DeviceFirmware.prototype.setCodec = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + @@ -1721,8 +6617,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.Codec.prototype.toObject = function(opt_includeInstance) { - return proto.api.Codec.toObject(opt_includeInstance, this); +proto.api.DeviceMetadata.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeviceMetadata.toObject(opt_includeInstance, this); }; @@ -1731,17 +6627,14 @@ proto.api.Codec.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.Codec} msg The msg instance to transform. + * @param {!proto.api.DeviceMetadata} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Codec.toObject = function(includeInstance, msg) { +proto.api.DeviceMetadata.toObject = function(includeInstance, msg) { var f, obj = { - vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), - file: jspb.Message.getFieldWithDefault(msg, 2, ""), - codec: jspb.Message.getFieldWithDefault(msg, 3, ""), - decodeTests: jspb.Message.getFieldWithDefault(msg, 4, ""), - encodeTests: jspb.Message.getFieldWithDefault(msg, 5, "") + productUrl: jspb.Message.getFieldWithDefault(msg, 1, ""), + documentationUrl: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -1755,23 +6648,23 @@ proto.api.Codec.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.Codec} + * @return {!proto.api.DeviceMetadata} */ -proto.api.Codec.deserializeBinary = function(bytes) { +proto.api.DeviceMetadata.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Codec; - return proto.api.Codec.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.DeviceMetadata; + return proto.api.DeviceMetadata.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.Codec} msg The message object to deserialize into. + * @param {!proto.api.DeviceMetadata} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.Codec} + * @return {!proto.api.DeviceMetadata} */ -proto.api.Codec.deserializeBinaryFromReader = function(msg, reader) { +proto.api.DeviceMetadata.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1780,178 +6673,91 @@ proto.api.Codec.deserializeBinaryFromReader = function(msg, reader) { switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setVendorDir(value); + msg.setProductUrl(value); break; case 2: var value = /** @type {string} */ (reader.readString()); - msg.setFile(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setCodec(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setDecodeTests(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setEncodeTests(value); + msg.setDocumentationUrl(value); break; default: reader.skipField(); break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.api.Codec.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Codec.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.api.Codec} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Codec.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVendorDir(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getFile(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getCodec(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getDecodeTests(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getEncodeTests(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } -}; - - -/** - * optional string vendor_dir = 1; - * @return {string} - */ -proto.api.Codec.prototype.getVendorDir = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.api.Codec} returns this - */ -proto.api.Codec.prototype.setVendorDir = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string file = 2; - * @return {string} - */ -proto.api.Codec.prototype.getFile = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.api.Codec} returns this - */ -proto.api.Codec.prototype.setFile = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); + } + } + return msg; }; /** - * optional string codec = 3; - * @return {string} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.api.Codec.prototype.getCodec = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.api.DeviceMetadata.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.DeviceMetadata.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {string} value - * @return {!proto.api.Codec} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.DeviceMetadata} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Codec.prototype.setCodec = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); +proto.api.DeviceMetadata.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProductUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDocumentationUrl(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } }; /** - * optional string decode_tests = 4; + * optional string product_url = 1; * @return {string} */ -proto.api.Codec.prototype.getDecodeTests = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.api.DeviceMetadata.prototype.getProductUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.api.Codec} returns this + * @return {!proto.api.DeviceMetadata} returns this */ -proto.api.Codec.prototype.setDecodeTests = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); +proto.api.DeviceMetadata.prototype.setProductUrl = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional string encode_tests = 5; + * optional string documentation_url = 2; * @return {string} */ -proto.api.Codec.prototype.getEncodeTests = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +proto.api.DeviceMetadata.prototype.getDocumentationUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.api.Codec} returns this + * @return {!proto.api.DeviceMetadata} returns this */ -proto.api.Codec.prototype.setEncodeTests = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); +proto.api.DeviceMetadata.prototype.setDocumentationUrl = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; @@ -1971,8 +6777,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.CreateCodecRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.CreateCodecRequest.toObject(opt_includeInstance, this); +proto.api.CreateDeviceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.CreateDeviceRequest.toObject(opt_includeInstance, this); }; @@ -1981,13 +6787,13 @@ proto.api.CreateCodecRequest.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.CreateCodecRequest} msg The msg instance to transform. + * @param {!proto.api.CreateDeviceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.CreateCodecRequest.toObject = function(includeInstance, msg) { +proto.api.CreateDeviceRequest.toObject = function(includeInstance, msg) { var f, obj = { - codec: (f = msg.getCodec()) && proto.api.Codec.toObject(includeInstance, f) + device: (f = msg.getDevice()) && proto.api.Device.toObject(includeInstance, f) }; if (includeInstance) { @@ -2001,23 +6807,23 @@ proto.api.CreateCodecRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.CreateCodecRequest} + * @return {!proto.api.CreateDeviceRequest} */ -proto.api.CreateCodecRequest.deserializeBinary = function(bytes) { +proto.api.CreateDeviceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.CreateCodecRequest; - return proto.api.CreateCodecRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.CreateDeviceRequest; + return proto.api.CreateDeviceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.CreateCodecRequest} msg The message object to deserialize into. + * @param {!proto.api.CreateDeviceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.CreateCodecRequest} + * @return {!proto.api.CreateDeviceRequest} */ -proto.api.CreateCodecRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.CreateDeviceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2025,9 +6831,9 @@ proto.api.CreateCodecRequest.deserializeBinaryFromReader = function(msg, reader) var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.api.Codec; - reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); - msg.setCodec(value); + var value = new proto.api.Device; + reader.readMessage(value,proto.api.Device.deserializeBinaryFromReader); + msg.setDevice(value); break; default: reader.skipField(); @@ -2042,9 +6848,9 @@ proto.api.CreateCodecRequest.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.CreateCodecRequest.prototype.serializeBinary = function() { +proto.api.CreateDeviceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.CreateCodecRequest.serializeBinaryToWriter(this, writer); + proto.api.CreateDeviceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2052,48 +6858,48 @@ proto.api.CreateCodecRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.CreateCodecRequest} message + * @param {!proto.api.CreateDeviceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.CreateCodecRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.CreateDeviceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getCodec(); + f = message.getDevice(); if (f != null) { writer.writeMessage( 1, f, - proto.api.Codec.serializeBinaryToWriter + proto.api.Device.serializeBinaryToWriter ); } }; /** - * optional Codec codec = 1; - * @return {?proto.api.Codec} + * optional Device device = 1; + * @return {?proto.api.Device} */ -proto.api.CreateCodecRequest.prototype.getCodec = function() { - return /** @type{?proto.api.Codec} */ ( - jspb.Message.getWrapperField(this, proto.api.Codec, 1)); +proto.api.CreateDeviceRequest.prototype.getDevice = function() { + return /** @type{?proto.api.Device} */ ( + jspb.Message.getWrapperField(this, proto.api.Device, 1)); }; /** - * @param {?proto.api.Codec|undefined} value - * @return {!proto.api.CreateCodecRequest} returns this + * @param {?proto.api.Device|undefined} value + * @return {!proto.api.CreateDeviceRequest} returns this */ -proto.api.CreateCodecRequest.prototype.setCodec = function(value) { +proto.api.CreateDeviceRequest.prototype.setDevice = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.CreateCodecRequest} returns this + * @return {!proto.api.CreateDeviceRequest} returns this */ -proto.api.CreateCodecRequest.prototype.clearCodec = function() { - return this.setCodec(undefined); +proto.api.CreateDeviceRequest.prototype.clearDevice = function() { + return this.setDevice(undefined); }; @@ -2101,7 +6907,7 @@ proto.api.CreateCodecRequest.prototype.clearCodec = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.CreateCodecRequest.prototype.hasCodec = function() { +proto.api.CreateDeviceRequest.prototype.hasDevice = function() { return jspb.Message.getField(this, 1) != null; }; @@ -2122,8 +6928,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetCodecRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetCodecRequest.toObject(opt_includeInstance, this); +proto.api.GetDeviceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceRequest.toObject(opt_includeInstance, this); }; @@ -2132,11 +6938,11 @@ proto.api.GetCodecRequest.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetCodecRequest} msg The msg instance to transform. + * @param {!proto.api.GetDeviceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetCodecRequest.toObject = function(includeInstance, msg) { +proto.api.GetDeviceRequest.toObject = function(includeInstance, msg) { var f, obj = { vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), file: jspb.Message.getFieldWithDefault(msg, 2, "") @@ -2153,23 +6959,23 @@ proto.api.GetCodecRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetCodecRequest} + * @return {!proto.api.GetDeviceRequest} */ -proto.api.GetCodecRequest.deserializeBinary = function(bytes) { +proto.api.GetDeviceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetCodecRequest; - return proto.api.GetCodecRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetDeviceRequest; + return proto.api.GetDeviceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetCodecRequest} msg The message object to deserialize into. + * @param {!proto.api.GetDeviceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetCodecRequest} + * @return {!proto.api.GetDeviceRequest} */ -proto.api.GetCodecRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetDeviceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2197,9 +7003,9 @@ proto.api.GetCodecRequest.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetCodecRequest.prototype.serializeBinary = function() { +proto.api.GetDeviceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.GetCodecRequest.serializeBinaryToWriter(this, writer); + proto.api.GetDeviceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2207,11 +7013,11 @@ proto.api.GetCodecRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.GetCodecRequest} message + * @param {!proto.api.GetDeviceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetCodecRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.GetDeviceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getVendorDir(); if (f.length > 0) { @@ -2234,16 +7040,16 @@ proto.api.GetCodecRequest.serializeBinaryToWriter = function(message, writer) { * optional string vendor_dir = 1; * @return {string} */ -proto.api.GetCodecRequest.prototype.getVendorDir = function() { +proto.api.GetDeviceRequest.prototype.getVendorDir = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.api.GetCodecRequest} returns this + * @return {!proto.api.GetDeviceRequest} returns this */ -proto.api.GetCodecRequest.prototype.setVendorDir = function(value) { +proto.api.GetDeviceRequest.prototype.setVendorDir = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -2252,16 +7058,16 @@ proto.api.GetCodecRequest.prototype.setVendorDir = function(value) { * optional string file = 2; * @return {string} */ -proto.api.GetCodecRequest.prototype.getFile = function() { +proto.api.GetDeviceRequest.prototype.getFile = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.api.GetCodecRequest} returns this + * @return {!proto.api.GetDeviceRequest} returns this */ -proto.api.GetCodecRequest.prototype.setFile = function(value) { +proto.api.GetDeviceRequest.prototype.setFile = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; @@ -2282,8 +7088,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetCodecResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetCodecResponse.toObject(opt_includeInstance, this); +proto.api.GetDeviceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceResponse.toObject(opt_includeInstance, this); }; @@ -2292,13 +7098,13 @@ proto.api.GetCodecResponse.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetCodecResponse} msg The msg instance to transform. + * @param {!proto.api.GetDeviceResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetCodecResponse.toObject = function(includeInstance, msg) { +proto.api.GetDeviceResponse.toObject = function(includeInstance, msg) { var f, obj = { - codec: (f = msg.getCodec()) && proto.api.Codec.toObject(includeInstance, f) + device: (f = msg.getDevice()) && proto.api.Device.toObject(includeInstance, f) }; if (includeInstance) { @@ -2312,23 +7118,23 @@ proto.api.GetCodecResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetCodecResponse} + * @return {!proto.api.GetDeviceResponse} */ -proto.api.GetCodecResponse.deserializeBinary = function(bytes) { +proto.api.GetDeviceResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetCodecResponse; - return proto.api.GetCodecResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetDeviceResponse; + return proto.api.GetDeviceResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetCodecResponse} msg The message object to deserialize into. + * @param {!proto.api.GetDeviceResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetCodecResponse} + * @return {!proto.api.GetDeviceResponse} */ -proto.api.GetCodecResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetDeviceResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2336,9 +7142,9 @@ proto.api.GetCodecResponse.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.api.Codec; - reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); - msg.setCodec(value); + var value = new proto.api.Device; + reader.readMessage(value,proto.api.Device.deserializeBinaryFromReader); + msg.setDevice(value); break; default: reader.skipField(); @@ -2353,9 +7159,9 @@ proto.api.GetCodecResponse.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetCodecResponse.prototype.serializeBinary = function() { +proto.api.GetDeviceResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.GetCodecResponse.serializeBinaryToWriter(this, writer); + proto.api.GetDeviceResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2363,48 +7169,48 @@ proto.api.GetCodecResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.GetCodecResponse} message + * @param {!proto.api.GetDeviceResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetCodecResponse.serializeBinaryToWriter = function(message, writer) { +proto.api.GetDeviceResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getCodec(); + f = message.getDevice(); if (f != null) { writer.writeMessage( 1, f, - proto.api.Codec.serializeBinaryToWriter + proto.api.Device.serializeBinaryToWriter ); } }; /** - * optional Codec codec = 1; - * @return {?proto.api.Codec} + * optional Device device = 1; + * @return {?proto.api.Device} */ -proto.api.GetCodecResponse.prototype.getCodec = function() { - return /** @type{?proto.api.Codec} */ ( - jspb.Message.getWrapperField(this, proto.api.Codec, 1)); +proto.api.GetDeviceResponse.prototype.getDevice = function() { + return /** @type{?proto.api.Device} */ ( + jspb.Message.getWrapperField(this, proto.api.Device, 1)); }; /** - * @param {?proto.api.Codec|undefined} value - * @return {!proto.api.GetCodecResponse} returns this + * @param {?proto.api.Device|undefined} value + * @return {!proto.api.GetDeviceResponse} returns this */ -proto.api.GetCodecResponse.prototype.setCodec = function(value) { +proto.api.GetDeviceResponse.prototype.setDevice = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.GetCodecResponse} returns this + * @return {!proto.api.GetDeviceResponse} returns this */ -proto.api.GetCodecResponse.prototype.clearCodec = function() { - return this.setCodec(undefined); +proto.api.GetDeviceResponse.prototype.clearDevice = function() { + return this.setDevice(undefined); }; @@ -2412,7 +7218,7 @@ proto.api.GetCodecResponse.prototype.clearCodec = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.GetCodecResponse.prototype.hasCodec = function() { +proto.api.GetDeviceResponse.prototype.hasDevice = function() { return jspb.Message.getField(this, 1) != null; }; @@ -2433,8 +7239,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.UpdateCodecRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.UpdateCodecRequest.toObject(opt_includeInstance, this); +proto.api.UpdateDeviceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.UpdateDeviceRequest.toObject(opt_includeInstance, this); }; @@ -2443,13 +7249,13 @@ proto.api.UpdateCodecRequest.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.UpdateCodecRequest} msg The msg instance to transform. + * @param {!proto.api.UpdateDeviceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.UpdateCodecRequest.toObject = function(includeInstance, msg) { +proto.api.UpdateDeviceRequest.toObject = function(includeInstance, msg) { var f, obj = { - codec: (f = msg.getCodec()) && proto.api.Codec.toObject(includeInstance, f) + device: (f = msg.getDevice()) && proto.api.Device.toObject(includeInstance, f) }; if (includeInstance) { @@ -2463,23 +7269,23 @@ proto.api.UpdateCodecRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.UpdateCodecRequest} + * @return {!proto.api.UpdateDeviceRequest} */ -proto.api.UpdateCodecRequest.deserializeBinary = function(bytes) { +proto.api.UpdateDeviceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.UpdateCodecRequest; - return proto.api.UpdateCodecRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.UpdateDeviceRequest; + return proto.api.UpdateDeviceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.UpdateCodecRequest} msg The message object to deserialize into. + * @param {!proto.api.UpdateDeviceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.UpdateCodecRequest} + * @return {!proto.api.UpdateDeviceRequest} */ -proto.api.UpdateCodecRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.UpdateDeviceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2487,9 +7293,9 @@ proto.api.UpdateCodecRequest.deserializeBinaryFromReader = function(msg, reader) var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.api.Codec; - reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); - msg.setCodec(value); + var value = new proto.api.Device; + reader.readMessage(value,proto.api.Device.deserializeBinaryFromReader); + msg.setDevice(value); break; default: reader.skipField(); @@ -2504,9 +7310,9 @@ proto.api.UpdateCodecRequest.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.UpdateCodecRequest.prototype.serializeBinary = function() { +proto.api.UpdateDeviceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.UpdateCodecRequest.serializeBinaryToWriter(this, writer); + proto.api.UpdateDeviceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2514,48 +7320,48 @@ proto.api.UpdateCodecRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.UpdateCodecRequest} message + * @param {!proto.api.UpdateDeviceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.UpdateCodecRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.UpdateDeviceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getCodec(); + f = message.getDevice(); if (f != null) { writer.writeMessage( 1, f, - proto.api.Codec.serializeBinaryToWriter + proto.api.Device.serializeBinaryToWriter ); } }; /** - * optional Codec codec = 1; - * @return {?proto.api.Codec} + * optional Device device = 1; + * @return {?proto.api.Device} */ -proto.api.UpdateCodecRequest.prototype.getCodec = function() { - return /** @type{?proto.api.Codec} */ ( - jspb.Message.getWrapperField(this, proto.api.Codec, 1)); +proto.api.UpdateDeviceRequest.prototype.getDevice = function() { + return /** @type{?proto.api.Device} */ ( + jspb.Message.getWrapperField(this, proto.api.Device, 1)); }; /** - * @param {?proto.api.Codec|undefined} value - * @return {!proto.api.UpdateCodecRequest} returns this + * @param {?proto.api.Device|undefined} value + * @return {!proto.api.UpdateDeviceRequest} returns this */ -proto.api.UpdateCodecRequest.prototype.setCodec = function(value) { +proto.api.UpdateDeviceRequest.prototype.setDevice = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.UpdateCodecRequest} returns this + * @return {!proto.api.UpdateDeviceRequest} returns this */ -proto.api.UpdateCodecRequest.prototype.clearCodec = function() { - return this.setCodec(undefined); +proto.api.UpdateDeviceRequest.prototype.clearDevice = function() { + return this.setDevice(undefined); }; @@ -2563,7 +7369,7 @@ proto.api.UpdateCodecRequest.prototype.clearCodec = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.UpdateCodecRequest.prototype.hasCodec = function() { +proto.api.UpdateDeviceRequest.prototype.hasDevice = function() { return jspb.Message.getField(this, 1) != null; }; @@ -2584,8 +7390,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.ListCodecsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.ListCodecsRequest.toObject(opt_includeInstance, this); +proto.api.ListDevicesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.ListDevicesRequest.toObject(opt_includeInstance, this); }; @@ -2594,11 +7400,11 @@ proto.api.ListCodecsRequest.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.ListCodecsRequest} msg The msg instance to transform. + * @param {!proto.api.ListDevicesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.ListCodecsRequest.toObject = function(includeInstance, msg) { +proto.api.ListDevicesRequest.toObject = function(includeInstance, msg) { var f, obj = { vendorDir: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -2614,23 +7420,23 @@ proto.api.ListCodecsRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.ListCodecsRequest} + * @return {!proto.api.ListDevicesRequest} */ -proto.api.ListCodecsRequest.deserializeBinary = function(bytes) { +proto.api.ListDevicesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.ListCodecsRequest; - return proto.api.ListCodecsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.ListDevicesRequest; + return proto.api.ListDevicesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.ListCodecsRequest} msg The message object to deserialize into. + * @param {!proto.api.ListDevicesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.ListCodecsRequest} + * @return {!proto.api.ListDevicesRequest} */ -proto.api.ListCodecsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.ListDevicesRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2654,9 +7460,9 @@ proto.api.ListCodecsRequest.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.ListCodecsRequest.prototype.serializeBinary = function() { +proto.api.ListDevicesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.ListCodecsRequest.serializeBinaryToWriter(this, writer); + proto.api.ListDevicesRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2664,11 +7470,11 @@ proto.api.ListCodecsRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.ListCodecsRequest} message + * @param {!proto.api.ListDevicesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.ListCodecsRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.ListDevicesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getVendorDir(); if (f.length > 0) { @@ -2684,16 +7490,16 @@ proto.api.ListCodecsRequest.serializeBinaryToWriter = function(message, writer) * optional string vendor_dir = 1; * @return {string} */ -proto.api.ListCodecsRequest.prototype.getVendorDir = function() { +proto.api.ListDevicesRequest.prototype.getVendorDir = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.api.ListCodecsRequest} returns this + * @return {!proto.api.ListDevicesRequest} returns this */ -proto.api.ListCodecsRequest.prototype.setVendorDir = function(value) { +proto.api.ListDevicesRequest.prototype.setVendorDir = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -2704,7 +7510,7 @@ proto.api.ListCodecsRequest.prototype.setVendorDir = function(value) { * @private {!Array} * @const */ -proto.api.ListCodecsResponse.repeatedFields_ = [2]; +proto.api.ListDevicesResponse.repeatedFields_ = [2]; @@ -2721,8 +7527,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.ListCodecsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.ListCodecsResponse.toObject(opt_includeInstance, this); +proto.api.ListDevicesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.ListDevicesResponse.toObject(opt_includeInstance, this); }; @@ -2731,15 +7537,15 @@ proto.api.ListCodecsResponse.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.ListCodecsResponse} msg The msg instance to transform. + * @param {!proto.api.ListDevicesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.ListCodecsResponse.toObject = function(includeInstance, msg) { +proto.api.ListDevicesResponse.toObject = function(includeInstance, msg) { var f, obj = { totalCount: jspb.Message.getFieldWithDefault(msg, 1, 0), resultList: jspb.Message.toObjectList(msg.getResultList(), - proto.api.Codec.toObject, includeInstance) + proto.api.Device.toObject, includeInstance) }; if (includeInstance) { @@ -2753,23 +7559,23 @@ proto.api.ListCodecsResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.ListCodecsResponse} + * @return {!proto.api.ListDevicesResponse} */ -proto.api.ListCodecsResponse.deserializeBinary = function(bytes) { +proto.api.ListDevicesResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.ListCodecsResponse; - return proto.api.ListCodecsResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.ListDevicesResponse; + return proto.api.ListDevicesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.ListCodecsResponse} msg The message object to deserialize into. + * @param {!proto.api.ListDevicesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.ListCodecsResponse} + * @return {!proto.api.ListDevicesResponse} */ -proto.api.ListCodecsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.api.ListDevicesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2781,8 +7587,8 @@ proto.api.ListCodecsResponse.deserializeBinaryFromReader = function(msg, reader) msg.setTotalCount(value); break; case 2: - var value = new proto.api.Codec; - reader.readMessage(value,proto.api.Codec.deserializeBinaryFromReader); + var value = new proto.api.Device; + reader.readMessage(value,proto.api.Device.deserializeBinaryFromReader); msg.addResult(value); break; default: @@ -2798,9 +7604,9 @@ proto.api.ListCodecsResponse.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.ListCodecsResponse.prototype.serializeBinary = function() { +proto.api.ListDevicesResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.ListCodecsResponse.serializeBinaryToWriter(this, writer); + proto.api.ListDevicesResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2808,11 +7614,11 @@ proto.api.ListCodecsResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.ListCodecsResponse} message + * @param {!proto.api.ListDevicesResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.ListCodecsResponse.serializeBinaryToWriter = function(message, writer) { +proto.api.ListDevicesResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getTotalCount(); if (f !== 0) { @@ -2826,7 +7632,7 @@ proto.api.ListCodecsResponse.serializeBinaryToWriter = function(message, writer) writer.writeRepeatedMessage( 2, f, - proto.api.Codec.serializeBinaryToWriter + proto.api.Device.serializeBinaryToWriter ); } }; @@ -2836,54 +7642,54 @@ proto.api.ListCodecsResponse.serializeBinaryToWriter = function(message, writer) * optional uint32 total_count = 1; * @return {number} */ -proto.api.ListCodecsResponse.prototype.getTotalCount = function() { +proto.api.ListDevicesResponse.prototype.getTotalCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value - * @return {!proto.api.ListCodecsResponse} returns this + * @return {!proto.api.ListDevicesResponse} returns this */ -proto.api.ListCodecsResponse.prototype.setTotalCount = function(value) { +proto.api.ListDevicesResponse.prototype.setTotalCount = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** - * repeated Codec result = 2; - * @return {!Array} + * repeated Device result = 2; + * @return {!Array} */ -proto.api.ListCodecsResponse.prototype.getResultList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.Codec, 2)); +proto.api.ListDevicesResponse.prototype.getResultList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.api.Device, 2)); }; /** - * @param {!Array} value - * @return {!proto.api.ListCodecsResponse} returns this + * @param {!Array} value + * @return {!proto.api.ListDevicesResponse} returns this */ -proto.api.ListCodecsResponse.prototype.setResultList = function(value) { +proto.api.ListDevicesResponse.prototype.setResultList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** - * @param {!proto.api.Codec=} opt_value + * @param {!proto.api.Device=} opt_value * @param {number=} opt_index - * @return {!proto.api.Codec} + * @return {!proto.api.Device} */ -proto.api.ListCodecsResponse.prototype.addResult = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.api.Codec, opt_index); +proto.api.ListDevicesResponse.prototype.addResult = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.api.Device, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.api.ListCodecsResponse} returns this + * @return {!proto.api.ListDevicesResponse} returns this */ -proto.api.ListCodecsResponse.prototype.clearResultList = function() { +proto.api.ListDevicesResponse.prototype.clearResultList = function() { return this.setResultList([]); }; @@ -2904,8 +7710,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.DeleteCodecRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.DeleteCodecRequest.toObject(opt_includeInstance, this); +proto.api.DeleteDeviceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeleteDeviceRequest.toObject(opt_includeInstance, this); }; @@ -2914,11 +7720,11 @@ proto.api.DeleteCodecRequest.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.DeleteCodecRequest} msg The msg instance to transform. + * @param {!proto.api.DeleteDeviceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.DeleteCodecRequest.toObject = function(includeInstance, msg) { +proto.api.DeleteDeviceRequest.toObject = function(includeInstance, msg) { var f, obj = { vendorDir: jspb.Message.getFieldWithDefault(msg, 1, ""), file: jspb.Message.getFieldWithDefault(msg, 2, "") @@ -2935,23 +7741,23 @@ proto.api.DeleteCodecRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.DeleteCodecRequest} + * @return {!proto.api.DeleteDeviceRequest} */ -proto.api.DeleteCodecRequest.deserializeBinary = function(bytes) { +proto.api.DeleteDeviceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.DeleteCodecRequest; - return proto.api.DeleteCodecRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.DeleteDeviceRequest; + return proto.api.DeleteDeviceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.DeleteCodecRequest} msg The message object to deserialize into. + * @param {!proto.api.DeleteDeviceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.DeleteCodecRequest} + * @return {!proto.api.DeleteDeviceRequest} */ -proto.api.DeleteCodecRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.DeleteDeviceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2979,9 +7785,9 @@ proto.api.DeleteCodecRequest.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.DeleteCodecRequest.prototype.serializeBinary = function() { +proto.api.DeleteDeviceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.DeleteCodecRequest.serializeBinaryToWriter(this, writer); + proto.api.DeleteDeviceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2989,11 +7795,11 @@ proto.api.DeleteCodecRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.DeleteCodecRequest} message + * @param {!proto.api.DeleteDeviceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.DeleteCodecRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.DeleteDeviceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getVendorDir(); if (f.length > 0) { @@ -3016,16 +7822,16 @@ proto.api.DeleteCodecRequest.serializeBinaryToWriter = function(message, writer) * optional string vendor_dir = 1; * @return {string} */ -proto.api.DeleteCodecRequest.prototype.getVendorDir = function() { +proto.api.DeleteDeviceRequest.prototype.getVendorDir = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.api.DeleteCodecRequest} returns this + * @return {!proto.api.DeleteDeviceRequest} returns this */ -proto.api.DeleteCodecRequest.prototype.setVendorDir = function(value) { +proto.api.DeleteDeviceRequest.prototype.setVendorDir = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -3034,18 +7840,63 @@ proto.api.DeleteCodecRequest.prototype.setVendorDir = function(value) { * optional string file = 2; * @return {string} */ -proto.api.DeleteCodecRequest.prototype.getFile = function() { +proto.api.DeleteDeviceRequest.prototype.getFile = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.api.DeleteCodecRequest} returns this + * @return {!proto.api.DeleteDeviceRequest} returns this */ -proto.api.DeleteCodecRequest.prototype.setFile = function(value) { +proto.api.DeleteDeviceRequest.prototype.setFile = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; +/** + * @enum {number} + */ +proto.api.Region = { + EU868: 0, + US915: 2, + CN779: 3, + EU433: 4, + AU915: 5, + CN470: 6, + AS923: 7, + AS923_2: 12, + AS923_3: 13, + AS923_4: 14, + KR920: 8, + IN865: 9, + RU864: 10, + ISM2400: 11 +}; + +/** + * @enum {number} + */ +proto.api.MacVersion = { + LORAWAN_1_0_0: 0, + LORAWAN_1_0_1: 1, + LORAWAN_1_0_2: 2, + LORAWAN_1_0_3: 3, + LORAWAN_1_0_4: 4, + LORAWAN_1_1_0: 5 +}; + +/** + * @enum {number} + */ +proto.api.RegParamsRevision = { + A: 0, + B: 1, + RP002_1_0_0: 2, + RP002_1_0_1: 3, + RP002_1_0_2: 4, + RP002_1_0_3: 5, + RP002_1_0_4: 6 +}; + goog.object.extend(exports, proto.api); diff --git a/interface/src/api.rs b/interface/src/api.rs index c3bbaa8..df39de5 100644 --- a/interface/src/api.rs +++ b/interface/src/api.rs @@ -2,10 +2,12 @@ tonic::include_proto!("api"); use std::path::Path; +use anyhow::anyhow; +use serde_valid::Validate; use tonic::{Code, Request, Response, Status}; use crate::api::device_profile_service_server::DeviceProfileService; -use crate::{api, storage, structs}; +use crate::{js, storage, structs}; trait ToStatus { fn status(&self) -> Status; @@ -23,6 +25,120 @@ impl ToStatus for Box { } } +impl ToStatus for serde_valid::validation::Errors { + fn status(&self) -> Status { + Status::new(Code::InvalidArgument, format!("{}", self)) + } +} + +impl TryFrom<&String> for Region { + type Error = anyhow::Error; + + fn try_from(value: &String) -> Result { + Ok(match value.as_ref() { + "EU868" => Region::Eu868, + "US915" => Region::Us915, + "CN779" => Region::Cn779, + "EU433" => Region::Eu433, + "AU915" => Region::Au915, + "CN470" => Region::Cn470, + "AS923" => Region::As923, + "AS923-2" => Region::As9232, + "AS923-3" => Region::As9233, + "AS923-4" => Region::As9234, + "KR920" => Region::Kr920, + "IN865" => Region::In865, + "RU864" => Region::Ru864, + "ISM2400" => Region::Ism2400, + _ => return Err(anyhow!("Invalid region: {}", value)), + }) + } +} + +impl From for String { + fn from(value: Region) -> Self { + match value { + Region::Eu868 => "EU868", + Region::Us915 => "US915", + Region::Cn779 => "CN779", + Region::Eu433 => "EU433", + Region::Au915 => "AU915", + Region::Cn470 => "CN470", + Region::As923 => "AS923", + Region::As9232 => "AS923-2", + Region::As9233 => "AS923-3", + Region::As9234 => "AS923-4", + Region::Kr920 => "KR920", + Region::In865 => "IN865", + Region::Ru864 => "RU864", + Region::Ism2400 => "ISM2400", + } + .to_string() + } +} + +impl TryFrom<&String> for MacVersion { + type Error = anyhow::Error; + + fn try_from(value: &String) -> Result { + Ok(match value.as_ref() { + "1.0.0" => MacVersion::Lorawan100, + "1.0.1" => MacVersion::Lorawan101, + "1.0.2" => MacVersion::Lorawan102, + "1.0.3" => MacVersion::Lorawan103, + "1.0.4" => MacVersion::Lorawan104, + "1.1.0" => MacVersion::Lorawan110, + _ => return Err(anyhow!("Invalid mac-version: {}", value)), + }) + } +} + +impl From for String { + fn from(value: MacVersion) -> Self { + match value { + MacVersion::Lorawan100 => "1.0.0", + MacVersion::Lorawan101 => "1.0.1", + MacVersion::Lorawan102 => "1.0.2", + MacVersion::Lorawan103 => "1.0.3", + MacVersion::Lorawan104 => "1.0.4", + MacVersion::Lorawan110 => "1.1.0", + } + .to_string() + } +} + +impl TryFrom<&String> for RegParamsRevision { + type Error = anyhow::Error; + + fn try_from(value: &String) -> Result { + Ok(match value.as_ref() { + "A" => RegParamsRevision::A, + "B" => RegParamsRevision::B, + "RP002-1.0.0" => RegParamsRevision::Rp002100, + "RP002-1.0.1" => RegParamsRevision::Rp002101, + "RP002-1.0.2" => RegParamsRevision::Rp002102, + "RP002-1.0.3" => RegParamsRevision::Rp002103, + "RP002-1.0.4" => RegParamsRevision::Rp002104, + _ => return Err(anyhow!("Invalid reg. params revision: {}", value)), + }) + } +} + +impl From for String { + fn from(value: RegParamsRevision) -> Self { + match value { + RegParamsRevision::A => "A", + RegParamsRevision::B => "B", + RegParamsRevision::Rp002100 => "RP002-1.0.0", + RegParamsRevision::Rp002101 => "RP002-1.0.1", + RegParamsRevision::Rp002102 => "RP002-1.0.2", + RegParamsRevision::Rp002103 => "RP002-1.0.3", + RegParamsRevision::Rp002104 => "RP002-1.0.4", + } + .to_string() + } +} + pub struct Service { pub ds_path: String, } @@ -40,19 +156,7 @@ impl DeviceProfileService for Service { } }; - let vendor = structs::VendorConfiguration { - vendor: structs::Vendor { - name: req_v.name.clone(), - id: req_v.lora_alliance_vendor_id, - ouis: req_v.ouis.clone(), - devices: Vec::new(), - metadata: structs::VendorMetadata { - homepage: req_v.metadata.as_ref().map(|v| v.homepage.clone()), - }, - }, - }; - - storage::create_vendor(Path::new(&self.ds_path), &req_v.dir, &vendor) + storage::create_vendor(Path::new(&self.ds_path), &req_v.dir, &req_v.into()) .map_err(|e| e.status())?; Ok(Response::new(())) @@ -60,27 +164,22 @@ impl DeviceProfileService for Service { async fn get_vendor( &self, - request: Request, - ) -> Result, Status> { + request: Request, + ) -> Result, Status> { let req = request.get_ref(); let v = storage::get_vendor(Path::new(&self.ds_path), &req.dir).map_err(|e| e.status())?; - Ok(Response::new(api::GetVendorResponse { - vendor: Some(api::Vendor { - dir: req.dir.clone(), - name: v.vendor.name.clone(), - lora_alliance_vendor_id: v.vendor.id, - ouis: v.vendor.ouis.clone(), - metadata: Some(api::VendorMetadata { - homepage: v.vendor.metadata.homepage.clone().unwrap_or_default(), - }), - }), + let mut vendor: Vendor = (&v).into(); + vendor.dir = req.dir.clone(); + + Ok(Response::new(GetVendorResponse { + vendor: Some(vendor), })) } async fn update_vendor( &self, - request: Request, + request: Request, ) -> Result, Status> { let req_v = match &request.get_ref().vendor { Some(v) => v, @@ -89,19 +188,7 @@ impl DeviceProfileService for Service { } }; - let vendor = structs::VendorConfiguration { - vendor: structs::Vendor { - name: req_v.name.clone(), - id: req_v.lora_alliance_vendor_id, - ouis: req_v.ouis.clone(), - devices: Vec::new(), - metadata: structs::VendorMetadata { - homepage: req_v.metadata.as_ref().map(|v| v.homepage.clone()), - }, - }, - }; - - storage::update_vendor(Path::new(&self.ds_path), &req_v.dir, &vendor) + storage::update_vendor(Path::new(&self.ds_path), &req_v.dir, &req_v.into()) .map_err(|e| e.status())?; Ok(Response::new(())) @@ -110,21 +197,17 @@ impl DeviceProfileService for Service { async fn list_vendors( &self, _request: Request<()>, - ) -> Result, Status> { + ) -> Result, Status> { let vendors = storage::get_vendors(Path::new(&self.ds_path)).map_err(|e| e.status())?; - Ok(Response::new(api::ListVendorsResponse { + Ok(Response::new(ListVendorsResponse { total_count: vendors.len() as u32, result: vendors .iter() - .map(|(k, v)| api::Vendor { - dir: k.clone(), - name: v.vendor.name.clone(), - lora_alliance_vendor_id: v.vendor.id, - ouis: v.vendor.ouis.clone(), - metadata: Some(api::VendorMetadata { - homepage: v.vendor.metadata.homepage.clone().unwrap_or_default(), - }), + .map(|(k, v)| { + let mut vendor: Vendor = v.into(); + vendor.dir = k.clone(); + vendor }) .collect(), })) @@ -132,7 +215,7 @@ impl DeviceProfileService for Service { async fn delete_vendor( &self, - request: Request, + request: Request, ) -> Result, Status> { let req = request.get_ref(); @@ -143,7 +226,7 @@ impl DeviceProfileService for Service { async fn create_codec( &self, - request: Request, + request: Request, ) -> Result, Status> { let req_c = match &request.get_ref().codec { Some(v) => v, @@ -167,16 +250,16 @@ impl DeviceProfileService for Service { async fn get_codec( &self, - request: Request, - ) -> Result, Status> { + request: Request, + ) -> Result, Status> { let req = request.get_ref(); let (codec, encode_tests, decode_tests) = storage::get_codec(Path::new(&self.ds_path), &req.vendor_dir, &req.file) .map_err(|e| e.status())?; - Ok(Response::new(api::GetCodecResponse { - codec: Some(api::Codec { + Ok(Response::new(GetCodecResponse { + codec: Some(Codec { vendor_dir: req.vendor_dir.clone(), file: req.file.clone(), codec, @@ -188,7 +271,7 @@ impl DeviceProfileService for Service { async fn update_codec( &self, - request: Request, + request: Request, ) -> Result, Status> { let req_c = match &request.get_ref().codec { Some(v) => v, @@ -212,18 +295,18 @@ impl DeviceProfileService for Service { async fn list_codecs( &self, - request: Request, - ) -> Result, Status> { + request: Request, + ) -> Result, Status> { let req = request.get_ref(); let codecs = storage::get_codecs(Path::new(&self.ds_path), &req.vendor_dir) .map_err(|e| e.status())?; - Ok(Response::new(api::ListCodecsResponse { + Ok(Response::new(ListCodecsResponse { total_count: codecs.len() as u32, result: codecs .iter() - .map(|(k, v)| api::Codec { + .map(|(k, v)| Codec { vendor_dir: req.vendor_dir.clone(), file: k.clone(), codec: v.0.clone(), @@ -236,7 +319,7 @@ impl DeviceProfileService for Service { async fn delete_codec( &self, - request: Request, + request: Request, ) -> Result, Status> { let req = request.get_ref(); @@ -245,4 +328,223 @@ impl DeviceProfileService for Service { Ok(Response::new(())) } + + async fn test_codec( + &self, + request: Request, + ) -> Result, Status> { + let req_c = match &request.get_ref().codec { + Some(v) => v, + None => { + return Err(Status::invalid_argument("codec is missing")); + } + }; + + if let Err(e) = js::run_tests("decodeUplink", &req_c.codec, &req_c.decode_tests) { + return Ok(Response::new(TestCodecResponse { + error: format!("{}", e), + })); + } + + if let Err(e) = js::run_tests("encodeDownlink", &req_c.codec, &req_c.encode_tests) { + return Ok(Response::new(TestCodecResponse { + error: format!("{}", e), + })); + } + + Ok(Response::new(TestCodecResponse::default())) + } + + async fn create_profile( + &self, + request: Request, + ) -> Result, Status> { + let req_p = match &request.get_ref().profile { + Some(v) => v, + None => { + return Err(Status::invalid_argument("profile is missing")); + } + }; + + let p: structs::ProfileConfiguration = req_p.into(); + p.profile.validate().map_err(|e| e.status())?; + + storage::create_profile(Path::new(&self.ds_path), &req_p.vendor_dir, &req_p.file, &p) + .map_err(|e| e.status())?; + + Ok(Response::new(())) + } + + async fn get_profile( + &self, + request: Request, + ) -> Result, Status> { + let req = request.get_ref(); + let p = storage::get_profile(Path::new(&self.ds_path), &req.vendor_dir, &req.file) + .map_err(|e| e.status())?; + + let mut profile: Profile = (&p).try_into().map_err(|e: anyhow::Error| e.status())?; + profile.vendor_dir = req.vendor_dir.clone(); + profile.file = req.file.clone(); + + Ok(Response::new(GetProfileResponse { + profile: Some(profile), + })) + } + + async fn update_profile( + &self, + request: Request, + ) -> Result, Status> { + let req_p = match &request.get_ref().profile { + Some(v) => v, + None => { + return Err(Status::invalid_argument("profile is missing")); + } + }; + + let p: structs::ProfileConfiguration = req_p.into(); + p.profile.validate().map_err(|e| e.status())?; + + storage::update_profile(Path::new(&self.ds_path), &req_p.vendor_dir, &req_p.file, &p) + .map_err(|e| e.status())?; + + Ok(Response::new(())) + } + + async fn list_profiles( + &self, + request: Request, + ) -> Result, Status> { + let req = request.get_ref(); + let profiles = storage::get_profiles(Path::new(&self.ds_path), &req.vendor_dir) + .map_err(|e| e.status())?; + + let mut out: Vec = Vec::new(); + + for (k, v) in profiles { + out.push({ + let mut profile: Profile = + (&v).try_into().map_err(|e: anyhow::Error| e.status())?; + profile.vendor_dir = req.vendor_dir.clone(); + profile.file = k.clone(); + + profile + }); + } + + Ok(Response::new(ListProfilesResponse { + total_count: out.len() as u32, + result: out, + })) + } + + async fn delete_profile( + &self, + request: Request, + ) -> Result, Status> { + let req = request.get_ref(); + + storage::delete_profile(Path::new(&self.ds_path), &req.vendor_dir, &req.file) + .map_err(|e| e.status())?; + + Ok(Response::new(())) + } + + async fn create_device( + &self, + request: Request, + ) -> Result, Status> { + let req_d = match &request.get_ref().device { + Some(v) => v, + None => { + return Err(Status::invalid_argument("device is missing")); + } + }; + + storage::create_device( + Path::new(&self.ds_path), + &req_d.vendor_dir, + &req_d.file, + &req_d.into(), + ) + .map_err(|e| e.status())?; + + Ok(Response::new(())) + } + + async fn get_device( + &self, + request: Request, + ) -> Result, Status> { + let req = request.get_ref(); + let d = storage::get_device(Path::new(&self.ds_path), &req.vendor_dir, &req.file) + .map_err(|e| e.status())?; + + let mut device: Device = (&d).into(); + device.vendor_dir = req.vendor_dir.clone(); + device.file = req.file.clone(); + + Ok(Response::new(GetDeviceResponse { + device: Some(device), + })) + } + + async fn update_device( + &self, + request: Request, + ) -> Result, Status> { + let req_d = match &request.get_ref().device { + Some(v) => v, + None => { + return Err(Status::invalid_argument("device is missing")); + } + }; + + storage::update_device( + Path::new(&self.ds_path), + &req_d.vendor_dir, + &req_d.file, + &req_d.into(), + ) + .map_err(|e| e.status())?; + + Ok(Response::new(())) + } + + async fn list_devices( + &self, + request: Request, + ) -> Result, Status> { + let req = request.get_ref(); + let devices = storage::get_devices(Path::new(&self.ds_path), &req.vendor_dir) + .map_err(|e| e.status())?; + + let out: Vec = devices + .iter() + .map(|(k, v)| { + let mut device: Device = v.into(); + device.vendor_dir = req.vendor_dir.clone(); + device.file = k.clone(); + device + }) + .collect(); + + Ok(Response::new(ListDevicesResponse { + total_count: out.len() as u32, + result: out, + })) + } + + async fn delete_device( + &self, + request: Request, + ) -> Result, Status> { + let req = request.get_ref(); + + storage::delete_device(Path::new(&self.ds_path), &req.vendor_dir, &req.file) + .map_err(|e| e.status())?; + + Ok(Response::new(())) + } } diff --git a/test-runner/src/js/mod.rs b/interface/src/js/mod.rs similarity index 73% rename from test-runner/src/js/mod.rs rename to interface/src/js/mod.rs index 671d6a3..1f334ce 100644 --- a/test-runner/src/js/mod.rs +++ b/interface/src/js/mod.rs @@ -1,10 +1,11 @@ +use anyhow::{anyhow, Result}; use rquickjs::CatchResultExt; mod vendor_base64_js; mod vendor_buffer; mod vendor_ieee754; -pub fn run_tests(function: &str, codec: &str, codec_tests: &str) { +pub fn run_tests(function: &str, codec: &str, codec_tests: &str) -> Result<()> { let resolver = rquickjs::loader::BuiltinResolver::default() .with_module("base64-js") .with_module("ieee754") @@ -14,10 +15,10 @@ pub fn run_tests(function: &str, codec: &str, codec_tests: &str) { .with_module("ieee754", vendor_ieee754::SCRIPT) .with_module("buffer", vendor_buffer::SCRIPT); - let rt = rquickjs::Runtime::new().unwrap(); + let rt = rquickjs::Runtime::new()?; rt.set_loader(resolver, loader); - let ctx = rquickjs::Context::full(&rt).unwrap(); + let ctx = rquickjs::Context::full(&rt)?; let script = format!( r#" @@ -35,7 +36,7 @@ pub fn run_tests(function: &str, codec: &str, codec_tests: &str) { codec, codec_tests, function ); - ctx.with(|ctx| { + ctx.with(|ctx| -> Result<()> { let buff = rquickjs::Module::declare( ctx.clone(), "b", @@ -43,15 +44,17 @@ pub fn run_tests(function: &str, codec: &str, codec_tests: &str) { import { Buffer } from "buffer"; export { Buffer } "#, - ) - .expect("Declare script"); + )?; - let (buff, buff_promise) = buff.eval().catch(&ctx).expect("JS eval"); - let _ret: rquickjs::Value = buff_promise.finish().expect("Script finish"); - let buff: rquickjs::Function = buff.get("Buffer").expect("Get buffer"); + let (buff, buff_promise) = buff + .eval() + .catch(&ctx) + .map_err(|e| anyhow!("JS error: {}", e))?; + let _ret: rquickjs::Value = buff_promise.finish()?; + let buff: rquickjs::Function = buff.get("Buffer")?; let globals = ctx.globals(); - globals.set("Buffer", buff).expect("Set Buffer"); + globals.set("Buffer", buff)?; let mut eval_options = rquickjs::context::EvalOptions::default(); eval_options.strict = false; @@ -59,6 +62,8 @@ pub fn run_tests(function: &str, codec: &str, codec_tests: &str) { let _ret: rquickjs::Value = ctx .eval_with_options(script, eval_options) .catch(&ctx) - .expect("Running tests"); - }); + .map_err(|e| anyhow!("JS error: {}", e))?; + + Ok(()) + }) } diff --git a/test-runner/src/js/vendor_base64_js.rs b/interface/src/js/vendor_base64_js.rs similarity index 100% rename from test-runner/src/js/vendor_base64_js.rs rename to interface/src/js/vendor_base64_js.rs diff --git a/test-runner/src/js/vendor_buffer.rs b/interface/src/js/vendor_buffer.rs similarity index 100% rename from test-runner/src/js/vendor_buffer.rs rename to interface/src/js/vendor_buffer.rs diff --git a/test-runner/src/js/vendor_ieee754.rs b/interface/src/js/vendor_ieee754.rs similarity index 100% rename from test-runner/src/js/vendor_ieee754.rs rename to interface/src/js/vendor_ieee754.rs diff --git a/interface/src/main.rs b/interface/src/main.rs index ae77225..6d5f790 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -1,13 +1,16 @@ +use std::path::Path; + use anyhow::Result; use axum::http::{header, HeaderMap, HeaderValue, StatusCode, Uri}; use axum::{response::IntoResponse, Router}; -use clap::Parser; +use clap::{Parser, Subcommand}; use rust_embed::RustEmbed; use tonic::transport::Server; use tower::ServiceExt; mod api; mod grpc_multiplex; +mod js; mod storage; mod structs; @@ -15,7 +18,7 @@ mod structs; #[folder = "ui/build"] struct Asset; -#[derive(Parser, Debug)] +#[derive(Parser)] #[command(author, version, about, long_about = None)] struct Cli { /// Path to the lorawan-device-profiles directory @@ -30,12 +33,26 @@ struct Cli { default_value = "0.0.0.0:8090" )] bind: String, + + #[command(subcommand)] + command: Option, +} + +#[derive(Subcommand)] +enum Commands { + /// Run the tests. + RunTests {}, } #[tokio::main] async fn main() -> Result<()> { let cli = Cli::parse(); + if let Some(Commands::RunTests {}) = cli.command { + run_tests(&cli.profile_dir)?; + return Ok(()); + } + let web = Router::new() .fallback(service_static_handler) .into_service() @@ -80,3 +97,38 @@ async fn service_static_handler(uri: Uri) -> impl IntoResponse { (StatusCode::NOT_FOUND, HeaderMap::new(), vec![]) } } + +fn run_tests(path: &str) -> Result<()> { + let path = Path::new(path); + let vendors = storage::get_vendors(path)?; + for (vendor_dir, _) in vendors { + println!("> Vendor: {}", vendor_dir); + + let devices = storage::get_devices(path, &vendor_dir)?; + for (device_file, device) in devices { + println!(" > Device: {}", device_file); + + for fw in device.device.firmware { + println!(" > Firmware: {}", fw.version); + + if let Some(codec_file) = fw.codec { + println!(" > Codec: {}", codec_file); + let (codec, encode_test, decode_test) = + storage::get_codec(path, &vendor_dir, &codec_file)?; + + println!(" > Test decodeUplink"); + js::run_tests("decodeUplink", &codec, &decode_test)?; + println!(" > Test encodeDownlink"); + js::run_tests("encodeDownlink", &codec, &encode_test)?; + } + + for profile_file in fw.profiles { + println!(" > Profile: {}", profile_file); + let _profile = storage::get_profile(path, &vendor_dir, &profile_file)?; + } + } + } + } + + Ok(()) +} diff --git a/interface/src/storage.rs b/interface/src/storage.rs index 1a7c38d..2ae5e7e 100644 --- a/interface/src/storage.rs +++ b/interface/src/storage.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::fs; use std::path::Path; -use crate::structs::VendorConfiguration; +use crate::structs::{DeviceConfiguration, ProfileConfiguration, VendorConfiguration}; use anyhow::{anyhow, Result}; pub fn create_vendor(path: &Path, dir: &str, v: &VendorConfiguration) -> Result<()> { @@ -143,3 +143,134 @@ pub fn delete_codec(path: &Path, vendor_dir: &str, name: &str) -> Result<()> { Ok(()) } + +pub fn create_profile( + path: &Path, + vendor_dir: &str, + name: &str, + profile: &ProfileConfiguration, +) -> Result<()> { + fs::write( + path.join("vendors") + .join(vendor_dir) + .join("profiles") + .join(name), + toml::to_string_pretty(profile)?, + )?; + Ok(()) +} + +pub fn get_profile(path: &Path, vendor_dir: &str, name: &str) -> Result { + toml::from_str(&fs::read_to_string( + path.join("vendors") + .join(vendor_dir) + .join("profiles") + .join(name), + )?) + .map_err(|e| anyhow!("{}", e)) +} + +pub fn update_profile( + path: &Path, + vendor_dir: &str, + name: &str, + profile: &ProfileConfiguration, +) -> Result<()> { + create_profile(path, vendor_dir, name, profile) +} + +pub fn get_profiles( + path: &Path, + vendor_dir: &str, +) -> Result> { + let mut out = HashMap::new(); + let profiles = fs::read_dir(path.join("vendors").join(vendor_dir).join("profiles"))?; + for profile in profiles { + let profile = profile?.path(); + let profile_filename = profile.file_name().unwrap().to_str().unwrap().to_string(); + if !profile_filename.ends_with(".toml") { + continue; + } + + out.insert( + profile_filename.clone(), + get_profile(path, vendor_dir, &profile_filename)?, + ); + } + + Ok(out) +} + +pub fn delete_profile(path: &Path, vendor_dir: &str, name: &str) -> Result<()> { + fs::remove_file( + path.join("vendors") + .join(vendor_dir) + .join("profiles") + .join(name), + )?; + Ok(()) +} + +pub fn create_device( + path: &Path, + vendor_dir: &str, + name: &str, + device: &DeviceConfiguration, +) -> Result<()> { + fs::write( + path.join("vendors") + .join(vendor_dir) + .join("devices") + .join(name), + toml::to_string_pretty(device)?, + )?; + Ok(()) +} + +pub fn get_device(path: &Path, vendor_dir: &str, name: &str) -> Result { + toml::from_str(&fs::read_to_string( + path.join("vendors") + .join(vendor_dir) + .join("devices") + .join(name), + )?) + .map_err(|e| anyhow!("{}", e)) +} + +pub fn update_device( + path: &Path, + vendor_dir: &str, + name: &str, + device: &DeviceConfiguration, +) -> Result<()> { + create_device(path, vendor_dir, name, device) +} + +pub fn get_devices(path: &Path, vendor_dir: &str) -> Result> { + let mut out = HashMap::new(); + let devices = fs::read_dir(path.join("vendors").join(vendor_dir).join("devices"))?; + for device in devices { + let device = device?.path(); + let device_filename = device.file_name().unwrap().to_str().unwrap().to_string(); + if !device_filename.ends_with(".toml") { + continue; + } + + out.insert( + device_filename.clone(), + get_device(path, vendor_dir, &device_filename)?, + ); + } + + Ok(out) +} + +pub fn delete_device(path: &Path, vendor_dir: &str, name: &str) -> Result<()> { + fs::remove_file( + path.join("vendors") + .join(vendor_dir) + .join("devices") + .join(name), + )?; + Ok(()) +} diff --git a/interface/src/structs.rs b/interface/src/structs.rs index c916451..fdaacfb 100644 --- a/interface/src/structs.rs +++ b/interface/src/structs.rs @@ -1,4 +1,7 @@ use serde::{Deserialize, Serialize}; +use serde_valid::Validate; + +use crate::api; #[derive(Serialize, Deserialize)] pub struct VendorConfiguration { @@ -20,3 +23,260 @@ pub struct Vendor { pub struct VendorMetadata { pub homepage: Option, } + +#[derive(Serialize, Deserialize)] +pub struct ProfileConfiguration { + pub profile: Profile, +} + +#[derive(Default, Serialize, Deserialize, Validate)] +#[serde(default)] +pub struct Profile { + pub id: usize, + #[validate(enumerate = ["EU868", "US915", "CN779", "EU433", "AU915", "CN470", "AS923", "AS923-2", "AS923-3", "AS923-4", "KR920", "IN865", "RU864"])] + pub region: String, + #[validate(enumerate = ["1.0.0", "1.0.1", "1.0.2", "1.0.3","1.0.4", "1.1.0"])] + pub mac_version: String, + #[validate(enumerate = ["A", "B", "RP002-1.0.0", "RP002-1.0.1", "RP002-1.0.2", "RP002-1.0.3", "RP002-1.0.4"])] + pub reg_params_revision: String, + pub supports_otaa: bool, + pub supports_class_b: bool, + pub supports_class_c: bool, + pub max_eirp: usize, + + #[validate] + pub abp: ProfileAbp, + #[validate] + pub class_b: ProfileClassB, + pub class_c: ProfileClassC, +} + +#[derive(Default, Serialize, Deserialize, Validate)] +pub struct ProfileAbp { + #[validate(maximum = 15)] + pub rx1_delay: usize, + #[validate(maximum = 7)] + pub rx1_dr_offset: usize, + #[validate(maximum = 15)] + pub rx2_dr: usize, + pub rx2_freq: usize, +} + +#[derive(Default, Serialize, Deserialize, Validate)] +pub struct ProfileClassB { + pub timeout_secs: usize, + + #[validate(maximum = 7)] + pub ping_slot_nb_k: usize, + #[validate(maximum = 15)] + pub ping_slot_dr: usize, + pub ping_slot_freq: usize, +} + +#[derive(Default, Serialize, Deserialize)] +pub struct ProfileClassC { + pub timeout_secs: usize, +} + +#[derive(Serialize, Deserialize)] +pub struct DeviceConfiguration { + pub device: Device, +} + +#[derive(Default, Serialize, Deserialize)] +#[serde(default)] +pub struct Device { + pub name: String, + pub description: String, + pub firmware: Vec, + pub metadata: DeviceMetadata, +} + +#[derive(Default, Serialize, Deserialize)] +pub struct DeviceMetadata { + pub product_url: Option, + pub documentation_url: Option, +} + +#[derive(Serialize, Deserialize)] +pub struct DeviceFirmware { + pub version: String, + pub profiles: Vec, + pub codec: Option, +} + +impl From<&api::Vendor> for VendorConfiguration { + fn from(value: &api::Vendor) -> Self { + VendorConfiguration { + vendor: Vendor { + name: value.name.clone(), + id: value.lora_alliance_vendor_id, + ouis: value.ouis.clone(), + devices: Vec::new(), + metadata: VendorMetadata { + homepage: value.metadata.as_ref().map(|v| v.homepage.clone()), + }, + }, + } + } +} + +impl From<&VendorConfiguration> for api::Vendor { + fn from(value: &VendorConfiguration) -> Self { + api::Vendor { + dir: "".into(), + name: value.vendor.name.clone(), + lora_alliance_vendor_id: value.vendor.id, + ouis: value.vendor.ouis.clone(), + metadata: Some(api::VendorMetadata { + homepage: value.vendor.metadata.homepage.clone().unwrap_or_default(), + }), + } + } +} + +impl From<&api::Profile> for ProfileConfiguration { + fn from(value: &api::Profile) -> Self { + ProfileConfiguration { + profile: Profile { + id: value.id as usize, + region: value.region().into(), + mac_version: value.mac_version().into(), + reg_params_revision: value.reg_params_revision().into(), + supports_otaa: value.supports_otaa, + supports_class_b: value.supports_class_b, + supports_class_c: value.supports_class_c, + max_eirp: value.max_eirp as usize, + abp: value + .abp + .map(|v| ProfileAbp { + rx1_delay: v.rx1_delay as usize, + rx1_dr_offset: v.rx1_dr_offset as usize, + rx2_dr: v.rx2_dr as usize, + rx2_freq: v.rx2_freq as usize, + }) + .unwrap_or_default(), + class_b: value + .class_b + .map(|v| ProfileClassB { + timeout_secs: v.timeout_secs as usize, + ping_slot_nb_k: v.ping_slot_nb_k as usize, + ping_slot_dr: v.ping_slot_dr as usize, + ping_slot_freq: v.ping_slot_freq as usize, + }) + .unwrap_or_default(), + class_c: value + .class_c + .map(|v| ProfileClassC { + timeout_secs: v.timeout_secs as usize, + }) + .unwrap_or_default(), + }, + } + } +} + +impl TryFrom<&ProfileConfiguration> for api::Profile { + type Error = anyhow::Error; + + fn try_from(value: &ProfileConfiguration) -> Result { + let value = &value.profile; + + Ok(api::Profile { + vendor_dir: "".into(), + file: "".into(), + + id: value.id as u32, + region: api::Region::try_from(&value.region)?.into(), + mac_version: api::MacVersion::try_from(&value.mac_version)?.into(), + reg_params_revision: api::RegParamsRevision::try_from(&value.reg_params_revision)? + .into(), + supports_otaa: value.supports_otaa, + supports_class_b: value.supports_class_b, + supports_class_c: value.supports_class_c, + max_eirp: value.max_eirp as u32, + abp: Some(&value.abp).map(|v| api::AbpParams { + rx1_delay: v.rx1_delay as u32, + rx1_dr_offset: v.rx1_dr_offset as u32, + rx2_dr: v.rx2_dr as u32, + rx2_freq: v.rx2_freq as u32, + }), + class_b: Some(&value.class_b).map(|v| api::ClassBParams { + timeout_secs: v.timeout_secs as u32, + ping_slot_nb_k: v.ping_slot_nb_k as u32, + ping_slot_dr: v.ping_slot_dr as u32, + ping_slot_freq: v.ping_slot_freq as u32, + }), + class_c: Some(&value.class_c).map(|v| api::ClassCParams { + timeout_secs: v.timeout_secs as u32, + }), + }) + } +} + +impl From<&api::Device> for DeviceConfiguration { + fn from(value: &api::Device) -> Self { + DeviceConfiguration { + device: Device { + name: value.name.clone(), + description: value.description.clone(), + metadata: value + .metadata + .as_ref() + .map(|v| DeviceMetadata { + product_url: if v.product_url.is_empty() { + None + } else { + Some(v.product_url.clone()) + }, + documentation_url: if v.documentation_url.is_empty() { + None + } else { + Some(v.documentation_url.clone()) + }, + }) + .unwrap_or_default(), + firmware: value + .firmware + .iter() + .map(|v| DeviceFirmware { + version: v.version.clone(), + profiles: v.profiles.clone(), + codec: if v.codec.is_empty() { + None + } else { + Some(v.codec.clone()) + }, + }) + .collect(), + }, + } + } +} + +impl From<&DeviceConfiguration> for api::Device { + fn from(value: &DeviceConfiguration) -> Self { + let value = &value.device; + + api::Device { + vendor_dir: "".into(), + file: "".into(), + + name: value.name.clone(), + description: value.description.clone(), + firmware: value + .firmware + .iter() + .map(|v| api::DeviceFirmware { + version: v.version.clone(), + profiles: v.profiles.clone(), + codec: v.codec.clone().unwrap_or_default(), + }) + .collect(), + metadata: Some(&value.metadata).map(|v| api::DeviceMetadata { + product_url: v.product_url.clone().unwrap_or_default(), + documentation_url: v.documentation_url.clone().unwrap_or_default(), + }), + } + } +} diff --git a/interface/ui/package.json b/interface/ui/package.json index d6978da..883fd88 100644 --- a/interface/ui/package.json +++ b/interface/ui/package.json @@ -14,14 +14,14 @@ "@ant-design/icons": "^5.3.7", "@ant-design/pro-layout": "^7.19.8", "@api/grpc-web": "file:../api/grpc-web", + "ace-builds": "^1.36.4", "antd": "^5.19.1", - "codemirror": "^5.65.16", "events": "^3.3.0", "google-protobuf": "^3.21.2", "grpc-web": "^1.5.0", "history": "^5.3.0", "react": "^18.3.1", - "react-codemirror2": "^8.0.0", + "react-ace": "^13.0.0", "react-dom": "^18.3.1", "react-json-tree": "^0.19.0", "react-router-dom": "^6.24.1", @@ -29,7 +29,6 @@ }, "devDependencies": { "@testing-library/jest-dom": "^6.4.6", - "@types/codemirror": "^5.60.15", "@types/events": "^3.0.3", "@types/google-protobuf": "^3.15.12", "@types/react": "^18.3.3", diff --git a/interface/ui/src/App.tsx b/interface/ui/src/App.tsx index 85eb03f..8c8b807 100644 --- a/interface/ui/src/App.tsx +++ b/interface/ui/src/App.tsx @@ -3,13 +3,20 @@ import React, { useState } from "react"; import type { RouterProps } from "react-router-dom"; import { Router, Routes, Route } from "react-router-dom"; -import { Layout } from "antd"; +import { Layout, Typography } from "antd"; import Menu from "./components/Menu"; import AddVendor from "./views/vendors/AddVendor"; import EditVendor from "./views/vendors/EditVendor"; import ListCodecs from "./views/codecs/ListCodecs"; import EditCodec from "./views/codecs/EditCodec"; +import CreateCodec from "./views/codecs/CreateCodec"; +import ListProfiles from "./views/profiles/ListProfiles"; +import EditProfile from "./views/profiles/EditProfile"; +import CreateProfile from "./views/profiles/CreateProfile"; +import ListDevices from "./views/devices/ListDevices"; +import EditDevice from "./views/devices/EditDevice"; +import CreateDevice from "./views/devices/CreateDevice"; import history from "./history"; @@ -34,6 +41,7 @@ function App() { + LoRaWAN® Device Profiles Editor @@ -44,7 +52,14 @@ function App() { } /> } /> } /> + } /> } /> + } /> + } /> + } /> + } /> + } /> + } /> diff --git a/interface/ui/src/components/CodeEditor.tsx b/interface/ui/src/components/CodeEditor.tsx index 2182cf4..03df514 100644 --- a/interface/ui/src/components/CodeEditor.tsx +++ b/interface/ui/src/components/CodeEditor.tsx @@ -1,10 +1,11 @@ import { useState, useEffect } from "react"; -import { Controlled as CodeMirror } from "react-codemirror2"; -import type { Editor, EditorChange } from "codemirror"; import { Form } from "antd"; +import AceEditor from "react-ace"; -import "codemirror/mode/javascript/javascript"; +import "ace-builds/src-noconflict/mode-javascript"; +import "ace-builds/src-noconflict/mode-json"; +import "ace-builds/src-noconflict/theme-github"; interface IProps { label?: string; @@ -12,6 +13,7 @@ interface IProps { required?: boolean; disabled?: boolean; tooltip?: string; + mode?: string; } function CodeEditor(props: IProps) { @@ -24,28 +26,25 @@ function CodeEditor(props: IProps) { setReloadKey(k => k + 1); }, [form, props]); - const handleChange = (editor: Editor, data: EditorChange, newCode: string) => { - setValue(newCode); + const onChange = (newValue: string) => { + setValue(newValue); form.setFieldsValue({ - [props.name]: newCode, + [props.name]: newValue, }); - }; - - const codeMirrorOptions = { - lineNumbers: true, - mode: "javascript", - theme: "base16-light", - readOnly: props.disabled, - }; + } return (
-
diff --git a/interface/ui/src/components/Menu.tsx b/interface/ui/src/components/Menu.tsx index 23e5e65..e6e1d62 100644 --- a/interface/ui/src/components/Menu.tsx +++ b/interface/ui/src/components/Menu.tsx @@ -23,11 +23,20 @@ function SideMenu() { }); }; + const deselectVendor = () => { + setVendor(undefined); + DeviceProfileStore.listVendors((resp: ListVendorsResponse) => { + setVendors(resp.getResultList()); + }); + } + DeviceProfileStore.on("change", loadVendors); + DeviceProfileStore.on("delete", deselectVendor); loadVendors(); return () => { DeviceProfileStore.removeAllListeners("change"); + DeviceProfileStore.removeAllListeners("delete"); }; }, []); @@ -84,11 +93,11 @@ function SideMenu() { ]; return (
- {vendor ? : } + /> : }
); } diff --git a/interface/ui/src/index.css b/interface/ui/src/index.css index 7bbd8b9..c58623e 100644 --- a/interface/ui/src/index.css +++ b/interface/ui/src/index.css @@ -55,7 +55,3 @@ .layout-content .content { background: #ffffff; } - -.CodeMirror { - height: 600px; -} diff --git a/interface/ui/src/index.tsx b/interface/ui/src/index.tsx index 751d7ea..af8d463 100644 --- a/interface/ui/src/index.tsx +++ b/interface/ui/src/index.tsx @@ -4,8 +4,6 @@ import ReactDOM from "react-dom/client"; import App from "./App"; import "antd/dist/reset.css"; -import "codemirror/lib/codemirror.css"; -import "codemirror/theme/base16-light.css"; import "./index.css"; const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement); diff --git a/interface/ui/src/stores/DeviceProfileStore.ts b/interface/ui/src/stores/DeviceProfileStore.ts index 510b67a..9d8ba37 100644 --- a/interface/ui/src/stores/DeviceProfileStore.ts +++ b/interface/ui/src/stores/DeviceProfileStore.ts @@ -13,6 +13,24 @@ import { UpdateCodecRequest, ListCodecsRequest, ListCodecsResponse, + DeleteCodecRequest, + TestCodecRequest, + TestCodecResponse, + DeleteVendorRequest, + CreateProfileRequest, + GetProfileRequest, + GetProfileResponse, + UpdateProfileRequest, + ListProfilesRequest, + ListProfilesResponse, + DeleteProfileRequest, + CreateDeviceRequest, + GetDeviceRequest, + GetDeviceResponse, + UpdateDeviceRequest, + ListDevicesRequest, + ListDevicesResponse, + DeleteDeviceRequest, } from "@api/grpc-web/api_pb"; import { notification } from "antd"; @@ -58,10 +76,23 @@ class DeviceProfileStore extends EventEmitter { duration: 3, }); + this.emit("change"); + callbackFunc(); }); } + getVendor = (req: GetVendorRequest, callbackFunc: (resp: GetVendorResponse) => void) => { + this.client.getVendor(req, undefined, (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + } + updateVendor = (req: UpdateVendorRequest, callbackFunc: () => void) => { this.client.updateVendor(req, undefined, (err) => { if (err !== null) { @@ -74,13 +105,14 @@ class DeviceProfileStore extends EventEmitter { duration: 3, }); + this.emit("change"); + callbackFunc(); }); } - - getVendor = (req: GetVendorRequest, callbackFunc: (resp: GetVendorResponse) => void) => { - this.client.getVendor(req, undefined, (err, resp) => { + listVendors = (callbackFunc: (resp: ListVendorsResponse) => void) => { + this.client.listVendors(new google_protobuf_empty_pb.Empty(), undefined, (err, resp) => { if (err !== null) { HandleError(err); return; @@ -90,14 +122,21 @@ class DeviceProfileStore extends EventEmitter { }); } - listVendors = (callbackFunc: (resp: ListVendorsResponse) => void) => { - this.client.listVendors(new google_protobuf_empty_pb.Empty(), undefined, (err, resp) => { + deleteVedor = (req: DeleteVendorRequest, callbackFunc: () => void) => { + this.client.deleteVendor(req, undefined, (err) => { if (err !== null) { HandleError(err); return; } - callbackFunc(resp); + notification.success({ + message: "Vendor deleted", + duration: 3, + }); + + this.emit("delete"); + + callbackFunc(); }); } @@ -139,7 +178,7 @@ class DeviceProfileStore extends EventEmitter { }); } - updateCodec(req: UpdateCodecRequest, callbackFunc: () => void) { + updateCodec = (req: UpdateCodecRequest, callbackFunc: () => void) => { this.client.updateCodec(req, undefined, (err) => { if (err !== null) { HandleError(err); @@ -154,6 +193,174 @@ class DeviceProfileStore extends EventEmitter { callbackFunc(); }); } + + deleteCodec = (req: DeleteCodecRequest, callbackFunc: () => void) => { + this.client.deleteCodec(req, undefined, (err) => { + if (err !== null) { + HandleError(err); + return; + } + + notification.success({ + message: "Codec deleted", + duration: 3, + }); + + callbackFunc(); + }); + } + + testCodec = (req: TestCodecRequest, callbackFunc: (resp: TestCodecResponse) => void) => { + this.client.testCodec(req, undefined, (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + } + + createProfile = (req: CreateProfileRequest, callbackFunc: () => void) => { + this.client.createProfile(req, undefined, (err) => { + if (err !== null) { + HandleError(err); + return; + } + + notification.success({ + message: "Profile created", + duration: 3, + }); + + callbackFunc(); + }); + } + + getProfile = (req: GetProfileRequest, callbackFunc: (resp: GetProfileResponse) => void) => { + this.client.getProfile(req, undefined, (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + } + + updateProfile = (req: UpdateProfileRequest, callbackFunc: () => void) => { + this.client.updateProfile(req, undefined, (err) => { + if (err !== null) { + HandleError(err); + return; + } + + notification.success({ + message: "Profile updated", + duration: 3, + }); + + callbackFunc(); + }); + } + + listProfiles = (req: ListProfilesRequest, callbackFunc: (resp: ListProfilesResponse) => void) => { + this.client.listProfiles(req, undefined, (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + } + + deleteProfile = (req: DeleteProfileRequest, callbackFunc: () => void) => { + this.client.deleteProfile(req, undefined, (err) => { + if (err !== null) { + HandleError(err); + return; + } + + notification.success({ + message: "Profile deleted", + duration: 3, + }); + + callbackFunc(); + }); + } + + createDevice = (req: CreateDeviceRequest, callbackFunc: () => void) => { + this.client.createDevice(req, undefined, (err) => { + if (err !== null) { + HandleError(err); + return; + } + + notification.success({ + message: "Device created", + duration: 3, + }); + + callbackFunc(); + }); + } + + getDevice = (req: GetDeviceRequest, callbackFunc: (resp: GetDeviceResponse) => void) => { + this.client.getDevice(req, undefined, (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + }; + + updateDevice = (req: UpdateDeviceRequest, callbackFunc: () => void) => { + this.client.updateDevice(req, undefined, (err) => { + if (err !== null) { + HandleError(err); + return; + } + + notification.success({ + message: "Device updated", + duration: 3, + }); + + + callbackFunc(); + }); + } + + listDevices = (req: ListDevicesRequest, callbackFunc: (resp: ListDevicesResponse) => void) => { + this.client.listDevices(req, undefined, (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + } + + deleteDevice = (req: DeleteDeviceRequest, callbackFunc: () => void) => { + this.client.deleteDevice(req, undefined, (err) => { + if (err !== null) { + HandleError(err); + return; + } + + notification.success({ + message: "Device deleted", + duration: 3, + }); + + callbackFunc(); + }); + } } const deviceProfileStore = new DeviceProfileStore(); diff --git a/interface/ui/src/views/codecs/CodecForm.tsx b/interface/ui/src/views/codecs/CodecForm.tsx index 74370e8..9ea0fd8 100644 --- a/interface/ui/src/views/codecs/CodecForm.tsx +++ b/interface/ui/src/views/codecs/CodecForm.tsx @@ -1,17 +1,56 @@ -import { Form, Input, InputNumber, Button, } from "antd"; +import { useState } from "react"; +import { Form, Button, Space, Input, notification, Alert } from "antd"; -import { Codec } from "@api/grpc-web/api_pb"; +import { Codec, TestCodecRequest, TestCodecResponse } from "@api/grpc-web/api_pb"; import CodeEditor from "../../components/CodeEditor"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + interface IProps { initialValues: Codec; onFinish: (obj: Codec) => void; + update?: boolean; } function CodecForm(props: IProps) { + const [form] = Form.useForm(); + const [codecErrors, setCodecErrors] = useState(undefined); + const onFinish = (values: Codec.AsObject) => { + const v = Object.assign(props.initialValues.toObject(), values); + + const codec = new Codec(); + codec.setVendorDir(v.vendorDir); + codec.setFile(v.file); + codec.setCodec(v.codec); + codec.setDecodeTests(v.decodeTests); + codec.setEncodeTests(v.encodeTests); + + props.onFinish(codec); + } + + const runCodecTests = () => { + const req = new TestCodecRequest(); + const codec = new Codec(); + + codec.setCodec(form.getFieldValue('codec')); + codec.setDecodeTests(form.getFieldValue('decodeTests')); + codec.setEncodeTests(form.getFieldValue('encodeTests')); + + req.setCodec(codec); + DeviceProfileStore.testCodec(req, (resp: TestCodecResponse) => { + if (resp.getError() === "") { + notification.success({ + message: "All tests are passing", + duration: 3, + }); + setCodecErrors(undefined); + } else { + setCodecErrors(resp.getError()); + } + }); } return ( @@ -19,8 +58,28 @@ function CodecForm(props: IProps) { layout="vertical" initialValues={props.initialValues.toObject()} onFinish={onFinish} + form={form} > - + + + + + + + {codecErrors && ( + + + + )} + + + + ); } diff --git a/interface/ui/src/views/codecs/CreateCodec.tsx b/interface/ui/src/views/codecs/CreateCodec.tsx new file mode 100644 index 0000000..6a25c00 --- /dev/null +++ b/interface/ui/src/views/codecs/CreateCodec.tsx @@ -0,0 +1,84 @@ +import { useNavigate, useParams } from "react-router-dom"; + +import { Space, Breadcrumb, Card } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; + +import { Codec, CreateCodecRequest } from "@api/grpc-web/api_pb"; +import CodecForm from "./CodecForm"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + +function CreateCodec() { + const navigate = useNavigate(); + const { vendorDir } = useParams(); + + const onFinish = (obj: Codec) => { + obj.setVendorDir(vendorDir!); + + const req = new CreateCodecRequest(); + req.setCodec(obj); + + DeviceProfileStore.createCodec(req, () => { + navigate(`/vendors/${vendorDir}/codecs`); + }); + }; + + const codec = new Codec(); + codec.setCodec(`/** + * Decode uplink function + * + * @param {object} input + * @param {number[]} input.bytes Byte array containing the uplink payload, e.g. [255, 230, 255, 0] + * @param {number} input.fPort Uplink fPort. + * @param {Record} input.variables Object containing the configured device variables. + * + * @returns {{data: object}} Object representing the decoded payload. + */ +function decodeUplink(input) { + return { + data: { + // temp: 22.5 + } + }; +} + +/** + * Encode downlink function. + * + * @param {object} input + * @param {object} input.data Object representing the payload that must be encoded. + * @param {Record} input.variables Object containing the configured device variables. + * + * @returns {{bytes: number[]}} Byte array containing the downlink payload. + */ +function encodeDownlink(input) { + return { + // bytes: [225, 230, 255, 0] + }; +} +`); + codec.setEncodeTests(`[]`); + codec.setDecodeTests(`[]`); + + return ( + + ( + + + Codecs + + + Add + + + )} + title="Add codec" + /> + + + + + ); +} + +export default CreateCodec; diff --git a/interface/ui/src/views/codecs/EditCodec.tsx b/interface/ui/src/views/codecs/EditCodec.tsx index 248e52a..1a25f4a 100644 --- a/interface/ui/src/views/codecs/EditCodec.tsx +++ b/interface/ui/src/views/codecs/EditCodec.tsx @@ -1,18 +1,18 @@ import { useEffect, useState } from "react"; -import { useParams, Link } from "react-router-dom"; +import { useParams, useNavigate } from "react-router-dom"; -import { Space, Breadcrumb, Card, Table } from "antd"; +import { Space, Breadcrumb, Card, Button, Popconfirm } from "antd"; import { PageHeader } from "@ant-design/pro-layout"; -import { GetCodecRequest, GetCodecResponse, Codec } from "@api/grpc-web/api_pb"; +import { GetCodecRequest, GetCodecResponse, Codec, UpdateCodecRequest, DeleteCodecRequest } from "@api/grpc-web/api_pb"; import CodecForm from "./CodecForm"; import DeviceProfileStore from "../../stores/DeviceProfileStore"; -import CodeEditor from "../../components/CodeEditor"; function EditCodec() { const [codec, setCodec] = useState(undefined); const { vendorDir, file } = useParams(); + const navigate = useNavigate(); useEffect(() => { const req = new GetCodecRequest(); @@ -24,7 +24,23 @@ function EditCodec() { }); }, [vendorDir, file]); - const onFinish = (obj: Codec) => { } + const onFinish = (obj: Codec) => { + const req = new UpdateCodecRequest(); + req.setCodec(obj); + DeviceProfileStore.updateCodec(req, () => { + navigate(`/vendors/${vendorDir}/codecs`); + }); + } + + const onDelete = () => { + const req = new DeleteCodecRequest(); + req.setVendorDir(vendorDir!); + req.setFile(file!); + + DeviceProfileStore.deleteCodec(req, () => { + navigate(`/vendors/${vendorDir}/codecs`); + }); + } if (codec === undefined) { return null; @@ -47,9 +63,19 @@ function EditCodec() { )} title="Update codec" + extra={ + + + + } /> - + ); diff --git a/interface/ui/src/views/codecs/ListCodecs.tsx b/interface/ui/src/views/codecs/ListCodecs.tsx index 108243d..1ae9d38 100644 --- a/interface/ui/src/views/codecs/ListCodecs.tsx +++ b/interface/ui/src/views/codecs/ListCodecs.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from "react"; import { useParams, Link } from "react-router-dom"; -import { Space, Breadcrumb, Card, Table } from "antd"; +import { Space, Breadcrumb, Card, Table, Button } from "antd"; import { PageHeader } from "@ant-design/pro-layout"; -import { ListCodecsRequest, ListCodecsResponse, Codec } from "@api/grpc-web/api_pb"; +import { ListCodecsRequest, ListCodecsResponse } from "@api/grpc-web/api_pb"; import DeviceProfileStore from "../../stores/DeviceProfileStore"; function ListCodecs() { @@ -49,6 +49,9 @@ function ListCodecs() { )} title="Codecs list" + extra={ + + } /> diff --git a/interface/ui/src/views/devices/CreateDevice.tsx b/interface/ui/src/views/devices/CreateDevice.tsx new file mode 100644 index 0000000..eb7f62e --- /dev/null +++ b/interface/ui/src/views/devices/CreateDevice.tsx @@ -0,0 +1,48 @@ +import { useNavigate, useParams } from "react-router-dom"; + +import { Space, Breadcrumb, Card } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; + +import { Device, CreateDeviceRequest } from "@api/grpc-web/api_pb"; +import DeviceForm from "./DeviceForm"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + +function CreateDevice() { + const { vendorDir } = useParams(); + const navigate = useNavigate(); + + const onFinish = (obj: Device) => { + const req = new CreateDeviceRequest(); + req.setDevice(obj); + + DeviceProfileStore.createDevice(req, () => { + navigate(`/vendors/${vendorDir}/devices`); + }); + } + + const device = new Device(); + device.setVendorDir(vendorDir!); + + return ( + + ( + + + Devices + + + Add + + + )} + title="Add device" + /> + + + + + ); +} + +export default CreateDevice; diff --git a/interface/ui/src/views/devices/DeviceForm.tsx b/interface/ui/src/views/devices/DeviceForm.tsx new file mode 100644 index 0000000..3185b7c --- /dev/null +++ b/interface/ui/src/views/devices/DeviceForm.tsx @@ -0,0 +1,157 @@ +import { useState, useEffect } from "react"; + +import { Form, Input, Button, Select, Row, Col } from "antd"; +import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons"; + +import { Device, DeviceFirmware, DeviceMetadata, Codec, Profile, ListCodecsRequest, ListProfilesRequest, ListProfilesResponse, ListCodecsResponse } from "@api/grpc-web/api_pb"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; +import { slugify } from "../helpers"; + +interface IProps { + initialValues: Device; + onFinish: (obj: Device) => void; + update?: boolean; +} + +function DeviceForm(props: IProps) { + const [form] = Form.useForm(); + const [profiles, setProfiles] = useState([]); + const [codecs, setCodecs] = useState([]); + + useEffect(() => { + const v = props.initialValues; + + const codecsReq = new ListCodecsRequest(); + codecsReq.setVendorDir(v.getVendorDir()); + DeviceProfileStore.listCodecs(codecsReq, (resp: ListCodecsResponse) => { + setCodecs(resp.getResultList()); + }); + + const profilesReq = new ListProfilesRequest(); + profilesReq.setVendorDir(v.getVendorDir()); + DeviceProfileStore.listProfiles(profilesReq, (resp: ListProfilesResponse) => { + setProfiles(resp.getResultList()); + }); + }, [props.initialValues]); + + const onFinish = (values: Device.AsObject) => { + const v = Object.assign(props.initialValues.toObject(), values); + + const device = new Device(); + const deviceMetadata = new DeviceMetadata(); + + device.setVendorDir(v.vendorDir); + device.setFile(v.file); + + device.setName(v.name); + device.setDescription(v.description); + deviceMetadata.setProductUrl(v.metadata?.productUrl || ""); + deviceMetadata.setDocumentationUrl(v.metadata?.documentationUrl || ""); + device.setMetadata(deviceMetadata); + + device.setFirmwareList(v.firmwareList.map((v) => { + const fw = new DeviceFirmware(); + fw.setVersion(v.version); + fw.setProfilesList(v.profilesList); + fw.setCodec(v.codec); + return fw; + })); + + props.onFinish(device); + } + + const onChangeName = (e: React.ChangeEvent) => { + if (props.update) { + return; + } + + form.setFieldsValue({ + file: slugify(e.target.value) + '.toml', + }); + } + + return ( +
+ + + + + + + + + + + + + + + + + {(fields, { add, remove }) => ( + <> + {fields.map(({ key, name, ...restField }) => ( + +
+ + + + + { return { label: v.getFile(), value: v.getFile() } })} /> + + + + remove(name)} /> + + + ))} + + + + + )} + + + + ); +} + +export default DeviceForm; diff --git a/interface/ui/src/views/devices/EditDevice.tsx b/interface/ui/src/views/devices/EditDevice.tsx new file mode 100644 index 0000000..4b0da39 --- /dev/null +++ b/interface/ui/src/views/devices/EditDevice.tsx @@ -0,0 +1,83 @@ +import { useEffect, useState } from "react"; +import { useParams, useNavigate } from "react-router-dom"; + +import { Space, Breadcrumb, Card, Button, Popconfirm } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; + +import { GetDeviceRequest, GetDeviceResponse, Device, DeleteDeviceRequest, UpdateDeviceRequest } from "@api/grpc-web/api_pb"; +import DeviceForm from "./DeviceForm"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + +function EditDevice() { + const [device, setDevice] = useState(undefined); + const { vendorDir, file } = useParams(); + const navigate = useNavigate(); + + useEffect(() => { + const req = new GetDeviceRequest(); + req.setFile(file!); + req.setVendorDir(vendorDir!); + + DeviceProfileStore.getDevice(req, (resp: GetDeviceResponse) => { + setDevice(resp.getDevice()); + }); + }, [vendorDir, file]); + + const onFinish = (obj: Device) => { + const req = new UpdateDeviceRequest(); + req.setDevice(obj); + DeviceProfileStore.updateDevice(req, () => { + navigate(`/vendors/${vendorDir}/devices`); + }); + } + + const onDelete = () => { + const req = new DeleteDeviceRequest(); + req.setVendorDir(vendorDir!); + req.setFile(file!); + + DeviceProfileStore.deleteDevice(req, () => { + navigate(`/vendors/${vendorDir}/profiles`); + }); + } + + if (device === undefined) { + return null; + } + + return ( + + ( + + + Devices + + + {file} + + + Update + + + )} + title="Update device" + extra={ + + + + } + /> + + + + + ); +} + +export default EditDevice; diff --git a/interface/ui/src/views/devices/ListDevices.tsx b/interface/ui/src/views/devices/ListDevices.tsx new file mode 100644 index 0000000..8849fa4 --- /dev/null +++ b/interface/ui/src/views/devices/ListDevices.tsx @@ -0,0 +1,64 @@ +import { useEffect, useState } from "react"; +import { useParams, Link } from "react-router-dom"; + +import { Space, Breadcrumb, Card, Table, Button } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; + +import { ListDevicesRequest, ListDevicesResponse } from "@api/grpc-web/api_pb"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + +function ListDevices() { + const [devices, setDevices] = useState(undefined); + const { vendorDir } = useParams(); + + const columns = [ + { + title: "Filename", + dataIndex: "file", + key: "file", + render: (text: string) => { + return {text} + }, + } + ]; + + useEffect(() => { + const req = new ListDevicesRequest(); + req.setVendorDir(vendorDir!); + + DeviceProfileStore.listDevices(req, (resp: ListDevicesResponse) => { + setDevices(resp); + }); + + }, [vendorDir]); + + if (devices === undefined) { + return null; + } + + return ( + + ( + + + Devices + + + List + + + )} + title="Devices list" + extra={ + + } + /> + +
+ + + ); +} + +export default ListDevices; diff --git a/interface/ui/src/views/profiles/CreateProfile.tsx b/interface/ui/src/views/profiles/CreateProfile.tsx new file mode 100644 index 0000000..2e99eeb --- /dev/null +++ b/interface/ui/src/views/profiles/CreateProfile.tsx @@ -0,0 +1,49 @@ +import { useNavigate, useParams } from "react-router-dom"; + +import { Space, Breadcrumb, Card } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; + +import { Profile, CreateProfileRequest } from "@api/grpc-web/api_pb"; +import ProfileForm from "./ProfileForm"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + +function CreateProfile() { + const { vendorDir } = useParams(); + const navigate = useNavigate(); + + const onFinish = (obj: Profile) => { + obj.setVendorDir(vendorDir!); + + const req = new CreateProfileRequest(); + req.setProfile(obj); + + DeviceProfileStore.createProfile(req, () => { + navigate(`/vendors/${vendorDir}/profiles`); + }); + } + + const profile = new Profile(); + + return ( + + ( + + + Profiles + + + Add + + + )} + title="Add profile" + /> + + + + + ); +} + +export default CreateProfile; diff --git a/interface/ui/src/views/profiles/EditProfile.tsx b/interface/ui/src/views/profiles/EditProfile.tsx new file mode 100644 index 0000000..9b3b484 --- /dev/null +++ b/interface/ui/src/views/profiles/EditProfile.tsx @@ -0,0 +1,83 @@ +import { useEffect, useState } from "react"; +import { useParams, useNavigate } from "react-router-dom"; + +import { Space, Breadcrumb, Card, Button, Popconfirm } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; + +import { GetProfileRequest, GetProfileResponse, Profile, UpdateProfileRequest, DeleteProfileRequest } from "@api/grpc-web/api_pb"; +import ProfileForm from "./ProfileForm"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + +function EditProfile() { + const [profile, setProfile] = useState(undefined); + const { vendorDir, file } = useParams(); + const navigate = useNavigate(); + + useEffect(() => { + const req = new GetProfileRequest(); + req.setFile(file!); + req.setVendorDir(vendorDir!); + + DeviceProfileStore.getProfile(req, (resp: GetProfileResponse) => { + setProfile(resp.getProfile()); + }); + }, [vendorDir, file]); + + const onFinish = (obj: Profile) => { + const req = new UpdateProfileRequest(); + req.setProfile(obj); + DeviceProfileStore.updateProfile(req, () => { + navigate(`/vendors/${vendorDir}/profiles`); + }); + } + + const onDelete = () => { + const req = new DeleteProfileRequest(); + req.setVendorDir(vendorDir!); + req.setFile(file!); + + DeviceProfileStore.deleteProfile(req, () => { + navigate(`/vendors/${vendorDir}/profiles`); + }); + } + + if (profile === undefined) { + return null; + } + + return ( + + ( + + + Profiles + + + {file} + + + Update + + + )} + title="Update profile" + extra={ + + + + } + /> + + + + + ); +} + +export default EditProfile; diff --git a/interface/ui/src/views/profiles/ListProfiles.tsx b/interface/ui/src/views/profiles/ListProfiles.tsx new file mode 100644 index 0000000..cb54430 --- /dev/null +++ b/interface/ui/src/views/profiles/ListProfiles.tsx @@ -0,0 +1,64 @@ +import { useEffect, useState } from "react"; +import { useParams, Link } from "react-router-dom"; + +import { Space, Breadcrumb, Card, Table, Button } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; + +import { ListProfilesRequest, ListProfilesResponse } from "@api/grpc-web/api_pb"; +import DeviceProfileStore from "../../stores/DeviceProfileStore"; + +function ListProfiles() { + const [profiles, setProfiles] = useState(undefined); + const { vendorDir } = useParams(); + + const columns = [ + { + title: "Filename", + dataIndex: "file", + key: "file", + render: (text: string) => { + return {text} + }, + } + ]; + + useEffect(() => { + const req = new ListProfilesRequest(); + req.setVendorDir(vendorDir!); + + DeviceProfileStore.listProfiles(req, (resp: ListProfilesResponse) => { + setProfiles(resp); + }); + + }, [vendorDir]); + + if (profiles === undefined) { + return null; + } + + return ( + + ( + + + Profiles + + + List + + + )} + title="Profiles list" + extra={ + + } + /> + +
+ + + ); +} + +export default ListProfiles; diff --git a/interface/ui/src/views/profiles/ProfileForm.tsx b/interface/ui/src/views/profiles/ProfileForm.tsx new file mode 100644 index 0000000..3c73726 --- /dev/null +++ b/interface/ui/src/views/profiles/ProfileForm.tsx @@ -0,0 +1,235 @@ +import { useState, useEffect } from "react"; + +import { Form, Input, InputNumber, Button, Select, Switch, Row, Col } from "antd"; + +import { Profile, MacVersion, RegParamsRevision, AbpParams, ClassBParams, ClassCParams, Region } from "@api/grpc-web/api_pb"; + +interface IProps { + initialValues: Profile; + onFinish: (obj: Profile) => void; + update?: boolean; +} + +function ProfileForm(props: IProps) { + const [supportsOtaa, setSupportsOtaa] = useState(false); + const [supportsClassB, setSupportsClassB] = useState(false); + const [supportsClassC, setSupportsClassC] = useState(false); + + useEffect(() => { + const v = props.initialValues; + setSupportsOtaa(v.getSupportsOtaa()); + setSupportsClassB(v.getSupportsClassB()); + setSupportsClassC(v.getSupportsClassC()); + }, [props]); + + + const onFinish = (values: Profile.AsObject) => { + const v = Object.assign(props.initialValues.toObject(), values); + + const profile = new Profile(); + + profile.setVendorDir(v.vendorDir); + profile.setFile(v.file); + + profile.setId(v.id); + profile.setRegion(v.region); + profile.setMacVersion(v.macVersion); + profile.setRegParamsRevision(v.regParamsRevision); + profile.setSupportsOtaa(v.supportsOtaa); + profile.setSupportsClassB(v.supportsClassB); + profile.setSupportsClassC(v.supportsClassC); + profile.setMaxEirp(v.maxEirp); + + if (!v.supportsOtaa && v.abp) { + const abp = new AbpParams(); + abp.setRx1Delay(v.abp.rx1Delay); + abp.setRx1DrOffset(v.abp.rx1DrOffset); + abp.setRx2Dr(v.abp.rx2Dr); + abp.setRx2Freq(v.abp.rx2Freq); + + profile.setAbp(abp); + } + + if (v.supportsClassB && v.classB) { + const classB = new ClassBParams(); + classB.setTimeoutSecs(v.classB.timeoutSecs); + classB.setPingSlotNbK(v.classB.pingSlotNbK); + classB.setPingSlotDr(v.classB.pingSlotDr); + classB.setPingSlotFreq(v.classB.pingSlotFreq); + + profile.setClassB(classB); + } + + if (v.supportsClassC && v.classC) { + const classC = new ClassCParams(); + classC.setTimeoutSecs(v.classC.timeoutSecs); + + profile.setClassC(classC); + } + + props.onFinish(profile); + } + + return ( +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {!supportsOtaa && ( + + + + + + + + + + + + + + + + + + + + + + + )} + {supportsClassB && ( + + + + + + + + + + + + + + + + + + + + + + + )} + {supportsClassC && ( + + + + )} + + + + ); +} + +export default ProfileForm; diff --git a/interface/ui/src/views/vendors/EditVendor.tsx b/interface/ui/src/views/vendors/EditVendor.tsx index 918e671..e66396f 100644 --- a/interface/ui/src/views/vendors/EditVendor.tsx +++ b/interface/ui/src/views/vendors/EditVendor.tsx @@ -1,16 +1,17 @@ import { useState, useEffect } from "react"; -import { useParams } from "react-router"; +import { useParams, useNavigate } from "react-router-dom"; -import { Space, Breadcrumb, Card } from "antd"; +import { Space, Breadcrumb, Card, Button, Popconfirm } from "antd"; import { PageHeader } from "@ant-design/pro-layout"; -import { Vendor, GetVendorRequest, GetVendorResponse, Vendor, UpdateVendorRequest } from "@api/grpc-web/api_pb"; +import { Vendor, GetVendorRequest, GetVendorResponse, DeleteVendorRequest, UpdateVendorRequest } from "@api/grpc-web/api_pb"; import VendorForm from "./VendorForm"; import DeviceProfileStore from "../../stores/DeviceProfileStore"; function EditVendor() { const [vendor, setVendor] = useState(undefined); const { dir } = useParams(); + const navigate = useNavigate(); useEffect(() => { const getVendor = () => { @@ -26,16 +27,25 @@ function EditVendor() { }, [dir]); - if (vendor === undefined) { - return null; - } - const onFinish = (obj: Vendor) => { const req = new UpdateVendorRequest(); req.setVendor(obj); DeviceProfileStore.updateVendor(req, () => { }); }; + const onDeleteVendor = () => { + const req = new DeleteVendorRequest(); + req.setDir(dir!); + + DeviceProfileStore.deleteVedor(req, () => { + navigate("/"); + }); + } + + if (vendor === undefined) { + return null; + } + return ( )} title="Update vendor" + extra={ + + + + } /> - + ); diff --git a/interface/ui/src/views/vendors/VendorForm.tsx b/interface/ui/src/views/vendors/VendorForm.tsx index 3d7ad65..50ee4ff 100644 --- a/interface/ui/src/views/vendors/VendorForm.tsx +++ b/interface/ui/src/views/vendors/VendorForm.tsx @@ -7,6 +7,7 @@ import { slugify } from "../helpers"; interface IProps { initialValues: Vendor; onFinish: (obj: Vendor) => void; + update?: boolean; } function VendorForm(props: IProps) { @@ -24,11 +25,16 @@ function VendorForm(props: IProps) { vendor.setOuisList(v.ouisList); vendorMetadata.setHomepage(v.metadata?.homepage || ""); + vendor.setMetadata(vendorMetadata); props.onFinish(vendor); }; const onChangeName = (e: React.ChangeEvent) => { + if (props.update) { + return; + } + form.setFieldsValue({ dir: slugify(e.target.value), }); @@ -42,47 +48,48 @@ function VendorForm(props: IProps) { onFinish={onFinish} form={form} > - - - - - - - - - - - - {(fields, { add, remove }) => ( - <> - {fields.map(({ key, name, ...restField }) => ( - - remove(name)} /> - } /> - - ))} - - + + + + + + + + + + + {(fields, { add, remove }) => ( + <> + {fields.map(({ key, name, ...restField }) => ( + + remove(name)} /> + } /> - - )} - - - - - + ))} + + + + + )} + + + + ); } diff --git a/interface/ui/yarn.lock b/interface/ui/yarn.lock index 2375028..d0b2100 100644 --- a/interface/ui/yarn.lock +++ b/interface/ui/yarn.lock @@ -622,14 +622,7 @@ lodash "^4.17.21" redent "^3.0.0" -"@types/codemirror@^5.60.15": - version "5.60.15" - resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.15.tgz#0f82be6f4126d1e59cf4c4830e56dcd49d3c3e8a" - integrity sha512-dTOvwEQ+ouKJ/rE9LT1Ue2hmP6H1mZv5+CCnNWu2qtiOe2LQa9lCprEY20HxiDmV/Bxh+dXjywmy5aKvoGjULA== - dependencies: - "@types/tern" "*" - -"@types/estree@*", "@types/estree@1.0.6": +"@types/estree@1.0.6": version "1.0.6" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== @@ -669,13 +662,6 @@ "@types/prop-types" "*" csstype "^3.0.2" -"@types/tern@*": - version "0.23.9" - resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.9.tgz#6f6093a4a9af3e6bb8dde528e024924d196b367c" - integrity sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw== - dependencies: - "@types/estree" "*" - "@typescript-eslint/eslint-plugin@^7.13.1": version "7.18.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz#b16d3cf3ee76bf572fdf511e79c248bdec619ea3" @@ -784,6 +770,11 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +ace-builds@^1.36.3, ace-builds@^1.36.4: + version "1.36.4" + resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.36.4.tgz#c859de4a7701aa86a1e708d38cebe66807d0d84c" + integrity sha512-eE+iAsLRfNsq30yd34cezKSob6/N9mQatWs44Bp5LUDgKZ3rJtQds/YtcbnwbEWMTe7yCIxG/Cfezd4BsKIiFg== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -974,11 +965,6 @@ client-only@^0.0.1: resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== -codemirror@^5.65.16: - version "5.65.18" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.18.tgz#d7146e4271135a9b4adcd023a270185457c9c428" - integrity sha512-Gaz4gHnkbHMGgahNt3CA5HBk5lLQBqmD/pBgeB4kQU6OedZmqMBjlRF0LSrp2tJ4wlLNPm2FfaUd1pDy0mdlpA== - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -1080,6 +1066,11 @@ detect-libc@^2.0.0: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700" integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw== +diff-match-patch@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.5.tgz#abb584d5f10cd1196dfc55aa03701592ae3f7b37" + integrity sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1570,6 +1561,16 @@ lodash-es@^4.17.21: resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -1580,7 +1581,7 @@ lodash@^4.17.21: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -loose-envify@^1.0.0, loose-envify@^1.1.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -1794,6 +1795,15 @@ prettier@^3.3.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== +prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + punycode@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" @@ -2155,6 +2165,17 @@ rc-virtual-list@^3.14.2, rc-virtual-list@^3.5.1, rc-virtual-list@^3.5.2: rc-resize-observer "^1.0.0" rc-util "^5.36.0" +react-ace@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/react-ace/-/react-ace-13.0.0.tgz#e69c2aa4ccf1a81c758adba9ba2b4b3e3d929a69" + integrity sha512-PPk2O/ArHzDtbnK82QImfHYXwuiitRgHJf5AxwMQh9zciojbWsPmKJm1tMgWOYLCtGEz8/Dh3MxRxrXe7QcstQ== + dependencies: + ace-builds "^1.36.3" + diff-match-patch "^1.0.5" + lodash.get "^4.4.2" + lodash.isequal "^4.5.0" + prop-types "^15.8.1" + react-base16-styling@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/react-base16-styling/-/react-base16-styling-0.10.0.tgz#5d5f019bd4dc5870c3e92fd9d5410533a0bbb0c6" @@ -2165,11 +2186,6 @@ react-base16-styling@^0.10.0: csstype "^3.1.3" lodash-es "^4.17.21" -react-codemirror2@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/react-codemirror2/-/react-codemirror2-8.0.0.tgz#0ce624d024ba4ac7bab8979c2fd6596500d6bf51" - integrity sha512-JIbhXoghvX0BrasIoCQvRxBPIU78plfjF1Buz0gaMFvZXwEDjkCYBkQhucoOtudQ7ikbB1jJUnmCsutElti7yA== - react-dom@^18.3.1: version "18.3.1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" @@ -2178,6 +2194,11 @@ react-dom@^18.3.1: loose-envify "^1.1.0" scheduler "^0.23.2" +react-is@^16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + react-is@^18.2.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" diff --git a/taplo.toml b/taplo.toml deleted file mode 100644 index 7501ac5..0000000 --- a/taplo.toml +++ /dev/null @@ -1,5 +0,0 @@ -include = ["vendors/**/*.toml"] - -[formatting] - indent_tables = true - indent_entries = true diff --git a/test-runner/.gitignore b/test-runner/.gitignore deleted file mode 100644 index ea8c4bf..0000000 --- a/test-runner/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/test-runner/Cargo.lock b/test-runner/Cargo.lock deleted file mode 100644 index e7cedc3..0000000 --- a/test-runner/Cargo.lock +++ /dev/null @@ -1,419 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "cc" -version = "1.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" -dependencies = [ - "shlex", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "relative-path" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" - -[[package]] -name = "rquickjs" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbd33e0b668aea0ab238b9164523aca929096f9f40834700d71d91dd4888882" -dependencies = [ - "rquickjs-core", -] - -[[package]] -name = "rquickjs-core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9129d69b7b8f7ee8ad1da5b12c7f4a8a8acd45f2e6dd9cb2ee1bc5a1f2fa3d" -dependencies = [ - "relative-path", - "rquickjs-sys", -] - -[[package]] -name = "rquickjs-sys" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf6f2288d8e7fbb5130f62cf720451641e99d55f6fde9db86aa2914ecb553fd2" -dependencies = [ - "cc", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.76", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_valid" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32c92fa3e7abc9108490d7f9ac752008e12297d5a969511a66fd0a42fbcaf1cd" -dependencies = [ - "indexmap", - "itertools", - "num-traits", - "once_cell", - "paste", - "regex", - "serde", - "serde_json", - "serde_valid_derive", - "serde_valid_literal", - "thiserror", - "unicode-segmentation", -] - -[[package]] -name = "serde_valid_derive" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02529dfc96005e7e0d2dd5a12a7d9664cf51be96a5b1a58a496e8080020711ee" -dependencies = [ - "itertools", - "paste", - "proc-macro-error", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.76", -] - -[[package]] -name = "serde_valid_literal" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b385e1d2d8fd49695e9ae387ebf9bde548fe8dcecd1cf5f164f9c2a2b4a3c3" -dependencies = [ - "paste", - "regex", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "test-runner" -version = "0.1.0" -dependencies = [ - "rquickjs", - "serde", - "serde_valid", - "toml", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.76", -] - -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "winnow" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" -dependencies = [ - "memchr", -] diff --git a/test-runner/Cargo.toml b/test-runner/Cargo.toml deleted file mode 100644 index bdeaa52..0000000 --- a/test-runner/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] - name = "test-runner" - version = "0.1.0" - edition = "2021" - -[dependencies] - serde = { version = "1.0", features = ["derive"] } - serde_valid = "0.24" - toml = "0.8" - rquickjs = { version = "0.6", features = ["loader", "array-buffer"] } diff --git a/test-runner/src/main.rs b/test-runner/src/main.rs deleted file mode 100644 index 6d95797..0000000 --- a/test-runner/src/main.rs +++ /dev/null @@ -1,109 +0,0 @@ -use std::fs; -use std::path::Path; - -use serde_valid::Validate; - -mod js; -#[allow(dead_code)] -mod structs; - -fn main() { - println!("Parsing vendors"); - - let vendors = fs::read_dir("../vendors").expect("Read vendors directory"); - for vendor in vendors { - let vendor = vendor.expect("Read vendor entry").path(); - if vendor.is_dir() { - parse_vendor(&vendor); - } - } -} - -fn parse_vendor(dir: &Path) { - println!("> Vendor file: {:?}", dir.join("vendor.toml")); - - let vendor_conf: structs::VendorConfiguration = - toml::from_str(&fs::read_to_string(dir.join("vendor.toml")).expect("Read vendor.toml")) - .expect("Parse TOML"); - - println!("> Vendor: {}", vendor_conf.vendor.name); - - println!("> Parsing vendor devices"); - - for device in &vendor_conf.vendor.devices { - parse_device(dir, device); - } -} - -fn parse_device(vendor_dir: &Path, device_config: &str) { - let device_path = vendor_dir.join("devices").join(device_config); - println!(" > Device file: {:?}", device_path); - - let device_config: structs::DeviceConfiguration = - toml::from_str(&fs::read_to_string(device_path).expect("Read device file")) - .expect("Parse TOML"); - - println!(" > Device: {}", device_config.device.name); - - for firmware in &device_config.device.firmware { - println!(" > Firmware: {}", firmware.version); - if let Some(codec) = &firmware.codec { - test_codec(vendor_dir, codec); - } else { - println!(" > Warning: no codec found!"); - } - println!(" > Profiles:"); - for profile in &firmware.profiles { - parse_profile(vendor_dir, profile); - } - } -} - -fn parse_profile(vendor_dir: &Path, profile_config: &str) { - let profile_path = vendor_dir.join("profiles").join(profile_config); - println!(" > Profile file: {:?}", profile_path); - - let profile_conf: structs::ProfileConfiguration = - toml::from_str(&fs::read_to_string(profile_path).expect("Read profile file")) - .expect("Parse TOML"); - - profile_conf.validate().unwrap(); - - println!( - " > Profile: {} - {} - {}", - profile_conf.profile.region, - profile_conf.profile.mac_version, - profile_conf.profile.reg_params_revision - ); -} - -fn test_codec(vendor_dir: &Path, codec: &str) { - let codec_path = vendor_dir.join("codecs").join(codec); - let codec_decode_test_path = vendor_dir - .join("codecs") - .join(format!("test_decode_{}on", codec)); - let codec_encode_test_path = vendor_dir - .join("codecs") - .join(format!("test_encode_{}on", codec)); - - println!(" > Codec file: {:?}", codec_path); - println!( - " > Codecs test encode file: {:?}", - codec_encode_test_path - ); - js::run_tests( - "decodeUplink", - &fs::read_to_string(&codec_path).expect("Read codec script"), - &fs::read_to_string(&codec_decode_test_path).expect("Read codec tests script"), - ); - - println!( - " > Codecs test decode file: {:?}", - codec_decode_test_path - ); - js::run_tests( - "encodeDownlink", - &fs::read_to_string(&codec_path).expect("Read codec script"), - &fs::read_to_string(&codec_encode_test_path).expect("Read codec tests script"), - ); -} diff --git a/test-runner/src/structs.rs b/test-runner/src/structs.rs deleted file mode 100644 index 01602ac..0000000 --- a/test-runner/src/structs.rs +++ /dev/null @@ -1,105 +0,0 @@ -use serde::Deserialize; -use serde_valid::Validate; - -#[derive(Deserialize)] -pub struct VendorConfiguration { - pub vendor: Vendor, -} - -#[derive(Default, Deserialize)] -#[serde(default)] -pub struct Vendor { - pub name: String, - pub id: usize, - pub ouis: Vec, - pub devices: Vec, - pub metadata: VendorMetadata, -} - -#[derive(Default, Deserialize)] -#[serde(default)] -pub struct VendorMetadata { - pub homepage: Option, -} - -#[derive(Deserialize)] -pub struct DeviceConfiguration { - pub device: Device, -} - -#[derive(Default, Deserialize)] -#[serde(default)] -pub struct Device { - pub name: String, - pub description: String, - pub firmware: Vec, - pub metadata: DeviceMetadata, -} - -#[derive(Default, Deserialize)] -pub struct DeviceMetadata { - pub product_url: Option, - pub documentation_url: Option, -} - -#[derive(Deserialize)] -pub struct DeviceFirmware { - pub version: String, - pub profiles: Vec, - pub codec: Option, -} - -#[derive(Deserialize, Validate)] -pub struct ProfileConfiguration { - #[validate] - pub profile: Profile, -} - -#[derive(Default, Deserialize, Validate)] -#[serde(default)] -pub struct Profile { - pub id: usize, - #[validate(enumerate = ["EU868", "US915", "CN779", "EU433", "AU915", "CN470", "AS923", "AS923-2", "AS923-3", "AS923-4", "KR920", "IN865", "RU864"])] - pub region: String, - #[validate(enumerate = ["1.0.0", "1.0.1", "1.0.2", "1.0.3","1.0.4", "1.1.0"])] - pub mac_version: String, - #[validate(enumerate = ["A", "B", "RP002-1.0.0", "RP002-1.0.1", "RP002-1.0.2", "RP002-1.0.3", "RP002-1.0.4"])] - pub reg_params_revision: String, - pub supports_otaa: bool, - pub supports_class_b: bool, - pub supports_class_c: bool, - pub max_eirp: usize, - - #[validate] - pub abp: ProfileAbp, - #[validate] - pub class_b: ProfileClassB, - pub class_c: ProfileClassC, -} - -#[derive(Default, Deserialize, Validate)] -pub struct ProfileAbp { - #[validate(maximum = 15)] - pub rx1_delay: usize, - #[validate(maximum = 7)] - pub rx1_dr_offset: usize, - #[validate(maximum = 15)] - pub rx2_dr: usize, - pub rx2_freq: usize, -} - -#[derive(Default, Deserialize, Validate)] -pub struct ProfileClassB { - pub timeout_secs: usize, - - #[validate(maximum = 7)] - pub ping_slot_nb_k: usize, - #[validate(maximum = 15)] - pub ping_slot_dr: usize, - pub ping_slot_freq: usize, -} - -#[derive(Default, Deserialize)] -pub struct ProfileClassC { - pub timeout_secs: usize, -}