diff --git a/.github/scripts/package-lock.json b/.github/scripts/package-lock.json index 074ab3c7..a24853e1 100644 --- a/.github/scripts/package-lock.json +++ b/.github/scripts/package-lock.json @@ -181,24 +181,13 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, "node_modules/ini": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.2.tgz", - "integrity": "sha512-AMB1mvwR1pyBFY/nSevUX6y8nJWS63/SzUKD3JyQn97s4xgIdgQPT75IRouIiBAN4yLQBUShNYVW0+UG25daCw==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -208,12 +197,9 @@ } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -257,11 +243,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } } diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml new file mode 100644 index 00000000..d0bbbdc0 --- /dev/null +++ b/.github/workflows/cpp-linter.yml @@ -0,0 +1,34 @@ +name: cpp-linter + +on: + pull_request: + types: [opened, reopened, synchronize] + paths: [ '**.c', '**.h', '**.cpp', '**.hpp', '.clang-format' ] + push: + paths: [ '**.c', '**.h', '**.cpp', '**.hpp', '.clang-format' ] + workflow_dispatch: # Manually invoked by user. + +jobs: + cpp-linter: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + version: 18 + step-summary: true + format-review: true + + - name: Fail fast?! + if: steps.linter.outputs.checks-failed > 0 + run: | + echo "Some files failed the linting checks!" + # for actual deployment + # run: exit 1 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..dafad5fb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "schemas"] + path = schemas + url = https://github.com/OpenShock/flatbuffers-schemas diff --git a/CHANGELOG.md b/CHANGELOG.md index 83677e5e..f14fba59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,37 @@ +# Version 1.3.0 Release Notes + +This release adds support for more boards, has more bugfixes, better error handling, and optimization/cleanup. + +## Highlight + +- Added support for **DFRobot Firebeetle**, **Wemos S3 Mini** and **WaveShare S3 Zero** boards. + +## Minor Updates + +- Re-Add **PET998DR** Quiet Postamble. +- Fix CaiXianlin protocol sending non-zero when doing a beep command. +- Moved schema files to seperate repository. +- Improve error handling and logging. +- Dependency updates. +- Code cleanup, optimization and refactoring. + +# Version 1.3.0-rc.1 Release Notes + +This is the first release candidate for version 1.3.0. + +## Highlight + +- Added support for **DFRobot Firebeetle**, **Wemos S3 Mini** and **WaveShare S3 Zero** boards. + +## Minor Updates + +- Re-Add **PET998DR** Quiet Postamble. +- Fix CaiXianlin protocol sending non-zero when doing a beep command. +- Moved schema files to seperate repository. +- Improve error handling and logging. +- Dependency updates. +- Code cleanup, optimization and refactoring. + # Version 1.2.0 Release Notes This release adds a new shocker protocol, more bugfixes, configurability, and performance improvements. diff --git a/README.md b/README.md index 1158faa9..084657f1 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Confirmed working boards: - Lolin S3 - OpenShock (Legacy) - Core V1 +- DFRobot Firebeetle 2 ESP32-E ## Flashing @@ -66,7 +67,7 @@ You will need: - VSCode - Knowledge about Arduino library and C++ -- Optimally compatible hardware to test your code +- Compatible ESP-32 board with 433 MHz antenna ### Setting up @@ -74,3 +75,7 @@ You will need: # Install dependencies pip install -r requirements.txt ``` + +## Support + +You can support the openshock dev team here: [Sponsor OpenShock](https://github.com/sponsors/OpenShock) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8e4560b8..d0bcc7f0 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8,36 +8,34 @@ "name": "frontend", "version": "0.0.1", "dependencies": { - "@floating-ui/dom": "1.6.3" + "@floating-ui/dom": "1.6.10" }, "devDependencies": { - "@playwright/test": "1.43.1", - "@skeletonlabs/skeleton": "2.9.1", + "@playwright/test": "1.46.1", + "@skeletonlabs/skeleton": "2.10.2", "@skeletonlabs/tw-plugin": "0.4.0", - "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/kit": "2.5.6", - "@sveltejs/vite-plugin-svelte": "^3.1.0", + "@sveltejs/adapter-static": "^3.0.4", + "@sveltejs/kit": "2.5.24", + "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tailwindcss/forms": "0.5.7", - "@tailwindcss/typography": "0.5.12", - "@types/node": "20.12.7", - "@typescript-eslint/eslint-plugin": "7.6.0", - "@typescript-eslint/parser": "7.6.0", - "autoprefixer": "10.4.19", - "eslint": "^8.5.7", + "@tailwindcss/typography": "0.5.14", + "@types/node": "22.5.0", + "autoprefixer": "10.4.20", + "eslint": "^9.9.1", "eslint-config-prettier": "9.1.0", - "eslint-plugin-svelte": "2.37.0", + "eslint-plugin-svelte": "2.43.0", "flatbuffers": "24.3.25", - "postcss": "8.4.38", - "prettier": "3.2.5", - "prettier-plugin-svelte": "3.2.3", - "svelte": "4.2.14", - "svelte-check": "3.6.9", - "tailwindcss": "3.4.3", - "tslib": "2.6.2", - "typescript": "5.4.5", - "vite": "^5.2.8", - "vite-plugin-tailwind-purgecss": "^0.3.0", - "vitest": "1.5.0" + "postcss": "8.4.41", + "prettier": "3.3.3", + "prettier-plugin-svelte": "3.2.6", + "svelte": "4.2.19", + "svelte-check": "3.8.6", + "tailwindcss": "3.4.10", + "tslib": "2.7.0", + "typescript": "5.5.4", + "vite": "^5.4.2", + "vite-plugin-tailwind-purgecss": "^0.3.3", + "vitest": "2.0.5" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -62,22 +60,22 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], @@ -91,9 +89,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], @@ -107,9 +105,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], @@ -123,9 +121,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], @@ -139,9 +137,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], @@ -155,9 +153,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], @@ -171,9 +169,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], @@ -187,9 +185,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], @@ -203,9 +201,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], @@ -219,9 +217,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], @@ -235,9 +233,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], @@ -251,9 +249,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], @@ -267,9 +265,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], @@ -283,9 +281,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], @@ -299,9 +297,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], @@ -315,9 +313,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], @@ -331,9 +329,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], @@ -347,9 +345,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], @@ -363,9 +361,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], @@ -379,9 +377,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], @@ -395,9 +393,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], @@ -411,9 +409,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], @@ -427,9 +425,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], @@ -458,24 +456,38 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "dev": true, + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -483,56 +495,80 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/espree": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", + "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "version": "9.9.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", + "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@floating-ui/core": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.3.tgz", - "integrity": "sha512-O0WKDOo0yhJuugCx6trZQj5jVJ9yR0ystG2JaNAemYUWce+pmM6WUEFIibnWyEJKdrDxhm75NoSRME35FNaM/Q==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.4.tgz", + "integrity": "sha512-a4IowK4QkXl4SCWTGUR0INAfEOX3wtsYw3rKK5InQEHMGObkR8Xk44qYQD9P4r6HHw0iIfK6GUKECmY8sTkqRA==", "dependencies": { - "@floating-ui/utils": "^0.2.0" + "@floating-ui/utils": "^0.2.4" } }, "node_modules/@floating-ui/dom": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz", - "integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==", + "version": "1.6.10", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.10.tgz", + "integrity": "sha512-fskgCFv8J8OamCmyun8MfjB1Olfn+uZKjOKZ0vhYF3gRmEUXcGOjxWL8bBr7i4kIuPZ2KD2S3EUIOxnjC8kl2A==", "dependencies": { - "@floating-ui/core": "^1.0.0", - "@floating-ui/utils": "^0.2.0" + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.7" } }, "node_modules/@floating-ui/utils": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", - "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.7.tgz", + "integrity": "sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA==" }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", @@ -547,11 +583,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@isaacs/cliui": { "version": "8.0.2", @@ -597,27 +640,15 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -633,9 +664,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" @@ -648,9 +679,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -703,18 +734,18 @@ } }, "node_modules/@playwright/test": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.1.tgz", - "integrity": "sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA==", + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.46.1.tgz", + "integrity": "sha512-Fq6SwLujA/DOIvNC2EL/SojJnkKf/rAwJ//APpJJHRyMi1PdKrY3Az+4XNQ51N4RTbItbIByQ0jgd1tayq1aeA==", "dev": true, "dependencies": { - "playwright": "1.43.1" + "playwright": "1.46.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/@polka/url": { @@ -724,9 +755,9 @@ "dev": true }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.1.tgz", - "integrity": "sha512-fH8/o8nSUek8ceQnT7K4EQbSiV7jgkHq81m9lWZFIXjJ7lJzpWXbQFpT/Zh6OZYnpFykvzC3fbEvEAFZu03dPA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.0.tgz", + "integrity": "sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==", "cpu": [ "arm" ], @@ -737,9 +768,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.1.tgz", - "integrity": "sha512-Y/9OHLjzkunF+KGEoJr3heiD5X9OLa8sbT1lm0NYeKyaM3oMhhQFvPB0bNZYJwlq93j8Z6wSxh9+cyKQaxS7PQ==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.0.tgz", + "integrity": "sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA==", "cpu": [ "arm64" ], @@ -750,9 +781,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.1.tgz", - "integrity": "sha512-+kecg3FY84WadgcuSVm6llrABOdQAEbNdnpi5X3UwWiFVhZIZvKgGrF7kmLguvxHNQy+UuRV66cLVl3S+Rkt+Q==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.0.tgz", + "integrity": "sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA==", "cpu": [ "arm64" ], @@ -763,9 +794,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.1.tgz", - "integrity": "sha512-2pYRzEjVqq2TB/UNv47BV/8vQiXkFGVmPFwJb+1E0IFFZbIX8/jo1olxqqMbo6xCXf8kabANhp5bzCij2tFLUA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.0.tgz", + "integrity": "sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg==", "cpu": [ "x64" ], @@ -776,9 +807,22 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.1.tgz", - "integrity": "sha512-mS6wQ6Do6/wmrF9aTFVpIJ3/IDXhg1EZcQFYHZLHqw6AzMBjTHWnCG35HxSqUNphh0EHqSM6wRTT8HsL1C0x5g==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.0.tgz", + "integrity": "sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.0.tgz", + "integrity": "sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w==", "cpu": [ "arm" ], @@ -789,9 +833,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.1.tgz", - "integrity": "sha512-p9rGKYkHdFMzhckOTFubfxgyIO1vw//7IIjBBRVzyZebWlzRLeNhqxuSaZ7kCEKVkm/kuC9fVRW9HkC/zNRG2w==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.0.tgz", + "integrity": "sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w==", "cpu": [ "arm64" ], @@ -802,9 +846,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.1.tgz", - "integrity": "sha512-nDY6Yz5xS/Y4M2i9JLQd3Rofh5OR8Bn8qe3Mv/qCVpHFlwtZSBYSPaU4mrGazWkXrdQ98GB//H0BirGR/SKFSw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.0.tgz", + "integrity": "sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw==", "cpu": [ "arm64" ], @@ -815,11 +859,11 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.1.tgz", - "integrity": "sha512-im7HE4VBL+aDswvcmfx88Mp1soqL9OBsdDBU8NqDEYtkri0qV0THhQsvZtZeNNlLeCUQ16PZyv7cqutjDF35qw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.0.tgz", + "integrity": "sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg==", "cpu": [ - "ppc64le" + "ppc64" ], "dev": true, "optional": true, @@ -828,9 +872,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.1.tgz", - "integrity": "sha512-RWdiHuAxWmzPJgaHJdpvUUlDz8sdQz4P2uv367T2JocdDa98iRw2UjIJ4QxSyt077mXZT2X6pKfT2iYtVEvOFw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.0.tgz", + "integrity": "sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg==", "cpu": [ "riscv64" ], @@ -841,9 +885,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.1.tgz", - "integrity": "sha512-VMgaGQ5zRX6ZqV/fas65/sUGc9cPmsntq2FiGmayW9KMNfWVG/j0BAqImvU4KTeOOgYSf1F+k6at1UfNONuNjA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.0.tgz", + "integrity": "sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw==", "cpu": [ "s390x" ], @@ -854,9 +898,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.1.tgz", - "integrity": "sha512-9Q7DGjZN+hTdJomaQ3Iub4m6VPu1r94bmK2z3UeWP3dGUecRC54tmVu9vKHTm1bOt3ASoYtEz6JSRLFzrysKlA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.0.tgz", + "integrity": "sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg==", "cpu": [ "x64" ], @@ -867,9 +911,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.1.tgz", - "integrity": "sha512-JNEG/Ti55413SsreTguSx0LOVKX902OfXIKVg+TCXO6Gjans/k9O6ww9q3oLGjNDaTLxM+IHFMeXy/0RXL5R/g==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.0.tgz", + "integrity": "sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ==", "cpu": [ "x64" ], @@ -880,9 +924,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.1.tgz", - "integrity": "sha512-ryS22I9y0mumlLNwDFYZRDFLwWh3aKaC72CWjFcFvxK0U6v/mOkM5Up1bTbCRAhv3kEIwW2ajROegCIQViUCeA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.0.tgz", + "integrity": "sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ==", "cpu": [ "arm64" ], @@ -893,9 +937,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.1.tgz", - "integrity": "sha512-TdloItiGk+T0mTxKx7Hp279xy30LspMso+GzQvV2maYePMAWdmrzqSNZhUpPj3CGw12aGj57I026PgLCTu8CGg==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.0.tgz", + "integrity": "sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg==", "cpu": [ "ia32" ], @@ -906,9 +950,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.1.tgz", - "integrity": "sha512-wQGI+LY/Py20zdUPq+XCem7JcPOyzIJBm3dli+56DJsQOHbnXZFEwgmnC6el1TPAfC8lBT3m+z69RmLykNUbew==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.0.tgz", + "integrity": "sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ==", "cpu": [ "x64" ], @@ -918,16 +962,10 @@ "win32" ] }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, "node_modules/@skeletonlabs/skeleton": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/@skeletonlabs/skeleton/-/skeleton-2.9.1.tgz", - "integrity": "sha512-cWDYfhZ8kIahPxvoT9xmwb3utIgtDpVQddNoQHnssxZZbqefl5z3cvWbuvvqEjewDxwKq4Zw4MtPcaT9nxojmQ==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/@skeletonlabs/skeleton/-/skeleton-2.10.2.tgz", + "integrity": "sha512-TV2yWjvHpmtaF1F5luB8n7UbjKZcsrJMMiiJQHbZvqXjBWvudAcL8zywhE/NFKW5rYU//MtgOODdMZPZxvKu6w==", "dev": true, "dependencies": { "esm-env": "1.0.0" @@ -946,26 +984,26 @@ } }, "node_modules/@sveltejs/adapter-static": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.1.tgz", - "integrity": "sha512-6lMvf7xYEJ+oGeR5L8DFJJrowkefTK6ZgA4JiMqoClMkKq0s6yvsd3FZfCFvX1fQ0tpCD7fkuRVHsnUVgsHyNg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.4.tgz", + "integrity": "sha512-Qm4GAHCnRXwfWG9/AtnQ7mqjyjTs7i0Opyb8H2KH9rMR7fLxqiPx/tXeoE6HHo66+72CjyOb4nFH3lrejY4vzA==", "dev": true, "peerDependencies": { "@sveltejs/kit": "^2.0.0" } }, "node_modules/@sveltejs/kit": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.5.6.tgz", - "integrity": "sha512-AYb02Jm5MfNqJHc8zrj7ScQAFAKmTUCkpkfoi8EVaZZDdnjkvI7L2GtnTDhpiXSAZRVitZX4qm59sMS1FgL+lQ==", + "version": "2.5.24", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.5.24.tgz", + "integrity": "sha512-Nr2oxsCsDfEkdS/zzQQQbsPYTbu692Qs3/iE3L7VHzCVjG2+WujF9oMUozWI7GuX98KxYSoPMlAsfmDLSg44hQ==", "dev": true, "hasInstallScript": true, "dependencies": { "@types/cookie": "^0.6.0", "cookie": "^0.6.0", - "devalue": "^4.3.2", + "devalue": "^5.0.0", "esm-env": "^1.0.0", - "import-meta-resolve": "^4.0.0", + "import-meta-resolve": "^4.1.0", "kleur": "^4.1.5", "magic-string": "^0.30.5", "mrmime": "^2.0.0", @@ -981,22 +1019,22 @@ "node": ">=18.13" }, "peerDependencies": { - "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1", "svelte": "^4.0.0 || ^5.0.0-next.0", "vite": "^5.0.3" } }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.0.tgz", - "integrity": "sha512-sY6ncCvg+O3njnzbZexcVtUqOBE3iYmQPJ9y+yXSkOwG576QI/xJrBnQSRXFLGwJNBa0T78JEKg5cIR0WOAuUw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.2.tgz", + "integrity": "sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==", "dev": true, "dependencies": { - "@sveltejs/vite-plugin-svelte-inspector": "^2.0.0", + "@sveltejs/vite-plugin-svelte-inspector": "^2.1.0", "debug": "^4.3.4", "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.30.9", + "magic-string": "^0.30.10", "svelte-hmr": "^0.16.0", "vitefu": "^0.2.5" }, @@ -1009,9 +1047,9 @@ } }, "node_modules/@sveltejs/vite-plugin-svelte-inspector": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.0.0.tgz", - "integrity": "sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.1.0.tgz", + "integrity": "sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==", "dev": true, "dependencies": { "debug": "^4.3.4" @@ -1038,9 +1076,9 @@ } }, "node_modules/@tailwindcss/typography": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.12.tgz", - "integrity": "sha512-CNwpBpconcP7ppxmuq3qvaCxiRWnbhANpY/ruH4L5qs2GCiVDJXde/pjj2HWPV1+Q4G9+V/etrwUYopdcjAlyg==", + "version": "0.5.14", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.14.tgz", + "integrity": "sha512-ZvOCjUbsJBjL9CxQBn+VEnFpouzuKhxh2dH8xMIWHILL+HfOYtlAkWcyoon8LlzE53d2Yo6YO6pahKKNW3q1YQ==", "dev": true, "dependencies": { "lodash.castarray": "^4.4.0", @@ -1064,19 +1102,13 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, "node_modules/@types/node": { - "version": "20.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", - "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "version": "22.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.0.tgz", + "integrity": "sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==", "dev": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/pug": { @@ -1085,332 +1117,91 @@ "integrity": "sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==", "dev": true }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.6.0.tgz", - "integrity": "sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.6.0", - "@typescript-eslint/type-utils": "7.6.0", - "@typescript-eslint/utils": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.6.0.tgz", - "integrity": "sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "7.6.0", - "@typescript-eslint/utils": "7.6.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.6.0.tgz", - "integrity": "sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.15", - "@types/semver": "^7.5.8", - "@typescript-eslint/scope-manager": "7.6.0", - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/typescript-estree": "7.6.0", - "semver": "^7.6.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.6.0.tgz", - "integrity": "sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "7.6.0", - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/typescript-estree": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.6.0.tgz", - "integrity": "sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.6.0.tgz", - "integrity": "sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.6.0.tgz", - "integrity": "sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.6.0.tgz", - "integrity": "sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true - }, "node_modules/@vitest/expect": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.5.0.tgz", - "integrity": "sha512-0pzuCI6KYi2SIC3LQezmxujU9RK/vwC1U9R0rLuGlNGcOuDWxqWKu6nUdFsX9tH1WU0SXtAxToOsEjeUn1s3hA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", + "integrity": "sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==", "dev": true, "dependencies": { - "@vitest/spy": "1.5.0", - "@vitest/utils": "1.5.0", - "chai": "^4.3.10" + "@vitest/spy": "2.0.5", + "@vitest/utils": "2.0.5", + "chai": "^5.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/runner": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.5.0.tgz", - "integrity": "sha512-7HWwdxXP5yDoe7DTpbif9l6ZmDwCzcSIK38kTSIt6CFEpMjX4EpCgT6wUmS0xTXqMI6E/ONmfgRKmaujpabjZQ==", + "node_modules/@vitest/pretty-format": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.5.tgz", + "integrity": "sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==", "dev": true, "dependencies": { - "@vitest/utils": "1.5.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/runner/node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "node_modules/@vitest/runner": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.5.tgz", + "integrity": "sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==", "dev": true, "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@vitest/runner/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" + "@vitest/utils": "2.0.5", + "pathe": "^1.1.2" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.5.0.tgz", - "integrity": "sha512-qpv3fSEuNrhAO3FpH6YYRdaECnnRjg9VxbhdtPwPRnzSfHVXnNzzrpX4cJxqiwgRMo7uRMWDFBlsBq4Cr+rO3A==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.5.tgz", + "integrity": "sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==", "dev": true, "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "2.0.5", + "magic-string": "^0.30.10", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.5.0.tgz", - "integrity": "sha512-vu6vi6ew5N5MMHJjD5PoakMRKYdmIrNJmyfkhRpQt5d9Ewhw9nZ5Aqynbi3N61bvk9UvZ5UysMT6ayIrZ8GA9w==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.5.tgz", + "integrity": "sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==", "dev": true, "dependencies": { - "tinyspy": "^2.2.0" + "tinyspy": "^3.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.5.0.tgz", - "integrity": "sha512-BDU0GNL8MWkRkSRdNFvCUCAVOeHaUlVJ9Tx0TYBZyXaaOTmGtUFObzchCivIBrIwKzvZA7A9sCejVhXM2aY98A==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.5.tgz", + "integrity": "sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==", "dev": true, "dependencies": { - "diff-sequences": "^29.6.3", + "@vitest/pretty-format": "2.0.5", "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" + "loupe": "^3.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", + "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1428,15 +1219,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1517,28 +1299,19 @@ "dequal": "^2.0.3" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/autoprefixer": { - "version": "10.4.19", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", - "integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==", + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", "dev": true, "funding": [ { @@ -1555,11 +1328,11 @@ } ], "dependencies": { - "browserslist": "^4.23.0", - "caniuse-lite": "^1.0.30001599", + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "postcss-value-parser": "^4.2.0" }, "bin": { @@ -1607,21 +1380,21 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "funding": [ { @@ -1638,10 +1411,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -1687,9 +1460,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001608", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001608.tgz", - "integrity": "sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA==", + "version": "1.0.30001649", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001649.tgz", + "integrity": "sha512-fJegqZZ0ZX8HOWr6rcafGr72+xcgJKI9oWfDW5DrD7ExUtgZC7a7R7ZYmZqplh7XDocFdGeIFn7roAxhOeYrPQ==", "dev": true, "funding": [ { @@ -1707,21 +1480,19 @@ ] }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chalk": { @@ -1741,15 +1512,12 @@ } }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/chokidar": { @@ -1886,9 +1654,9 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1903,13 +1671,10 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } @@ -1948,9 +1713,9 @@ } }, "node_modules/devalue": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.2.tgz", - "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.0.0.tgz", + "integrity": "sha512-gO+/OMXF7488D+u3ue+G7Y4AA3ZmUnB3eHJXmBTgNHvr4ZNzl36A0ZtG+XCRNYCkYx/bFmw4qtkoFLa+wSrwAA==", "dev": true }, "node_modules/didyoumean": { @@ -1959,45 +1724,12 @@ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", "dev": true }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/dlv": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", "dev": true }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/domelementtype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", @@ -2032,9 +1764,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.734", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.734.tgz", - "integrity": "sha512-pYfGUc+ll8AOzLbLC0lfgwkvCZIV+sKGuFFsSNuF3K3ujrmem8jIjg/t6DNq0J7biTSS1hCt/Hts0nmA3ZyprQ==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz", + "integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==", "dev": true }, "node_modules/emoji-regex": { @@ -2062,9 +1794,9 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, "bin": { @@ -2074,29 +1806,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/escalade": { @@ -2121,41 +1853,37 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "9.9.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", + "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.9.1", "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.0.2", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -2169,16 +1897,24 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-compat-utils": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.0.tgz", - "integrity": "sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", + "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", "dev": true, "dependencies": { "semver": "^7.5.4" @@ -2203,23 +1939,22 @@ } }, "node_modules/eslint-plugin-svelte": { - "version": "2.37.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.37.0.tgz", - "integrity": "sha512-H/2Gz7agYHEMEEzRuLYuCmAIdjuBnbhFG9hOK0yCdSBvvJGJMkjo+lR6j67OIvLOavgp4L7zA5LnDKi8WqdPhQ==", + "version": "2.43.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.43.0.tgz", + "integrity": "sha512-REkxQWvg2pp7QVLxQNa+dJ97xUqRe7Y2JJbSWkHSuszu0VcblZtXkPBPckkivk99y5CdLw4slqfPylL2d/X4jQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@jridgewell/sourcemap-codec": "^1.4.15", - "debug": "^4.3.4", - "eslint-compat-utils": "^0.5.0", + "eslint-compat-utils": "^0.5.1", "esutils": "^2.0.3", - "known-css-properties": "^0.30.0", + "known-css-properties": "^0.34.0", "postcss": "^8.4.38", "postcss-load-config": "^3.1.4", "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.16", - "semver": "^7.6.0", - "svelte-eslint-parser": ">=0.34.0 <1.0.0" + "postcss-selector-parser": "^6.1.0", + "semver": "^7.6.2", + "svelte-eslint-parser": "^0.41.0" }, "engines": { "node": "^14.17.0 || >=16.0.0" @@ -2229,7 +1964,7 @@ }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0-0 || ^9.0.0-0", - "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.95" + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.191" }, "peerDependenciesMeta": { "svelte": { @@ -2238,9 +1973,9 @@ } }, "node_modules/eslint-plugin-svelte/node_modules/postcss-selector-parser": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", - "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz", + "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -2278,6 +2013,51 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/espree": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", + "dev": true, + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esm-env": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.0.0.tgz", @@ -2431,21 +2211,21 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -2471,17 +2251,16 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatbuffers": { @@ -2608,15 +2387,12 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2628,26 +2404,6 @@ "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", "dev": true }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globrex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", @@ -2660,12 +2416,6 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2722,9 +2472,9 @@ } }, "node_modules/import-meta-resolve": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", - "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", "dev": true, "funding": { "type": "github", @@ -2882,12 +2632,6 @@ "jiti": "bin/jiti.js" } }, - "node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2918,12 +2662,6 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, - "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -2943,9 +2681,9 @@ } }, "node_modules/known-css-properties": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.30.0.tgz", - "integrity": "sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==", + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.34.0.tgz", + "integrity": "sha512-tBECoUqNFbyAY4RrbqsBQqDFpGXAEbdD5QKr8kACx3+rnArmuuR22nKQWKazvp07N9yjTyDZaw/20UIH8tL9DQ==", "dev": true }, "node_modules/levn": { @@ -2976,22 +2714,6 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, - "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, "node_modules/locate-character": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", @@ -3032,36 +2754,21 @@ "dev": true }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", + "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", "dev": true, "dependencies": { "get-func-name": "^2.0.1" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/magic-string": { - "version": "0.30.9", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.9.tgz", - "integrity": "sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==", + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" } }, "node_modules/mdn-data": { @@ -3086,12 +2793,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -3170,18 +2877,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", - "dev": true, - "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", - "pkg-types": "^1.0.3", - "ufo": "^1.3.0" - } - }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", @@ -3242,9 +2937,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true }, "node_modules/normalize-path": { @@ -3476,28 +3171,19 @@ "node": "14 || >=16.14" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/periscopic": { @@ -3512,9 +3198,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, "node_modules/picomatch": { @@ -3547,51 +3233,40 @@ "node": ">= 6" } }, - "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dev": true, - "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" - } - }, "node_modules/playwright": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.1.tgz", - "integrity": "sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA==", + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz", + "integrity": "sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==", "dev": true, "dependencies": { - "playwright-core": "1.43.1" + "playwright-core": "1.46.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.1.tgz", - "integrity": "sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg==", + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.1.tgz", + "integrity": "sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==", "dev": true, "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "dev": true, "funding": [ { @@ -3609,7 +3284,7 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "source-map-js": "^1.2.0" }, "engines": { @@ -3784,9 +3459,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -3799,41 +3474,15 @@ } }, "node_modules/prettier-plugin-svelte": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.2.3.tgz", - "integrity": "sha512-wJq8RunyFlWco6U0WJV5wNCM7zpBFakS76UBSbmzMGpncpK98NZABaE+s7n8/APDCEVNHXC5Mpq+MLebQtsRlg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.2.6.tgz", + "integrity": "sha512-Y1XWLw7vXUQQZmgv1JAEiLcErqUniAF2wO7QJsw8BVMvpLET2dI5WpEIEJx1r11iHVdSMzQxivyfrH9On9t2IQ==", "dev": true, "peerDependencies": { "prettier": "^3.0.0", "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -3943,12 +3592,6 @@ } ] }, - "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -4006,25 +3649,10 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rollup": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.1.tgz", - "integrity": "sha512-4LnHSdd3QK2pa1J6dFbfm1HN0D7vSK/ZuZTsdyUAlA6Rr1yTouUTL13HaDOGJVgby461AhrNGBS7sCGXXtT+SA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.0.tgz", + "integrity": "sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -4037,21 +3665,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.14.1", - "@rollup/rollup-android-arm64": "4.14.1", - "@rollup/rollup-darwin-arm64": "4.14.1", - "@rollup/rollup-darwin-x64": "4.14.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.14.1", - "@rollup/rollup-linux-arm64-gnu": "4.14.1", - "@rollup/rollup-linux-arm64-musl": "4.14.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.14.1", - "@rollup/rollup-linux-riscv64-gnu": "4.14.1", - "@rollup/rollup-linux-s390x-gnu": "4.14.1", - "@rollup/rollup-linux-x64-gnu": "4.14.1", - "@rollup/rollup-linux-x64-musl": "4.14.1", - "@rollup/rollup-win32-arm64-msvc": "4.14.1", - "@rollup/rollup-win32-ia32-msvc": "4.14.1", - "@rollup/rollup-win32-x64-msvc": "4.14.1", + "@rollup/rollup-android-arm-eabi": "4.21.0", + "@rollup/rollup-android-arm64": "4.21.0", + "@rollup/rollup-darwin-arm64": "4.21.0", + "@rollup/rollup-darwin-x64": "4.21.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.21.0", + "@rollup/rollup-linux-arm-musleabihf": "4.21.0", + "@rollup/rollup-linux-arm64-gnu": "4.21.0", + "@rollup/rollup-linux-arm64-musl": "4.21.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.21.0", + "@rollup/rollup-linux-riscv64-gnu": "4.21.0", + "@rollup/rollup-linux-s390x-gnu": "4.21.0", + "@rollup/rollup-linux-x64-gnu": "4.21.0", + "@rollup/rollup-linux-x64-musl": "4.21.0", + "@rollup/rollup-win32-arm64-msvc": "4.21.0", + "@rollup/rollup-win32-ia32-msvc": "4.21.0", + "@rollup/rollup-win32-x64-msvc": "4.21.0", "fsevents": "~2.3.2" } }, @@ -4115,13 +3744,10 @@ } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -4188,15 +3814,6 @@ "node": ">= 10" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/sorcery": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/sorcery/-/sorcery-0.11.0.tgz", @@ -4228,9 +3845,9 @@ "dev": true }, "node_modules/std-env": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.6.0.tgz", - "integrity": "sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, "node_modules/string-width": { @@ -4359,18 +3976,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", - "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", - "dev": true, - "dependencies": { - "js-tokens": "^9.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, "node_modules/sucrase": { "version": "3.34.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", @@ -4438,9 +4043,9 @@ } }, "node_modules/svelte": { - "version": "4.2.14", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.14.tgz", - "integrity": "sha512-ry3+YlWqZpHxLy45MW4MZIxNdvB+Wl7p2nnstWKbOAewaJyNJuOtivSbRChcfIej6wFBjWqyKmf/NgK1uW2JAA==", + "version": "4.2.19", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz", + "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", @@ -4463,15 +4068,13 @@ } }, "node_modules/svelte-check": { - "version": "3.6.9", - "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.6.9.tgz", - "integrity": "sha512-hDQrk3L0osX07djQyMiXocKysTLfusqi8AriNcCiQxhQR49/LonYolcUGMtZ0fbUR8HTR198Prrgf52WWU9wEg==", + "version": "3.8.6", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.8.6.tgz", + "integrity": "sha512-ij0u4Lw/sOTREP13BdWZjiXD/BlHE6/e2e34XzmVmsp5IN4kVa3PWP65NM32JAgwjZlwBg/+JtiNV1MM8khu0Q==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", "chokidar": "^3.4.1", - "fast-glob": "^3.2.7", - "import-fresh": "^3.2.1", "picocolors": "^1.0.0", "sade": "^1.7.4", "svelte-preprocess": "^5.1.3", @@ -4485,15 +4088,15 @@ } }, "node_modules/svelte-eslint-parser": { - "version": "0.34.1", - "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.34.1.tgz", - "integrity": "sha512-9+uLA1pqI9AZioKVGJzYYmlOZWxfoCXSbAM9iaNm7H01XlYlzRTtJfZgl9o3StQGN41PfGJIbkKkfk3e/pHFfA==", + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.41.0.tgz", + "integrity": "sha512-L6f4hOL+AbgfBIB52Z310pg1d2QjRqm7wy3kI1W6hhdhX5bvu7+f0R6w4ykp5HoDdzq+vGhIJmsisaiJDGmVfA==", "dev": true, "dependencies": { "eslint-scope": "^7.2.2", "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", - "postcss": "^8.4.38", + "postcss": "^8.4.39", "postcss-scss": "^4.0.9" }, "engines": { @@ -4503,7 +4106,7 @@ "url": "https://github.com/sponsors/ota-meshi" }, "peerDependencies": { - "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.94" + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.191" }, "peerDependenciesMeta": { "svelte": { @@ -4587,9 +4190,9 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz", - "integrity": "sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==", + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.10.tgz", + "integrity": "sha512-KWZkVPm7yJRhdu4SRSl9d4AK2wM3a50UsvgHZO7xY77NQr2V+fIrEuoDGQcbvswWvFGbS2f6e+jC/6WJm1Dl0w==", "dev": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", @@ -4727,24 +4330,33 @@ } }, "node_modules/tinybench": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", - "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", "dev": true }, "node_modules/tinypool": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.3.tgz", - "integrity": "sha512-Ud7uepAklqRH1bvwy22ynrliC7Dljz7Tm8M/0RBUW+YRa4YHhZ6e4PpgE+fu1zr/WqB1kbeuVrdfeuyIBpy4tw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.0.tgz", + "integrity": "sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==", + "dev": true, + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.0.tgz", + "integrity": "sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==", "dev": true, "engines": { "node": ">=14.0.0" @@ -4771,18 +4383,6 @@ "node": ">=6" } }, - "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", - "dev": true, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "typescript": ">=4.2.0" - } - }, "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", @@ -4790,9 +4390,9 @@ "dev": true }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, "node_modules/type-check": { @@ -4807,31 +4407,10 @@ "node": ">= 0.8.0" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -4841,22 +4420,16 @@ "node": ">=14.17" } }, - "node_modules/ufo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", - "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", - "dev": true - }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.6.tgz", + "integrity": "sha512-e/vggGopEfTKSvj4ihnOLTsqhrKRN3LeO6qSN/GxohhuRv8qH9bNQ4B8W7e/vFL+0XTnmHPB4/kegunZGA4Org==", "dev": true }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "funding": [ { @@ -4873,8 +4446,8 @@ } ], "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -4899,14 +4472,14 @@ "dev": true }, "node_modules/vite": { - "version": "5.2.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.8.tgz", - "integrity": "sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.2.tgz", + "integrity": "sha512-dDrQTRHp5C1fTFzcSaMxjk6vdpKvT+2/mIdE07Gw2ykehT49O0z/VHS3zZ8iV/Gh8BJJKHWOe5RjaNrW5xf/GA==", "dev": true, "dependencies": { - "esbuild": "^0.20.1", - "postcss": "^8.4.38", - "rollup": "^4.13.0" + "esbuild": "^0.21.3", + "postcss": "^8.4.41", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -4925,6 +4498,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -4942,6 +4516,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -4954,15 +4531,15 @@ } }, "node_modules/vite-node": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.5.0.tgz", - "integrity": "sha512-tV8h6gMj6vPzVCa7l+VGq9lwoJjW8Y79vst8QZZGiuRAfijU+EEWuc0kFpmndQrWhMMhet1jdSF+40KSZUqIIw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.0.5.tgz", + "integrity": "sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==", "dev": true, "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", + "debug": "^4.3.5", + "pathe": "^1.1.2", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0" }, "bin": { @@ -4976,14 +4553,13 @@ } }, "node_modules/vite-plugin-tailwind-purgecss": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/vite-plugin-tailwind-purgecss/-/vite-plugin-tailwind-purgecss-0.3.0.tgz", - "integrity": "sha512-hm0yOZ2Z+Xn0T70lWa10IbgBgORGFj5da5NLUglvHSiZHSeJrQKcG1WAZjCBSBTrLPTffF+vYDbBLgVpbo2q0A==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/vite-plugin-tailwind-purgecss/-/vite-plugin-tailwind-purgecss-0.3.3.tgz", + "integrity": "sha512-fsTAzcSdFKrhLxX8zTq3zaTFjk+APmJWOAy+1ujsmxkh9y8hIvM81dWEgdXK1k7suQjns+b7JsoIUkHpxLf5UA==", "dev": true, "dependencies": { "chalk": "^5.3.0", "css-tree": "^2.3.1", - "estree-walker": "^3.0.3", "fast-glob": "^3.3.2", "purgecss": "^6.0.0", "purgecss-from-html": "^6.0.0" @@ -5034,31 +4610,30 @@ } }, "node_modules/vitest": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.5.0.tgz", - "integrity": "sha512-d8UKgR0m2kjdxDWX6911uwxout6GHS0XaGH1cksSIVVG8kRlE7G7aBw7myKQCvDI5dT4j7ZMa+l706BIORMDLw==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.5.0", - "@vitest/runner": "1.5.0", - "@vitest/snapshot": "1.5.0", - "@vitest/spy": "1.5.0", - "@vitest/utils": "1.5.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.5.tgz", + "integrity": "sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@vitest/expect": "2.0.5", + "@vitest/pretty-format": "^2.0.5", + "@vitest/runner": "2.0.5", + "@vitest/snapshot": "2.0.5", + "@vitest/spy": "2.0.5", + "@vitest/utils": "2.0.5", + "chai": "^5.1.1", + "debug": "^4.3.5", "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", + "magic-string": "^0.30.10", + "pathe": "^1.1.2", + "std-env": "^3.7.0", + "tinybench": "^2.8.0", + "tinypool": "^1.0.0", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "1.5.0", - "why-is-node-running": "^2.2.2" + "vite-node": "2.0.5", + "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" @@ -5072,8 +4647,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.5.0", - "@vitest/ui": "1.5.0", + "@vitest/browser": "2.0.5", + "@vitest/ui": "2.0.5", "happy-dom": "*", "jsdom": "*" }, @@ -5114,9 +4689,9 @@ } }, "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, "dependencies": { "siginfo": "^2.0.0", @@ -5229,12 +4804,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", diff --git a/frontend/package.json b/frontend/package.json index dc7d4e66..01098ade 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,36 +15,34 @@ "test:unit": "vitest" }, "devDependencies": { - "@playwright/test": "1.43.1", - "@skeletonlabs/skeleton": "2.9.1", + "@playwright/test": "1.46.1", + "@skeletonlabs/skeleton": "2.10.2", "@skeletonlabs/tw-plugin": "0.4.0", - "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/kit": "2.5.6", - "@sveltejs/vite-plugin-svelte": "^3.1.0", + "@sveltejs/adapter-static": "^3.0.4", + "@sveltejs/kit": "2.5.24", + "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tailwindcss/forms": "0.5.7", - "@tailwindcss/typography": "0.5.12", - "@types/node": "20.12.7", - "@typescript-eslint/eslint-plugin": "7.6.0", - "@typescript-eslint/parser": "7.6.0", - "autoprefixer": "10.4.19", - "eslint": "^8.5.7", + "@tailwindcss/typography": "0.5.14", + "@types/node": "22.5.0", + "autoprefixer": "10.4.20", + "eslint": "^9.9.1", "eslint-config-prettier": "9.1.0", - "eslint-plugin-svelte": "2.37.0", + "eslint-plugin-svelte": "2.43.0", "flatbuffers": "24.3.25", - "postcss": "8.4.38", - "prettier": "3.2.5", - "prettier-plugin-svelte": "3.2.3", - "svelte": "4.2.14", - "svelte-check": "3.6.9", - "tailwindcss": "3.4.3", - "tslib": "2.6.2", - "typescript": "5.4.5", - "vite": "^5.2.8", - "vite-plugin-tailwind-purgecss": "^0.3.0", - "vitest": "1.5.0" + "postcss": "8.4.41", + "prettier": "3.3.3", + "prettier-plugin-svelte": "3.2.6", + "svelte": "4.2.19", + "svelte-check": "3.8.6", + "tailwindcss": "3.4.10", + "tslib": "2.7.0", + "typescript": "5.5.4", + "vite": "^5.4.2", + "vite-plugin-tailwind-purgecss": "^0.3.3", + "vitest": "2.0.5" }, "type": "module", "dependencies": { - "@floating-ui/dom": "1.6.3" + "@floating-ui/dom": "1.6.10" } } diff --git a/frontend/src/lib/MessageHandlers/index.ts b/frontend/src/lib/MessageHandlers/index.ts index b848153a..fa077afd 100644 --- a/frontend/src/lib/MessageHandlers/index.ts +++ b/frontend/src/lib/MessageHandlers/index.ts @@ -1,6 +1,6 @@ import type { WebSocketClient } from '$lib/WebSocketClient'; -import { DeviceToLocalMessage } from '$lib/_fbs/open-shock/serialization/local/device-to-local-message'; -import { DeviceToLocalMessagePayload } from '$lib/_fbs/open-shock/serialization/local/device-to-local-message-payload'; +import { HubToLocalMessage } from '$lib/_fbs/open-shock/serialization/local/hub-to-local-message'; +import { HubToLocalMessagePayload } from '$lib/_fbs/open-shock/serialization/local/hub-to-local-message-payload'; import { ReadyMessage } from '$lib/_fbs/open-shock/serialization/local/ready-message'; import { WifiScanStatusMessage } from '$lib/_fbs/open-shock/serialization/local/wifi-scan-status-message'; import { ByteBuffer } from 'flatbuffers'; @@ -15,16 +15,16 @@ import { ErrorMessage } from '$lib/_fbs/open-shock/serialization/local/error-mes import { WifiNetworkEventHandler } from './WifiNetworkEventHandler'; import { mapConfig } from '$lib/mappers/ConfigMapper'; -export type MessageHandler = (wsClient: WebSocketClient, message: DeviceToLocalMessage) => void; +export type MessageHandler = (wsClient: WebSocketClient, message: HubToLocalMessage) => void; function handleInvalidMessage() { console.warn('[WS] Received invalid message'); } -const PayloadTypes = Object.keys(DeviceToLocalMessagePayload).length / 2; +const PayloadTypes = Object.keys(HubToLocalMessagePayload).length / 2; const PayloadHandlers: MessageHandler[] = new Array(PayloadTypes).fill(handleInvalidMessage); -PayloadHandlers[DeviceToLocalMessagePayload.ReadyMessage] = (cli, msg) => { +PayloadHandlers[HubToLocalMessagePayload.ReadyMessage] = (cli, msg) => { const payload = new ReadyMessage(); msg.payload(payload); @@ -49,7 +49,7 @@ PayloadHandlers[DeviceToLocalMessagePayload.ReadyMessage] = (cli, msg) => { }); }; -PayloadHandlers[DeviceToLocalMessagePayload.ErrorMessage] = (cli, msg) => { +PayloadHandlers[HubToLocalMessagePayload.ErrorMessage] = (cli, msg) => { const payload = new ErrorMessage(); msg.payload(payload); @@ -61,16 +61,16 @@ PayloadHandlers[DeviceToLocalMessagePayload.ErrorMessage] = (cli, msg) => { }); }; -PayloadHandlers[DeviceToLocalMessagePayload.WifiScanStatusMessage] = (cli, msg) => { +PayloadHandlers[HubToLocalMessagePayload.WifiScanStatusMessage] = (cli, msg) => { const payload = new WifiScanStatusMessage(); msg.payload(payload); DeviceStateStore.setWifiScanStatus(payload.status()); }; -PayloadHandlers[DeviceToLocalMessagePayload.WifiNetworkEvent] = WifiNetworkEventHandler; +PayloadHandlers[HubToLocalMessagePayload.WifiNetworkEvent] = WifiNetworkEventHandler; -PayloadHandlers[DeviceToLocalMessagePayload.AccountLinkCommandResult] = (cli, msg) => { +PayloadHandlers[HubToLocalMessagePayload.AccountLinkCommandResult] = (cli, msg) => { const payload = new AccountLinkCommandResult(); msg.payload(payload); @@ -110,7 +110,7 @@ PayloadHandlers[DeviceToLocalMessagePayload.AccountLinkCommandResult] = (cli, ms } }; -PayloadHandlers[DeviceToLocalMessagePayload.SetRfTxPinCommandResult] = (cli, msg) => { +PayloadHandlers[HubToLocalMessagePayload.SetRfTxPinCommandResult] = (cli, msg) => { const payload = new SetRfTxPinCommandResult(); msg.payload(payload); @@ -143,7 +143,7 @@ PayloadHandlers[DeviceToLocalMessagePayload.SetRfTxPinCommandResult] = (cli, msg }; export function WebSocketMessageBinaryHandler(cli: WebSocketClient, data: ArrayBuffer) { - const msg = DeviceToLocalMessage.getRootAsDeviceToLocalMessage(new ByteBuffer(new Uint8Array(data))); + const msg = HubToLocalMessage.getRootAsHubToLocalMessage(new ByteBuffer(new Uint8Array(data))); const payloadType = msg.payloadType(); if (payloadType < 0 || payloadType >= PayloadHandlers.length) { diff --git a/frontend/src/lib/Serializers/AccountLinkCommand.ts b/frontend/src/lib/Serializers/AccountLinkCommand.ts index 5a51e0ea..0f74f720 100644 --- a/frontend/src/lib/Serializers/AccountLinkCommand.ts +++ b/frontend/src/lib/Serializers/AccountLinkCommand.ts @@ -1,6 +1,6 @@ import { Builder as FlatbufferBuilder } from 'flatbuffers'; -import { LocalToDeviceMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message'; -import { LocalToDeviceMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message-payload'; +import { LocalToHubMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message'; +import { LocalToHubMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload'; import { AccountLinkCommand } from '$lib/_fbs/open-shock/serialization/local/account-link-command'; export function SerializeAccountLinkCommand(linkCode: string): Uint8Array { @@ -10,7 +10,7 @@ export function SerializeAccountLinkCommand(linkCode: string): Uint8Array { const cmdOffset = AccountLinkCommand.createAccountLinkCommand(fbb, linkCodeOffset); - const payloadOffset = LocalToDeviceMessage.createLocalToDeviceMessage(fbb, LocalToDeviceMessagePayload.AccountLinkCommand, cmdOffset); + const payloadOffset = LocalToHubMessage.createLocalToHubMessage(fbb, LocalToHubMessagePayload.AccountLinkCommand, cmdOffset); fbb.finish(payloadOffset); diff --git a/frontend/src/lib/Serializers/SetRfTxPinCommand.ts b/frontend/src/lib/Serializers/SetRfTxPinCommand.ts index a38218bf..0f82ec96 100644 --- a/frontend/src/lib/Serializers/SetRfTxPinCommand.ts +++ b/frontend/src/lib/Serializers/SetRfTxPinCommand.ts @@ -1,6 +1,6 @@ import { Builder as FlatbufferBuilder } from 'flatbuffers'; -import { LocalToDeviceMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message'; -import { LocalToDeviceMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message-payload'; +import { LocalToHubMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message'; +import { LocalToHubMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload'; import { SetRfTxPinCommand } from '$lib/_fbs/open-shock/serialization/local/set-rf-tx-pin-command'; export function SerializeSetRfTxPinCommand(pin: number): Uint8Array { @@ -8,7 +8,7 @@ export function SerializeSetRfTxPinCommand(pin: number): Uint8Array { const cmdOffset = SetRfTxPinCommand.createSetRfTxPinCommand(fbb, pin); - const payloadOffset = LocalToDeviceMessage.createLocalToDeviceMessage(fbb, LocalToDeviceMessagePayload.SetRfTxPinCommand, cmdOffset); + const payloadOffset = LocalToHubMessage.createLocalToHubMessage(fbb, LocalToHubMessagePayload.SetRfTxPinCommand, cmdOffset); fbb.finish(payloadOffset); diff --git a/frontend/src/lib/Serializers/WifiNetworkConnectCommand.ts b/frontend/src/lib/Serializers/WifiNetworkConnectCommand.ts index 74dc2e3e..14c7f76e 100644 --- a/frontend/src/lib/Serializers/WifiNetworkConnectCommand.ts +++ b/frontend/src/lib/Serializers/WifiNetworkConnectCommand.ts @@ -1,6 +1,6 @@ import { Builder as FlatbufferBuilder } from 'flatbuffers'; -import { LocalToDeviceMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message'; -import { LocalToDeviceMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message-payload'; +import { LocalToHubMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message'; +import { LocalToHubMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload'; import { WifiNetworkConnectCommand } from '$lib/_fbs/open-shock/serialization/local/wifi-network-connect-command'; export function SerializeWifiNetworkConnectCommand(ssid: string): Uint8Array { @@ -10,7 +10,7 @@ export function SerializeWifiNetworkConnectCommand(ssid: string): Uint8Array { const cmdOffset = WifiNetworkConnectCommand.createWifiNetworkConnectCommand(fbb, ssidOffset); - const payloadOffset = LocalToDeviceMessage.createLocalToDeviceMessage(fbb, LocalToDeviceMessagePayload.WifiNetworkConnectCommand, cmdOffset); + const payloadOffset = LocalToHubMessage.createLocalToHubMessage(fbb, LocalToHubMessagePayload.WifiNetworkConnectCommand, cmdOffset); fbb.finish(payloadOffset); diff --git a/frontend/src/lib/Serializers/WifiNetworkDisconnectCommand.ts b/frontend/src/lib/Serializers/WifiNetworkDisconnectCommand.ts index 567fbf3e..16143842 100644 --- a/frontend/src/lib/Serializers/WifiNetworkDisconnectCommand.ts +++ b/frontend/src/lib/Serializers/WifiNetworkDisconnectCommand.ts @@ -1,6 +1,6 @@ import { Builder as FlatbufferBuilder } from 'flatbuffers'; -import { LocalToDeviceMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message'; -import { LocalToDeviceMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message-payload'; +import { LocalToHubMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message'; +import { LocalToHubMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload'; import { WifiNetworkDisconnectCommand } from '$lib/_fbs/open-shock/serialization/local/wifi-network-disconnect-command'; export function SerializeWifiNetworkDisconnectCommand(): Uint8Array { @@ -8,7 +8,7 @@ export function SerializeWifiNetworkDisconnectCommand(): Uint8Array { const cmdOffset = WifiNetworkDisconnectCommand.createWifiNetworkDisconnectCommand(fbb, true); - const payloadOffset = LocalToDeviceMessage.createLocalToDeviceMessage(fbb, LocalToDeviceMessagePayload.WifiNetworkDisconnectCommand, cmdOffset); + const payloadOffset = LocalToHubMessage.createLocalToHubMessage(fbb, LocalToHubMessagePayload.WifiNetworkDisconnectCommand, cmdOffset); fbb.finish(payloadOffset); diff --git a/frontend/src/lib/Serializers/WifiNetworkForgetCommand.ts b/frontend/src/lib/Serializers/WifiNetworkForgetCommand.ts index 9706370a..fe148ffc 100644 --- a/frontend/src/lib/Serializers/WifiNetworkForgetCommand.ts +++ b/frontend/src/lib/Serializers/WifiNetworkForgetCommand.ts @@ -1,6 +1,6 @@ import { Builder as FlatbufferBuilder } from 'flatbuffers'; -import { LocalToDeviceMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message'; -import { LocalToDeviceMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message-payload'; +import { LocalToHubMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message'; +import { LocalToHubMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload'; import { WifiNetworkForgetCommand } from '$lib/_fbs/open-shock/serialization/local/wifi-network-forget-command'; export function SerializeWifiNetworkForgetCommand(ssid: string): Uint8Array { @@ -10,7 +10,7 @@ export function SerializeWifiNetworkForgetCommand(ssid: string): Uint8Array { const cmdOffset = WifiNetworkForgetCommand.createWifiNetworkForgetCommand(fbb, ssidOffset); - const payloadOffset = LocalToDeviceMessage.createLocalToDeviceMessage(fbb, LocalToDeviceMessagePayload.WifiNetworkForgetCommand, cmdOffset); + const payloadOffset = LocalToHubMessage.createLocalToHubMessage(fbb, LocalToHubMessagePayload.WifiNetworkForgetCommand, cmdOffset); fbb.finish(payloadOffset); diff --git a/frontend/src/lib/Serializers/WifiNetworkSaveCommand.ts b/frontend/src/lib/Serializers/WifiNetworkSaveCommand.ts index f7f75daa..bdee0850 100644 --- a/frontend/src/lib/Serializers/WifiNetworkSaveCommand.ts +++ b/frontend/src/lib/Serializers/WifiNetworkSaveCommand.ts @@ -1,6 +1,6 @@ import { Builder as FlatbufferBuilder } from 'flatbuffers'; -import { LocalToDeviceMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message'; -import { LocalToDeviceMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message-payload'; +import { LocalToHubMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message'; +import { LocalToHubMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload'; import { WifiNetworkSaveCommand } from '$lib/_fbs/open-shock/serialization/local/wifi-network-save-command'; export function SerializeWifiNetworkSaveCommand(ssid: string, password: string | null, connect: boolean): Uint8Array { @@ -14,7 +14,7 @@ export function SerializeWifiNetworkSaveCommand(ssid: string, password: string | const cmdOffset = WifiNetworkSaveCommand.createWifiNetworkSaveCommand(fbb, ssidOffset, passwordOffset, connect); - const payloadOffset = LocalToDeviceMessage.createLocalToDeviceMessage(fbb, LocalToDeviceMessagePayload.WifiNetworkSaveCommand, cmdOffset); + const payloadOffset = LocalToHubMessage.createLocalToHubMessage(fbb, LocalToHubMessagePayload.WifiNetworkSaveCommand, cmdOffset); fbb.finish(payloadOffset); diff --git a/frontend/src/lib/Serializers/WifiScanCommand.ts b/frontend/src/lib/Serializers/WifiScanCommand.ts index 634c5e09..378d989b 100644 --- a/frontend/src/lib/Serializers/WifiScanCommand.ts +++ b/frontend/src/lib/Serializers/WifiScanCommand.ts @@ -1,14 +1,14 @@ import { Builder as FlatbufferBuilder } from 'flatbuffers'; import { WifiScanCommand } from '$lib/_fbs/open-shock/serialization/local/wifi-scan-command'; -import { LocalToDeviceMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message'; -import { LocalToDeviceMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-device-message-payload'; +import { LocalToHubMessage } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message'; +import { LocalToHubMessagePayload } from '$lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload'; export function SerializeWifiScanCommand(scan: boolean): Uint8Array { const fbb = new FlatbufferBuilder(32); const cmdOffset = WifiScanCommand.createWifiScanCommand(fbb, scan); - const payloadOffset = LocalToDeviceMessage.createLocalToDeviceMessage(fbb, LocalToDeviceMessagePayload.WifiScanCommand, cmdOffset); + const payloadOffset = LocalToHubMessage.createLocalToHubMessage(fbb, LocalToHubMessagePayload.WifiScanCommand, cmdOffset); fbb.finish(payloadOffset); diff --git a/frontend/src/lib/_fbs/open-shock/serialization/configuration.ts b/frontend/src/lib/_fbs/open-shock/serialization/configuration.ts index b7193bf5..0c019d49 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/configuration.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/configuration.ts @@ -4,7 +4,7 @@ export { BackendConfig } from './configuration/backend-config'; export { CaptivePortalConfig } from './configuration/captive-portal-config'; -export { Config } from './configuration/config'; +export { HubConfig } from './configuration/hub-config'; export { OtaUpdateChannel } from './configuration/ota-update-channel'; export { OtaUpdateConfig } from './configuration/ota-update-config'; export { OtaUpdateStep } from './configuration/ota-update-step'; diff --git a/frontend/src/lib/_fbs/open-shock/serialization/configuration/config.ts b/frontend/src/lib/_fbs/open-shock/serialization/configuration/hub-config.ts similarity index 84% rename from frontend/src/lib/_fbs/open-shock/serialization/configuration/config.ts rename to frontend/src/lib/_fbs/open-shock/serialization/configuration/hub-config.ts index 452f7dfa..e4489db0 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/configuration/config.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/configuration/hub-config.ts @@ -1,114 +1,114 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import * as flatbuffers from 'flatbuffers'; - -import { BackendConfig } from '../../../open-shock/serialization/configuration/backend-config'; -import { CaptivePortalConfig } from '../../../open-shock/serialization/configuration/captive-portal-config'; -import { OtaUpdateConfig } from '../../../open-shock/serialization/configuration/ota-update-config'; -import { RFConfig } from '../../../open-shock/serialization/configuration/rfconfig'; -import { SerialInputConfig } from '../../../open-shock/serialization/configuration/serial-input-config'; -import { WiFiConfig } from '../../../open-shock/serialization/configuration/wi-fi-config'; - - -export class Config { - bb: flatbuffers.ByteBuffer|null = null; - bb_pos = 0; - __init(i:number, bb:flatbuffers.ByteBuffer):Config { - this.bb_pos = i; - this.bb = bb; - return this; -} - -static getRootAsConfig(bb:flatbuffers.ByteBuffer, obj?:Config):Config { - return (obj || new Config()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -static getSizePrefixedRootAsConfig(bb:flatbuffers.ByteBuffer, obj?:Config):Config { - bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); - return (obj || new Config()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -/** - * RF Transmitter configuration - */ -rf(obj?:RFConfig):RFConfig|null { - const offset = this.bb!.__offset(this.bb_pos, 4); - return offset ? (obj || new RFConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; -} - -/** - * WiFi configuration - */ -wifi(obj?:WiFiConfig):WiFiConfig|null { - const offset = this.bb!.__offset(this.bb_pos, 6); - return offset ? (obj || new WiFiConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; -} - -/** - * Captive portal configuration - */ -captivePortal(obj?:CaptivePortalConfig):CaptivePortalConfig|null { - const offset = this.bb!.__offset(this.bb_pos, 8); - return offset ? (obj || new CaptivePortalConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; -} - -/** - * Backend configuration - */ -backend(obj?:BackendConfig):BackendConfig|null { - const offset = this.bb!.__offset(this.bb_pos, 10); - return offset ? (obj || new BackendConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; -} - -/** - * Serial input configuration - */ -serialInput(obj?:SerialInputConfig):SerialInputConfig|null { - const offset = this.bb!.__offset(this.bb_pos, 12); - return offset ? (obj || new SerialInputConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; -} - -/** - * OTA update configuration - */ -otaUpdate(obj?:OtaUpdateConfig):OtaUpdateConfig|null { - const offset = this.bb!.__offset(this.bb_pos, 14); - return offset ? (obj || new OtaUpdateConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; -} - -static startConfig(builder:flatbuffers.Builder) { - builder.startObject(6); -} - -static addRf(builder:flatbuffers.Builder, rfOffset:flatbuffers.Offset) { - builder.addFieldOffset(0, rfOffset, 0); -} - -static addWifi(builder:flatbuffers.Builder, wifiOffset:flatbuffers.Offset) { - builder.addFieldOffset(1, wifiOffset, 0); -} - -static addCaptivePortal(builder:flatbuffers.Builder, captivePortalOffset:flatbuffers.Offset) { - builder.addFieldOffset(2, captivePortalOffset, 0); -} - -static addBackend(builder:flatbuffers.Builder, backendOffset:flatbuffers.Offset) { - builder.addFieldOffset(3, backendOffset, 0); -} - -static addSerialInput(builder:flatbuffers.Builder, serialInputOffset:flatbuffers.Offset) { - builder.addFieldOffset(4, serialInputOffset, 0); -} - -static addOtaUpdate(builder:flatbuffers.Builder, otaUpdateOffset:flatbuffers.Offset) { - builder.addFieldOffset(5, otaUpdateOffset, 0); -} - -static endConfig(builder:flatbuffers.Builder):flatbuffers.Offset { - const offset = builder.endObject(); - return offset; -} - -} +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import * as flatbuffers from 'flatbuffers'; + +import { BackendConfig } from '../../../open-shock/serialization/configuration/backend-config'; +import { CaptivePortalConfig } from '../../../open-shock/serialization/configuration/captive-portal-config'; +import { OtaUpdateConfig } from '../../../open-shock/serialization/configuration/ota-update-config'; +import { RFConfig } from '../../../open-shock/serialization/configuration/rfconfig'; +import { SerialInputConfig } from '../../../open-shock/serialization/configuration/serial-input-config'; +import { WiFiConfig } from '../../../open-shock/serialization/configuration/wi-fi-config'; + + +export class HubConfig { + bb: flatbuffers.ByteBuffer|null = null; + bb_pos = 0; + __init(i:number, bb:flatbuffers.ByteBuffer):HubConfig { + this.bb_pos = i; + this.bb = bb; + return this; +} + +static getRootAsHubConfig(bb:flatbuffers.ByteBuffer, obj?:HubConfig):HubConfig { + return (obj || new HubConfig()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +static getSizePrefixedRootAsHubConfig(bb:flatbuffers.ByteBuffer, obj?:HubConfig):HubConfig { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new HubConfig()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +/** + * RF Transmitter configuration + */ +rf(obj?:RFConfig):RFConfig|null { + const offset = this.bb!.__offset(this.bb_pos, 4); + return offset ? (obj || new RFConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; +} + +/** + * WiFi configuration + */ +wifi(obj?:WiFiConfig):WiFiConfig|null { + const offset = this.bb!.__offset(this.bb_pos, 6); + return offset ? (obj || new WiFiConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; +} + +/** + * Captive portal configuration + */ +captivePortal(obj?:CaptivePortalConfig):CaptivePortalConfig|null { + const offset = this.bb!.__offset(this.bb_pos, 8); + return offset ? (obj || new CaptivePortalConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; +} + +/** + * Backend configuration + */ +backend(obj?:BackendConfig):BackendConfig|null { + const offset = this.bb!.__offset(this.bb_pos, 10); + return offset ? (obj || new BackendConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; +} + +/** + * Serial input configuration + */ +serialInput(obj?:SerialInputConfig):SerialInputConfig|null { + const offset = this.bb!.__offset(this.bb_pos, 12); + return offset ? (obj || new SerialInputConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; +} + +/** + * OTA update configuration + */ +otaUpdate(obj?:OtaUpdateConfig):OtaUpdateConfig|null { + const offset = this.bb!.__offset(this.bb_pos, 14); + return offset ? (obj || new OtaUpdateConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; +} + +static startHubConfig(builder:flatbuffers.Builder) { + builder.startObject(6); +} + +static addRf(builder:flatbuffers.Builder, rfOffset:flatbuffers.Offset) { + builder.addFieldOffset(0, rfOffset, 0); +} + +static addWifi(builder:flatbuffers.Builder, wifiOffset:flatbuffers.Offset) { + builder.addFieldOffset(1, wifiOffset, 0); +} + +static addCaptivePortal(builder:flatbuffers.Builder, captivePortalOffset:flatbuffers.Offset) { + builder.addFieldOffset(2, captivePortalOffset, 0); +} + +static addBackend(builder:flatbuffers.Builder, backendOffset:flatbuffers.Offset) { + builder.addFieldOffset(3, backendOffset, 0); +} + +static addSerialInput(builder:flatbuffers.Builder, serialInputOffset:flatbuffers.Offset) { + builder.addFieldOffset(4, serialInputOffset, 0); +} + +static addOtaUpdate(builder:flatbuffers.Builder, otaUpdateOffset:flatbuffers.Offset) { + builder.addFieldOffset(5, otaUpdateOffset, 0); +} + +static endHubConfig(builder:flatbuffers.Builder):flatbuffers.Offset { + const offset = builder.endObject(); + return offset; +} + +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/configuration/ota-update-config.ts b/frontend/src/lib/_fbs/open-shock/serialization/configuration/ota-update-config.ts index b3a29758..77ea19a2 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/configuration/ota-update-config.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/configuration/ota-update-config.ts @@ -77,7 +77,7 @@ checkInterval():number { } /** - * Indicates if the backend is authorized to manage the device's update version on behalf of the user. + * Indicates if the backend is authorized to manage the hub's update version on behalf of the user. */ allowBackendManagement():boolean { const offset = this.bb!.__offset(this.bb_pos, 16); @@ -101,7 +101,7 @@ updateId():number { } /** - * Indicates what step of the update process the device is currently in, used to detect failed updates for status reporting. + * Indicates what step of the update process the hub is currently in, used to detect failed updates for status reporting. */ updateStep():OtaUpdateStep { const offset = this.bb!.__offset(this.bb_pos, 22); diff --git a/frontend/src/lib/_fbs/open-shock/serialization/configuration/rfconfig.ts b/frontend/src/lib/_fbs/open-shock/serialization/configuration/rfconfig.ts index b34fb2a4..0ef62da2 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/configuration/rfconfig.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/configuration/rfconfig.ts @@ -31,7 +31,7 @@ txPin():number { } /** - * Whether to transmit keepalive messages to keep the devices from entering sleep mode + * Whether to transmit keepalive messages to keep the shockers from entering sleep mode */ keepaliveEnabled():boolean { const offset = this.bb!.__offset(this.bb_pos, 6); diff --git a/frontend/src/lib/_fbs/open-shock/serialization/configuration/wi-fi-config.ts b/frontend/src/lib/_fbs/open-shock/serialization/configuration/wi-fi-config.ts index 126b275f..f5f6d9cb 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/configuration/wi-fi-config.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/configuration/wi-fi-config.ts @@ -36,7 +36,7 @@ apSsid(optionalEncoding?:any):string|Uint8Array|null { } /** - * Device hostname + * Hub hostname */ hostname():string|null hostname(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null diff --git a/frontend/src/lib/_fbs/open-shock/serialization/gateway.ts b/frontend/src/lib/_fbs/open-shock/serialization/gateway.ts index 655b96d7..eaaca50d 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/gateway.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/gateway.ts @@ -2,9 +2,11 @@ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ -export { CaptivePortalConfig } from './gateway/captive-portal-config'; -export { GatewayToDeviceMessage } from './gateway/gateway-to-device-message'; -export { GatewayToDeviceMessagePayload } from './gateway/gateway-to-device-message-payload'; -export { OtaInstall } from './gateway/ota-install'; -export { ShockerCommand } from './gateway/shocker-command'; -export { ShockerCommandList } from './gateway/shocker-command-list'; +export { BootStatus } from './gateway/boot-status'; +export { HubToGatewayMessage } from './gateway/hub-to-gateway-message'; +export { HubToGatewayMessagePayload } from './gateway/hub-to-gateway-message-payload'; +export { KeepAlive } from './gateway/keep-alive'; +export { OtaInstallFailed } from './gateway/ota-install-failed'; +export { OtaInstallProgress } from './gateway/ota-install-progress'; +export { OtaInstallProgressTask } from './gateway/ota-install-progress-task'; +export { OtaInstallStarted } from './gateway/ota-install-started'; diff --git a/frontend/src/lib/_fbs/open-shock/serialization/gateway/device-to-gateway-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/gateway/device-to-gateway-message.ts deleted file mode 100644 index 1f0048d6..00000000 --- a/frontend/src/lib/_fbs/open-shock/serialization/gateway/device-to-gateway-message.ts +++ /dev/null @@ -1,69 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import * as flatbuffers from 'flatbuffers'; - -import { DeviceToGatewayMessagePayload, unionToDeviceToGatewayMessagePayload, unionListToDeviceToGatewayMessagePayload } from '../../../open-shock/serialization/gateway/device-to-gateway-message-payload'; - - -export class DeviceToGatewayMessage { - bb: flatbuffers.ByteBuffer|null = null; - bb_pos = 0; - __init(i:number, bb:flatbuffers.ByteBuffer):DeviceToGatewayMessage { - this.bb_pos = i; - this.bb = bb; - return this; -} - -static getRootAsDeviceToGatewayMessage(bb:flatbuffers.ByteBuffer, obj?:DeviceToGatewayMessage):DeviceToGatewayMessage { - return (obj || new DeviceToGatewayMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -static getSizePrefixedRootAsDeviceToGatewayMessage(bb:flatbuffers.ByteBuffer, obj?:DeviceToGatewayMessage):DeviceToGatewayMessage { - bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); - return (obj || new DeviceToGatewayMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -payloadType():DeviceToGatewayMessagePayload { - const offset = this.bb!.__offset(this.bb_pos, 4); - return offset ? this.bb!.readUint8(this.bb_pos + offset) : DeviceToGatewayMessagePayload.NONE; -} - -payload(obj:any):any|null { - const offset = this.bb!.__offset(this.bb_pos, 6); - return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; -} - -static startDeviceToGatewayMessage(builder:flatbuffers.Builder) { - builder.startObject(2); -} - -static addPayloadType(builder:flatbuffers.Builder, payloadType:DeviceToGatewayMessagePayload) { - builder.addFieldInt8(0, payloadType, DeviceToGatewayMessagePayload.NONE); -} - -static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { - builder.addFieldOffset(1, payloadOffset, 0); -} - -static endDeviceToGatewayMessage(builder:flatbuffers.Builder):flatbuffers.Offset { - const offset = builder.endObject(); - return offset; -} - -static finishDeviceToGatewayMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset); -} - -static finishSizePrefixedDeviceToGatewayMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset, undefined, true); -} - -static createDeviceToGatewayMessage(builder:flatbuffers.Builder, payloadType:DeviceToGatewayMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { - DeviceToGatewayMessage.startDeviceToGatewayMessage(builder); - DeviceToGatewayMessage.addPayloadType(builder, payloadType); - DeviceToGatewayMessage.addPayload(builder, payloadOffset); - return DeviceToGatewayMessage.endDeviceToGatewayMessage(builder); -} -} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-device-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-device-message.ts deleted file mode 100644 index 85a7ecc1..00000000 --- a/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-device-message.ts +++ /dev/null @@ -1,69 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import * as flatbuffers from 'flatbuffers'; - -import { GatewayToDeviceMessagePayload, unionToGatewayToDeviceMessagePayload, unionListToGatewayToDeviceMessagePayload } from '../../../open-shock/serialization/gateway/gateway-to-device-message-payload'; - - -export class GatewayToDeviceMessage { - bb: flatbuffers.ByteBuffer|null = null; - bb_pos = 0; - __init(i:number, bb:flatbuffers.ByteBuffer):GatewayToDeviceMessage { - this.bb_pos = i; - this.bb = bb; - return this; -} - -static getRootAsGatewayToDeviceMessage(bb:flatbuffers.ByteBuffer, obj?:GatewayToDeviceMessage):GatewayToDeviceMessage { - return (obj || new GatewayToDeviceMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -static getSizePrefixedRootAsGatewayToDeviceMessage(bb:flatbuffers.ByteBuffer, obj?:GatewayToDeviceMessage):GatewayToDeviceMessage { - bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); - return (obj || new GatewayToDeviceMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -payloadType():GatewayToDeviceMessagePayload { - const offset = this.bb!.__offset(this.bb_pos, 4); - return offset ? this.bb!.readUint8(this.bb_pos + offset) : GatewayToDeviceMessagePayload.NONE; -} - -payload(obj:any):any|null { - const offset = this.bb!.__offset(this.bb_pos, 6); - return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; -} - -static startGatewayToDeviceMessage(builder:flatbuffers.Builder) { - builder.startObject(2); -} - -static addPayloadType(builder:flatbuffers.Builder, payloadType:GatewayToDeviceMessagePayload) { - builder.addFieldInt8(0, payloadType, GatewayToDeviceMessagePayload.NONE); -} - -static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { - builder.addFieldOffset(1, payloadOffset, 0); -} - -static endGatewayToDeviceMessage(builder:flatbuffers.Builder):flatbuffers.Offset { - const offset = builder.endObject(); - return offset; -} - -static finishGatewayToDeviceMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset); -} - -static finishSizePrefixedGatewayToDeviceMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset, undefined, true); -} - -static createGatewayToDeviceMessage(builder:flatbuffers.Builder, payloadType:GatewayToDeviceMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { - GatewayToDeviceMessage.startGatewayToDeviceMessage(builder); - GatewayToDeviceMessage.addPayloadType(builder, payloadType); - GatewayToDeviceMessage.addPayload(builder, payloadOffset); - return GatewayToDeviceMessage.endGatewayToDeviceMessage(builder); -} -} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-device-message-payload.ts b/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-hub-message-payload.ts similarity index 81% rename from frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-device-message-payload.ts rename to frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-hub-message-payload.ts index 0b12d57b..7b7ff5cd 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-device-message-payload.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-hub-message-payload.ts @@ -1,42 +1,42 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import { CaptivePortalConfig } from '../../../open-shock/serialization/gateway/captive-portal-config'; -import { OtaInstall } from '../../../open-shock/serialization/gateway/ota-install'; -import { ShockerCommandList } from '../../../open-shock/serialization/gateway/shocker-command-list'; - - -export enum GatewayToDeviceMessagePayload { - NONE = 0, - ShockerCommandList = 1, - CaptivePortalConfig = 2, - OtaInstall = 3 -} - -export function unionToGatewayToDeviceMessagePayload( - type: GatewayToDeviceMessagePayload, - accessor: (obj:CaptivePortalConfig|OtaInstall|ShockerCommandList) => CaptivePortalConfig|OtaInstall|ShockerCommandList|null -): CaptivePortalConfig|OtaInstall|ShockerCommandList|null { - switch(GatewayToDeviceMessagePayload[type]) { - case 'NONE': return null; - case 'ShockerCommandList': return accessor(new ShockerCommandList())! as ShockerCommandList; - case 'CaptivePortalConfig': return accessor(new CaptivePortalConfig())! as CaptivePortalConfig; - case 'OtaInstall': return accessor(new OtaInstall())! as OtaInstall; - default: return null; - } -} - -export function unionListToGatewayToDeviceMessagePayload( - type: GatewayToDeviceMessagePayload, - accessor: (index: number, obj:CaptivePortalConfig|OtaInstall|ShockerCommandList) => CaptivePortalConfig|OtaInstall|ShockerCommandList|null, - index: number -): CaptivePortalConfig|OtaInstall|ShockerCommandList|null { - switch(GatewayToDeviceMessagePayload[type]) { - case 'NONE': return null; - case 'ShockerCommandList': return accessor(index, new ShockerCommandList())! as ShockerCommandList; - case 'CaptivePortalConfig': return accessor(index, new CaptivePortalConfig())! as CaptivePortalConfig; - case 'OtaInstall': return accessor(index, new OtaInstall())! as OtaInstall; - default: return null; - } -} +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import { CaptivePortalConfig } from '../../../open-shock/serialization/gateway/captive-portal-config'; +import { OtaInstall } from '../../../open-shock/serialization/gateway/ota-install'; +import { ShockerCommandList } from '../../../open-shock/serialization/gateway/shocker-command-list'; + + +export enum GatewayToHubMessagePayload { + NONE = 0, + ShockerCommandList = 1, + CaptivePortalConfig = 2, + OtaInstall = 3 +} + +export function unionToGatewayToHubMessagePayload( + type: GatewayToHubMessagePayload, + accessor: (obj:CaptivePortalConfig|OtaInstall|ShockerCommandList) => CaptivePortalConfig|OtaInstall|ShockerCommandList|null +): CaptivePortalConfig|OtaInstall|ShockerCommandList|null { + switch(GatewayToHubMessagePayload[type]) { + case 'NONE': return null; + case 'ShockerCommandList': return accessor(new ShockerCommandList())! as ShockerCommandList; + case 'CaptivePortalConfig': return accessor(new CaptivePortalConfig())! as CaptivePortalConfig; + case 'OtaInstall': return accessor(new OtaInstall())! as OtaInstall; + default: return null; + } +} + +export function unionListToGatewayToHubMessagePayload( + type: GatewayToHubMessagePayload, + accessor: (index: number, obj:CaptivePortalConfig|OtaInstall|ShockerCommandList) => CaptivePortalConfig|OtaInstall|ShockerCommandList|null, + index: number +): CaptivePortalConfig|OtaInstall|ShockerCommandList|null { + switch(GatewayToHubMessagePayload[type]) { + case 'NONE': return null; + case 'ShockerCommandList': return accessor(index, new ShockerCommandList())! as ShockerCommandList; + case 'CaptivePortalConfig': return accessor(index, new CaptivePortalConfig())! as CaptivePortalConfig; + case 'OtaInstall': return accessor(index, new OtaInstall())! as OtaInstall; + default: return null; + } +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-hub-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-hub-message.ts new file mode 100644 index 00000000..6f565d76 --- /dev/null +++ b/frontend/src/lib/_fbs/open-shock/serialization/gateway/gateway-to-hub-message.ts @@ -0,0 +1,69 @@ +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import * as flatbuffers from 'flatbuffers'; + +import { GatewayToHubMessagePayload, unionToGatewayToHubMessagePayload, unionListToGatewayToHubMessagePayload } from '../../../open-shock/serialization/gateway/gateway-to-hub-message-payload'; + + +export class GatewayToHubMessage { + bb: flatbuffers.ByteBuffer|null = null; + bb_pos = 0; + __init(i:number, bb:flatbuffers.ByteBuffer):GatewayToHubMessage { + this.bb_pos = i; + this.bb = bb; + return this; +} + +static getRootAsGatewayToHubMessage(bb:flatbuffers.ByteBuffer, obj?:GatewayToHubMessage):GatewayToHubMessage { + return (obj || new GatewayToHubMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +static getSizePrefixedRootAsGatewayToHubMessage(bb:flatbuffers.ByteBuffer, obj?:GatewayToHubMessage):GatewayToHubMessage { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new GatewayToHubMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +payloadType():GatewayToHubMessagePayload { + const offset = this.bb!.__offset(this.bb_pos, 4); + return offset ? this.bb!.readUint8(this.bb_pos + offset) : GatewayToHubMessagePayload.NONE; +} + +payload(obj:any):any|null { + const offset = this.bb!.__offset(this.bb_pos, 6); + return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; +} + +static startGatewayToHubMessage(builder:flatbuffers.Builder) { + builder.startObject(2); +} + +static addPayloadType(builder:flatbuffers.Builder, payloadType:GatewayToHubMessagePayload) { + builder.addFieldInt8(0, payloadType, GatewayToHubMessagePayload.NONE); +} + +static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { + builder.addFieldOffset(1, payloadOffset, 0); +} + +static endGatewayToHubMessage(builder:flatbuffers.Builder):flatbuffers.Offset { + const offset = builder.endObject(); + return offset; +} + +static finishGatewayToHubMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset); +} + +static finishSizePrefixedGatewayToHubMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset, undefined, true); +} + +static createGatewayToHubMessage(builder:flatbuffers.Builder, payloadType:GatewayToHubMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { + GatewayToHubMessage.startGatewayToHubMessage(builder); + GatewayToHubMessage.addPayloadType(builder, payloadType); + GatewayToHubMessage.addPayload(builder, payloadOffset); + return GatewayToHubMessage.endGatewayToHubMessage(builder); +} +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/gateway/device-to-gateway-message-payload.ts b/frontend/src/lib/_fbs/open-shock/serialization/gateway/hub-to-gateway-message-payload.ts similarity index 86% rename from frontend/src/lib/_fbs/open-shock/serialization/gateway/device-to-gateway-message-payload.ts rename to frontend/src/lib/_fbs/open-shock/serialization/gateway/hub-to-gateway-message-payload.ts index 2da46cc9..40fa1c55 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/gateway/device-to-gateway-message-payload.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/gateway/hub-to-gateway-message-payload.ts @@ -1,50 +1,50 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import { BootStatus } from '../../../open-shock/serialization/gateway/boot-status'; -import { KeepAlive } from '../../../open-shock/serialization/gateway/keep-alive'; -import { OtaInstallFailed } from '../../../open-shock/serialization/gateway/ota-install-failed'; -import { OtaInstallProgress } from '../../../open-shock/serialization/gateway/ota-install-progress'; -import { OtaInstallStarted } from '../../../open-shock/serialization/gateway/ota-install-started'; - - -export enum DeviceToGatewayMessagePayload { - NONE = 0, - KeepAlive = 1, - BootStatus = 2, - OtaInstallStarted = 3, - OtaInstallProgress = 4, - OtaInstallFailed = 5 -} - -export function unionToDeviceToGatewayMessagePayload( - type: DeviceToGatewayMessagePayload, - accessor: (obj:BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted) => BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null -): BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null { - switch(DeviceToGatewayMessagePayload[type]) { - case 'NONE': return null; - case 'KeepAlive': return accessor(new KeepAlive())! as KeepAlive; - case 'BootStatus': return accessor(new BootStatus())! as BootStatus; - case 'OtaInstallStarted': return accessor(new OtaInstallStarted())! as OtaInstallStarted; - case 'OtaInstallProgress': return accessor(new OtaInstallProgress())! as OtaInstallProgress; - case 'OtaInstallFailed': return accessor(new OtaInstallFailed())! as OtaInstallFailed; - default: return null; - } -} - -export function unionListToDeviceToGatewayMessagePayload( - type: DeviceToGatewayMessagePayload, - accessor: (index: number, obj:BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted) => BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null, - index: number -): BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null { - switch(DeviceToGatewayMessagePayload[type]) { - case 'NONE': return null; - case 'KeepAlive': return accessor(index, new KeepAlive())! as KeepAlive; - case 'BootStatus': return accessor(index, new BootStatus())! as BootStatus; - case 'OtaInstallStarted': return accessor(index, new OtaInstallStarted())! as OtaInstallStarted; - case 'OtaInstallProgress': return accessor(index, new OtaInstallProgress())! as OtaInstallProgress; - case 'OtaInstallFailed': return accessor(index, new OtaInstallFailed())! as OtaInstallFailed; - default: return null; - } -} +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import { BootStatus } from '../../../open-shock/serialization/gateway/boot-status'; +import { KeepAlive } from '../../../open-shock/serialization/gateway/keep-alive'; +import { OtaInstallFailed } from '../../../open-shock/serialization/gateway/ota-install-failed'; +import { OtaInstallProgress } from '../../../open-shock/serialization/gateway/ota-install-progress'; +import { OtaInstallStarted } from '../../../open-shock/serialization/gateway/ota-install-started'; + + +export enum HubToGatewayMessagePayload { + NONE = 0, + KeepAlive = 1, + BootStatus = 2, + OtaInstallStarted = 3, + OtaInstallProgress = 4, + OtaInstallFailed = 5 +} + +export function unionToHubToGatewayMessagePayload( + type: HubToGatewayMessagePayload, + accessor: (obj:BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted) => BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null +): BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null { + switch(HubToGatewayMessagePayload[type]) { + case 'NONE': return null; + case 'KeepAlive': return accessor(new KeepAlive())! as KeepAlive; + case 'BootStatus': return accessor(new BootStatus())! as BootStatus; + case 'OtaInstallStarted': return accessor(new OtaInstallStarted())! as OtaInstallStarted; + case 'OtaInstallProgress': return accessor(new OtaInstallProgress())! as OtaInstallProgress; + case 'OtaInstallFailed': return accessor(new OtaInstallFailed())! as OtaInstallFailed; + default: return null; + } +} + +export function unionListToHubToGatewayMessagePayload( + type: HubToGatewayMessagePayload, + accessor: (index: number, obj:BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted) => BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null, + index: number +): BootStatus|KeepAlive|OtaInstallFailed|OtaInstallProgress|OtaInstallStarted|null { + switch(HubToGatewayMessagePayload[type]) { + case 'NONE': return null; + case 'KeepAlive': return accessor(index, new KeepAlive())! as KeepAlive; + case 'BootStatus': return accessor(index, new BootStatus())! as BootStatus; + case 'OtaInstallStarted': return accessor(index, new OtaInstallStarted())! as OtaInstallStarted; + case 'OtaInstallProgress': return accessor(index, new OtaInstallProgress())! as OtaInstallProgress; + case 'OtaInstallFailed': return accessor(index, new OtaInstallFailed())! as OtaInstallFailed; + default: return null; + } +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/gateway/hub-to-gateway-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/gateway/hub-to-gateway-message.ts new file mode 100644 index 00000000..c90d11bf --- /dev/null +++ b/frontend/src/lib/_fbs/open-shock/serialization/gateway/hub-to-gateway-message.ts @@ -0,0 +1,69 @@ +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import * as flatbuffers from 'flatbuffers'; + +import { HubToGatewayMessagePayload, unionToHubToGatewayMessagePayload, unionListToHubToGatewayMessagePayload } from '../../../open-shock/serialization/gateway/hub-to-gateway-message-payload'; + + +export class HubToGatewayMessage { + bb: flatbuffers.ByteBuffer|null = null; + bb_pos = 0; + __init(i:number, bb:flatbuffers.ByteBuffer):HubToGatewayMessage { + this.bb_pos = i; + this.bb = bb; + return this; +} + +static getRootAsHubToGatewayMessage(bb:flatbuffers.ByteBuffer, obj?:HubToGatewayMessage):HubToGatewayMessage { + return (obj || new HubToGatewayMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +static getSizePrefixedRootAsHubToGatewayMessage(bb:flatbuffers.ByteBuffer, obj?:HubToGatewayMessage):HubToGatewayMessage { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new HubToGatewayMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +payloadType():HubToGatewayMessagePayload { + const offset = this.bb!.__offset(this.bb_pos, 4); + return offset ? this.bb!.readUint8(this.bb_pos + offset) : HubToGatewayMessagePayload.NONE; +} + +payload(obj:any):any|null { + const offset = this.bb!.__offset(this.bb_pos, 6); + return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; +} + +static startHubToGatewayMessage(builder:flatbuffers.Builder) { + builder.startObject(2); +} + +static addPayloadType(builder:flatbuffers.Builder, payloadType:HubToGatewayMessagePayload) { + builder.addFieldInt8(0, payloadType, HubToGatewayMessagePayload.NONE); +} + +static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { + builder.addFieldOffset(1, payloadOffset, 0); +} + +static endHubToGatewayMessage(builder:flatbuffers.Builder):flatbuffers.Offset { + const offset = builder.endObject(); + return offset; +} + +static finishHubToGatewayMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset); +} + +static finishSizePrefixedHubToGatewayMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset, undefined, true); +} + +static createHubToGatewayMessage(builder:flatbuffers.Builder, payloadType:HubToGatewayMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { + HubToGatewayMessage.startHubToGatewayMessage(builder); + HubToGatewayMessage.addPayloadType(builder, payloadType); + HubToGatewayMessage.addPayload(builder, payloadOffset); + return HubToGatewayMessage.endHubToGatewayMessage(builder); +} +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local.ts b/frontend/src/lib/_fbs/open-shock/serialization/local.ts index f7b55800..c1d595db 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/local.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/local.ts @@ -4,8 +4,8 @@ export { AccountLinkCommand } from './local/account-link-command'; export { AccountUnlinkCommand } from './local/account-unlink-command'; -export { LocalToDeviceMessage } from './local/local-to-device-message'; -export { LocalToDeviceMessagePayload } from './local/local-to-device-message-payload'; +export { LocalToHubMessage } from './local/local-to-hub-message'; +export { LocalToHubMessagePayload } from './local/local-to-hub-message-payload'; export { OtaUpdateCheckForUpdatesCommand } from './local/ota-update-check-for-updates-command'; export { OtaUpdateHandleUpdateRequestCommand } from './local/ota-update-handle-update-request-command'; export { OtaUpdateSetAllowBackendManagementCommand } from './local/ota-update-set-allow-backend-management-command'; diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local/device-to-local-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/local/device-to-local-message.ts deleted file mode 100644 index 953e2207..00000000 --- a/frontend/src/lib/_fbs/open-shock/serialization/local/device-to-local-message.ts +++ /dev/null @@ -1,69 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import * as flatbuffers from 'flatbuffers'; - -import { DeviceToLocalMessagePayload, unionToDeviceToLocalMessagePayload, unionListToDeviceToLocalMessagePayload } from '../../../open-shock/serialization/local/device-to-local-message-payload'; - - -export class DeviceToLocalMessage { - bb: flatbuffers.ByteBuffer|null = null; - bb_pos = 0; - __init(i:number, bb:flatbuffers.ByteBuffer):DeviceToLocalMessage { - this.bb_pos = i; - this.bb = bb; - return this; -} - -static getRootAsDeviceToLocalMessage(bb:flatbuffers.ByteBuffer, obj?:DeviceToLocalMessage):DeviceToLocalMessage { - return (obj || new DeviceToLocalMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -static getSizePrefixedRootAsDeviceToLocalMessage(bb:flatbuffers.ByteBuffer, obj?:DeviceToLocalMessage):DeviceToLocalMessage { - bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); - return (obj || new DeviceToLocalMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -payloadType():DeviceToLocalMessagePayload { - const offset = this.bb!.__offset(this.bb_pos, 4); - return offset ? this.bb!.readUint8(this.bb_pos + offset) : DeviceToLocalMessagePayload.NONE; -} - -payload(obj:any):any|null { - const offset = this.bb!.__offset(this.bb_pos, 6); - return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; -} - -static startDeviceToLocalMessage(builder:flatbuffers.Builder) { - builder.startObject(2); -} - -static addPayloadType(builder:flatbuffers.Builder, payloadType:DeviceToLocalMessagePayload) { - builder.addFieldInt8(0, payloadType, DeviceToLocalMessagePayload.NONE); -} - -static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { - builder.addFieldOffset(1, payloadOffset, 0); -} - -static endDeviceToLocalMessage(builder:flatbuffers.Builder):flatbuffers.Offset { - const offset = builder.endObject(); - return offset; -} - -static finishDeviceToLocalMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset); -} - -static finishSizePrefixedDeviceToLocalMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset, undefined, true); -} - -static createDeviceToLocalMessage(builder:flatbuffers.Builder, payloadType:DeviceToLocalMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { - DeviceToLocalMessage.startDeviceToLocalMessage(builder); - DeviceToLocalMessage.addPayloadType(builder, payloadType); - DeviceToLocalMessage.addPayload(builder, payloadOffset); - return DeviceToLocalMessage.endDeviceToLocalMessage(builder); -} -} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local/device-to-local-message-payload.ts b/frontend/src/lib/_fbs/open-shock/serialization/local/hub-to-local-message-payload.ts similarity index 91% rename from frontend/src/lib/_fbs/open-shock/serialization/local/device-to-local-message-payload.ts rename to frontend/src/lib/_fbs/open-shock/serialization/local/hub-to-local-message-payload.ts index 5e5dd9e0..522a968a 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/local/device-to-local-message-payload.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/local/hub-to-local-message-payload.ts @@ -1,62 +1,62 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import { AccountLinkCommandResult } from '../../../open-shock/serialization/local/account-link-command-result'; -import { ErrorMessage } from '../../../open-shock/serialization/local/error-message'; -import { ReadyMessage } from '../../../open-shock/serialization/local/ready-message'; -import { SetRfTxPinCommandResult } from '../../../open-shock/serialization/local/set-rf-tx-pin-command-result'; -import { WifiGotIpEvent } from '../../../open-shock/serialization/local/wifi-got-ip-event'; -import { WifiLostIpEvent } from '../../../open-shock/serialization/local/wifi-lost-ip-event'; -import { WifiNetworkEvent } from '../../../open-shock/serialization/local/wifi-network-event'; -import { WifiScanStatusMessage } from '../../../open-shock/serialization/local/wifi-scan-status-message'; - - -export enum DeviceToLocalMessagePayload { - NONE = 0, - ReadyMessage = 1, - ErrorMessage = 2, - WifiScanStatusMessage = 3, - WifiNetworkEvent = 4, - WifiGotIpEvent = 5, - WifiLostIpEvent = 6, - AccountLinkCommandResult = 7, - SetRfTxPinCommandResult = 8 -} - -export function unionToDeviceToLocalMessagePayload( - type: DeviceToLocalMessagePayload, - accessor: (obj:AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage) => AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null -): AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null { - switch(DeviceToLocalMessagePayload[type]) { - case 'NONE': return null; - case 'ReadyMessage': return accessor(new ReadyMessage())! as ReadyMessage; - case 'ErrorMessage': return accessor(new ErrorMessage())! as ErrorMessage; - case 'WifiScanStatusMessage': return accessor(new WifiScanStatusMessage())! as WifiScanStatusMessage; - case 'WifiNetworkEvent': return accessor(new WifiNetworkEvent())! as WifiNetworkEvent; - case 'WifiGotIpEvent': return accessor(new WifiGotIpEvent())! as WifiGotIpEvent; - case 'WifiLostIpEvent': return accessor(new WifiLostIpEvent())! as WifiLostIpEvent; - case 'AccountLinkCommandResult': return accessor(new AccountLinkCommandResult())! as AccountLinkCommandResult; - case 'SetRfTxPinCommandResult': return accessor(new SetRfTxPinCommandResult())! as SetRfTxPinCommandResult; - default: return null; - } -} - -export function unionListToDeviceToLocalMessagePayload( - type: DeviceToLocalMessagePayload, - accessor: (index: number, obj:AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage) => AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null, - index: number -): AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null { - switch(DeviceToLocalMessagePayload[type]) { - case 'NONE': return null; - case 'ReadyMessage': return accessor(index, new ReadyMessage())! as ReadyMessage; - case 'ErrorMessage': return accessor(index, new ErrorMessage())! as ErrorMessage; - case 'WifiScanStatusMessage': return accessor(index, new WifiScanStatusMessage())! as WifiScanStatusMessage; - case 'WifiNetworkEvent': return accessor(index, new WifiNetworkEvent())! as WifiNetworkEvent; - case 'WifiGotIpEvent': return accessor(index, new WifiGotIpEvent())! as WifiGotIpEvent; - case 'WifiLostIpEvent': return accessor(index, new WifiLostIpEvent())! as WifiLostIpEvent; - case 'AccountLinkCommandResult': return accessor(index, new AccountLinkCommandResult())! as AccountLinkCommandResult; - case 'SetRfTxPinCommandResult': return accessor(index, new SetRfTxPinCommandResult())! as SetRfTxPinCommandResult; - default: return null; - } -} +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import { AccountLinkCommandResult } from '../../../open-shock/serialization/local/account-link-command-result'; +import { ErrorMessage } from '../../../open-shock/serialization/local/error-message'; +import { ReadyMessage } from '../../../open-shock/serialization/local/ready-message'; +import { SetRfTxPinCommandResult } from '../../../open-shock/serialization/local/set-rf-tx-pin-command-result'; +import { WifiGotIpEvent } from '../../../open-shock/serialization/local/wifi-got-ip-event'; +import { WifiLostIpEvent } from '../../../open-shock/serialization/local/wifi-lost-ip-event'; +import { WifiNetworkEvent } from '../../../open-shock/serialization/local/wifi-network-event'; +import { WifiScanStatusMessage } from '../../../open-shock/serialization/local/wifi-scan-status-message'; + + +export enum HubToLocalMessagePayload { + NONE = 0, + ReadyMessage = 1, + ErrorMessage = 2, + WifiScanStatusMessage = 3, + WifiNetworkEvent = 4, + WifiGotIpEvent = 5, + WifiLostIpEvent = 6, + AccountLinkCommandResult = 7, + SetRfTxPinCommandResult = 8 +} + +export function unionToHubToLocalMessagePayload( + type: HubToLocalMessagePayload, + accessor: (obj:AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage) => AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null +): AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null { + switch(HubToLocalMessagePayload[type]) { + case 'NONE': return null; + case 'ReadyMessage': return accessor(new ReadyMessage())! as ReadyMessage; + case 'ErrorMessage': return accessor(new ErrorMessage())! as ErrorMessage; + case 'WifiScanStatusMessage': return accessor(new WifiScanStatusMessage())! as WifiScanStatusMessage; + case 'WifiNetworkEvent': return accessor(new WifiNetworkEvent())! as WifiNetworkEvent; + case 'WifiGotIpEvent': return accessor(new WifiGotIpEvent())! as WifiGotIpEvent; + case 'WifiLostIpEvent': return accessor(new WifiLostIpEvent())! as WifiLostIpEvent; + case 'AccountLinkCommandResult': return accessor(new AccountLinkCommandResult())! as AccountLinkCommandResult; + case 'SetRfTxPinCommandResult': return accessor(new SetRfTxPinCommandResult())! as SetRfTxPinCommandResult; + default: return null; + } +} + +export function unionListToHubToLocalMessagePayload( + type: HubToLocalMessagePayload, + accessor: (index: number, obj:AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage) => AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null, + index: number +): AccountLinkCommandResult|ErrorMessage|ReadyMessage|SetRfTxPinCommandResult|WifiGotIpEvent|WifiLostIpEvent|WifiNetworkEvent|WifiScanStatusMessage|null { + switch(HubToLocalMessagePayload[type]) { + case 'NONE': return null; + case 'ReadyMessage': return accessor(index, new ReadyMessage())! as ReadyMessage; + case 'ErrorMessage': return accessor(index, new ErrorMessage())! as ErrorMessage; + case 'WifiScanStatusMessage': return accessor(index, new WifiScanStatusMessage())! as WifiScanStatusMessage; + case 'WifiNetworkEvent': return accessor(index, new WifiNetworkEvent())! as WifiNetworkEvent; + case 'WifiGotIpEvent': return accessor(index, new WifiGotIpEvent())! as WifiGotIpEvent; + case 'WifiLostIpEvent': return accessor(index, new WifiLostIpEvent())! as WifiLostIpEvent; + case 'AccountLinkCommandResult': return accessor(index, new AccountLinkCommandResult())! as AccountLinkCommandResult; + case 'SetRfTxPinCommandResult': return accessor(index, new SetRfTxPinCommandResult())! as SetRfTxPinCommandResult; + default: return null; + } +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local/hub-to-local-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/local/hub-to-local-message.ts new file mode 100644 index 00000000..b4ec5d50 --- /dev/null +++ b/frontend/src/lib/_fbs/open-shock/serialization/local/hub-to-local-message.ts @@ -0,0 +1,69 @@ +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import * as flatbuffers from 'flatbuffers'; + +import { HubToLocalMessagePayload, unionToHubToLocalMessagePayload, unionListToHubToLocalMessagePayload } from '../../../open-shock/serialization/local/hub-to-local-message-payload'; + + +export class HubToLocalMessage { + bb: flatbuffers.ByteBuffer|null = null; + bb_pos = 0; + __init(i:number, bb:flatbuffers.ByteBuffer):HubToLocalMessage { + this.bb_pos = i; + this.bb = bb; + return this; +} + +static getRootAsHubToLocalMessage(bb:flatbuffers.ByteBuffer, obj?:HubToLocalMessage):HubToLocalMessage { + return (obj || new HubToLocalMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +static getSizePrefixedRootAsHubToLocalMessage(bb:flatbuffers.ByteBuffer, obj?:HubToLocalMessage):HubToLocalMessage { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new HubToLocalMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +payloadType():HubToLocalMessagePayload { + const offset = this.bb!.__offset(this.bb_pos, 4); + return offset ? this.bb!.readUint8(this.bb_pos + offset) : HubToLocalMessagePayload.NONE; +} + +payload(obj:any):any|null { + const offset = this.bb!.__offset(this.bb_pos, 6); + return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; +} + +static startHubToLocalMessage(builder:flatbuffers.Builder) { + builder.startObject(2); +} + +static addPayloadType(builder:flatbuffers.Builder, payloadType:HubToLocalMessagePayload) { + builder.addFieldInt8(0, payloadType, HubToLocalMessagePayload.NONE); +} + +static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { + builder.addFieldOffset(1, payloadOffset, 0); +} + +static endHubToLocalMessage(builder:flatbuffers.Builder):flatbuffers.Offset { + const offset = builder.endObject(); + return offset; +} + +static finishHubToLocalMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset); +} + +static finishSizePrefixedHubToLocalMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset, undefined, true); +} + +static createHubToLocalMessage(builder:flatbuffers.Builder, payloadType:HubToLocalMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { + HubToLocalMessage.startHubToLocalMessage(builder); + HubToLocalMessage.addPayloadType(builder, payloadType); + HubToLocalMessage.addPayload(builder, payloadOffset); + return HubToLocalMessage.endHubToLocalMessage(builder); +} +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-device-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-device-message.ts deleted file mode 100644 index 91a2a4a8..00000000 --- a/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-device-message.ts +++ /dev/null @@ -1,69 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import * as flatbuffers from 'flatbuffers'; - -import { LocalToDeviceMessagePayload, unionToLocalToDeviceMessagePayload, unionListToLocalToDeviceMessagePayload } from '../../../open-shock/serialization/local/local-to-device-message-payload'; - - -export class LocalToDeviceMessage { - bb: flatbuffers.ByteBuffer|null = null; - bb_pos = 0; - __init(i:number, bb:flatbuffers.ByteBuffer):LocalToDeviceMessage { - this.bb_pos = i; - this.bb = bb; - return this; -} - -static getRootAsLocalToDeviceMessage(bb:flatbuffers.ByteBuffer, obj?:LocalToDeviceMessage):LocalToDeviceMessage { - return (obj || new LocalToDeviceMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -static getSizePrefixedRootAsLocalToDeviceMessage(bb:flatbuffers.ByteBuffer, obj?:LocalToDeviceMessage):LocalToDeviceMessage { - bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); - return (obj || new LocalToDeviceMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); -} - -payloadType():LocalToDeviceMessagePayload { - const offset = this.bb!.__offset(this.bb_pos, 4); - return offset ? this.bb!.readUint8(this.bb_pos + offset) : LocalToDeviceMessagePayload.NONE; -} - -payload(obj:any):any|null { - const offset = this.bb!.__offset(this.bb_pos, 6); - return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; -} - -static startLocalToDeviceMessage(builder:flatbuffers.Builder) { - builder.startObject(2); -} - -static addPayloadType(builder:flatbuffers.Builder, payloadType:LocalToDeviceMessagePayload) { - builder.addFieldInt8(0, payloadType, LocalToDeviceMessagePayload.NONE); -} - -static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { - builder.addFieldOffset(1, payloadOffset, 0); -} - -static endLocalToDeviceMessage(builder:flatbuffers.Builder):flatbuffers.Offset { - const offset = builder.endObject(); - return offset; -} - -static finishLocalToDeviceMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset); -} - -static finishSizePrefixedLocalToDeviceMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { - builder.finish(offset, undefined, true); -} - -static createLocalToDeviceMessage(builder:flatbuffers.Builder, payloadType:LocalToDeviceMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { - LocalToDeviceMessage.startLocalToDeviceMessage(builder); - LocalToDeviceMessage.addPayloadType(builder, payloadType); - LocalToDeviceMessage.addPayload(builder, payloadOffset); - return LocalToDeviceMessage.endLocalToDeviceMessage(builder); -} -} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-device-message-payload.ts b/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload.ts similarity index 96% rename from frontend/src/lib/_fbs/open-shock/serialization/local/local-to-device-message-payload.ts rename to frontend/src/lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload.ts index fc1999fb..76298dae 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-device-message-payload.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-hub-message-payload.ts @@ -1,98 +1,98 @@ -// automatically generated by the FlatBuffers compiler, do not modify - -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ - -import { AccountLinkCommand } from '../../../open-shock/serialization/local/account-link-command'; -import { AccountUnlinkCommand } from '../../../open-shock/serialization/local/account-unlink-command'; -import { OtaUpdateCheckForUpdatesCommand } from '../../../open-shock/serialization/local/ota-update-check-for-updates-command'; -import { OtaUpdateHandleUpdateRequestCommand } from '../../../open-shock/serialization/local/ota-update-handle-update-request-command'; -import { OtaUpdateSetAllowBackendManagementCommand } from '../../../open-shock/serialization/local/ota-update-set-allow-backend-management-command'; -import { OtaUpdateSetCheckIntervalCommand } from '../../../open-shock/serialization/local/ota-update-set-check-interval-command'; -import { OtaUpdateSetDomainCommand } from '../../../open-shock/serialization/local/ota-update-set-domain-command'; -import { OtaUpdateSetIsEnabledCommand } from '../../../open-shock/serialization/local/ota-update-set-is-enabled-command'; -import { OtaUpdateSetRequireManualApprovalCommand } from '../../../open-shock/serialization/local/ota-update-set-require-manual-approval-command'; -import { OtaUpdateSetUpdateChannelCommand } from '../../../open-shock/serialization/local/ota-update-set-update-channel-command'; -import { OtaUpdateStartUpdateCommand } from '../../../open-shock/serialization/local/ota-update-start-update-command'; -import { SetRfTxPinCommand } from '../../../open-shock/serialization/local/set-rf-tx-pin-command'; -import { WifiNetworkConnectCommand } from '../../../open-shock/serialization/local/wifi-network-connect-command'; -import { WifiNetworkDisconnectCommand } from '../../../open-shock/serialization/local/wifi-network-disconnect-command'; -import { WifiNetworkForgetCommand } from '../../../open-shock/serialization/local/wifi-network-forget-command'; -import { WifiNetworkSaveCommand } from '../../../open-shock/serialization/local/wifi-network-save-command'; -import { WifiScanCommand } from '../../../open-shock/serialization/local/wifi-scan-command'; - - -export enum LocalToDeviceMessagePayload { - NONE = 0, - WifiScanCommand = 1, - WifiNetworkSaveCommand = 2, - WifiNetworkForgetCommand = 3, - WifiNetworkConnectCommand = 4, - WifiNetworkDisconnectCommand = 5, - OtaUpdateSetIsEnabledCommand = 6, - OtaUpdateSetDomainCommand = 7, - OtaUpdateSetUpdateChannelCommand = 8, - OtaUpdateSetCheckIntervalCommand = 9, - OtaUpdateSetAllowBackendManagementCommand = 10, - OtaUpdateSetRequireManualApprovalCommand = 11, - OtaUpdateHandleUpdateRequestCommand = 12, - OtaUpdateCheckForUpdatesCommand = 13, - OtaUpdateStartUpdateCommand = 14, - AccountLinkCommand = 15, - AccountUnlinkCommand = 16, - SetRfTxPinCommand = 17 -} - -export function unionToLocalToDeviceMessagePayload( - type: LocalToDeviceMessagePayload, - accessor: (obj:AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand) => AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null -): AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null { - switch(LocalToDeviceMessagePayload[type]) { - case 'NONE': return null; - case 'WifiScanCommand': return accessor(new WifiScanCommand())! as WifiScanCommand; - case 'WifiNetworkSaveCommand': return accessor(new WifiNetworkSaveCommand())! as WifiNetworkSaveCommand; - case 'WifiNetworkForgetCommand': return accessor(new WifiNetworkForgetCommand())! as WifiNetworkForgetCommand; - case 'WifiNetworkConnectCommand': return accessor(new WifiNetworkConnectCommand())! as WifiNetworkConnectCommand; - case 'WifiNetworkDisconnectCommand': return accessor(new WifiNetworkDisconnectCommand())! as WifiNetworkDisconnectCommand; - case 'OtaUpdateSetIsEnabledCommand': return accessor(new OtaUpdateSetIsEnabledCommand())! as OtaUpdateSetIsEnabledCommand; - case 'OtaUpdateSetDomainCommand': return accessor(new OtaUpdateSetDomainCommand())! as OtaUpdateSetDomainCommand; - case 'OtaUpdateSetUpdateChannelCommand': return accessor(new OtaUpdateSetUpdateChannelCommand())! as OtaUpdateSetUpdateChannelCommand; - case 'OtaUpdateSetCheckIntervalCommand': return accessor(new OtaUpdateSetCheckIntervalCommand())! as OtaUpdateSetCheckIntervalCommand; - case 'OtaUpdateSetAllowBackendManagementCommand': return accessor(new OtaUpdateSetAllowBackendManagementCommand())! as OtaUpdateSetAllowBackendManagementCommand; - case 'OtaUpdateSetRequireManualApprovalCommand': return accessor(new OtaUpdateSetRequireManualApprovalCommand())! as OtaUpdateSetRequireManualApprovalCommand; - case 'OtaUpdateHandleUpdateRequestCommand': return accessor(new OtaUpdateHandleUpdateRequestCommand())! as OtaUpdateHandleUpdateRequestCommand; - case 'OtaUpdateCheckForUpdatesCommand': return accessor(new OtaUpdateCheckForUpdatesCommand())! as OtaUpdateCheckForUpdatesCommand; - case 'OtaUpdateStartUpdateCommand': return accessor(new OtaUpdateStartUpdateCommand())! as OtaUpdateStartUpdateCommand; - case 'AccountLinkCommand': return accessor(new AccountLinkCommand())! as AccountLinkCommand; - case 'AccountUnlinkCommand': return accessor(new AccountUnlinkCommand())! as AccountUnlinkCommand; - case 'SetRfTxPinCommand': return accessor(new SetRfTxPinCommand())! as SetRfTxPinCommand; - default: return null; - } -} - -export function unionListToLocalToDeviceMessagePayload( - type: LocalToDeviceMessagePayload, - accessor: (index: number, obj:AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand) => AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null, - index: number -): AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null { - switch(LocalToDeviceMessagePayload[type]) { - case 'NONE': return null; - case 'WifiScanCommand': return accessor(index, new WifiScanCommand())! as WifiScanCommand; - case 'WifiNetworkSaveCommand': return accessor(index, new WifiNetworkSaveCommand())! as WifiNetworkSaveCommand; - case 'WifiNetworkForgetCommand': return accessor(index, new WifiNetworkForgetCommand())! as WifiNetworkForgetCommand; - case 'WifiNetworkConnectCommand': return accessor(index, new WifiNetworkConnectCommand())! as WifiNetworkConnectCommand; - case 'WifiNetworkDisconnectCommand': return accessor(index, new WifiNetworkDisconnectCommand())! as WifiNetworkDisconnectCommand; - case 'OtaUpdateSetIsEnabledCommand': return accessor(index, new OtaUpdateSetIsEnabledCommand())! as OtaUpdateSetIsEnabledCommand; - case 'OtaUpdateSetDomainCommand': return accessor(index, new OtaUpdateSetDomainCommand())! as OtaUpdateSetDomainCommand; - case 'OtaUpdateSetUpdateChannelCommand': return accessor(index, new OtaUpdateSetUpdateChannelCommand())! as OtaUpdateSetUpdateChannelCommand; - case 'OtaUpdateSetCheckIntervalCommand': return accessor(index, new OtaUpdateSetCheckIntervalCommand())! as OtaUpdateSetCheckIntervalCommand; - case 'OtaUpdateSetAllowBackendManagementCommand': return accessor(index, new OtaUpdateSetAllowBackendManagementCommand())! as OtaUpdateSetAllowBackendManagementCommand; - case 'OtaUpdateSetRequireManualApprovalCommand': return accessor(index, new OtaUpdateSetRequireManualApprovalCommand())! as OtaUpdateSetRequireManualApprovalCommand; - case 'OtaUpdateHandleUpdateRequestCommand': return accessor(index, new OtaUpdateHandleUpdateRequestCommand())! as OtaUpdateHandleUpdateRequestCommand; - case 'OtaUpdateCheckForUpdatesCommand': return accessor(index, new OtaUpdateCheckForUpdatesCommand())! as OtaUpdateCheckForUpdatesCommand; - case 'OtaUpdateStartUpdateCommand': return accessor(index, new OtaUpdateStartUpdateCommand())! as OtaUpdateStartUpdateCommand; - case 'AccountLinkCommand': return accessor(index, new AccountLinkCommand())! as AccountLinkCommand; - case 'AccountUnlinkCommand': return accessor(index, new AccountUnlinkCommand())! as AccountUnlinkCommand; - case 'SetRfTxPinCommand': return accessor(index, new SetRfTxPinCommand())! as SetRfTxPinCommand; - default: return null; - } -} +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import { AccountLinkCommand } from '../../../open-shock/serialization/local/account-link-command'; +import { AccountUnlinkCommand } from '../../../open-shock/serialization/local/account-unlink-command'; +import { OtaUpdateCheckForUpdatesCommand } from '../../../open-shock/serialization/local/ota-update-check-for-updates-command'; +import { OtaUpdateHandleUpdateRequestCommand } from '../../../open-shock/serialization/local/ota-update-handle-update-request-command'; +import { OtaUpdateSetAllowBackendManagementCommand } from '../../../open-shock/serialization/local/ota-update-set-allow-backend-management-command'; +import { OtaUpdateSetCheckIntervalCommand } from '../../../open-shock/serialization/local/ota-update-set-check-interval-command'; +import { OtaUpdateSetDomainCommand } from '../../../open-shock/serialization/local/ota-update-set-domain-command'; +import { OtaUpdateSetIsEnabledCommand } from '../../../open-shock/serialization/local/ota-update-set-is-enabled-command'; +import { OtaUpdateSetRequireManualApprovalCommand } from '../../../open-shock/serialization/local/ota-update-set-require-manual-approval-command'; +import { OtaUpdateSetUpdateChannelCommand } from '../../../open-shock/serialization/local/ota-update-set-update-channel-command'; +import { OtaUpdateStartUpdateCommand } from '../../../open-shock/serialization/local/ota-update-start-update-command'; +import { SetRfTxPinCommand } from '../../../open-shock/serialization/local/set-rf-tx-pin-command'; +import { WifiNetworkConnectCommand } from '../../../open-shock/serialization/local/wifi-network-connect-command'; +import { WifiNetworkDisconnectCommand } from '../../../open-shock/serialization/local/wifi-network-disconnect-command'; +import { WifiNetworkForgetCommand } from '../../../open-shock/serialization/local/wifi-network-forget-command'; +import { WifiNetworkSaveCommand } from '../../../open-shock/serialization/local/wifi-network-save-command'; +import { WifiScanCommand } from '../../../open-shock/serialization/local/wifi-scan-command'; + + +export enum LocalToHubMessagePayload { + NONE = 0, + WifiScanCommand = 1, + WifiNetworkSaveCommand = 2, + WifiNetworkForgetCommand = 3, + WifiNetworkConnectCommand = 4, + WifiNetworkDisconnectCommand = 5, + OtaUpdateSetIsEnabledCommand = 6, + OtaUpdateSetDomainCommand = 7, + OtaUpdateSetUpdateChannelCommand = 8, + OtaUpdateSetCheckIntervalCommand = 9, + OtaUpdateSetAllowBackendManagementCommand = 10, + OtaUpdateSetRequireManualApprovalCommand = 11, + OtaUpdateHandleUpdateRequestCommand = 12, + OtaUpdateCheckForUpdatesCommand = 13, + OtaUpdateStartUpdateCommand = 14, + AccountLinkCommand = 15, + AccountUnlinkCommand = 16, + SetRfTxPinCommand = 17 +} + +export function unionToLocalToHubMessagePayload( + type: LocalToHubMessagePayload, + accessor: (obj:AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand) => AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null +): AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null { + switch(LocalToHubMessagePayload[type]) { + case 'NONE': return null; + case 'WifiScanCommand': return accessor(new WifiScanCommand())! as WifiScanCommand; + case 'WifiNetworkSaveCommand': return accessor(new WifiNetworkSaveCommand())! as WifiNetworkSaveCommand; + case 'WifiNetworkForgetCommand': return accessor(new WifiNetworkForgetCommand())! as WifiNetworkForgetCommand; + case 'WifiNetworkConnectCommand': return accessor(new WifiNetworkConnectCommand())! as WifiNetworkConnectCommand; + case 'WifiNetworkDisconnectCommand': return accessor(new WifiNetworkDisconnectCommand())! as WifiNetworkDisconnectCommand; + case 'OtaUpdateSetIsEnabledCommand': return accessor(new OtaUpdateSetIsEnabledCommand())! as OtaUpdateSetIsEnabledCommand; + case 'OtaUpdateSetDomainCommand': return accessor(new OtaUpdateSetDomainCommand())! as OtaUpdateSetDomainCommand; + case 'OtaUpdateSetUpdateChannelCommand': return accessor(new OtaUpdateSetUpdateChannelCommand())! as OtaUpdateSetUpdateChannelCommand; + case 'OtaUpdateSetCheckIntervalCommand': return accessor(new OtaUpdateSetCheckIntervalCommand())! as OtaUpdateSetCheckIntervalCommand; + case 'OtaUpdateSetAllowBackendManagementCommand': return accessor(new OtaUpdateSetAllowBackendManagementCommand())! as OtaUpdateSetAllowBackendManagementCommand; + case 'OtaUpdateSetRequireManualApprovalCommand': return accessor(new OtaUpdateSetRequireManualApprovalCommand())! as OtaUpdateSetRequireManualApprovalCommand; + case 'OtaUpdateHandleUpdateRequestCommand': return accessor(new OtaUpdateHandleUpdateRequestCommand())! as OtaUpdateHandleUpdateRequestCommand; + case 'OtaUpdateCheckForUpdatesCommand': return accessor(new OtaUpdateCheckForUpdatesCommand())! as OtaUpdateCheckForUpdatesCommand; + case 'OtaUpdateStartUpdateCommand': return accessor(new OtaUpdateStartUpdateCommand())! as OtaUpdateStartUpdateCommand; + case 'AccountLinkCommand': return accessor(new AccountLinkCommand())! as AccountLinkCommand; + case 'AccountUnlinkCommand': return accessor(new AccountUnlinkCommand())! as AccountUnlinkCommand; + case 'SetRfTxPinCommand': return accessor(new SetRfTxPinCommand())! as SetRfTxPinCommand; + default: return null; + } +} + +export function unionListToLocalToHubMessagePayload( + type: LocalToHubMessagePayload, + accessor: (index: number, obj:AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand) => AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null, + index: number +): AccountLinkCommand|AccountUnlinkCommand|OtaUpdateCheckForUpdatesCommand|OtaUpdateHandleUpdateRequestCommand|OtaUpdateSetAllowBackendManagementCommand|OtaUpdateSetCheckIntervalCommand|OtaUpdateSetDomainCommand|OtaUpdateSetIsEnabledCommand|OtaUpdateSetRequireManualApprovalCommand|OtaUpdateSetUpdateChannelCommand|OtaUpdateStartUpdateCommand|SetRfTxPinCommand|WifiNetworkConnectCommand|WifiNetworkDisconnectCommand|WifiNetworkForgetCommand|WifiNetworkSaveCommand|WifiScanCommand|null { + switch(LocalToHubMessagePayload[type]) { + case 'NONE': return null; + case 'WifiScanCommand': return accessor(index, new WifiScanCommand())! as WifiScanCommand; + case 'WifiNetworkSaveCommand': return accessor(index, new WifiNetworkSaveCommand())! as WifiNetworkSaveCommand; + case 'WifiNetworkForgetCommand': return accessor(index, new WifiNetworkForgetCommand())! as WifiNetworkForgetCommand; + case 'WifiNetworkConnectCommand': return accessor(index, new WifiNetworkConnectCommand())! as WifiNetworkConnectCommand; + case 'WifiNetworkDisconnectCommand': return accessor(index, new WifiNetworkDisconnectCommand())! as WifiNetworkDisconnectCommand; + case 'OtaUpdateSetIsEnabledCommand': return accessor(index, new OtaUpdateSetIsEnabledCommand())! as OtaUpdateSetIsEnabledCommand; + case 'OtaUpdateSetDomainCommand': return accessor(index, new OtaUpdateSetDomainCommand())! as OtaUpdateSetDomainCommand; + case 'OtaUpdateSetUpdateChannelCommand': return accessor(index, new OtaUpdateSetUpdateChannelCommand())! as OtaUpdateSetUpdateChannelCommand; + case 'OtaUpdateSetCheckIntervalCommand': return accessor(index, new OtaUpdateSetCheckIntervalCommand())! as OtaUpdateSetCheckIntervalCommand; + case 'OtaUpdateSetAllowBackendManagementCommand': return accessor(index, new OtaUpdateSetAllowBackendManagementCommand())! as OtaUpdateSetAllowBackendManagementCommand; + case 'OtaUpdateSetRequireManualApprovalCommand': return accessor(index, new OtaUpdateSetRequireManualApprovalCommand())! as OtaUpdateSetRequireManualApprovalCommand; + case 'OtaUpdateHandleUpdateRequestCommand': return accessor(index, new OtaUpdateHandleUpdateRequestCommand())! as OtaUpdateHandleUpdateRequestCommand; + case 'OtaUpdateCheckForUpdatesCommand': return accessor(index, new OtaUpdateCheckForUpdatesCommand())! as OtaUpdateCheckForUpdatesCommand; + case 'OtaUpdateStartUpdateCommand': return accessor(index, new OtaUpdateStartUpdateCommand())! as OtaUpdateStartUpdateCommand; + case 'AccountLinkCommand': return accessor(index, new AccountLinkCommand())! as AccountLinkCommand; + case 'AccountUnlinkCommand': return accessor(index, new AccountUnlinkCommand())! as AccountUnlinkCommand; + case 'SetRfTxPinCommand': return accessor(index, new SetRfTxPinCommand())! as SetRfTxPinCommand; + default: return null; + } +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-hub-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-hub-message.ts new file mode 100644 index 00000000..ad02a7b8 --- /dev/null +++ b/frontend/src/lib/_fbs/open-shock/serialization/local/local-to-hub-message.ts @@ -0,0 +1,69 @@ +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +import * as flatbuffers from 'flatbuffers'; + +import { LocalToHubMessagePayload, unionToLocalToHubMessagePayload, unionListToLocalToHubMessagePayload } from '../../../open-shock/serialization/local/local-to-hub-message-payload'; + + +export class LocalToHubMessage { + bb: flatbuffers.ByteBuffer|null = null; + bb_pos = 0; + __init(i:number, bb:flatbuffers.ByteBuffer):LocalToHubMessage { + this.bb_pos = i; + this.bb = bb; + return this; +} + +static getRootAsLocalToHubMessage(bb:flatbuffers.ByteBuffer, obj?:LocalToHubMessage):LocalToHubMessage { + return (obj || new LocalToHubMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +static getSizePrefixedRootAsLocalToHubMessage(bb:flatbuffers.ByteBuffer, obj?:LocalToHubMessage):LocalToHubMessage { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new LocalToHubMessage()).__init(bb.readInt32(bb.position()) + bb.position(), bb); +} + +payloadType():LocalToHubMessagePayload { + const offset = this.bb!.__offset(this.bb_pos, 4); + return offset ? this.bb!.readUint8(this.bb_pos + offset) : LocalToHubMessagePayload.NONE; +} + +payload(obj:any):any|null { + const offset = this.bb!.__offset(this.bb_pos, 6); + return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; +} + +static startLocalToHubMessage(builder:flatbuffers.Builder) { + builder.startObject(2); +} + +static addPayloadType(builder:flatbuffers.Builder, payloadType:LocalToHubMessagePayload) { + builder.addFieldInt8(0, payloadType, LocalToHubMessagePayload.NONE); +} + +static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) { + builder.addFieldOffset(1, payloadOffset, 0); +} + +static endLocalToHubMessage(builder:flatbuffers.Builder):flatbuffers.Offset { + const offset = builder.endObject(); + return offset; +} + +static finishLocalToHubMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset); +} + +static finishSizePrefixedLocalToHubMessageBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { + builder.finish(offset, undefined, true); +} + +static createLocalToHubMessage(builder:flatbuffers.Builder, payloadType:LocalToHubMessagePayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset { + LocalToHubMessage.startLocalToHubMessage(builder); + LocalToHubMessage.addPayloadType(builder, payloadType); + LocalToHubMessage.addPayload(builder, payloadOffset); + return LocalToHubMessage.endLocalToHubMessage(builder); +} +} diff --git a/frontend/src/lib/_fbs/open-shock/serialization/local/ready-message.ts b/frontend/src/lib/_fbs/open-shock/serialization/local/ready-message.ts index a4402724..aee82d90 100644 --- a/frontend/src/lib/_fbs/open-shock/serialization/local/ready-message.ts +++ b/frontend/src/lib/_fbs/open-shock/serialization/local/ready-message.ts @@ -4,7 +4,7 @@ import * as flatbuffers from 'flatbuffers'; -import { Config } from '../../../open-shock/serialization/configuration/config'; +import { HubConfig } from '../../../open-shock/serialization/configuration/hub-config'; import { WifiNetwork } from '../../../open-shock/serialization/types/wifi-network'; @@ -41,9 +41,9 @@ accountLinked():boolean { return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; } -config(obj?:Config):Config|null { +config(obj?:HubConfig):HubConfig|null { const offset = this.bb!.__offset(this.bb_pos, 10); - return offset ? (obj || new Config()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; + return offset ? (obj || new HubConfig()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; } static startReadyMessage(builder:flatbuffers.Builder) { diff --git a/frontend/src/lib/mappers/ConfigMapper.ts b/frontend/src/lib/mappers/ConfigMapper.ts index f6af6f21..78db3c2f 100644 --- a/frontend/src/lib/mappers/ConfigMapper.ts +++ b/frontend/src/lib/mappers/ConfigMapper.ts @@ -1,5 +1,5 @@ import type { OtaUpdateChannel } from '$lib/_fbs/open-shock/serialization/configuration'; -import { Config as FbsConfig } from '$lib/_fbs/open-shock/serialization/configuration/config'; +import { HubConfig } from '$lib/_fbs/open-shock/serialization/configuration/hub-config'; // TODO: Update these configs and ensure that typescript enforces them to be up to date @@ -52,9 +52,9 @@ export interface Config { otaUpdate: OtaUpdateConfig; } -function mapRfConfig(fbsConfig: FbsConfig): RFConfig { - const rf = fbsConfig.rf(); - if (!rf) throw new Error('fbsConfig.rf is null'); +function mapRfConfig(hubConfig: HubConfig): RFConfig { + const rf = hubConfig.rf(); + if (!rf) throw new Error('hubConfig.rf is null'); const txPin = rf.txPin(); const keepaliveEnabled = rf.keepaliveEnabled(); @@ -65,9 +65,9 @@ function mapRfConfig(fbsConfig: FbsConfig): RFConfig { }; } -function mapWifiConfig(fbsConfig: FbsConfig): WifiConfig { - const wifi = fbsConfig.wifi(); - if (!wifi) throw new Error('fbsConfig.wifi is null'); +function mapWifiConfig(hubConfig: HubConfig): WifiConfig { + const wifi = hubConfig.wifi(); + if (!wifi) throw new Error('hubConfig.wifi is null'); const apSsid = wifi.apSsid(); const hostname = wifi.hostname(); @@ -102,9 +102,9 @@ function mapWifiConfig(fbsConfig: FbsConfig): WifiConfig { }; } -function mapCaptivePortalConfig(fbsConfig: FbsConfig): CaptivePortalConfig { - const captivePortal = fbsConfig.captivePortal(); - if (!captivePortal) throw new Error('fbsConfig.captivePortal is null'); +function mapCaptivePortalConfig(hubConfig: HubConfig): CaptivePortalConfig { + const captivePortal = hubConfig.captivePortal(); + if (!captivePortal) throw new Error('hubConfig.captivePortal is null'); const alwaysEnabled = captivePortal.alwaysEnabled(); @@ -113,9 +113,9 @@ function mapCaptivePortalConfig(fbsConfig: FbsConfig): CaptivePortalConfig { }; } -function mapBackendConfig(fbsConfig: FbsConfig): BackendConfig { - const backend = fbsConfig.backend(); - if (!backend) throw new Error('fbsConfig.backend is null'); +function mapBackendConfig(hubConfig: HubConfig): BackendConfig { + const backend = hubConfig.backend(); + if (!backend) throw new Error('hubConfig.backend is null'); const domain = backend.domain(); const authToken = backend.authToken(); @@ -128,9 +128,9 @@ function mapBackendConfig(fbsConfig: FbsConfig): BackendConfig { }; } -function mapSerialInputConfig(fbsConfig: FbsConfig): SerialInputConfig { - const serialInput = fbsConfig.serialInput(); - if (!serialInput) throw new Error('fbsConfig.serialInput is null'); +function mapSerialInputConfig(hubConfig: HubConfig): SerialInputConfig { + const serialInput = hubConfig.serialInput(); + if (!serialInput) throw new Error('hubConfig.serialInput is null'); const echoEnabled = serialInput.echoEnabled(); @@ -139,9 +139,9 @@ function mapSerialInputConfig(fbsConfig: FbsConfig): SerialInputConfig { }; } -function mapOtaUpdateConfig(fbsConfig: FbsConfig): OtaUpdateConfig { - const otaUpdate = fbsConfig.otaUpdate(); - if (!otaUpdate) throw new Error('fbsConfig.otaUpdate is null'); +function mapOtaUpdateConfig(hubConfig: HubConfig): OtaUpdateConfig { + const otaUpdate = hubConfig.otaUpdate(); + if (!otaUpdate) throw new Error('hubConfig.otaUpdate is null'); const isEnabled = otaUpdate.isEnabled(); const cdnDomain = otaUpdate.cdnDomain(); @@ -164,15 +164,15 @@ function mapOtaUpdateConfig(fbsConfig: FbsConfig): OtaUpdateConfig { }; } -export function mapConfig(fbsConfig: FbsConfig | null): Config | null { - if (!fbsConfig) return null; +export function mapConfig(hubConfig: HubConfig | null): Config | null { + if (!hubConfig) return null; return { - rf: mapRfConfig(fbsConfig), - wifi: mapWifiConfig(fbsConfig), - captivePortal: mapCaptivePortalConfig(fbsConfig), - backend: mapBackendConfig(fbsConfig), - serialInput: mapSerialInputConfig(fbsConfig), - otaUpdate: mapOtaUpdateConfig(fbsConfig), + rf: mapRfConfig(hubConfig), + wifi: mapWifiConfig(hubConfig), + captivePortal: mapCaptivePortalConfig(hubConfig), + backend: mapBackendConfig(hubConfig), + serialInput: mapSerialInputConfig(hubConfig), + otaUpdate: mapOtaUpdateConfig(hubConfig), }; } diff --git a/include/AccountLinkResultCode.h b/include/AccountLinkResultCode.h index e12e2c26..03e6ac1c 100644 --- a/include/AccountLinkResultCode.h +++ b/include/AccountLinkResultCode.h @@ -1,6 +1,6 @@ #pragma once -#include "serialization/_fbs/DeviceToLocalMessage_generated.h" +#include "serialization/_fbs/HubToLocalMessage_generated.h" #include diff --git a/include/Chipset.h b/include/Chipset.h index d24ec2ad..f39166f8 100644 --- a/include/Chipset.h +++ b/include/Chipset.h @@ -1,5 +1,7 @@ #pragma once +#include "Common.h" + #include #include @@ -190,6 +192,9 @@ #ifdef OPENSHOCK_FW_BOARD_OPENSHOCKCOREV1 #define OPENSHOCK_BYPASSED_GPIO(pin) ((pin) == 15 || (pin) == 35) #endif +#ifdef OPENSHOCK_FW_BOARD_DFROBOTFIREBEETLE2ESP32E +#define OPENSHOCK_BYPASSED_GPIO(pin) ((pin) == 2 || (pin) == 5) +#endif #ifndef OPENSHOCK_BYPASSED_GPIO #define OPENSHOCK_BYPASSED_GPIO(pin) (false) #endif @@ -198,6 +203,10 @@ namespace OpenShock { constexpr bool IsValidGPIOPin(std::uint8_t pin) { + if (pin == OPENSHOCK_GPIO_INVALID) { + return false; + } + if (pin >= GPIO_NUM_MAX) { return false; } @@ -230,27 +239,31 @@ namespace OpenShock { return true; } - constexpr std::bitset GetValidGPIOPins() { - std::bitset pins; - for (std::uint8_t i = 0; i < GPIO_NUM_MAX; i++) { + + const std::size_t GPIOPinSetSize = GPIO_NUM_MAX + 1; + typedef std::bitset GPIOPinSet; + + constexpr GPIOPinSet GetValidGPIOPins() { + GPIOPinSet pins; + for (std::size_t i = 0; i < GPIOPinSetSize; i++) { if (IsValidGPIOPin(i)) { pins.set(i); } } return pins; } - constexpr std::bitset GetValidInputPins() { - std::bitset pins; - for (std::uint8_t i = 0; i < GPIO_NUM_MAX; i++) { + constexpr GPIOPinSet GetValidInputPins() { + GPIOPinSet pins; + for (std::size_t i = 0; i < GPIOPinSetSize; i++) { if (IsValidInputPin(i)) { pins.set(i); } } return pins; } - constexpr std::bitset GetValidOutputPins() { - std::bitset pins; - for (std::uint8_t i = 0; i < GPIO_NUM_MAX; i++) { + constexpr GPIOPinSet GetValidOutputPins() { + GPIOPinSet pins; + for (std::size_t i = 0; i < GPIOPinSetSize; i++) { if (IsValidOutputPin(i)) { pins.set(i); } diff --git a/include/Common.h b/include/Common.h index 9925f948..a4c557ea 100644 --- a/include/Common.h +++ b/include/Common.h @@ -1,5 +1,7 @@ #pragma once +#include "StringView.h" + #include #define DISABLE_COPY(TypeName) \ @@ -40,7 +42,6 @@ #endif namespace OpenShock::Constants { - const std::uint8_t GPIO_INVALID = OPENSHOCK_GPIO_INVALID; - const std::uint8_t GPIO_RF_TX = OPENSHOCK_RF_TX_GPIO; - const char* const FW_USERAGENT = OPENSHOCK_FW_USERAGENT; + const char* const FW_USERAGENT = OPENSHOCK_FW_USERAGENT; + const StringView FW_USERAGENT_sv = OPENSHOCK_FW_USERAGENT ""_sv; } // namespace OpenShock::Constants diff --git a/include/EStopManager.h b/include/EStopManager.h index fd89b4ed..077db205 100644 --- a/include/EStopManager.h +++ b/include/EStopManager.h @@ -3,14 +3,7 @@ #include namespace OpenShock::EStopManager { - enum class EStopStatus : std::uint8_t { - ALL_CLEAR, // The initial, idle state - ESTOPPED_AND_HELD, // The EStop has been pressed and has not yet been released - ESTOPPED, // Idle EStopped state - ESTOPPED_CLEARED // The EStop has been cleared by the user, but we're waiting for the user to release the button (to avoid incidental estops) - }; - - void Init(std::uint16_t updateIntervalMs); + void Init(); bool IsEStopped(); - std::int64_t WhenEStopped(); + std::int64_t LastEStopped(); } // namespace OpenShock::EStopManager diff --git a/include/FormatHelpers.h b/include/FormatHelpers.h index be5035b2..03fe31ed 100644 --- a/include/FormatHelpers.h +++ b/include/FormatHelpers.h @@ -4,7 +4,7 @@ #define BSSID_ARG(bssid) bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5] #define BSSID_FMT_LEN 18 -#define IPV4ADDR_FMT "%u.%u.%u.%u" +#define IPV4ADDR_FMT "%hhu.%hhu.%hhu.%hhu" #define IPV4ADDR_ARG(addr) addr[0], addr[1], addr[2], addr[3] #define IPV4ADDR_FMT_LEN 15 diff --git a/include/OtaUpdateChannel.h b/include/OtaUpdateChannel.h index a44ef376..e0bbf2fa 100644 --- a/include/OtaUpdateChannel.h +++ b/include/OtaUpdateChannel.h @@ -1,6 +1,6 @@ #pragma once -#include "serialization/_fbs/ConfigFile_generated.h" +#include "serialization/_fbs/HubConfig_generated.h" #include #include diff --git a/include/OtaUpdateStep.h b/include/OtaUpdateStep.h index 343ea3cc..28a9dae7 100644 --- a/include/OtaUpdateStep.h +++ b/include/OtaUpdateStep.h @@ -1,6 +1,6 @@ #pragma once -#include "serialization/_fbs/ConfigFile_generated.h" +#include "serialization/_fbs/HubConfig_generated.h" #include #include diff --git a/include/SetRfPinResultCode.h b/include/SetRfPinResultCode.h index 83f39a38..5b4cf19f 100644 --- a/include/SetRfPinResultCode.h +++ b/include/SetRfPinResultCode.h @@ -1,6 +1,6 @@ #pragma once -#include "serialization/_fbs/DeviceToLocalMessage_generated.h" +#include "serialization/_fbs/HubToLocalMessage_generated.h" #include diff --git a/include/VisualStateManager.h b/include/VisualStateManager.h index 0d717ec0..b7a56198 100644 --- a/include/VisualStateManager.h +++ b/include/VisualStateManager.h @@ -8,6 +8,6 @@ namespace OpenShock::VisualStateManager { void SetCriticalError(); void SetScanningStarted(); - void SetEmergencyStop(OpenShock::EStopManager::EStopStatus status); + void SetEmergencyStopStatus(bool isActive, bool isAwaitingRelease); void SetWebSocketConnected(bool isConnected); } // namespace OpenShock::VisualStateManager diff --git a/include/config/Config.h b/include/config/Config.h index 5c0033eb..be705c42 100644 --- a/include/config/Config.h +++ b/include/config/Config.h @@ -20,8 +20,8 @@ namespace OpenShock::Config { bool SaveFromJSON(StringView json); /* GetAsFlatBuffer and SaveFromFlatBuffer are used for Reading/Writing the config file in its binary form. */ - flatbuffers::Offset GetAsFlatBuffer(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData); - bool SaveFromFlatBuffer(const Serialization::Configuration::Config* config); + flatbuffers::Offset GetAsFlatBuffer(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData); + bool SaveFromFlatBuffer(const Serialization::Configuration::HubConfig* config); /* GetRaw and SetRaw are used for Reading/Writing the config file in its binary form. */ bool GetRaw(std::vector& buffer); diff --git a/include/config/ConfigBase.h b/include/config/ConfigBase.h index d1301830..88a417ab 100644 --- a/include/config/ConfigBase.h +++ b/include/config/ConfigBase.h @@ -1,6 +1,6 @@ #pragma once -#include "serialization/_fbs/ConfigFile_generated.h" +#include "serialization/_fbs/HubConfig_generated.h" #include diff --git a/include/config/RootConfig.h b/include/config/RootConfig.h index 8a23e179..44e2fe6c 100644 --- a/include/config/RootConfig.h +++ b/include/config/RootConfig.h @@ -9,7 +9,7 @@ #include "config/WiFiConfig.h" namespace OpenShock::Config { - struct RootConfig : public ConfigBase { + struct RootConfig : public ConfigBase { OpenShock::Config::RFConfig rf; OpenShock::Config::WiFiConfig wifi; OpenShock::Config::CaptivePortalConfig captivePortal; @@ -19,8 +19,8 @@ namespace OpenShock::Config { void ToDefault() override; - bool FromFlatbuffers(const Serialization::Configuration::Config* config) override; - flatbuffers::Offset ToFlatbuffers(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData) const override; + bool FromFlatbuffers(const Serialization::Configuration::HubConfig* config) override; + flatbuffers::Offset ToFlatbuffers(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData) const override; bool FromJSON(const cJSON* json) override; cJSON* ToJSON(bool withSensitiveData) const override; diff --git a/include/event_handlers/impl/WSGateway.h b/include/event_handlers/impl/WSGateway.h index cf0419fd..a01faf9e 100644 --- a/include/event_handlers/impl/WSGateway.h +++ b/include/event_handlers/impl/WSGateway.h @@ -1,10 +1,10 @@ #pragma once -#include "serialization/_fbs/GatewayToDeviceMessage_generated.h" +#include "serialization/_fbs/GatewayToHubMessage_generated.h" #include -#define WS_EVENT_HANDLER_SIGNATURE(NAME) void NAME(const OpenShock::Serialization::Gateway::GatewayToDeviceMessage* msg) +#define WS_EVENT_HANDLER_SIGNATURE(NAME) void NAME(const OpenShock::Serialization::Gateway::GatewayToHubMessage* msg) namespace OpenShock::MessageHandlers::Server::_Private { typedef WS_EVENT_HANDLER_SIGNATURE((*HandlerType)); diff --git a/include/event_handlers/impl/WSLocal.h b/include/event_handlers/impl/WSLocal.h index cf68ed59..3b3b65aa 100644 --- a/include/event_handlers/impl/WSLocal.h +++ b/include/event_handlers/impl/WSLocal.h @@ -1,11 +1,11 @@ #pragma once -#include "serialization/_fbs/DeviceToLocalMessage_generated.h" -#include "serialization/_fbs/LocalToDeviceMessage_generated.h" +#include "serialization/_fbs/HubToLocalMessage_generated.h" +#include "serialization/_fbs/LocalToHubMessage_generated.h" #include -#define WS_EVENT_HANDLER_SIGNATURE(NAME) void NAME(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* msg) +#define WS_EVENT_HANDLER_SIGNATURE(NAME) void NAME(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* msg) namespace OpenShock::MessageHandlers::Local::_Private { typedef WS_EVENT_HANDLER_SIGNATURE((*HandlerType)); diff --git a/include/serialization/WSGateway.h b/include/serialization/WSGateway.h index 81a304c0..3f04a28d 100644 --- a/include/serialization/WSGateway.h +++ b/include/serialization/WSGateway.h @@ -5,7 +5,7 @@ #include "serialization/CallbackFn.h" #include "StringView.h" -#include "serialization/_fbs/DeviceToGatewayMessage_generated.h" +#include "serialization/_fbs/HubToGatewayMessage_generated.h" namespace OpenShock::Serialization::Gateway { bool SerializeKeepAliveMessage(Common::SerializationCallbackFn callback); diff --git a/include/serialization/_fbs/GatewayToDeviceMessage_generated.h b/include/serialization/_fbs/GatewayToHubMessage_generated.h similarity index 64% rename from include/serialization/_fbs/GatewayToDeviceMessage_generated.h rename to include/serialization/_fbs/GatewayToHubMessage_generated.h index 5b00a6f8..959b55d2 100644 --- a/include/serialization/_fbs/GatewayToDeviceMessage_generated.h +++ b/include/serialization/_fbs/GatewayToHubMessage_generated.h @@ -1,432 +1,432 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_GATEWAYTODEVICEMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ -#define FLATBUFFERS_GENERATED_GATEWAYTODEVICEMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ - -#include "flatbuffers/flatbuffers.h" - -// Ensure the included flatbuffers.h is the same version as when this file was -// generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && - FLATBUFFERS_VERSION_MINOR == 3 && - FLATBUFFERS_VERSION_REVISION == 25, - "Non-compatible flatbuffers version included"); - -#include "SemVer_generated.h" -#include "ShockerCommandType_generated.h" -#include "ShockerModelType_generated.h" - -namespace OpenShock { -namespace Serialization { -namespace Gateway { - -struct ShockerCommand; - -struct ShockerCommandList; -struct ShockerCommandListBuilder; - -struct CaptivePortalConfig; - -struct OtaInstall; -struct OtaInstallBuilder; - -struct GatewayToDeviceMessage; -struct GatewayToDeviceMessageBuilder; - -enum class GatewayToDeviceMessagePayload : uint8_t { - NONE = 0, - ShockerCommandList = 1, - CaptivePortalConfig = 2, - OtaInstall = 3, - MIN = NONE, - MAX = OtaInstall -}; - -inline const GatewayToDeviceMessagePayload (&EnumValuesGatewayToDeviceMessagePayload())[4] { - static const GatewayToDeviceMessagePayload values[] = { - GatewayToDeviceMessagePayload::NONE, - GatewayToDeviceMessagePayload::ShockerCommandList, - GatewayToDeviceMessagePayload::CaptivePortalConfig, - GatewayToDeviceMessagePayload::OtaInstall - }; - return values; -} - -inline const char * const *EnumNamesGatewayToDeviceMessagePayload() { - static const char * const names[5] = { - "NONE", - "ShockerCommandList", - "CaptivePortalConfig", - "OtaInstall", - nullptr - }; - return names; -} - -inline const char *EnumNameGatewayToDeviceMessagePayload(GatewayToDeviceMessagePayload e) { - if (::flatbuffers::IsOutRange(e, GatewayToDeviceMessagePayload::NONE, GatewayToDeviceMessagePayload::OtaInstall)) return ""; - const size_t index = static_cast(e); - return EnumNamesGatewayToDeviceMessagePayload()[index]; -} - -template struct GatewayToDeviceMessagePayloadTraits { - static const GatewayToDeviceMessagePayload enum_value = GatewayToDeviceMessagePayload::NONE; -}; - -template<> struct GatewayToDeviceMessagePayloadTraits { - static const GatewayToDeviceMessagePayload enum_value = GatewayToDeviceMessagePayload::ShockerCommandList; -}; - -template<> struct GatewayToDeviceMessagePayloadTraits { - static const GatewayToDeviceMessagePayload enum_value = GatewayToDeviceMessagePayload::CaptivePortalConfig; -}; - -template<> struct GatewayToDeviceMessagePayloadTraits { - static const GatewayToDeviceMessagePayload enum_value = GatewayToDeviceMessagePayload::OtaInstall; -}; - -bool VerifyGatewayToDeviceMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, GatewayToDeviceMessagePayload type); -bool VerifyGatewayToDeviceMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) ShockerCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t model_; - int8_t padding0__; - uint16_t id_; - uint8_t type_; - uint8_t intensity_; - uint16_t duration_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.ShockerCommand"; - } - ShockerCommand() - : model_(0), - padding0__(0), - id_(0), - type_(0), - intensity_(0), - duration_(0) { - (void)padding0__; - } - ShockerCommand(OpenShock::Serialization::Types::ShockerModelType _model, uint16_t _id, OpenShock::Serialization::Types::ShockerCommandType _type, uint8_t _intensity, uint16_t _duration) - : model_(::flatbuffers::EndianScalar(static_cast(_model))), - padding0__(0), - id_(::flatbuffers::EndianScalar(_id)), - type_(::flatbuffers::EndianScalar(static_cast(_type))), - intensity_(::flatbuffers::EndianScalar(_intensity)), - duration_(::flatbuffers::EndianScalar(_duration)) { - (void)padding0__; - } - OpenShock::Serialization::Types::ShockerModelType model() const { - return static_cast(::flatbuffers::EndianScalar(model_)); - } - uint16_t id() const { - return ::flatbuffers::EndianScalar(id_); - } - OpenShock::Serialization::Types::ShockerCommandType type() const { - return static_cast(::flatbuffers::EndianScalar(type_)); - } - uint8_t intensity() const { - return ::flatbuffers::EndianScalar(intensity_); - } - uint16_t duration() const { - return ::flatbuffers::EndianScalar(duration_); - } -}; -FLATBUFFERS_STRUCT_END(ShockerCommand, 8); - -struct ShockerCommand::Traits { - using type = ShockerCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) CaptivePortalConfig FLATBUFFERS_FINAL_CLASS { - private: - uint8_t enabled_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.CaptivePortalConfig"; - } - CaptivePortalConfig() - : enabled_(0) { - } - CaptivePortalConfig(bool _enabled) - : enabled_(::flatbuffers::EndianScalar(static_cast(_enabled))) { - } - bool enabled() const { - return ::flatbuffers::EndianScalar(enabled_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(CaptivePortalConfig, 1); - -struct CaptivePortalConfig::Traits { - using type = CaptivePortalConfig; -}; - -struct ShockerCommandList FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef ShockerCommandListBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.ShockerCommandList"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_COMMANDS = 4 - }; - const ::flatbuffers::Vector *commands() const { - return GetPointer *>(VT_COMMANDS); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_COMMANDS) && - verifier.VerifyVector(commands()) && - verifier.EndTable(); - } -}; - -struct ShockerCommandListBuilder { - typedef ShockerCommandList Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_commands(::flatbuffers::Offset<::flatbuffers::Vector> commands) { - fbb_.AddOffset(ShockerCommandList::VT_COMMANDS, commands); - } - explicit ShockerCommandListBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - fbb_.Required(o, ShockerCommandList::VT_COMMANDS); - return o; - } -}; - -inline ::flatbuffers::Offset CreateShockerCommandList( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::Vector> commands = 0) { - ShockerCommandListBuilder builder_(_fbb); - builder_.add_commands(commands); - return builder_.Finish(); -} - -struct ShockerCommandList::Traits { - using type = ShockerCommandList; - static auto constexpr Create = CreateShockerCommandList; -}; - -inline ::flatbuffers::Offset CreateShockerCommandListDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *commands = nullptr) { - auto commands__ = commands ? _fbb.CreateVectorOfStructs(*commands) : 0; - return OpenShock::Serialization::Gateway::CreateShockerCommandList( - _fbb, - commands__); -} - -struct OtaInstall FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaInstallBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.OtaInstall"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VERSION = 4 - }; - const OpenShock::Serialization::Types::SemVer *version() const { - return GetPointer(VT_VERSION); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_VERSION) && - verifier.VerifyTable(version()) && - verifier.EndTable(); - } -}; - -struct OtaInstallBuilder { - typedef OtaInstall Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_version(::flatbuffers::Offset version) { - fbb_.AddOffset(OtaInstall::VT_VERSION, version); - } - explicit OtaInstallBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaInstall( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset version = 0) { - OtaInstallBuilder builder_(_fbb); - builder_.add_version(version); - return builder_.Finish(); -} - -struct OtaInstall::Traits { - using type = OtaInstall; - static auto constexpr Create = CreateOtaInstall; -}; - -struct GatewayToDeviceMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef GatewayToDeviceMessageBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.GatewayToDeviceMessage"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_PAYLOAD_TYPE = 4, - VT_PAYLOAD = 6 - }; - OpenShock::Serialization::Gateway::GatewayToDeviceMessagePayload payload_type() const { - return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); - } - const void *payload() const { - return GetPointer(VT_PAYLOAD); - } - template const T *payload_as() const; - const OpenShock::Serialization::Gateway::ShockerCommandList *payload_as_ShockerCommandList() const { - return payload_type() == OpenShock::Serialization::Gateway::GatewayToDeviceMessagePayload::ShockerCommandList ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Gateway::CaptivePortalConfig *payload_as_CaptivePortalConfig() const { - return payload_type() == OpenShock::Serialization::Gateway::GatewayToDeviceMessagePayload::CaptivePortalConfig ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Gateway::OtaInstall *payload_as_OtaInstall() const { - return payload_type() == OpenShock::Serialization::Gateway::GatewayToDeviceMessagePayload::OtaInstall ? static_cast(payload()) : nullptr; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && - VerifyOffset(verifier, VT_PAYLOAD) && - VerifyGatewayToDeviceMessagePayload(verifier, payload(), payload_type()) && - verifier.EndTable(); - } -}; - -template<> inline const OpenShock::Serialization::Gateway::ShockerCommandList *GatewayToDeviceMessage::payload_as() const { - return payload_as_ShockerCommandList(); -} - -template<> inline const OpenShock::Serialization::Gateway::CaptivePortalConfig *GatewayToDeviceMessage::payload_as() const { - return payload_as_CaptivePortalConfig(); -} - -template<> inline const OpenShock::Serialization::Gateway::OtaInstall *GatewayToDeviceMessage::payload_as() const { - return payload_as_OtaInstall(); -} - -struct GatewayToDeviceMessageBuilder { - typedef GatewayToDeviceMessage Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_payload_type(OpenShock::Serialization::Gateway::GatewayToDeviceMessagePayload payload_type) { - fbb_.AddElement(GatewayToDeviceMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); - } - void add_payload(::flatbuffers::Offset payload) { - fbb_.AddOffset(GatewayToDeviceMessage::VT_PAYLOAD, payload); - } - explicit GatewayToDeviceMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateGatewayToDeviceMessage( - ::flatbuffers::FlatBufferBuilder &_fbb, - OpenShock::Serialization::Gateway::GatewayToDeviceMessagePayload payload_type = OpenShock::Serialization::Gateway::GatewayToDeviceMessagePayload::NONE, - ::flatbuffers::Offset payload = 0) { - GatewayToDeviceMessageBuilder builder_(_fbb); - builder_.add_payload(payload); - builder_.add_payload_type(payload_type); - return builder_.Finish(); -} - -struct GatewayToDeviceMessage::Traits { - using type = GatewayToDeviceMessage; - static auto constexpr Create = CreateGatewayToDeviceMessage; -}; - -inline bool VerifyGatewayToDeviceMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, GatewayToDeviceMessagePayload type) { - switch (type) { - case GatewayToDeviceMessagePayload::NONE: { - return true; - } - case GatewayToDeviceMessagePayload::ShockerCommandList: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case GatewayToDeviceMessagePayload::CaptivePortalConfig: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case GatewayToDeviceMessagePayload::OtaInstall: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyGatewayToDeviceMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyGatewayToDeviceMessagePayload( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const OpenShock::Serialization::Gateway::GatewayToDeviceMessage *GetGatewayToDeviceMessage(const void *buf) { - return ::flatbuffers::GetRoot(buf); -} - -inline const OpenShock::Serialization::Gateway::GatewayToDeviceMessage *GetSizePrefixedGatewayToDeviceMessage(const void *buf) { - return ::flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyGatewayToDeviceMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedGatewayToDeviceMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishGatewayToDeviceMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedGatewayToDeviceMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace Gateway -} // namespace Serialization -} // namespace OpenShock - -#endif // FLATBUFFERS_GENERATED_GATEWAYTODEVICEMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_GATEWAYTOHUBMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ +#define FLATBUFFERS_GENERATED_GATEWAYTOHUBMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, + "Non-compatible flatbuffers version included"); + +#include "SemVer_generated.h" +#include "ShockerCommandType_generated.h" +#include "ShockerModelType_generated.h" + +namespace OpenShock { +namespace Serialization { +namespace Gateway { + +struct ShockerCommand; + +struct ShockerCommandList; +struct ShockerCommandListBuilder; + +struct CaptivePortalConfig; + +struct OtaInstall; +struct OtaInstallBuilder; + +struct GatewayToHubMessage; +struct GatewayToHubMessageBuilder; + +enum class GatewayToHubMessagePayload : uint8_t { + NONE = 0, + ShockerCommandList = 1, + CaptivePortalConfig = 2, + OtaInstall = 3, + MIN = NONE, + MAX = OtaInstall +}; + +inline const GatewayToHubMessagePayload (&EnumValuesGatewayToHubMessagePayload())[4] { + static const GatewayToHubMessagePayload values[] = { + GatewayToHubMessagePayload::NONE, + GatewayToHubMessagePayload::ShockerCommandList, + GatewayToHubMessagePayload::CaptivePortalConfig, + GatewayToHubMessagePayload::OtaInstall + }; + return values; +} + +inline const char * const *EnumNamesGatewayToHubMessagePayload() { + static const char * const names[5] = { + "NONE", + "ShockerCommandList", + "CaptivePortalConfig", + "OtaInstall", + nullptr + }; + return names; +} + +inline const char *EnumNameGatewayToHubMessagePayload(GatewayToHubMessagePayload e) { + if (::flatbuffers::IsOutRange(e, GatewayToHubMessagePayload::NONE, GatewayToHubMessagePayload::OtaInstall)) return ""; + const size_t index = static_cast(e); + return EnumNamesGatewayToHubMessagePayload()[index]; +} + +template struct GatewayToHubMessagePayloadTraits { + static const GatewayToHubMessagePayload enum_value = GatewayToHubMessagePayload::NONE; +}; + +template<> struct GatewayToHubMessagePayloadTraits { + static const GatewayToHubMessagePayload enum_value = GatewayToHubMessagePayload::ShockerCommandList; +}; + +template<> struct GatewayToHubMessagePayloadTraits { + static const GatewayToHubMessagePayload enum_value = GatewayToHubMessagePayload::CaptivePortalConfig; +}; + +template<> struct GatewayToHubMessagePayloadTraits { + static const GatewayToHubMessagePayload enum_value = GatewayToHubMessagePayload::OtaInstall; +}; + +bool VerifyGatewayToHubMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, GatewayToHubMessagePayload type); +bool VerifyGatewayToHubMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) ShockerCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t model_; + int8_t padding0__; + uint16_t id_; + uint8_t type_; + uint8_t intensity_; + uint16_t duration_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.ShockerCommand"; + } + ShockerCommand() + : model_(0), + padding0__(0), + id_(0), + type_(0), + intensity_(0), + duration_(0) { + (void)padding0__; + } + ShockerCommand(OpenShock::Serialization::Types::ShockerModelType _model, uint16_t _id, OpenShock::Serialization::Types::ShockerCommandType _type, uint8_t _intensity, uint16_t _duration) + : model_(::flatbuffers::EndianScalar(static_cast(_model))), + padding0__(0), + id_(::flatbuffers::EndianScalar(_id)), + type_(::flatbuffers::EndianScalar(static_cast(_type))), + intensity_(::flatbuffers::EndianScalar(_intensity)), + duration_(::flatbuffers::EndianScalar(_duration)) { + (void)padding0__; + } + OpenShock::Serialization::Types::ShockerModelType model() const { + return static_cast(::flatbuffers::EndianScalar(model_)); + } + uint16_t id() const { + return ::flatbuffers::EndianScalar(id_); + } + OpenShock::Serialization::Types::ShockerCommandType type() const { + return static_cast(::flatbuffers::EndianScalar(type_)); + } + uint8_t intensity() const { + return ::flatbuffers::EndianScalar(intensity_); + } + uint16_t duration() const { + return ::flatbuffers::EndianScalar(duration_); + } +}; +FLATBUFFERS_STRUCT_END(ShockerCommand, 8); + +struct ShockerCommand::Traits { + using type = ShockerCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) CaptivePortalConfig FLATBUFFERS_FINAL_CLASS { + private: + uint8_t enabled_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.CaptivePortalConfig"; + } + CaptivePortalConfig() + : enabled_(0) { + } + CaptivePortalConfig(bool _enabled) + : enabled_(::flatbuffers::EndianScalar(static_cast(_enabled))) { + } + bool enabled() const { + return ::flatbuffers::EndianScalar(enabled_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(CaptivePortalConfig, 1); + +struct CaptivePortalConfig::Traits { + using type = CaptivePortalConfig; +}; + +struct ShockerCommandList FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef ShockerCommandListBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.ShockerCommandList"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_COMMANDS = 4 + }; + const ::flatbuffers::Vector *commands() const { + return GetPointer *>(VT_COMMANDS); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_COMMANDS) && + verifier.VerifyVector(commands()) && + verifier.EndTable(); + } +}; + +struct ShockerCommandListBuilder { + typedef ShockerCommandList Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_commands(::flatbuffers::Offset<::flatbuffers::Vector> commands) { + fbb_.AddOffset(ShockerCommandList::VT_COMMANDS, commands); + } + explicit ShockerCommandListBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + fbb_.Required(o, ShockerCommandList::VT_COMMANDS); + return o; + } +}; + +inline ::flatbuffers::Offset CreateShockerCommandList( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::Vector> commands = 0) { + ShockerCommandListBuilder builder_(_fbb); + builder_.add_commands(commands); + return builder_.Finish(); +} + +struct ShockerCommandList::Traits { + using type = ShockerCommandList; + static auto constexpr Create = CreateShockerCommandList; +}; + +inline ::flatbuffers::Offset CreateShockerCommandListDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *commands = nullptr) { + auto commands__ = commands ? _fbb.CreateVectorOfStructs(*commands) : 0; + return OpenShock::Serialization::Gateway::CreateShockerCommandList( + _fbb, + commands__); +} + +struct OtaInstall FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaInstallBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.OtaInstall"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VERSION = 4 + }; + const OpenShock::Serialization::Types::SemVer *version() const { + return GetPointer(VT_VERSION); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_VERSION) && + verifier.VerifyTable(version()) && + verifier.EndTable(); + } +}; + +struct OtaInstallBuilder { + typedef OtaInstall Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_version(::flatbuffers::Offset version) { + fbb_.AddOffset(OtaInstall::VT_VERSION, version); + } + explicit OtaInstallBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaInstall( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset version = 0) { + OtaInstallBuilder builder_(_fbb); + builder_.add_version(version); + return builder_.Finish(); +} + +struct OtaInstall::Traits { + using type = OtaInstall; + static auto constexpr Create = CreateOtaInstall; +}; + +struct GatewayToHubMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef GatewayToHubMessageBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.GatewayToHubMessage"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_PAYLOAD_TYPE = 4, + VT_PAYLOAD = 6 + }; + OpenShock::Serialization::Gateway::GatewayToHubMessagePayload payload_type() const { + return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); + } + const void *payload() const { + return GetPointer(VT_PAYLOAD); + } + template const T *payload_as() const; + const OpenShock::Serialization::Gateway::ShockerCommandList *payload_as_ShockerCommandList() const { + return payload_type() == OpenShock::Serialization::Gateway::GatewayToHubMessagePayload::ShockerCommandList ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Gateway::CaptivePortalConfig *payload_as_CaptivePortalConfig() const { + return payload_type() == OpenShock::Serialization::Gateway::GatewayToHubMessagePayload::CaptivePortalConfig ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Gateway::OtaInstall *payload_as_OtaInstall() const { + return payload_type() == OpenShock::Serialization::Gateway::GatewayToHubMessagePayload::OtaInstall ? static_cast(payload()) : nullptr; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && + VerifyOffset(verifier, VT_PAYLOAD) && + VerifyGatewayToHubMessagePayload(verifier, payload(), payload_type()) && + verifier.EndTable(); + } +}; + +template<> inline const OpenShock::Serialization::Gateway::ShockerCommandList *GatewayToHubMessage::payload_as() const { + return payload_as_ShockerCommandList(); +} + +template<> inline const OpenShock::Serialization::Gateway::CaptivePortalConfig *GatewayToHubMessage::payload_as() const { + return payload_as_CaptivePortalConfig(); +} + +template<> inline const OpenShock::Serialization::Gateway::OtaInstall *GatewayToHubMessage::payload_as() const { + return payload_as_OtaInstall(); +} + +struct GatewayToHubMessageBuilder { + typedef GatewayToHubMessage Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_payload_type(OpenShock::Serialization::Gateway::GatewayToHubMessagePayload payload_type) { + fbb_.AddElement(GatewayToHubMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); + } + void add_payload(::flatbuffers::Offset payload) { + fbb_.AddOffset(GatewayToHubMessage::VT_PAYLOAD, payload); + } + explicit GatewayToHubMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateGatewayToHubMessage( + ::flatbuffers::FlatBufferBuilder &_fbb, + OpenShock::Serialization::Gateway::GatewayToHubMessagePayload payload_type = OpenShock::Serialization::Gateway::GatewayToHubMessagePayload::NONE, + ::flatbuffers::Offset payload = 0) { + GatewayToHubMessageBuilder builder_(_fbb); + builder_.add_payload(payload); + builder_.add_payload_type(payload_type); + return builder_.Finish(); +} + +struct GatewayToHubMessage::Traits { + using type = GatewayToHubMessage; + static auto constexpr Create = CreateGatewayToHubMessage; +}; + +inline bool VerifyGatewayToHubMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, GatewayToHubMessagePayload type) { + switch (type) { + case GatewayToHubMessagePayload::NONE: { + return true; + } + case GatewayToHubMessagePayload::ShockerCommandList: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case GatewayToHubMessagePayload::CaptivePortalConfig: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case GatewayToHubMessagePayload::OtaInstall: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyGatewayToHubMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyGatewayToHubMessagePayload( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const OpenShock::Serialization::Gateway::GatewayToHubMessage *GetGatewayToHubMessage(const void *buf) { + return ::flatbuffers::GetRoot(buf); +} + +inline const OpenShock::Serialization::Gateway::GatewayToHubMessage *GetSizePrefixedGatewayToHubMessage(const void *buf) { + return ::flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyGatewayToHubMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedGatewayToHubMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishGatewayToHubMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedGatewayToHubMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace Gateway +} // namespace Serialization +} // namespace OpenShock + +#endif // FLATBUFFERS_GENERATED_GATEWAYTOHUBMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ diff --git a/include/serialization/_fbs/ConfigFile_generated.h b/include/serialization/_fbs/HubConfig_generated.h similarity index 92% rename from include/serialization/_fbs/ConfigFile_generated.h rename to include/serialization/_fbs/HubConfig_generated.h index 93a6307b..87fac04c 100644 --- a/include/serialization/_fbs/ConfigFile_generated.h +++ b/include/serialization/_fbs/HubConfig_generated.h @@ -1,850 +1,850 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_CONFIGFILE_OPENSHOCK_SERIALIZATION_CONFIGURATION_H_ -#define FLATBUFFERS_GENERATED_CONFIGFILE_OPENSHOCK_SERIALIZATION_CONFIGURATION_H_ - -#include "flatbuffers/flatbuffers.h" - -// Ensure the included flatbuffers.h is the same version as when this file was -// generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && - FLATBUFFERS_VERSION_MINOR == 3 && - FLATBUFFERS_VERSION_REVISION == 25, - "Non-compatible flatbuffers version included"); - -namespace OpenShock { -namespace Serialization { -namespace Configuration { - -struct RFConfig; -struct RFConfigBuilder; - -struct WiFiCredentials; -struct WiFiCredentialsBuilder; - -struct WiFiConfig; -struct WiFiConfigBuilder; - -struct CaptivePortalConfig; -struct CaptivePortalConfigBuilder; - -struct BackendConfig; -struct BackendConfigBuilder; - -struct SerialInputConfig; -struct SerialInputConfigBuilder; - -struct OtaUpdateConfig; -struct OtaUpdateConfigBuilder; - -struct Config; -struct ConfigBuilder; - -enum class OtaUpdateChannel : uint8_t { - Stable = 0, - Beta = 1, - Develop = 2, - MIN = Stable, - MAX = Develop -}; - -inline const OtaUpdateChannel (&EnumValuesOtaUpdateChannel())[3] { - static const OtaUpdateChannel values[] = { - OtaUpdateChannel::Stable, - OtaUpdateChannel::Beta, - OtaUpdateChannel::Develop - }; - return values; -} - -inline const char * const *EnumNamesOtaUpdateChannel() { - static const char * const names[4] = { - "Stable", - "Beta", - "Develop", - nullptr - }; - return names; -} - -inline const char *EnumNameOtaUpdateChannel(OtaUpdateChannel e) { - if (::flatbuffers::IsOutRange(e, OtaUpdateChannel::Stable, OtaUpdateChannel::Develop)) return ""; - const size_t index = static_cast(e); - return EnumNamesOtaUpdateChannel()[index]; -} - -enum class OtaUpdateStep : uint8_t { - None = 0, - Updating = 1, - Updated = 2, - Validating = 3, - Validated = 4, - RollingBack = 5, - MIN = None, - MAX = RollingBack -}; - -inline const OtaUpdateStep (&EnumValuesOtaUpdateStep())[6] { - static const OtaUpdateStep values[] = { - OtaUpdateStep::None, - OtaUpdateStep::Updating, - OtaUpdateStep::Updated, - OtaUpdateStep::Validating, - OtaUpdateStep::Validated, - OtaUpdateStep::RollingBack - }; - return values; -} - -inline const char * const *EnumNamesOtaUpdateStep() { - static const char * const names[7] = { - "None", - "Updating", - "Updated", - "Validating", - "Validated", - "RollingBack", - nullptr - }; - return names; -} - -inline const char *EnumNameOtaUpdateStep(OtaUpdateStep e) { - if (::flatbuffers::IsOutRange(e, OtaUpdateStep::None, OtaUpdateStep::RollingBack)) return ""; - const size_t index = static_cast(e); - return EnumNamesOtaUpdateStep()[index]; -} - -struct RFConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef RFConfigBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.RFConfig"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_TX_PIN = 4, - VT_KEEPALIVE_ENABLED = 6 - }; - /// The GPIO pin connected to the RF modulator's data pin for transmitting (TX) - uint8_t tx_pin() const { - return GetField(VT_TX_PIN, 0); - } - /// Whether to transmit keepalive messages to keep the devices from entering sleep mode - bool keepalive_enabled() const { - return GetField(VT_KEEPALIVE_ENABLED, 0) != 0; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_TX_PIN, 1) && - VerifyField(verifier, VT_KEEPALIVE_ENABLED, 1) && - verifier.EndTable(); - } -}; - -struct RFConfigBuilder { - typedef RFConfig Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_tx_pin(uint8_t tx_pin) { - fbb_.AddElement(RFConfig::VT_TX_PIN, tx_pin, 0); - } - void add_keepalive_enabled(bool keepalive_enabled) { - fbb_.AddElement(RFConfig::VT_KEEPALIVE_ENABLED, static_cast(keepalive_enabled), 0); - } - explicit RFConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateRFConfig( - ::flatbuffers::FlatBufferBuilder &_fbb, - uint8_t tx_pin = 0, - bool keepalive_enabled = false) { - RFConfigBuilder builder_(_fbb); - builder_.add_keepalive_enabled(keepalive_enabled); - builder_.add_tx_pin(tx_pin); - return builder_.Finish(); -} - -struct RFConfig::Traits { - using type = RFConfig; - static auto constexpr Create = CreateRFConfig; -}; - -struct WiFiCredentials FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WiFiCredentialsBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.WiFiCredentials"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4, - VT_SSID = 6, - VT_PASSWORD = 8 - }; - /// ID of the WiFi network credentials, used for referencing the credentials with a low memory footprint - uint8_t id() const { - return GetField(VT_ID, 0); - } - /// SSID of the WiFi network - const ::flatbuffers::String *ssid() const { - return GetPointer(VT_SSID); - } - /// Password of the WiFi network - const ::flatbuffers::String *password() const { - return GetPointer(VT_PASSWORD); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID, 1) && - VerifyOffset(verifier, VT_SSID) && - verifier.VerifyString(ssid()) && - VerifyOffset(verifier, VT_PASSWORD) && - verifier.VerifyString(password()) && - verifier.EndTable(); - } -}; - -struct WiFiCredentialsBuilder { - typedef WiFiCredentials Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_id(uint8_t id) { - fbb_.AddElement(WiFiCredentials::VT_ID, id, 0); - } - void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { - fbb_.AddOffset(WiFiCredentials::VT_SSID, ssid); - } - void add_password(::flatbuffers::Offset<::flatbuffers::String> password) { - fbb_.AddOffset(WiFiCredentials::VT_PASSWORD, password); - } - explicit WiFiCredentialsBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWiFiCredentials( - ::flatbuffers::FlatBufferBuilder &_fbb, - uint8_t id = 0, - ::flatbuffers::Offset<::flatbuffers::String> ssid = 0, - ::flatbuffers::Offset<::flatbuffers::String> password = 0) { - WiFiCredentialsBuilder builder_(_fbb); - builder_.add_password(password); - builder_.add_ssid(ssid); - builder_.add_id(id); - return builder_.Finish(); -} - -struct WiFiCredentials::Traits { - using type = WiFiCredentials; - static auto constexpr Create = CreateWiFiCredentials; -}; - -inline ::flatbuffers::Offset CreateWiFiCredentialsDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - uint8_t id = 0, - const char *ssid = nullptr, - const char *password = nullptr) { - auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; - auto password__ = password ? _fbb.CreateString(password) : 0; - return OpenShock::Serialization::Configuration::CreateWiFiCredentials( - _fbb, - id, - ssid__, - password__); -} - -struct WiFiConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WiFiConfigBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.WiFiConfig"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_AP_SSID = 4, - VT_HOSTNAME = 6, - VT_CREDENTIALS = 8 - }; - /// Access point SSID - const ::flatbuffers::String *ap_ssid() const { - return GetPointer(VT_AP_SSID); - } - /// Device hostname - const ::flatbuffers::String *hostname() const { - return GetPointer(VT_HOSTNAME); - } - /// WiFi network credentials - const ::flatbuffers::Vector<::flatbuffers::Offset> *credentials() const { - return GetPointer> *>(VT_CREDENTIALS); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_AP_SSID) && - verifier.VerifyString(ap_ssid()) && - VerifyOffset(verifier, VT_HOSTNAME) && - verifier.VerifyString(hostname()) && - VerifyOffset(verifier, VT_CREDENTIALS) && - verifier.VerifyVector(credentials()) && - verifier.VerifyVectorOfTables(credentials()) && - verifier.EndTable(); - } -}; - -struct WiFiConfigBuilder { - typedef WiFiConfig Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_ap_ssid(::flatbuffers::Offset<::flatbuffers::String> ap_ssid) { - fbb_.AddOffset(WiFiConfig::VT_AP_SSID, ap_ssid); - } - void add_hostname(::flatbuffers::Offset<::flatbuffers::String> hostname) { - fbb_.AddOffset(WiFiConfig::VT_HOSTNAME, hostname); - } - void add_credentials(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> credentials) { - fbb_.AddOffset(WiFiConfig::VT_CREDENTIALS, credentials); - } - explicit WiFiConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWiFiConfig( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> ap_ssid = 0, - ::flatbuffers::Offset<::flatbuffers::String> hostname = 0, - ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> credentials = 0) { - WiFiConfigBuilder builder_(_fbb); - builder_.add_credentials(credentials); - builder_.add_hostname(hostname); - builder_.add_ap_ssid(ap_ssid); - return builder_.Finish(); -} - -struct WiFiConfig::Traits { - using type = WiFiConfig; - static auto constexpr Create = CreateWiFiConfig; -}; - -inline ::flatbuffers::Offset CreateWiFiConfigDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *ap_ssid = nullptr, - const char *hostname = nullptr, - const std::vector<::flatbuffers::Offset> *credentials = nullptr) { - auto ap_ssid__ = ap_ssid ? _fbb.CreateString(ap_ssid) : 0; - auto hostname__ = hostname ? _fbb.CreateString(hostname) : 0; - auto credentials__ = credentials ? _fbb.CreateVector<::flatbuffers::Offset>(*credentials) : 0; - return OpenShock::Serialization::Configuration::CreateWiFiConfig( - _fbb, - ap_ssid__, - hostname__, - credentials__); -} - -struct CaptivePortalConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef CaptivePortalConfigBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.CaptivePortalConfig"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ALWAYS_ENABLED = 4 - }; - /// Whether the captive portal is forced to be enabled - /// The captive portal will otherwise shut down when a gateway connection is established - bool always_enabled() const { - return GetField(VT_ALWAYS_ENABLED, 0) != 0; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ALWAYS_ENABLED, 1) && - verifier.EndTable(); - } -}; - -struct CaptivePortalConfigBuilder { - typedef CaptivePortalConfig Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_always_enabled(bool always_enabled) { - fbb_.AddElement(CaptivePortalConfig::VT_ALWAYS_ENABLED, static_cast(always_enabled), 0); - } - explicit CaptivePortalConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateCaptivePortalConfig( - ::flatbuffers::FlatBufferBuilder &_fbb, - bool always_enabled = false) { - CaptivePortalConfigBuilder builder_(_fbb); - builder_.add_always_enabled(always_enabled); - return builder_.Finish(); -} - -struct CaptivePortalConfig::Traits { - using type = CaptivePortalConfig; - static auto constexpr Create = CreateCaptivePortalConfig; -}; - -struct BackendConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef BackendConfigBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.BackendConfig"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_DOMAIN = 4, - VT_AUTH_TOKEN = 6, - VT_LCG_OVERRIDE = 8 - }; - /// Domain name of the backend server, e.g. "api.shocklink.net" - const ::flatbuffers::String *domain() const { - return GetPointer(VT_DOMAIN); - } - /// Authentication token for the backend server - const ::flatbuffers::String *auth_token() const { - return GetPointer(VT_AUTH_TOKEN); - } - /// Override the Live-Control-Gateway (LCG) URL - const ::flatbuffers::String *lcg_override() const { - return GetPointer(VT_LCG_OVERRIDE); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_DOMAIN) && - verifier.VerifyString(domain()) && - VerifyOffset(verifier, VT_AUTH_TOKEN) && - verifier.VerifyString(auth_token()) && - VerifyOffset(verifier, VT_LCG_OVERRIDE) && - verifier.VerifyString(lcg_override()) && - verifier.EndTable(); - } -}; - -struct BackendConfigBuilder { - typedef BackendConfig Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_domain(::flatbuffers::Offset<::flatbuffers::String> domain) { - fbb_.AddOffset(BackendConfig::VT_DOMAIN, domain); - } - void add_auth_token(::flatbuffers::Offset<::flatbuffers::String> auth_token) { - fbb_.AddOffset(BackendConfig::VT_AUTH_TOKEN, auth_token); - } - void add_lcg_override(::flatbuffers::Offset<::flatbuffers::String> lcg_override) { - fbb_.AddOffset(BackendConfig::VT_LCG_OVERRIDE, lcg_override); - } - explicit BackendConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateBackendConfig( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> domain = 0, - ::flatbuffers::Offset<::flatbuffers::String> auth_token = 0, - ::flatbuffers::Offset<::flatbuffers::String> lcg_override = 0) { - BackendConfigBuilder builder_(_fbb); - builder_.add_lcg_override(lcg_override); - builder_.add_auth_token(auth_token); - builder_.add_domain(domain); - return builder_.Finish(); -} - -struct BackendConfig::Traits { - using type = BackendConfig; - static auto constexpr Create = CreateBackendConfig; -}; - -inline ::flatbuffers::Offset CreateBackendConfigDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *domain = nullptr, - const char *auth_token = nullptr, - const char *lcg_override = nullptr) { - auto domain__ = domain ? _fbb.CreateString(domain) : 0; - auto auth_token__ = auth_token ? _fbb.CreateString(auth_token) : 0; - auto lcg_override__ = lcg_override ? _fbb.CreateString(lcg_override) : 0; - return OpenShock::Serialization::Configuration::CreateBackendConfig( - _fbb, - domain__, - auth_token__, - lcg_override__); -} - -struct SerialInputConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef SerialInputConfigBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.SerialInputConfig"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ECHO_ENABLED = 4 - }; - /// Whether to echo typed characters back to the serial console - bool echo_enabled() const { - return GetField(VT_ECHO_ENABLED, 1) != 0; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ECHO_ENABLED, 1) && - verifier.EndTable(); - } -}; - -struct SerialInputConfigBuilder { - typedef SerialInputConfig Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_echo_enabled(bool echo_enabled) { - fbb_.AddElement(SerialInputConfig::VT_ECHO_ENABLED, static_cast(echo_enabled), 1); - } - explicit SerialInputConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateSerialInputConfig( - ::flatbuffers::FlatBufferBuilder &_fbb, - bool echo_enabled = true) { - SerialInputConfigBuilder builder_(_fbb); - builder_.add_echo_enabled(echo_enabled); - return builder_.Finish(); -} - -struct SerialInputConfig::Traits { - using type = SerialInputConfig; - static auto constexpr Create = CreateSerialInputConfig; -}; - -struct OtaUpdateConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaUpdateConfigBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.OtaUpdateConfig"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IS_ENABLED = 4, - VT_CDN_DOMAIN = 6, - VT_UPDATE_CHANNEL = 8, - VT_CHECK_ON_STARTUP = 10, - VT_CHECK_PERIODICALLY = 12, - VT_CHECK_INTERVAL = 14, - VT_ALLOW_BACKEND_MANAGEMENT = 16, - VT_REQUIRE_MANUAL_APPROVAL = 18, - VT_UPDATE_ID = 20, - VT_UPDATE_STEP = 22 - }; - /// Indicates whether OTA updates are enabled. - bool is_enabled() const { - return GetField(VT_IS_ENABLED, 0) != 0; - } - /// The domain name of the OTA Content Delivery Network (CDN). - const ::flatbuffers::String *cdn_domain() const { - return GetPointer(VT_CDN_DOMAIN); - } - /// The update channel to use. - OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel() const { - return static_cast(GetField(VT_UPDATE_CHANNEL, 0)); - } - /// Indicates whether to check for updates on startup. - bool check_on_startup() const { - return GetField(VT_CHECK_ON_STARTUP, 0) != 0; - } - /// Indicates whether to check for updates periodically. - bool check_periodically() const { - return GetField(VT_CHECK_PERIODICALLY, 0) != 0; - } - /// The interval in minutes between periodic update checks. - uint16_t check_interval() const { - return GetField(VT_CHECK_INTERVAL, 0); - } - /// Indicates if the backend is authorized to manage the device's update version on behalf of the user. - bool allow_backend_management() const { - return GetField(VT_ALLOW_BACKEND_MANAGEMENT, 0) != 0; - } - /// Indicates if manual approval via serial input or captive portal is required before installing updates. - bool require_manual_approval() const { - return GetField(VT_REQUIRE_MANUAL_APPROVAL, 0) != 0; - } - /// Update process ID, used to track the update process server-side across reboots. - int32_t update_id() const { - return GetField(VT_UPDATE_ID, 0); - } - /// Indicates what step of the update process the device is currently in, used to detect failed updates for status reporting. - OpenShock::Serialization::Configuration::OtaUpdateStep update_step() const { - return static_cast(GetField(VT_UPDATE_STEP, 0)); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IS_ENABLED, 1) && - VerifyOffset(verifier, VT_CDN_DOMAIN) && - verifier.VerifyString(cdn_domain()) && - VerifyField(verifier, VT_UPDATE_CHANNEL, 1) && - VerifyField(verifier, VT_CHECK_ON_STARTUP, 1) && - VerifyField(verifier, VT_CHECK_PERIODICALLY, 1) && - VerifyField(verifier, VT_CHECK_INTERVAL, 2) && - VerifyField(verifier, VT_ALLOW_BACKEND_MANAGEMENT, 1) && - VerifyField(verifier, VT_REQUIRE_MANUAL_APPROVAL, 1) && - VerifyField(verifier, VT_UPDATE_ID, 4) && - VerifyField(verifier, VT_UPDATE_STEP, 1) && - verifier.EndTable(); - } -}; - -struct OtaUpdateConfigBuilder { - typedef OtaUpdateConfig Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_is_enabled(bool is_enabled) { - fbb_.AddElement(OtaUpdateConfig::VT_IS_ENABLED, static_cast(is_enabled), 0); - } - void add_cdn_domain(::flatbuffers::Offset<::flatbuffers::String> cdn_domain) { - fbb_.AddOffset(OtaUpdateConfig::VT_CDN_DOMAIN, cdn_domain); - } - void add_update_channel(OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel) { - fbb_.AddElement(OtaUpdateConfig::VT_UPDATE_CHANNEL, static_cast(update_channel), 0); - } - void add_check_on_startup(bool check_on_startup) { - fbb_.AddElement(OtaUpdateConfig::VT_CHECK_ON_STARTUP, static_cast(check_on_startup), 0); - } - void add_check_periodically(bool check_periodically) { - fbb_.AddElement(OtaUpdateConfig::VT_CHECK_PERIODICALLY, static_cast(check_periodically), 0); - } - void add_check_interval(uint16_t check_interval) { - fbb_.AddElement(OtaUpdateConfig::VT_CHECK_INTERVAL, check_interval, 0); - } - void add_allow_backend_management(bool allow_backend_management) { - fbb_.AddElement(OtaUpdateConfig::VT_ALLOW_BACKEND_MANAGEMENT, static_cast(allow_backend_management), 0); - } - void add_require_manual_approval(bool require_manual_approval) { - fbb_.AddElement(OtaUpdateConfig::VT_REQUIRE_MANUAL_APPROVAL, static_cast(require_manual_approval), 0); - } - void add_update_id(int32_t update_id) { - fbb_.AddElement(OtaUpdateConfig::VT_UPDATE_ID, update_id, 0); - } - void add_update_step(OpenShock::Serialization::Configuration::OtaUpdateStep update_step) { - fbb_.AddElement(OtaUpdateConfig::VT_UPDATE_STEP, static_cast(update_step), 0); - } - explicit OtaUpdateConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaUpdateConfig( - ::flatbuffers::FlatBufferBuilder &_fbb, - bool is_enabled = false, - ::flatbuffers::Offset<::flatbuffers::String> cdn_domain = 0, - OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel = OpenShock::Serialization::Configuration::OtaUpdateChannel::Stable, - bool check_on_startup = false, - bool check_periodically = false, - uint16_t check_interval = 0, - bool allow_backend_management = false, - bool require_manual_approval = false, - int32_t update_id = 0, - OpenShock::Serialization::Configuration::OtaUpdateStep update_step = OpenShock::Serialization::Configuration::OtaUpdateStep::None) { - OtaUpdateConfigBuilder builder_(_fbb); - builder_.add_update_id(update_id); - builder_.add_cdn_domain(cdn_domain); - builder_.add_check_interval(check_interval); - builder_.add_update_step(update_step); - builder_.add_require_manual_approval(require_manual_approval); - builder_.add_allow_backend_management(allow_backend_management); - builder_.add_check_periodically(check_periodically); - builder_.add_check_on_startup(check_on_startup); - builder_.add_update_channel(update_channel); - builder_.add_is_enabled(is_enabled); - return builder_.Finish(); -} - -struct OtaUpdateConfig::Traits { - using type = OtaUpdateConfig; - static auto constexpr Create = CreateOtaUpdateConfig; -}; - -inline ::flatbuffers::Offset CreateOtaUpdateConfigDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - bool is_enabled = false, - const char *cdn_domain = nullptr, - OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel = OpenShock::Serialization::Configuration::OtaUpdateChannel::Stable, - bool check_on_startup = false, - bool check_periodically = false, - uint16_t check_interval = 0, - bool allow_backend_management = false, - bool require_manual_approval = false, - int32_t update_id = 0, - OpenShock::Serialization::Configuration::OtaUpdateStep update_step = OpenShock::Serialization::Configuration::OtaUpdateStep::None) { - auto cdn_domain__ = cdn_domain ? _fbb.CreateString(cdn_domain) : 0; - return OpenShock::Serialization::Configuration::CreateOtaUpdateConfig( - _fbb, - is_enabled, - cdn_domain__, - update_channel, - check_on_startup, - check_periodically, - check_interval, - allow_backend_management, - require_manual_approval, - update_id, - update_step); -} - -struct Config FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef ConfigBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Configuration.Config"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_RF = 4, - VT_WIFI = 6, - VT_CAPTIVE_PORTAL = 8, - VT_BACKEND = 10, - VT_SERIAL_INPUT = 12, - VT_OTA_UPDATE = 14 - }; - /// RF Transmitter configuration - const OpenShock::Serialization::Configuration::RFConfig *rf() const { - return GetPointer(VT_RF); - } - /// WiFi configuration - const OpenShock::Serialization::Configuration::WiFiConfig *wifi() const { - return GetPointer(VT_WIFI); - } - /// Captive portal configuration - const OpenShock::Serialization::Configuration::CaptivePortalConfig *captive_portal() const { - return GetPointer(VT_CAPTIVE_PORTAL); - } - /// Backend configuration - const OpenShock::Serialization::Configuration::BackendConfig *backend() const { - return GetPointer(VT_BACKEND); - } - /// Serial input configuration - const OpenShock::Serialization::Configuration::SerialInputConfig *serial_input() const { - return GetPointer(VT_SERIAL_INPUT); - } - /// OTA update configuration - const OpenShock::Serialization::Configuration::OtaUpdateConfig *ota_update() const { - return GetPointer(VT_OTA_UPDATE); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_RF) && - verifier.VerifyTable(rf()) && - VerifyOffset(verifier, VT_WIFI) && - verifier.VerifyTable(wifi()) && - VerifyOffset(verifier, VT_CAPTIVE_PORTAL) && - verifier.VerifyTable(captive_portal()) && - VerifyOffset(verifier, VT_BACKEND) && - verifier.VerifyTable(backend()) && - VerifyOffset(verifier, VT_SERIAL_INPUT) && - verifier.VerifyTable(serial_input()) && - VerifyOffset(verifier, VT_OTA_UPDATE) && - verifier.VerifyTable(ota_update()) && - verifier.EndTable(); - } -}; - -struct ConfigBuilder { - typedef Config Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_rf(::flatbuffers::Offset rf) { - fbb_.AddOffset(Config::VT_RF, rf); - } - void add_wifi(::flatbuffers::Offset wifi) { - fbb_.AddOffset(Config::VT_WIFI, wifi); - } - void add_captive_portal(::flatbuffers::Offset captive_portal) { - fbb_.AddOffset(Config::VT_CAPTIVE_PORTAL, captive_portal); - } - void add_backend(::flatbuffers::Offset backend) { - fbb_.AddOffset(Config::VT_BACKEND, backend); - } - void add_serial_input(::flatbuffers::Offset serial_input) { - fbb_.AddOffset(Config::VT_SERIAL_INPUT, serial_input); - } - void add_ota_update(::flatbuffers::Offset ota_update) { - fbb_.AddOffset(Config::VT_OTA_UPDATE, ota_update); - } - explicit ConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateConfig( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset rf = 0, - ::flatbuffers::Offset wifi = 0, - ::flatbuffers::Offset captive_portal = 0, - ::flatbuffers::Offset backend = 0, - ::flatbuffers::Offset serial_input = 0, - ::flatbuffers::Offset ota_update = 0) { - ConfigBuilder builder_(_fbb); - builder_.add_ota_update(ota_update); - builder_.add_serial_input(serial_input); - builder_.add_backend(backend); - builder_.add_captive_portal(captive_portal); - builder_.add_wifi(wifi); - builder_.add_rf(rf); - return builder_.Finish(); -} - -struct Config::Traits { - using type = Config; - static auto constexpr Create = CreateConfig; -}; - -} // namespace Configuration -} // namespace Serialization -} // namespace OpenShock - -#endif // FLATBUFFERS_GENERATED_CONFIGFILE_OPENSHOCK_SERIALIZATION_CONFIGURATION_H_ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_HUBCONFIG_OPENSHOCK_SERIALIZATION_CONFIGURATION_H_ +#define FLATBUFFERS_GENERATED_HUBCONFIG_OPENSHOCK_SERIALIZATION_CONFIGURATION_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, + "Non-compatible flatbuffers version included"); + +namespace OpenShock { +namespace Serialization { +namespace Configuration { + +struct RFConfig; +struct RFConfigBuilder; + +struct WiFiCredentials; +struct WiFiCredentialsBuilder; + +struct WiFiConfig; +struct WiFiConfigBuilder; + +struct CaptivePortalConfig; +struct CaptivePortalConfigBuilder; + +struct BackendConfig; +struct BackendConfigBuilder; + +struct SerialInputConfig; +struct SerialInputConfigBuilder; + +struct OtaUpdateConfig; +struct OtaUpdateConfigBuilder; + +struct HubConfig; +struct HubConfigBuilder; + +enum class OtaUpdateChannel : uint8_t { + Stable = 0, + Beta = 1, + Develop = 2, + MIN = Stable, + MAX = Develop +}; + +inline const OtaUpdateChannel (&EnumValuesOtaUpdateChannel())[3] { + static const OtaUpdateChannel values[] = { + OtaUpdateChannel::Stable, + OtaUpdateChannel::Beta, + OtaUpdateChannel::Develop + }; + return values; +} + +inline const char * const *EnumNamesOtaUpdateChannel() { + static const char * const names[4] = { + "Stable", + "Beta", + "Develop", + nullptr + }; + return names; +} + +inline const char *EnumNameOtaUpdateChannel(OtaUpdateChannel e) { + if (::flatbuffers::IsOutRange(e, OtaUpdateChannel::Stable, OtaUpdateChannel::Develop)) return ""; + const size_t index = static_cast(e); + return EnumNamesOtaUpdateChannel()[index]; +} + +enum class OtaUpdateStep : uint8_t { + None = 0, + Updating = 1, + Updated = 2, + Validating = 3, + Validated = 4, + RollingBack = 5, + MIN = None, + MAX = RollingBack +}; + +inline const OtaUpdateStep (&EnumValuesOtaUpdateStep())[6] { + static const OtaUpdateStep values[] = { + OtaUpdateStep::None, + OtaUpdateStep::Updating, + OtaUpdateStep::Updated, + OtaUpdateStep::Validating, + OtaUpdateStep::Validated, + OtaUpdateStep::RollingBack + }; + return values; +} + +inline const char * const *EnumNamesOtaUpdateStep() { + static const char * const names[7] = { + "None", + "Updating", + "Updated", + "Validating", + "Validated", + "RollingBack", + nullptr + }; + return names; +} + +inline const char *EnumNameOtaUpdateStep(OtaUpdateStep e) { + if (::flatbuffers::IsOutRange(e, OtaUpdateStep::None, OtaUpdateStep::RollingBack)) return ""; + const size_t index = static_cast(e); + return EnumNamesOtaUpdateStep()[index]; +} + +struct RFConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef RFConfigBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.RFConfig"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_TX_PIN = 4, + VT_KEEPALIVE_ENABLED = 6 + }; + /// The GPIO pin connected to the RF modulator's data pin for transmitting (TX) + uint8_t tx_pin() const { + return GetField(VT_TX_PIN, 0); + } + /// Whether to transmit keepalive messages to keep the shockers from entering sleep mode + bool keepalive_enabled() const { + return GetField(VT_KEEPALIVE_ENABLED, 0) != 0; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_TX_PIN, 1) && + VerifyField(verifier, VT_KEEPALIVE_ENABLED, 1) && + verifier.EndTable(); + } +}; + +struct RFConfigBuilder { + typedef RFConfig Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_tx_pin(uint8_t tx_pin) { + fbb_.AddElement(RFConfig::VT_TX_PIN, tx_pin, 0); + } + void add_keepalive_enabled(bool keepalive_enabled) { + fbb_.AddElement(RFConfig::VT_KEEPALIVE_ENABLED, static_cast(keepalive_enabled), 0); + } + explicit RFConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateRFConfig( + ::flatbuffers::FlatBufferBuilder &_fbb, + uint8_t tx_pin = 0, + bool keepalive_enabled = false) { + RFConfigBuilder builder_(_fbb); + builder_.add_keepalive_enabled(keepalive_enabled); + builder_.add_tx_pin(tx_pin); + return builder_.Finish(); +} + +struct RFConfig::Traits { + using type = RFConfig; + static auto constexpr Create = CreateRFConfig; +}; + +struct WiFiCredentials FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WiFiCredentialsBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.WiFiCredentials"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4, + VT_SSID = 6, + VT_PASSWORD = 8 + }; + /// ID of the WiFi network credentials, used for referencing the credentials with a low memory footprint + uint8_t id() const { + return GetField(VT_ID, 0); + } + /// SSID of the WiFi network + const ::flatbuffers::String *ssid() const { + return GetPointer(VT_SSID); + } + /// Password of the WiFi network + const ::flatbuffers::String *password() const { + return GetPointer(VT_PASSWORD); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID, 1) && + VerifyOffset(verifier, VT_SSID) && + verifier.VerifyString(ssid()) && + VerifyOffset(verifier, VT_PASSWORD) && + verifier.VerifyString(password()) && + verifier.EndTable(); + } +}; + +struct WiFiCredentialsBuilder { + typedef WiFiCredentials Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_id(uint8_t id) { + fbb_.AddElement(WiFiCredentials::VT_ID, id, 0); + } + void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { + fbb_.AddOffset(WiFiCredentials::VT_SSID, ssid); + } + void add_password(::flatbuffers::Offset<::flatbuffers::String> password) { + fbb_.AddOffset(WiFiCredentials::VT_PASSWORD, password); + } + explicit WiFiCredentialsBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWiFiCredentials( + ::flatbuffers::FlatBufferBuilder &_fbb, + uint8_t id = 0, + ::flatbuffers::Offset<::flatbuffers::String> ssid = 0, + ::flatbuffers::Offset<::flatbuffers::String> password = 0) { + WiFiCredentialsBuilder builder_(_fbb); + builder_.add_password(password); + builder_.add_ssid(ssid); + builder_.add_id(id); + return builder_.Finish(); +} + +struct WiFiCredentials::Traits { + using type = WiFiCredentials; + static auto constexpr Create = CreateWiFiCredentials; +}; + +inline ::flatbuffers::Offset CreateWiFiCredentialsDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + uint8_t id = 0, + const char *ssid = nullptr, + const char *password = nullptr) { + auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; + auto password__ = password ? _fbb.CreateString(password) : 0; + return OpenShock::Serialization::Configuration::CreateWiFiCredentials( + _fbb, + id, + ssid__, + password__); +} + +struct WiFiConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WiFiConfigBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.WiFiConfig"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_AP_SSID = 4, + VT_HOSTNAME = 6, + VT_CREDENTIALS = 8 + }; + /// Access point SSID + const ::flatbuffers::String *ap_ssid() const { + return GetPointer(VT_AP_SSID); + } + /// Hub hostname + const ::flatbuffers::String *hostname() const { + return GetPointer(VT_HOSTNAME); + } + /// WiFi network credentials + const ::flatbuffers::Vector<::flatbuffers::Offset> *credentials() const { + return GetPointer> *>(VT_CREDENTIALS); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_AP_SSID) && + verifier.VerifyString(ap_ssid()) && + VerifyOffset(verifier, VT_HOSTNAME) && + verifier.VerifyString(hostname()) && + VerifyOffset(verifier, VT_CREDENTIALS) && + verifier.VerifyVector(credentials()) && + verifier.VerifyVectorOfTables(credentials()) && + verifier.EndTable(); + } +}; + +struct WiFiConfigBuilder { + typedef WiFiConfig Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_ap_ssid(::flatbuffers::Offset<::flatbuffers::String> ap_ssid) { + fbb_.AddOffset(WiFiConfig::VT_AP_SSID, ap_ssid); + } + void add_hostname(::flatbuffers::Offset<::flatbuffers::String> hostname) { + fbb_.AddOffset(WiFiConfig::VT_HOSTNAME, hostname); + } + void add_credentials(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> credentials) { + fbb_.AddOffset(WiFiConfig::VT_CREDENTIALS, credentials); + } + explicit WiFiConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWiFiConfig( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> ap_ssid = 0, + ::flatbuffers::Offset<::flatbuffers::String> hostname = 0, + ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> credentials = 0) { + WiFiConfigBuilder builder_(_fbb); + builder_.add_credentials(credentials); + builder_.add_hostname(hostname); + builder_.add_ap_ssid(ap_ssid); + return builder_.Finish(); +} + +struct WiFiConfig::Traits { + using type = WiFiConfig; + static auto constexpr Create = CreateWiFiConfig; +}; + +inline ::flatbuffers::Offset CreateWiFiConfigDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *ap_ssid = nullptr, + const char *hostname = nullptr, + const std::vector<::flatbuffers::Offset> *credentials = nullptr) { + auto ap_ssid__ = ap_ssid ? _fbb.CreateString(ap_ssid) : 0; + auto hostname__ = hostname ? _fbb.CreateString(hostname) : 0; + auto credentials__ = credentials ? _fbb.CreateVector<::flatbuffers::Offset>(*credentials) : 0; + return OpenShock::Serialization::Configuration::CreateWiFiConfig( + _fbb, + ap_ssid__, + hostname__, + credentials__); +} + +struct CaptivePortalConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef CaptivePortalConfigBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.CaptivePortalConfig"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ALWAYS_ENABLED = 4 + }; + /// Whether the captive portal is forced to be enabled + /// The captive portal will otherwise shut down when a gateway connection is established + bool always_enabled() const { + return GetField(VT_ALWAYS_ENABLED, 0) != 0; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ALWAYS_ENABLED, 1) && + verifier.EndTable(); + } +}; + +struct CaptivePortalConfigBuilder { + typedef CaptivePortalConfig Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_always_enabled(bool always_enabled) { + fbb_.AddElement(CaptivePortalConfig::VT_ALWAYS_ENABLED, static_cast(always_enabled), 0); + } + explicit CaptivePortalConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateCaptivePortalConfig( + ::flatbuffers::FlatBufferBuilder &_fbb, + bool always_enabled = false) { + CaptivePortalConfigBuilder builder_(_fbb); + builder_.add_always_enabled(always_enabled); + return builder_.Finish(); +} + +struct CaptivePortalConfig::Traits { + using type = CaptivePortalConfig; + static auto constexpr Create = CreateCaptivePortalConfig; +}; + +struct BackendConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef BackendConfigBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.BackendConfig"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_DOMAIN = 4, + VT_AUTH_TOKEN = 6, + VT_LCG_OVERRIDE = 8 + }; + /// Domain name of the backend server, e.g. "api.shocklink.net" + const ::flatbuffers::String *domain() const { + return GetPointer(VT_DOMAIN); + } + /// Authentication token for the backend server + const ::flatbuffers::String *auth_token() const { + return GetPointer(VT_AUTH_TOKEN); + } + /// Override the Live-Control-Gateway (LCG) URL + const ::flatbuffers::String *lcg_override() const { + return GetPointer(VT_LCG_OVERRIDE); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_DOMAIN) && + verifier.VerifyString(domain()) && + VerifyOffset(verifier, VT_AUTH_TOKEN) && + verifier.VerifyString(auth_token()) && + VerifyOffset(verifier, VT_LCG_OVERRIDE) && + verifier.VerifyString(lcg_override()) && + verifier.EndTable(); + } +}; + +struct BackendConfigBuilder { + typedef BackendConfig Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_domain(::flatbuffers::Offset<::flatbuffers::String> domain) { + fbb_.AddOffset(BackendConfig::VT_DOMAIN, domain); + } + void add_auth_token(::flatbuffers::Offset<::flatbuffers::String> auth_token) { + fbb_.AddOffset(BackendConfig::VT_AUTH_TOKEN, auth_token); + } + void add_lcg_override(::flatbuffers::Offset<::flatbuffers::String> lcg_override) { + fbb_.AddOffset(BackendConfig::VT_LCG_OVERRIDE, lcg_override); + } + explicit BackendConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateBackendConfig( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> domain = 0, + ::flatbuffers::Offset<::flatbuffers::String> auth_token = 0, + ::flatbuffers::Offset<::flatbuffers::String> lcg_override = 0) { + BackendConfigBuilder builder_(_fbb); + builder_.add_lcg_override(lcg_override); + builder_.add_auth_token(auth_token); + builder_.add_domain(domain); + return builder_.Finish(); +} + +struct BackendConfig::Traits { + using type = BackendConfig; + static auto constexpr Create = CreateBackendConfig; +}; + +inline ::flatbuffers::Offset CreateBackendConfigDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *domain = nullptr, + const char *auth_token = nullptr, + const char *lcg_override = nullptr) { + auto domain__ = domain ? _fbb.CreateString(domain) : 0; + auto auth_token__ = auth_token ? _fbb.CreateString(auth_token) : 0; + auto lcg_override__ = lcg_override ? _fbb.CreateString(lcg_override) : 0; + return OpenShock::Serialization::Configuration::CreateBackendConfig( + _fbb, + domain__, + auth_token__, + lcg_override__); +} + +struct SerialInputConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef SerialInputConfigBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.SerialInputConfig"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ECHO_ENABLED = 4 + }; + /// Whether to echo typed characters back to the serial console + bool echo_enabled() const { + return GetField(VT_ECHO_ENABLED, 1) != 0; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ECHO_ENABLED, 1) && + verifier.EndTable(); + } +}; + +struct SerialInputConfigBuilder { + typedef SerialInputConfig Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_echo_enabled(bool echo_enabled) { + fbb_.AddElement(SerialInputConfig::VT_ECHO_ENABLED, static_cast(echo_enabled), 1); + } + explicit SerialInputConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateSerialInputConfig( + ::flatbuffers::FlatBufferBuilder &_fbb, + bool echo_enabled = true) { + SerialInputConfigBuilder builder_(_fbb); + builder_.add_echo_enabled(echo_enabled); + return builder_.Finish(); +} + +struct SerialInputConfig::Traits { + using type = SerialInputConfig; + static auto constexpr Create = CreateSerialInputConfig; +}; + +struct OtaUpdateConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaUpdateConfigBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.OtaUpdateConfig"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IS_ENABLED = 4, + VT_CDN_DOMAIN = 6, + VT_UPDATE_CHANNEL = 8, + VT_CHECK_ON_STARTUP = 10, + VT_CHECK_PERIODICALLY = 12, + VT_CHECK_INTERVAL = 14, + VT_ALLOW_BACKEND_MANAGEMENT = 16, + VT_REQUIRE_MANUAL_APPROVAL = 18, + VT_UPDATE_ID = 20, + VT_UPDATE_STEP = 22 + }; + /// Indicates whether OTA updates are enabled. + bool is_enabled() const { + return GetField(VT_IS_ENABLED, 0) != 0; + } + /// The domain name of the OTA Content Delivery Network (CDN). + const ::flatbuffers::String *cdn_domain() const { + return GetPointer(VT_CDN_DOMAIN); + } + /// The update channel to use. + OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel() const { + return static_cast(GetField(VT_UPDATE_CHANNEL, 0)); + } + /// Indicates whether to check for updates on startup. + bool check_on_startup() const { + return GetField(VT_CHECK_ON_STARTUP, 0) != 0; + } + /// Indicates whether to check for updates periodically. + bool check_periodically() const { + return GetField(VT_CHECK_PERIODICALLY, 0) != 0; + } + /// The interval in minutes between periodic update checks. + uint16_t check_interval() const { + return GetField(VT_CHECK_INTERVAL, 0); + } + /// Indicates if the backend is authorized to manage the hub's update version on behalf of the user. + bool allow_backend_management() const { + return GetField(VT_ALLOW_BACKEND_MANAGEMENT, 0) != 0; + } + /// Indicates if manual approval via serial input or captive portal is required before installing updates. + bool require_manual_approval() const { + return GetField(VT_REQUIRE_MANUAL_APPROVAL, 0) != 0; + } + /// Update process ID, used to track the update process server-side across reboots. + int32_t update_id() const { + return GetField(VT_UPDATE_ID, 0); + } + /// Indicates what step of the update process the hub is currently in, used to detect failed updates for status reporting. + OpenShock::Serialization::Configuration::OtaUpdateStep update_step() const { + return static_cast(GetField(VT_UPDATE_STEP, 0)); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IS_ENABLED, 1) && + VerifyOffset(verifier, VT_CDN_DOMAIN) && + verifier.VerifyString(cdn_domain()) && + VerifyField(verifier, VT_UPDATE_CHANNEL, 1) && + VerifyField(verifier, VT_CHECK_ON_STARTUP, 1) && + VerifyField(verifier, VT_CHECK_PERIODICALLY, 1) && + VerifyField(verifier, VT_CHECK_INTERVAL, 2) && + VerifyField(verifier, VT_ALLOW_BACKEND_MANAGEMENT, 1) && + VerifyField(verifier, VT_REQUIRE_MANUAL_APPROVAL, 1) && + VerifyField(verifier, VT_UPDATE_ID, 4) && + VerifyField(verifier, VT_UPDATE_STEP, 1) && + verifier.EndTable(); + } +}; + +struct OtaUpdateConfigBuilder { + typedef OtaUpdateConfig Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_is_enabled(bool is_enabled) { + fbb_.AddElement(OtaUpdateConfig::VT_IS_ENABLED, static_cast(is_enabled), 0); + } + void add_cdn_domain(::flatbuffers::Offset<::flatbuffers::String> cdn_domain) { + fbb_.AddOffset(OtaUpdateConfig::VT_CDN_DOMAIN, cdn_domain); + } + void add_update_channel(OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel) { + fbb_.AddElement(OtaUpdateConfig::VT_UPDATE_CHANNEL, static_cast(update_channel), 0); + } + void add_check_on_startup(bool check_on_startup) { + fbb_.AddElement(OtaUpdateConfig::VT_CHECK_ON_STARTUP, static_cast(check_on_startup), 0); + } + void add_check_periodically(bool check_periodically) { + fbb_.AddElement(OtaUpdateConfig::VT_CHECK_PERIODICALLY, static_cast(check_periodically), 0); + } + void add_check_interval(uint16_t check_interval) { + fbb_.AddElement(OtaUpdateConfig::VT_CHECK_INTERVAL, check_interval, 0); + } + void add_allow_backend_management(bool allow_backend_management) { + fbb_.AddElement(OtaUpdateConfig::VT_ALLOW_BACKEND_MANAGEMENT, static_cast(allow_backend_management), 0); + } + void add_require_manual_approval(bool require_manual_approval) { + fbb_.AddElement(OtaUpdateConfig::VT_REQUIRE_MANUAL_APPROVAL, static_cast(require_manual_approval), 0); + } + void add_update_id(int32_t update_id) { + fbb_.AddElement(OtaUpdateConfig::VT_UPDATE_ID, update_id, 0); + } + void add_update_step(OpenShock::Serialization::Configuration::OtaUpdateStep update_step) { + fbb_.AddElement(OtaUpdateConfig::VT_UPDATE_STEP, static_cast(update_step), 0); + } + explicit OtaUpdateConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaUpdateConfig( + ::flatbuffers::FlatBufferBuilder &_fbb, + bool is_enabled = false, + ::flatbuffers::Offset<::flatbuffers::String> cdn_domain = 0, + OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel = OpenShock::Serialization::Configuration::OtaUpdateChannel::Stable, + bool check_on_startup = false, + bool check_periodically = false, + uint16_t check_interval = 0, + bool allow_backend_management = false, + bool require_manual_approval = false, + int32_t update_id = 0, + OpenShock::Serialization::Configuration::OtaUpdateStep update_step = OpenShock::Serialization::Configuration::OtaUpdateStep::None) { + OtaUpdateConfigBuilder builder_(_fbb); + builder_.add_update_id(update_id); + builder_.add_cdn_domain(cdn_domain); + builder_.add_check_interval(check_interval); + builder_.add_update_step(update_step); + builder_.add_require_manual_approval(require_manual_approval); + builder_.add_allow_backend_management(allow_backend_management); + builder_.add_check_periodically(check_periodically); + builder_.add_check_on_startup(check_on_startup); + builder_.add_update_channel(update_channel); + builder_.add_is_enabled(is_enabled); + return builder_.Finish(); +} + +struct OtaUpdateConfig::Traits { + using type = OtaUpdateConfig; + static auto constexpr Create = CreateOtaUpdateConfig; +}; + +inline ::flatbuffers::Offset CreateOtaUpdateConfigDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + bool is_enabled = false, + const char *cdn_domain = nullptr, + OpenShock::Serialization::Configuration::OtaUpdateChannel update_channel = OpenShock::Serialization::Configuration::OtaUpdateChannel::Stable, + bool check_on_startup = false, + bool check_periodically = false, + uint16_t check_interval = 0, + bool allow_backend_management = false, + bool require_manual_approval = false, + int32_t update_id = 0, + OpenShock::Serialization::Configuration::OtaUpdateStep update_step = OpenShock::Serialization::Configuration::OtaUpdateStep::None) { + auto cdn_domain__ = cdn_domain ? _fbb.CreateString(cdn_domain) : 0; + return OpenShock::Serialization::Configuration::CreateOtaUpdateConfig( + _fbb, + is_enabled, + cdn_domain__, + update_channel, + check_on_startup, + check_periodically, + check_interval, + allow_backend_management, + require_manual_approval, + update_id, + update_step); +} + +struct HubConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef HubConfigBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Configuration.HubConfig"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_RF = 4, + VT_WIFI = 6, + VT_CAPTIVE_PORTAL = 8, + VT_BACKEND = 10, + VT_SERIAL_INPUT = 12, + VT_OTA_UPDATE = 14 + }; + /// RF Transmitter configuration + const OpenShock::Serialization::Configuration::RFConfig *rf() const { + return GetPointer(VT_RF); + } + /// WiFi configuration + const OpenShock::Serialization::Configuration::WiFiConfig *wifi() const { + return GetPointer(VT_WIFI); + } + /// Captive portal configuration + const OpenShock::Serialization::Configuration::CaptivePortalConfig *captive_portal() const { + return GetPointer(VT_CAPTIVE_PORTAL); + } + /// Backend configuration + const OpenShock::Serialization::Configuration::BackendConfig *backend() const { + return GetPointer(VT_BACKEND); + } + /// Serial input configuration + const OpenShock::Serialization::Configuration::SerialInputConfig *serial_input() const { + return GetPointer(VT_SERIAL_INPUT); + } + /// OTA update configuration + const OpenShock::Serialization::Configuration::OtaUpdateConfig *ota_update() const { + return GetPointer(VT_OTA_UPDATE); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_RF) && + verifier.VerifyTable(rf()) && + VerifyOffset(verifier, VT_WIFI) && + verifier.VerifyTable(wifi()) && + VerifyOffset(verifier, VT_CAPTIVE_PORTAL) && + verifier.VerifyTable(captive_portal()) && + VerifyOffset(verifier, VT_BACKEND) && + verifier.VerifyTable(backend()) && + VerifyOffset(verifier, VT_SERIAL_INPUT) && + verifier.VerifyTable(serial_input()) && + VerifyOffset(verifier, VT_OTA_UPDATE) && + verifier.VerifyTable(ota_update()) && + verifier.EndTable(); + } +}; + +struct HubConfigBuilder { + typedef HubConfig Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_rf(::flatbuffers::Offset rf) { + fbb_.AddOffset(HubConfig::VT_RF, rf); + } + void add_wifi(::flatbuffers::Offset wifi) { + fbb_.AddOffset(HubConfig::VT_WIFI, wifi); + } + void add_captive_portal(::flatbuffers::Offset captive_portal) { + fbb_.AddOffset(HubConfig::VT_CAPTIVE_PORTAL, captive_portal); + } + void add_backend(::flatbuffers::Offset backend) { + fbb_.AddOffset(HubConfig::VT_BACKEND, backend); + } + void add_serial_input(::flatbuffers::Offset serial_input) { + fbb_.AddOffset(HubConfig::VT_SERIAL_INPUT, serial_input); + } + void add_ota_update(::flatbuffers::Offset ota_update) { + fbb_.AddOffset(HubConfig::VT_OTA_UPDATE, ota_update); + } + explicit HubConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateHubConfig( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset rf = 0, + ::flatbuffers::Offset wifi = 0, + ::flatbuffers::Offset captive_portal = 0, + ::flatbuffers::Offset backend = 0, + ::flatbuffers::Offset serial_input = 0, + ::flatbuffers::Offset ota_update = 0) { + HubConfigBuilder builder_(_fbb); + builder_.add_ota_update(ota_update); + builder_.add_serial_input(serial_input); + builder_.add_backend(backend); + builder_.add_captive_portal(captive_portal); + builder_.add_wifi(wifi); + builder_.add_rf(rf); + return builder_.Finish(); +} + +struct HubConfig::Traits { + using type = HubConfig; + static auto constexpr Create = CreateHubConfig; +}; + +} // namespace Configuration +} // namespace Serialization +} // namespace OpenShock + +#endif // FLATBUFFERS_GENERATED_HUBCONFIG_OPENSHOCK_SERIALIZATION_CONFIGURATION_H_ diff --git a/include/serialization/_fbs/DeviceToGatewayMessage_generated.h b/include/serialization/_fbs/HubToGatewayMessage_generated.h similarity index 69% rename from include/serialization/_fbs/DeviceToGatewayMessage_generated.h rename to include/serialization/_fbs/HubToGatewayMessage_generated.h index 0dddb692..4dbe20f6 100644 --- a/include/serialization/_fbs/DeviceToGatewayMessage_generated.h +++ b/include/serialization/_fbs/HubToGatewayMessage_generated.h @@ -1,636 +1,636 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_DEVICETOGATEWAYMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ -#define FLATBUFFERS_GENERATED_DEVICETOGATEWAYMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ - -#include "flatbuffers/flatbuffers.h" - -// Ensure the included flatbuffers.h is the same version as when this file was -// generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && - FLATBUFFERS_VERSION_MINOR == 3 && - FLATBUFFERS_VERSION_REVISION == 25, - "Non-compatible flatbuffers version included"); - -#include "FirmwareBootType_generated.h" -#include "SemVer_generated.h" - -namespace OpenShock { -namespace Serialization { -namespace Gateway { - -struct KeepAlive; - -struct BootStatus; -struct BootStatusBuilder; - -struct OtaInstallStarted; -struct OtaInstallStartedBuilder; - -struct OtaInstallProgress; -struct OtaInstallProgressBuilder; - -struct OtaInstallFailed; -struct OtaInstallFailedBuilder; - -struct DeviceToGatewayMessage; -struct DeviceToGatewayMessageBuilder; - -enum class OtaInstallProgressTask : int8_t { - FetchingMetadata = 0, - PreparingForInstall = 1, - FlashingFilesystem = 2, - VerifyingFilesystem = 3, - FlashingApplication = 4, - MarkingApplicationBootable = 5, - Rebooting = 6, - MIN = FetchingMetadata, - MAX = Rebooting -}; - -inline const OtaInstallProgressTask (&EnumValuesOtaInstallProgressTask())[7] { - static const OtaInstallProgressTask values[] = { - OtaInstallProgressTask::FetchingMetadata, - OtaInstallProgressTask::PreparingForInstall, - OtaInstallProgressTask::FlashingFilesystem, - OtaInstallProgressTask::VerifyingFilesystem, - OtaInstallProgressTask::FlashingApplication, - OtaInstallProgressTask::MarkingApplicationBootable, - OtaInstallProgressTask::Rebooting - }; - return values; -} - -inline const char * const *EnumNamesOtaInstallProgressTask() { - static const char * const names[8] = { - "FetchingMetadata", - "PreparingForInstall", - "FlashingFilesystem", - "VerifyingFilesystem", - "FlashingApplication", - "MarkingApplicationBootable", - "Rebooting", - nullptr - }; - return names; -} - -inline const char *EnumNameOtaInstallProgressTask(OtaInstallProgressTask e) { - if (::flatbuffers::IsOutRange(e, OtaInstallProgressTask::FetchingMetadata, OtaInstallProgressTask::Rebooting)) return ""; - const size_t index = static_cast(e); - return EnumNamesOtaInstallProgressTask()[index]; -} - -enum class DeviceToGatewayMessagePayload : uint8_t { - NONE = 0, - KeepAlive = 1, - BootStatus = 2, - OtaInstallStarted = 3, - OtaInstallProgress = 4, - OtaInstallFailed = 5, - MIN = NONE, - MAX = OtaInstallFailed -}; - -inline const DeviceToGatewayMessagePayload (&EnumValuesDeviceToGatewayMessagePayload())[6] { - static const DeviceToGatewayMessagePayload values[] = { - DeviceToGatewayMessagePayload::NONE, - DeviceToGatewayMessagePayload::KeepAlive, - DeviceToGatewayMessagePayload::BootStatus, - DeviceToGatewayMessagePayload::OtaInstallStarted, - DeviceToGatewayMessagePayload::OtaInstallProgress, - DeviceToGatewayMessagePayload::OtaInstallFailed - }; - return values; -} - -inline const char * const *EnumNamesDeviceToGatewayMessagePayload() { - static const char * const names[7] = { - "NONE", - "KeepAlive", - "BootStatus", - "OtaInstallStarted", - "OtaInstallProgress", - "OtaInstallFailed", - nullptr - }; - return names; -} - -inline const char *EnumNameDeviceToGatewayMessagePayload(DeviceToGatewayMessagePayload e) { - if (::flatbuffers::IsOutRange(e, DeviceToGatewayMessagePayload::NONE, DeviceToGatewayMessagePayload::OtaInstallFailed)) return ""; - const size_t index = static_cast(e); - return EnumNamesDeviceToGatewayMessagePayload()[index]; -} - -template struct DeviceToGatewayMessagePayloadTraits { - static const DeviceToGatewayMessagePayload enum_value = DeviceToGatewayMessagePayload::NONE; -}; - -template<> struct DeviceToGatewayMessagePayloadTraits { - static const DeviceToGatewayMessagePayload enum_value = DeviceToGatewayMessagePayload::KeepAlive; -}; - -template<> struct DeviceToGatewayMessagePayloadTraits { - static const DeviceToGatewayMessagePayload enum_value = DeviceToGatewayMessagePayload::BootStatus; -}; - -template<> struct DeviceToGatewayMessagePayloadTraits { - static const DeviceToGatewayMessagePayload enum_value = DeviceToGatewayMessagePayload::OtaInstallStarted; -}; - -template<> struct DeviceToGatewayMessagePayloadTraits { - static const DeviceToGatewayMessagePayload enum_value = DeviceToGatewayMessagePayload::OtaInstallProgress; -}; - -template<> struct DeviceToGatewayMessagePayloadTraits { - static const DeviceToGatewayMessagePayload enum_value = DeviceToGatewayMessagePayload::OtaInstallFailed; -}; - -bool VerifyDeviceToGatewayMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, DeviceToGatewayMessagePayload type); -bool VerifyDeviceToGatewayMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) KeepAlive FLATBUFFERS_FINAL_CLASS { - private: - uint64_t uptime_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.KeepAlive"; - } - KeepAlive() - : uptime_(0) { - } - KeepAlive(uint64_t _uptime) - : uptime_(::flatbuffers::EndianScalar(_uptime)) { - } - uint64_t uptime() const { - return ::flatbuffers::EndianScalar(uptime_); - } -}; -FLATBUFFERS_STRUCT_END(KeepAlive, 8); - -struct KeepAlive::Traits { - using type = KeepAlive; -}; - -struct BootStatus FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef BootStatusBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.BootStatus"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BOOT_TYPE = 4, - VT_FIRMWARE_VERSION = 6, - VT_OTA_UPDATE_ID = 8 - }; - OpenShock::Serialization::Types::FirmwareBootType boot_type() const { - return static_cast(GetField(VT_BOOT_TYPE, 0)); - } - const OpenShock::Serialization::Types::SemVer *firmware_version() const { - return GetPointer(VT_FIRMWARE_VERSION); - } - int32_t ota_update_id() const { - return GetField(VT_OTA_UPDATE_ID, 0); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_BOOT_TYPE, 1) && - VerifyOffset(verifier, VT_FIRMWARE_VERSION) && - verifier.VerifyTable(firmware_version()) && - VerifyField(verifier, VT_OTA_UPDATE_ID, 4) && - verifier.EndTable(); - } -}; - -struct BootStatusBuilder { - typedef BootStatus Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_boot_type(OpenShock::Serialization::Types::FirmwareBootType boot_type) { - fbb_.AddElement(BootStatus::VT_BOOT_TYPE, static_cast(boot_type), 0); - } - void add_firmware_version(::flatbuffers::Offset firmware_version) { - fbb_.AddOffset(BootStatus::VT_FIRMWARE_VERSION, firmware_version); - } - void add_ota_update_id(int32_t ota_update_id) { - fbb_.AddElement(BootStatus::VT_OTA_UPDATE_ID, ota_update_id, 0); - } - explicit BootStatusBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateBootStatus( - ::flatbuffers::FlatBufferBuilder &_fbb, - OpenShock::Serialization::Types::FirmwareBootType boot_type = OpenShock::Serialization::Types::FirmwareBootType::Normal, - ::flatbuffers::Offset firmware_version = 0, - int32_t ota_update_id = 0) { - BootStatusBuilder builder_(_fbb); - builder_.add_ota_update_id(ota_update_id); - builder_.add_firmware_version(firmware_version); - builder_.add_boot_type(boot_type); - return builder_.Finish(); -} - -struct BootStatus::Traits { - using type = BootStatus; - static auto constexpr Create = CreateBootStatus; -}; - -struct OtaInstallStarted FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaInstallStartedBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.OtaInstallStarted"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_UPDATE_ID = 4, - VT_VERSION = 6 - }; - int32_t update_id() const { - return GetField(VT_UPDATE_ID, 0); - } - const OpenShock::Serialization::Types::SemVer *version() const { - return GetPointer(VT_VERSION); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_UPDATE_ID, 4) && - VerifyOffset(verifier, VT_VERSION) && - verifier.VerifyTable(version()) && - verifier.EndTable(); - } -}; - -struct OtaInstallStartedBuilder { - typedef OtaInstallStarted Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_update_id(int32_t update_id) { - fbb_.AddElement(OtaInstallStarted::VT_UPDATE_ID, update_id, 0); - } - void add_version(::flatbuffers::Offset version) { - fbb_.AddOffset(OtaInstallStarted::VT_VERSION, version); - } - explicit OtaInstallStartedBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaInstallStarted( - ::flatbuffers::FlatBufferBuilder &_fbb, - int32_t update_id = 0, - ::flatbuffers::Offset version = 0) { - OtaInstallStartedBuilder builder_(_fbb); - builder_.add_version(version); - builder_.add_update_id(update_id); - return builder_.Finish(); -} - -struct OtaInstallStarted::Traits { - using type = OtaInstallStarted; - static auto constexpr Create = CreateOtaInstallStarted; -}; - -struct OtaInstallProgress FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaInstallProgressBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.OtaInstallProgress"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_UPDATE_ID = 4, - VT_TASK = 6, - VT_PROGRESS = 8 - }; - int32_t update_id() const { - return GetField(VT_UPDATE_ID, 0); - } - OpenShock::Serialization::Gateway::OtaInstallProgressTask task() const { - return static_cast(GetField(VT_TASK, 0)); - } - float progress() const { - return GetField(VT_PROGRESS, 0.0f); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_UPDATE_ID, 4) && - VerifyField(verifier, VT_TASK, 1) && - VerifyField(verifier, VT_PROGRESS, 4) && - verifier.EndTable(); - } -}; - -struct OtaInstallProgressBuilder { - typedef OtaInstallProgress Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_update_id(int32_t update_id) { - fbb_.AddElement(OtaInstallProgress::VT_UPDATE_ID, update_id, 0); - } - void add_task(OpenShock::Serialization::Gateway::OtaInstallProgressTask task) { - fbb_.AddElement(OtaInstallProgress::VT_TASK, static_cast(task), 0); - } - void add_progress(float progress) { - fbb_.AddElement(OtaInstallProgress::VT_PROGRESS, progress, 0.0f); - } - explicit OtaInstallProgressBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaInstallProgress( - ::flatbuffers::FlatBufferBuilder &_fbb, - int32_t update_id = 0, - OpenShock::Serialization::Gateway::OtaInstallProgressTask task = OpenShock::Serialization::Gateway::OtaInstallProgressTask::FetchingMetadata, - float progress = 0.0f) { - OtaInstallProgressBuilder builder_(_fbb); - builder_.add_progress(progress); - builder_.add_update_id(update_id); - builder_.add_task(task); - return builder_.Finish(); -} - -struct OtaInstallProgress::Traits { - using type = OtaInstallProgress; - static auto constexpr Create = CreateOtaInstallProgress; -}; - -struct OtaInstallFailed FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaInstallFailedBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.OtaInstallFailed"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_UPDATE_ID = 4, - VT_MESSAGE = 6, - VT_FATAL = 8 - }; - int32_t update_id() const { - return GetField(VT_UPDATE_ID, 0); - } - const ::flatbuffers::String *message() const { - return GetPointer(VT_MESSAGE); - } - bool fatal() const { - return GetField(VT_FATAL, 0) != 0; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_UPDATE_ID, 4) && - VerifyOffset(verifier, VT_MESSAGE) && - verifier.VerifyString(message()) && - VerifyField(verifier, VT_FATAL, 1) && - verifier.EndTable(); - } -}; - -struct OtaInstallFailedBuilder { - typedef OtaInstallFailed Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_update_id(int32_t update_id) { - fbb_.AddElement(OtaInstallFailed::VT_UPDATE_ID, update_id, 0); - } - void add_message(::flatbuffers::Offset<::flatbuffers::String> message) { - fbb_.AddOffset(OtaInstallFailed::VT_MESSAGE, message); - } - void add_fatal(bool fatal) { - fbb_.AddElement(OtaInstallFailed::VT_FATAL, static_cast(fatal), 0); - } - explicit OtaInstallFailedBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaInstallFailed( - ::flatbuffers::FlatBufferBuilder &_fbb, - int32_t update_id = 0, - ::flatbuffers::Offset<::flatbuffers::String> message = 0, - bool fatal = false) { - OtaInstallFailedBuilder builder_(_fbb); - builder_.add_message(message); - builder_.add_update_id(update_id); - builder_.add_fatal(fatal); - return builder_.Finish(); -} - -struct OtaInstallFailed::Traits { - using type = OtaInstallFailed; - static auto constexpr Create = CreateOtaInstallFailed; -}; - -inline ::flatbuffers::Offset CreateOtaInstallFailedDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - int32_t update_id = 0, - const char *message = nullptr, - bool fatal = false) { - auto message__ = message ? _fbb.CreateString(message) : 0; - return OpenShock::Serialization::Gateway::CreateOtaInstallFailed( - _fbb, - update_id, - message__, - fatal); -} - -struct DeviceToGatewayMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef DeviceToGatewayMessageBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Gateway.DeviceToGatewayMessage"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_PAYLOAD_TYPE = 4, - VT_PAYLOAD = 6 - }; - OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload payload_type() const { - return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); - } - const void *payload() const { - return GetPointer(VT_PAYLOAD); - } - template const T *payload_as() const; - const OpenShock::Serialization::Gateway::KeepAlive *payload_as_KeepAlive() const { - return payload_type() == OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload::KeepAlive ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Gateway::BootStatus *payload_as_BootStatus() const { - return payload_type() == OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload::BootStatus ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Gateway::OtaInstallStarted *payload_as_OtaInstallStarted() const { - return payload_type() == OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload::OtaInstallStarted ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Gateway::OtaInstallProgress *payload_as_OtaInstallProgress() const { - return payload_type() == OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload::OtaInstallProgress ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Gateway::OtaInstallFailed *payload_as_OtaInstallFailed() const { - return payload_type() == OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload::OtaInstallFailed ? static_cast(payload()) : nullptr; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && - VerifyOffset(verifier, VT_PAYLOAD) && - VerifyDeviceToGatewayMessagePayload(verifier, payload(), payload_type()) && - verifier.EndTable(); - } -}; - -template<> inline const OpenShock::Serialization::Gateway::KeepAlive *DeviceToGatewayMessage::payload_as() const { - return payload_as_KeepAlive(); -} - -template<> inline const OpenShock::Serialization::Gateway::BootStatus *DeviceToGatewayMessage::payload_as() const { - return payload_as_BootStatus(); -} - -template<> inline const OpenShock::Serialization::Gateway::OtaInstallStarted *DeviceToGatewayMessage::payload_as() const { - return payload_as_OtaInstallStarted(); -} - -template<> inline const OpenShock::Serialization::Gateway::OtaInstallProgress *DeviceToGatewayMessage::payload_as() const { - return payload_as_OtaInstallProgress(); -} - -template<> inline const OpenShock::Serialization::Gateway::OtaInstallFailed *DeviceToGatewayMessage::payload_as() const { - return payload_as_OtaInstallFailed(); -} - -struct DeviceToGatewayMessageBuilder { - typedef DeviceToGatewayMessage Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_payload_type(OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload payload_type) { - fbb_.AddElement(DeviceToGatewayMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); - } - void add_payload(::flatbuffers::Offset payload) { - fbb_.AddOffset(DeviceToGatewayMessage::VT_PAYLOAD, payload); - } - explicit DeviceToGatewayMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateDeviceToGatewayMessage( - ::flatbuffers::FlatBufferBuilder &_fbb, - OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload payload_type = OpenShock::Serialization::Gateway::DeviceToGatewayMessagePayload::NONE, - ::flatbuffers::Offset payload = 0) { - DeviceToGatewayMessageBuilder builder_(_fbb); - builder_.add_payload(payload); - builder_.add_payload_type(payload_type); - return builder_.Finish(); -} - -struct DeviceToGatewayMessage::Traits { - using type = DeviceToGatewayMessage; - static auto constexpr Create = CreateDeviceToGatewayMessage; -}; - -inline bool VerifyDeviceToGatewayMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, DeviceToGatewayMessagePayload type) { - switch (type) { - case DeviceToGatewayMessagePayload::NONE: { - return true; - } - case DeviceToGatewayMessagePayload::KeepAlive: { - return verifier.VerifyField(static_cast(obj), 0, 8); - } - case DeviceToGatewayMessagePayload::BootStatus: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToGatewayMessagePayload::OtaInstallStarted: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToGatewayMessagePayload::OtaInstallProgress: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToGatewayMessagePayload::OtaInstallFailed: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyDeviceToGatewayMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyDeviceToGatewayMessagePayload( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const OpenShock::Serialization::Gateway::DeviceToGatewayMessage *GetDeviceToGatewayMessage(const void *buf) { - return ::flatbuffers::GetRoot(buf); -} - -inline const OpenShock::Serialization::Gateway::DeviceToGatewayMessage *GetSizePrefixedDeviceToGatewayMessage(const void *buf) { - return ::flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyDeviceToGatewayMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedDeviceToGatewayMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishDeviceToGatewayMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedDeviceToGatewayMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace Gateway -} // namespace Serialization -} // namespace OpenShock - -#endif // FLATBUFFERS_GENERATED_DEVICETOGATEWAYMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_HUBTOGATEWAYMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ +#define FLATBUFFERS_GENERATED_HUBTOGATEWAYMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, + "Non-compatible flatbuffers version included"); + +#include "FirmwareBootType_generated.h" +#include "SemVer_generated.h" + +namespace OpenShock { +namespace Serialization { +namespace Gateway { + +struct KeepAlive; + +struct BootStatus; +struct BootStatusBuilder; + +struct OtaInstallStarted; +struct OtaInstallStartedBuilder; + +struct OtaInstallProgress; +struct OtaInstallProgressBuilder; + +struct OtaInstallFailed; +struct OtaInstallFailedBuilder; + +struct HubToGatewayMessage; +struct HubToGatewayMessageBuilder; + +enum class OtaInstallProgressTask : int8_t { + FetchingMetadata = 0, + PreparingForInstall = 1, + FlashingFilesystem = 2, + VerifyingFilesystem = 3, + FlashingApplication = 4, + MarkingApplicationBootable = 5, + Rebooting = 6, + MIN = FetchingMetadata, + MAX = Rebooting +}; + +inline const OtaInstallProgressTask (&EnumValuesOtaInstallProgressTask())[7] { + static const OtaInstallProgressTask values[] = { + OtaInstallProgressTask::FetchingMetadata, + OtaInstallProgressTask::PreparingForInstall, + OtaInstallProgressTask::FlashingFilesystem, + OtaInstallProgressTask::VerifyingFilesystem, + OtaInstallProgressTask::FlashingApplication, + OtaInstallProgressTask::MarkingApplicationBootable, + OtaInstallProgressTask::Rebooting + }; + return values; +} + +inline const char * const *EnumNamesOtaInstallProgressTask() { + static const char * const names[8] = { + "FetchingMetadata", + "PreparingForInstall", + "FlashingFilesystem", + "VerifyingFilesystem", + "FlashingApplication", + "MarkingApplicationBootable", + "Rebooting", + nullptr + }; + return names; +} + +inline const char *EnumNameOtaInstallProgressTask(OtaInstallProgressTask e) { + if (::flatbuffers::IsOutRange(e, OtaInstallProgressTask::FetchingMetadata, OtaInstallProgressTask::Rebooting)) return ""; + const size_t index = static_cast(e); + return EnumNamesOtaInstallProgressTask()[index]; +} + +enum class HubToGatewayMessagePayload : uint8_t { + NONE = 0, + KeepAlive = 1, + BootStatus = 2, + OtaInstallStarted = 3, + OtaInstallProgress = 4, + OtaInstallFailed = 5, + MIN = NONE, + MAX = OtaInstallFailed +}; + +inline const HubToGatewayMessagePayload (&EnumValuesHubToGatewayMessagePayload())[6] { + static const HubToGatewayMessagePayload values[] = { + HubToGatewayMessagePayload::NONE, + HubToGatewayMessagePayload::KeepAlive, + HubToGatewayMessagePayload::BootStatus, + HubToGatewayMessagePayload::OtaInstallStarted, + HubToGatewayMessagePayload::OtaInstallProgress, + HubToGatewayMessagePayload::OtaInstallFailed + }; + return values; +} + +inline const char * const *EnumNamesHubToGatewayMessagePayload() { + static const char * const names[7] = { + "NONE", + "KeepAlive", + "BootStatus", + "OtaInstallStarted", + "OtaInstallProgress", + "OtaInstallFailed", + nullptr + }; + return names; +} + +inline const char *EnumNameHubToGatewayMessagePayload(HubToGatewayMessagePayload e) { + if (::flatbuffers::IsOutRange(e, HubToGatewayMessagePayload::NONE, HubToGatewayMessagePayload::OtaInstallFailed)) return ""; + const size_t index = static_cast(e); + return EnumNamesHubToGatewayMessagePayload()[index]; +} + +template struct HubToGatewayMessagePayloadTraits { + static const HubToGatewayMessagePayload enum_value = HubToGatewayMessagePayload::NONE; +}; + +template<> struct HubToGatewayMessagePayloadTraits { + static const HubToGatewayMessagePayload enum_value = HubToGatewayMessagePayload::KeepAlive; +}; + +template<> struct HubToGatewayMessagePayloadTraits { + static const HubToGatewayMessagePayload enum_value = HubToGatewayMessagePayload::BootStatus; +}; + +template<> struct HubToGatewayMessagePayloadTraits { + static const HubToGatewayMessagePayload enum_value = HubToGatewayMessagePayload::OtaInstallStarted; +}; + +template<> struct HubToGatewayMessagePayloadTraits { + static const HubToGatewayMessagePayload enum_value = HubToGatewayMessagePayload::OtaInstallProgress; +}; + +template<> struct HubToGatewayMessagePayloadTraits { + static const HubToGatewayMessagePayload enum_value = HubToGatewayMessagePayload::OtaInstallFailed; +}; + +bool VerifyHubToGatewayMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, HubToGatewayMessagePayload type); +bool VerifyHubToGatewayMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) KeepAlive FLATBUFFERS_FINAL_CLASS { + private: + uint64_t uptime_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.KeepAlive"; + } + KeepAlive() + : uptime_(0) { + } + KeepAlive(uint64_t _uptime) + : uptime_(::flatbuffers::EndianScalar(_uptime)) { + } + uint64_t uptime() const { + return ::flatbuffers::EndianScalar(uptime_); + } +}; +FLATBUFFERS_STRUCT_END(KeepAlive, 8); + +struct KeepAlive::Traits { + using type = KeepAlive; +}; + +struct BootStatus FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef BootStatusBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.BootStatus"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BOOT_TYPE = 4, + VT_FIRMWARE_VERSION = 6, + VT_OTA_UPDATE_ID = 8 + }; + OpenShock::Serialization::Types::FirmwareBootType boot_type() const { + return static_cast(GetField(VT_BOOT_TYPE, 0)); + } + const OpenShock::Serialization::Types::SemVer *firmware_version() const { + return GetPointer(VT_FIRMWARE_VERSION); + } + int32_t ota_update_id() const { + return GetField(VT_OTA_UPDATE_ID, 0); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_BOOT_TYPE, 1) && + VerifyOffset(verifier, VT_FIRMWARE_VERSION) && + verifier.VerifyTable(firmware_version()) && + VerifyField(verifier, VT_OTA_UPDATE_ID, 4) && + verifier.EndTable(); + } +}; + +struct BootStatusBuilder { + typedef BootStatus Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_boot_type(OpenShock::Serialization::Types::FirmwareBootType boot_type) { + fbb_.AddElement(BootStatus::VT_BOOT_TYPE, static_cast(boot_type), 0); + } + void add_firmware_version(::flatbuffers::Offset firmware_version) { + fbb_.AddOffset(BootStatus::VT_FIRMWARE_VERSION, firmware_version); + } + void add_ota_update_id(int32_t ota_update_id) { + fbb_.AddElement(BootStatus::VT_OTA_UPDATE_ID, ota_update_id, 0); + } + explicit BootStatusBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateBootStatus( + ::flatbuffers::FlatBufferBuilder &_fbb, + OpenShock::Serialization::Types::FirmwareBootType boot_type = OpenShock::Serialization::Types::FirmwareBootType::Normal, + ::flatbuffers::Offset firmware_version = 0, + int32_t ota_update_id = 0) { + BootStatusBuilder builder_(_fbb); + builder_.add_ota_update_id(ota_update_id); + builder_.add_firmware_version(firmware_version); + builder_.add_boot_type(boot_type); + return builder_.Finish(); +} + +struct BootStatus::Traits { + using type = BootStatus; + static auto constexpr Create = CreateBootStatus; +}; + +struct OtaInstallStarted FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaInstallStartedBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.OtaInstallStarted"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_UPDATE_ID = 4, + VT_VERSION = 6 + }; + int32_t update_id() const { + return GetField(VT_UPDATE_ID, 0); + } + const OpenShock::Serialization::Types::SemVer *version() const { + return GetPointer(VT_VERSION); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_UPDATE_ID, 4) && + VerifyOffset(verifier, VT_VERSION) && + verifier.VerifyTable(version()) && + verifier.EndTable(); + } +}; + +struct OtaInstallStartedBuilder { + typedef OtaInstallStarted Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_update_id(int32_t update_id) { + fbb_.AddElement(OtaInstallStarted::VT_UPDATE_ID, update_id, 0); + } + void add_version(::flatbuffers::Offset version) { + fbb_.AddOffset(OtaInstallStarted::VT_VERSION, version); + } + explicit OtaInstallStartedBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaInstallStarted( + ::flatbuffers::FlatBufferBuilder &_fbb, + int32_t update_id = 0, + ::flatbuffers::Offset version = 0) { + OtaInstallStartedBuilder builder_(_fbb); + builder_.add_version(version); + builder_.add_update_id(update_id); + return builder_.Finish(); +} + +struct OtaInstallStarted::Traits { + using type = OtaInstallStarted; + static auto constexpr Create = CreateOtaInstallStarted; +}; + +struct OtaInstallProgress FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaInstallProgressBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.OtaInstallProgress"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_UPDATE_ID = 4, + VT_TASK = 6, + VT_PROGRESS = 8 + }; + int32_t update_id() const { + return GetField(VT_UPDATE_ID, 0); + } + OpenShock::Serialization::Gateway::OtaInstallProgressTask task() const { + return static_cast(GetField(VT_TASK, 0)); + } + float progress() const { + return GetField(VT_PROGRESS, 0.0f); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_UPDATE_ID, 4) && + VerifyField(verifier, VT_TASK, 1) && + VerifyField(verifier, VT_PROGRESS, 4) && + verifier.EndTable(); + } +}; + +struct OtaInstallProgressBuilder { + typedef OtaInstallProgress Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_update_id(int32_t update_id) { + fbb_.AddElement(OtaInstallProgress::VT_UPDATE_ID, update_id, 0); + } + void add_task(OpenShock::Serialization::Gateway::OtaInstallProgressTask task) { + fbb_.AddElement(OtaInstallProgress::VT_TASK, static_cast(task), 0); + } + void add_progress(float progress) { + fbb_.AddElement(OtaInstallProgress::VT_PROGRESS, progress, 0.0f); + } + explicit OtaInstallProgressBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaInstallProgress( + ::flatbuffers::FlatBufferBuilder &_fbb, + int32_t update_id = 0, + OpenShock::Serialization::Gateway::OtaInstallProgressTask task = OpenShock::Serialization::Gateway::OtaInstallProgressTask::FetchingMetadata, + float progress = 0.0f) { + OtaInstallProgressBuilder builder_(_fbb); + builder_.add_progress(progress); + builder_.add_update_id(update_id); + builder_.add_task(task); + return builder_.Finish(); +} + +struct OtaInstallProgress::Traits { + using type = OtaInstallProgress; + static auto constexpr Create = CreateOtaInstallProgress; +}; + +struct OtaInstallFailed FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaInstallFailedBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.OtaInstallFailed"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_UPDATE_ID = 4, + VT_MESSAGE = 6, + VT_FATAL = 8 + }; + int32_t update_id() const { + return GetField(VT_UPDATE_ID, 0); + } + const ::flatbuffers::String *message() const { + return GetPointer(VT_MESSAGE); + } + bool fatal() const { + return GetField(VT_FATAL, 0) != 0; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_UPDATE_ID, 4) && + VerifyOffset(verifier, VT_MESSAGE) && + verifier.VerifyString(message()) && + VerifyField(verifier, VT_FATAL, 1) && + verifier.EndTable(); + } +}; + +struct OtaInstallFailedBuilder { + typedef OtaInstallFailed Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_update_id(int32_t update_id) { + fbb_.AddElement(OtaInstallFailed::VT_UPDATE_ID, update_id, 0); + } + void add_message(::flatbuffers::Offset<::flatbuffers::String> message) { + fbb_.AddOffset(OtaInstallFailed::VT_MESSAGE, message); + } + void add_fatal(bool fatal) { + fbb_.AddElement(OtaInstallFailed::VT_FATAL, static_cast(fatal), 0); + } + explicit OtaInstallFailedBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaInstallFailed( + ::flatbuffers::FlatBufferBuilder &_fbb, + int32_t update_id = 0, + ::flatbuffers::Offset<::flatbuffers::String> message = 0, + bool fatal = false) { + OtaInstallFailedBuilder builder_(_fbb); + builder_.add_message(message); + builder_.add_update_id(update_id); + builder_.add_fatal(fatal); + return builder_.Finish(); +} + +struct OtaInstallFailed::Traits { + using type = OtaInstallFailed; + static auto constexpr Create = CreateOtaInstallFailed; +}; + +inline ::flatbuffers::Offset CreateOtaInstallFailedDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + int32_t update_id = 0, + const char *message = nullptr, + bool fatal = false) { + auto message__ = message ? _fbb.CreateString(message) : 0; + return OpenShock::Serialization::Gateway::CreateOtaInstallFailed( + _fbb, + update_id, + message__, + fatal); +} + +struct HubToGatewayMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef HubToGatewayMessageBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Gateway.HubToGatewayMessage"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_PAYLOAD_TYPE = 4, + VT_PAYLOAD = 6 + }; + OpenShock::Serialization::Gateway::HubToGatewayMessagePayload payload_type() const { + return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); + } + const void *payload() const { + return GetPointer(VT_PAYLOAD); + } + template const T *payload_as() const; + const OpenShock::Serialization::Gateway::KeepAlive *payload_as_KeepAlive() const { + return payload_type() == OpenShock::Serialization::Gateway::HubToGatewayMessagePayload::KeepAlive ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Gateway::BootStatus *payload_as_BootStatus() const { + return payload_type() == OpenShock::Serialization::Gateway::HubToGatewayMessagePayload::BootStatus ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Gateway::OtaInstallStarted *payload_as_OtaInstallStarted() const { + return payload_type() == OpenShock::Serialization::Gateway::HubToGatewayMessagePayload::OtaInstallStarted ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Gateway::OtaInstallProgress *payload_as_OtaInstallProgress() const { + return payload_type() == OpenShock::Serialization::Gateway::HubToGatewayMessagePayload::OtaInstallProgress ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Gateway::OtaInstallFailed *payload_as_OtaInstallFailed() const { + return payload_type() == OpenShock::Serialization::Gateway::HubToGatewayMessagePayload::OtaInstallFailed ? static_cast(payload()) : nullptr; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && + VerifyOffset(verifier, VT_PAYLOAD) && + VerifyHubToGatewayMessagePayload(verifier, payload(), payload_type()) && + verifier.EndTable(); + } +}; + +template<> inline const OpenShock::Serialization::Gateway::KeepAlive *HubToGatewayMessage::payload_as() const { + return payload_as_KeepAlive(); +} + +template<> inline const OpenShock::Serialization::Gateway::BootStatus *HubToGatewayMessage::payload_as() const { + return payload_as_BootStatus(); +} + +template<> inline const OpenShock::Serialization::Gateway::OtaInstallStarted *HubToGatewayMessage::payload_as() const { + return payload_as_OtaInstallStarted(); +} + +template<> inline const OpenShock::Serialization::Gateway::OtaInstallProgress *HubToGatewayMessage::payload_as() const { + return payload_as_OtaInstallProgress(); +} + +template<> inline const OpenShock::Serialization::Gateway::OtaInstallFailed *HubToGatewayMessage::payload_as() const { + return payload_as_OtaInstallFailed(); +} + +struct HubToGatewayMessageBuilder { + typedef HubToGatewayMessage Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_payload_type(OpenShock::Serialization::Gateway::HubToGatewayMessagePayload payload_type) { + fbb_.AddElement(HubToGatewayMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); + } + void add_payload(::flatbuffers::Offset payload) { + fbb_.AddOffset(HubToGatewayMessage::VT_PAYLOAD, payload); + } + explicit HubToGatewayMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateHubToGatewayMessage( + ::flatbuffers::FlatBufferBuilder &_fbb, + OpenShock::Serialization::Gateway::HubToGatewayMessagePayload payload_type = OpenShock::Serialization::Gateway::HubToGatewayMessagePayload::NONE, + ::flatbuffers::Offset payload = 0) { + HubToGatewayMessageBuilder builder_(_fbb); + builder_.add_payload(payload); + builder_.add_payload_type(payload_type); + return builder_.Finish(); +} + +struct HubToGatewayMessage::Traits { + using type = HubToGatewayMessage; + static auto constexpr Create = CreateHubToGatewayMessage; +}; + +inline bool VerifyHubToGatewayMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, HubToGatewayMessagePayload type) { + switch (type) { + case HubToGatewayMessagePayload::NONE: { + return true; + } + case HubToGatewayMessagePayload::KeepAlive: { + return verifier.VerifyField(static_cast(obj), 0, 8); + } + case HubToGatewayMessagePayload::BootStatus: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToGatewayMessagePayload::OtaInstallStarted: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToGatewayMessagePayload::OtaInstallProgress: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToGatewayMessagePayload::OtaInstallFailed: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyHubToGatewayMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyHubToGatewayMessagePayload( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const OpenShock::Serialization::Gateway::HubToGatewayMessage *GetHubToGatewayMessage(const void *buf) { + return ::flatbuffers::GetRoot(buf); +} + +inline const OpenShock::Serialization::Gateway::HubToGatewayMessage *GetSizePrefixedHubToGatewayMessage(const void *buf) { + return ::flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyHubToGatewayMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedHubToGatewayMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishHubToGatewayMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedHubToGatewayMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace Gateway +} // namespace Serialization +} // namespace OpenShock + +#endif // FLATBUFFERS_GENERATED_HUBTOGATEWAYMESSAGE_OPENSHOCK_SERIALIZATION_GATEWAY_H_ diff --git a/include/serialization/_fbs/DeviceToLocalMessage_generated.h b/include/serialization/_fbs/HubToLocalMessage_generated.h similarity index 69% rename from include/serialization/_fbs/DeviceToLocalMessage_generated.h rename to include/serialization/_fbs/HubToLocalMessage_generated.h index 2a86a2a0..66912a7c 100644 --- a/include/serialization/_fbs/DeviceToLocalMessage_generated.h +++ b/include/serialization/_fbs/HubToLocalMessage_generated.h @@ -1,832 +1,832 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_DEVICETOLOCALMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ -#define FLATBUFFERS_GENERATED_DEVICETOLOCALMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ - -#include "flatbuffers/flatbuffers.h" - -// Ensure the included flatbuffers.h is the same version as when this file was -// generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && - FLATBUFFERS_VERSION_MINOR == 3 && - FLATBUFFERS_VERSION_REVISION == 25, - "Non-compatible flatbuffers version included"); - -#include "ConfigFile_generated.h" -#include "WifiNetwork_generated.h" -#include "WifiNetworkEventType_generated.h" -#include "WifiScanStatus_generated.h" - -namespace OpenShock { -namespace Serialization { -namespace Local { - -struct ReadyMessage; -struct ReadyMessageBuilder; - -struct ErrorMessage; -struct ErrorMessageBuilder; - -struct WifiScanStatusMessage; - -struct WifiNetworkEvent; -struct WifiNetworkEventBuilder; - -struct WifiGotIpEvent; -struct WifiGotIpEventBuilder; - -struct WifiLostIpEvent; -struct WifiLostIpEventBuilder; - -struct AccountLinkCommandResult; - -struct SetRfTxPinCommandResult; - -struct DeviceToLocalMessage; -struct DeviceToLocalMessageBuilder; - -enum class AccountLinkResultCode : uint8_t { - Success = 0, - CodeRequired = 1, - InvalidCodeLength = 2, - NoInternetConnection = 3, - InvalidCode = 4, - InternalError = 5, - MIN = Success, - MAX = InternalError -}; - -inline const AccountLinkResultCode (&EnumValuesAccountLinkResultCode())[6] { - static const AccountLinkResultCode values[] = { - AccountLinkResultCode::Success, - AccountLinkResultCode::CodeRequired, - AccountLinkResultCode::InvalidCodeLength, - AccountLinkResultCode::NoInternetConnection, - AccountLinkResultCode::InvalidCode, - AccountLinkResultCode::InternalError - }; - return values; -} - -inline const char * const *EnumNamesAccountLinkResultCode() { - static const char * const names[7] = { - "Success", - "CodeRequired", - "InvalidCodeLength", - "NoInternetConnection", - "InvalidCode", - "InternalError", - nullptr - }; - return names; -} - -inline const char *EnumNameAccountLinkResultCode(AccountLinkResultCode e) { - if (::flatbuffers::IsOutRange(e, AccountLinkResultCode::Success, AccountLinkResultCode::InternalError)) return ""; - const size_t index = static_cast(e); - return EnumNamesAccountLinkResultCode()[index]; -} - -enum class SetRfPinResultCode : uint8_t { - Success = 0, - InvalidPin = 1, - InternalError = 2, - MIN = Success, - MAX = InternalError -}; - -inline const SetRfPinResultCode (&EnumValuesSetRfPinResultCode())[3] { - static const SetRfPinResultCode values[] = { - SetRfPinResultCode::Success, - SetRfPinResultCode::InvalidPin, - SetRfPinResultCode::InternalError - }; - return values; -} - -inline const char * const *EnumNamesSetRfPinResultCode() { - static const char * const names[4] = { - "Success", - "InvalidPin", - "InternalError", - nullptr - }; - return names; -} - -inline const char *EnumNameSetRfPinResultCode(SetRfPinResultCode e) { - if (::flatbuffers::IsOutRange(e, SetRfPinResultCode::Success, SetRfPinResultCode::InternalError)) return ""; - const size_t index = static_cast(e); - return EnumNamesSetRfPinResultCode()[index]; -} - -enum class DeviceToLocalMessagePayload : uint8_t { - NONE = 0, - ReadyMessage = 1, - ErrorMessage = 2, - WifiScanStatusMessage = 3, - WifiNetworkEvent = 4, - WifiGotIpEvent = 5, - WifiLostIpEvent = 6, - AccountLinkCommandResult = 7, - SetRfTxPinCommandResult = 8, - MIN = NONE, - MAX = SetRfTxPinCommandResult -}; - -inline const DeviceToLocalMessagePayload (&EnumValuesDeviceToLocalMessagePayload())[9] { - static const DeviceToLocalMessagePayload values[] = { - DeviceToLocalMessagePayload::NONE, - DeviceToLocalMessagePayload::ReadyMessage, - DeviceToLocalMessagePayload::ErrorMessage, - DeviceToLocalMessagePayload::WifiScanStatusMessage, - DeviceToLocalMessagePayload::WifiNetworkEvent, - DeviceToLocalMessagePayload::WifiGotIpEvent, - DeviceToLocalMessagePayload::WifiLostIpEvent, - DeviceToLocalMessagePayload::AccountLinkCommandResult, - DeviceToLocalMessagePayload::SetRfTxPinCommandResult - }; - return values; -} - -inline const char * const *EnumNamesDeviceToLocalMessagePayload() { - static const char * const names[10] = { - "NONE", - "ReadyMessage", - "ErrorMessage", - "WifiScanStatusMessage", - "WifiNetworkEvent", - "WifiGotIpEvent", - "WifiLostIpEvent", - "AccountLinkCommandResult", - "SetRfTxPinCommandResult", - nullptr - }; - return names; -} - -inline const char *EnumNameDeviceToLocalMessagePayload(DeviceToLocalMessagePayload e) { - if (::flatbuffers::IsOutRange(e, DeviceToLocalMessagePayload::NONE, DeviceToLocalMessagePayload::SetRfTxPinCommandResult)) return ""; - const size_t index = static_cast(e); - return EnumNamesDeviceToLocalMessagePayload()[index]; -} - -template struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::NONE; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::ReadyMessage; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::ErrorMessage; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::WifiScanStatusMessage; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::WifiNetworkEvent; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::WifiGotIpEvent; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::WifiLostIpEvent; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::AccountLinkCommandResult; -}; - -template<> struct DeviceToLocalMessagePayloadTraits { - static const DeviceToLocalMessagePayload enum_value = DeviceToLocalMessagePayload::SetRfTxPinCommandResult; -}; - -bool VerifyDeviceToLocalMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, DeviceToLocalMessagePayload type); -bool VerifyDeviceToLocalMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) WifiScanStatusMessage FLATBUFFERS_FINAL_CLASS { - private: - uint8_t status_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiScanStatusMessage"; - } - WifiScanStatusMessage() - : status_(0) { - } - WifiScanStatusMessage(OpenShock::Serialization::Types::WifiScanStatus _status) - : status_(::flatbuffers::EndianScalar(static_cast(_status))) { - } - OpenShock::Serialization::Types::WifiScanStatus status() const { - return static_cast(::flatbuffers::EndianScalar(status_)); - } -}; -FLATBUFFERS_STRUCT_END(WifiScanStatusMessage, 1); - -struct WifiScanStatusMessage::Traits { - using type = WifiScanStatusMessage; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) AccountLinkCommandResult FLATBUFFERS_FINAL_CLASS { - private: - uint8_t result_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.AccountLinkCommandResult"; - } - AccountLinkCommandResult() - : result_(0) { - } - AccountLinkCommandResult(OpenShock::Serialization::Local::AccountLinkResultCode _result) - : result_(::flatbuffers::EndianScalar(static_cast(_result))) { - } - OpenShock::Serialization::Local::AccountLinkResultCode result() const { - return static_cast(::flatbuffers::EndianScalar(result_)); - } -}; -FLATBUFFERS_STRUCT_END(AccountLinkCommandResult, 1); - -struct AccountLinkCommandResult::Traits { - using type = AccountLinkCommandResult; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) SetRfTxPinCommandResult FLATBUFFERS_FINAL_CLASS { - private: - uint8_t pin_; - uint8_t result_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.SetRfTxPinCommandResult"; - } - SetRfTxPinCommandResult() - : pin_(0), - result_(0) { - } - SetRfTxPinCommandResult(uint8_t _pin, OpenShock::Serialization::Local::SetRfPinResultCode _result) - : pin_(::flatbuffers::EndianScalar(_pin)), - result_(::flatbuffers::EndianScalar(static_cast(_result))) { - } - uint8_t pin() const { - return ::flatbuffers::EndianScalar(pin_); - } - OpenShock::Serialization::Local::SetRfPinResultCode result() const { - return static_cast(::flatbuffers::EndianScalar(result_)); - } -}; -FLATBUFFERS_STRUCT_END(SetRfTxPinCommandResult, 2); - -struct SetRfTxPinCommandResult::Traits { - using type = SetRfTxPinCommandResult; -}; - -struct ReadyMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef ReadyMessageBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.ReadyMessage"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_POGGIES = 4, - VT_CONNECTED_WIFI = 6, - VT_ACCOUNT_LINKED = 8, - VT_CONFIG = 10 - }; - bool poggies() const { - return GetField(VT_POGGIES, 0) != 0; - } - const OpenShock::Serialization::Types::WifiNetwork *connected_wifi() const { - return GetPointer(VT_CONNECTED_WIFI); - } - bool account_linked() const { - return GetField(VT_ACCOUNT_LINKED, 0) != 0; - } - const OpenShock::Serialization::Configuration::Config *config() const { - return GetPointer(VT_CONFIG); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_POGGIES, 1) && - VerifyOffset(verifier, VT_CONNECTED_WIFI) && - verifier.VerifyTable(connected_wifi()) && - VerifyField(verifier, VT_ACCOUNT_LINKED, 1) && - VerifyOffset(verifier, VT_CONFIG) && - verifier.VerifyTable(config()) && - verifier.EndTable(); - } -}; - -struct ReadyMessageBuilder { - typedef ReadyMessage Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_poggies(bool poggies) { - fbb_.AddElement(ReadyMessage::VT_POGGIES, static_cast(poggies), 0); - } - void add_connected_wifi(::flatbuffers::Offset connected_wifi) { - fbb_.AddOffset(ReadyMessage::VT_CONNECTED_WIFI, connected_wifi); - } - void add_account_linked(bool account_linked) { - fbb_.AddElement(ReadyMessage::VT_ACCOUNT_LINKED, static_cast(account_linked), 0); - } - void add_config(::flatbuffers::Offset config) { - fbb_.AddOffset(ReadyMessage::VT_CONFIG, config); - } - explicit ReadyMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateReadyMessage( - ::flatbuffers::FlatBufferBuilder &_fbb, - bool poggies = false, - ::flatbuffers::Offset connected_wifi = 0, - bool account_linked = false, - ::flatbuffers::Offset config = 0) { - ReadyMessageBuilder builder_(_fbb); - builder_.add_config(config); - builder_.add_connected_wifi(connected_wifi); - builder_.add_account_linked(account_linked); - builder_.add_poggies(poggies); - return builder_.Finish(); -} - -struct ReadyMessage::Traits { - using type = ReadyMessage; - static auto constexpr Create = CreateReadyMessage; -}; - -struct ErrorMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef ErrorMessageBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.ErrorMessage"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_MESSAGE = 4 - }; - const ::flatbuffers::String *message() const { - return GetPointer(VT_MESSAGE); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_MESSAGE) && - verifier.VerifyString(message()) && - verifier.EndTable(); - } -}; - -struct ErrorMessageBuilder { - typedef ErrorMessage Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_message(::flatbuffers::Offset<::flatbuffers::String> message) { - fbb_.AddOffset(ErrorMessage::VT_MESSAGE, message); - } - explicit ErrorMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateErrorMessage( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> message = 0) { - ErrorMessageBuilder builder_(_fbb); - builder_.add_message(message); - return builder_.Finish(); -} - -struct ErrorMessage::Traits { - using type = ErrorMessage; - static auto constexpr Create = CreateErrorMessage; -}; - -inline ::flatbuffers::Offset CreateErrorMessageDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *message = nullptr) { - auto message__ = message ? _fbb.CreateString(message) : 0; - return OpenShock::Serialization::Local::CreateErrorMessage( - _fbb, - message__); -} - -struct WifiNetworkEvent FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WifiNetworkEventBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiNetworkEvent"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_EVENT_TYPE = 4, - VT_NETWORKS = 6 - }; - OpenShock::Serialization::Types::WifiNetworkEventType event_type() const { - return static_cast(GetField(VT_EVENT_TYPE, 0)); - } - const ::flatbuffers::Vector<::flatbuffers::Offset> *networks() const { - return GetPointer> *>(VT_NETWORKS); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_EVENT_TYPE, 1) && - VerifyOffset(verifier, VT_NETWORKS) && - verifier.VerifyVector(networks()) && - verifier.VerifyVectorOfTables(networks()) && - verifier.EndTable(); - } -}; - -struct WifiNetworkEventBuilder { - typedef WifiNetworkEvent Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_event_type(OpenShock::Serialization::Types::WifiNetworkEventType event_type) { - fbb_.AddElement(WifiNetworkEvent::VT_EVENT_TYPE, static_cast(event_type), 0); - } - void add_networks(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> networks) { - fbb_.AddOffset(WifiNetworkEvent::VT_NETWORKS, networks); - } - explicit WifiNetworkEventBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWifiNetworkEvent( - ::flatbuffers::FlatBufferBuilder &_fbb, - OpenShock::Serialization::Types::WifiNetworkEventType event_type = OpenShock::Serialization::Types::WifiNetworkEventType::Discovered, - ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> networks = 0) { - WifiNetworkEventBuilder builder_(_fbb); - builder_.add_networks(networks); - builder_.add_event_type(event_type); - return builder_.Finish(); -} - -struct WifiNetworkEvent::Traits { - using type = WifiNetworkEvent; - static auto constexpr Create = CreateWifiNetworkEvent; -}; - -inline ::flatbuffers::Offset CreateWifiNetworkEventDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - OpenShock::Serialization::Types::WifiNetworkEventType event_type = OpenShock::Serialization::Types::WifiNetworkEventType::Discovered, - const std::vector<::flatbuffers::Offset> *networks = nullptr) { - auto networks__ = networks ? _fbb.CreateVector<::flatbuffers::Offset>(*networks) : 0; - return OpenShock::Serialization::Local::CreateWifiNetworkEvent( - _fbb, - event_type, - networks__); -} - -struct WifiGotIpEvent FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WifiGotIpEventBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiGotIpEvent"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IP = 4 - }; - const ::flatbuffers::String *ip() const { - return GetPointer(VT_IP); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_IP) && - verifier.VerifyString(ip()) && - verifier.EndTable(); - } -}; - -struct WifiGotIpEventBuilder { - typedef WifiGotIpEvent Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_ip(::flatbuffers::Offset<::flatbuffers::String> ip) { - fbb_.AddOffset(WifiGotIpEvent::VT_IP, ip); - } - explicit WifiGotIpEventBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWifiGotIpEvent( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> ip = 0) { - WifiGotIpEventBuilder builder_(_fbb); - builder_.add_ip(ip); - return builder_.Finish(); -} - -struct WifiGotIpEvent::Traits { - using type = WifiGotIpEvent; - static auto constexpr Create = CreateWifiGotIpEvent; -}; - -inline ::flatbuffers::Offset CreateWifiGotIpEventDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *ip = nullptr) { - auto ip__ = ip ? _fbb.CreateString(ip) : 0; - return OpenShock::Serialization::Local::CreateWifiGotIpEvent( - _fbb, - ip__); -} - -struct WifiLostIpEvent FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WifiLostIpEventBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiLostIpEvent"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IP = 4 - }; - const ::flatbuffers::String *ip() const { - return GetPointer(VT_IP); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_IP) && - verifier.VerifyString(ip()) && - verifier.EndTable(); - } -}; - -struct WifiLostIpEventBuilder { - typedef WifiLostIpEvent Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_ip(::flatbuffers::Offset<::flatbuffers::String> ip) { - fbb_.AddOffset(WifiLostIpEvent::VT_IP, ip); - } - explicit WifiLostIpEventBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWifiLostIpEvent( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> ip = 0) { - WifiLostIpEventBuilder builder_(_fbb); - builder_.add_ip(ip); - return builder_.Finish(); -} - -struct WifiLostIpEvent::Traits { - using type = WifiLostIpEvent; - static auto constexpr Create = CreateWifiLostIpEvent; -}; - -inline ::flatbuffers::Offset CreateWifiLostIpEventDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *ip = nullptr) { - auto ip__ = ip ? _fbb.CreateString(ip) : 0; - return OpenShock::Serialization::Local::CreateWifiLostIpEvent( - _fbb, - ip__); -} - -struct DeviceToLocalMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef DeviceToLocalMessageBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.DeviceToLocalMessage"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_PAYLOAD_TYPE = 4, - VT_PAYLOAD = 6 - }; - OpenShock::Serialization::Local::DeviceToLocalMessagePayload payload_type() const { - return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); - } - const void *payload() const { - return GetPointer(VT_PAYLOAD); - } - template const T *payload_as() const; - const OpenShock::Serialization::Local::ReadyMessage *payload_as_ReadyMessage() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::ReadyMessage ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::ErrorMessage *payload_as_ErrorMessage() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::ErrorMessage ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiScanStatusMessage *payload_as_WifiScanStatusMessage() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::WifiScanStatusMessage ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiNetworkEvent *payload_as_WifiNetworkEvent() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::WifiNetworkEvent ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiGotIpEvent *payload_as_WifiGotIpEvent() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::WifiGotIpEvent ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiLostIpEvent *payload_as_WifiLostIpEvent() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::WifiLostIpEvent ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::AccountLinkCommandResult *payload_as_AccountLinkCommandResult() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::AccountLinkCommandResult ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::SetRfTxPinCommandResult *payload_as_SetRfTxPinCommandResult() const { - return payload_type() == OpenShock::Serialization::Local::DeviceToLocalMessagePayload::SetRfTxPinCommandResult ? static_cast(payload()) : nullptr; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && - VerifyOffset(verifier, VT_PAYLOAD) && - VerifyDeviceToLocalMessagePayload(verifier, payload(), payload_type()) && - verifier.EndTable(); - } -}; - -template<> inline const OpenShock::Serialization::Local::ReadyMessage *DeviceToLocalMessage::payload_as() const { - return payload_as_ReadyMessage(); -} - -template<> inline const OpenShock::Serialization::Local::ErrorMessage *DeviceToLocalMessage::payload_as() const { - return payload_as_ErrorMessage(); -} - -template<> inline const OpenShock::Serialization::Local::WifiScanStatusMessage *DeviceToLocalMessage::payload_as() const { - return payload_as_WifiScanStatusMessage(); -} - -template<> inline const OpenShock::Serialization::Local::WifiNetworkEvent *DeviceToLocalMessage::payload_as() const { - return payload_as_WifiNetworkEvent(); -} - -template<> inline const OpenShock::Serialization::Local::WifiGotIpEvent *DeviceToLocalMessage::payload_as() const { - return payload_as_WifiGotIpEvent(); -} - -template<> inline const OpenShock::Serialization::Local::WifiLostIpEvent *DeviceToLocalMessage::payload_as() const { - return payload_as_WifiLostIpEvent(); -} - -template<> inline const OpenShock::Serialization::Local::AccountLinkCommandResult *DeviceToLocalMessage::payload_as() const { - return payload_as_AccountLinkCommandResult(); -} - -template<> inline const OpenShock::Serialization::Local::SetRfTxPinCommandResult *DeviceToLocalMessage::payload_as() const { - return payload_as_SetRfTxPinCommandResult(); -} - -struct DeviceToLocalMessageBuilder { - typedef DeviceToLocalMessage Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_payload_type(OpenShock::Serialization::Local::DeviceToLocalMessagePayload payload_type) { - fbb_.AddElement(DeviceToLocalMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); - } - void add_payload(::flatbuffers::Offset payload) { - fbb_.AddOffset(DeviceToLocalMessage::VT_PAYLOAD, payload); - } - explicit DeviceToLocalMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateDeviceToLocalMessage( - ::flatbuffers::FlatBufferBuilder &_fbb, - OpenShock::Serialization::Local::DeviceToLocalMessagePayload payload_type = OpenShock::Serialization::Local::DeviceToLocalMessagePayload::NONE, - ::flatbuffers::Offset payload = 0) { - DeviceToLocalMessageBuilder builder_(_fbb); - builder_.add_payload(payload); - builder_.add_payload_type(payload_type); - return builder_.Finish(); -} - -struct DeviceToLocalMessage::Traits { - using type = DeviceToLocalMessage; - static auto constexpr Create = CreateDeviceToLocalMessage; -}; - -inline bool VerifyDeviceToLocalMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, DeviceToLocalMessagePayload type) { - switch (type) { - case DeviceToLocalMessagePayload::NONE: { - return true; - } - case DeviceToLocalMessagePayload::ReadyMessage: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToLocalMessagePayload::ErrorMessage: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToLocalMessagePayload::WifiScanStatusMessage: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case DeviceToLocalMessagePayload::WifiNetworkEvent: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToLocalMessagePayload::WifiGotIpEvent: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToLocalMessagePayload::WifiLostIpEvent: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case DeviceToLocalMessagePayload::AccountLinkCommandResult: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case DeviceToLocalMessagePayload::SetRfTxPinCommandResult: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - default: return true; - } -} - -inline bool VerifyDeviceToLocalMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyDeviceToLocalMessagePayload( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const OpenShock::Serialization::Local::DeviceToLocalMessage *GetDeviceToLocalMessage(const void *buf) { - return ::flatbuffers::GetRoot(buf); -} - -inline const OpenShock::Serialization::Local::DeviceToLocalMessage *GetSizePrefixedDeviceToLocalMessage(const void *buf) { - return ::flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyDeviceToLocalMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedDeviceToLocalMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishDeviceToLocalMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedDeviceToLocalMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace Local -} // namespace Serialization -} // namespace OpenShock - -#endif // FLATBUFFERS_GENERATED_DEVICETOLOCALMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_HUBTOLOCALMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ +#define FLATBUFFERS_GENERATED_HUBTOLOCALMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, + "Non-compatible flatbuffers version included"); + +#include "HubConfig_generated.h" +#include "WifiNetwork_generated.h" +#include "WifiNetworkEventType_generated.h" +#include "WifiScanStatus_generated.h" + +namespace OpenShock { +namespace Serialization { +namespace Local { + +struct ReadyMessage; +struct ReadyMessageBuilder; + +struct ErrorMessage; +struct ErrorMessageBuilder; + +struct WifiScanStatusMessage; + +struct WifiNetworkEvent; +struct WifiNetworkEventBuilder; + +struct WifiGotIpEvent; +struct WifiGotIpEventBuilder; + +struct WifiLostIpEvent; +struct WifiLostIpEventBuilder; + +struct AccountLinkCommandResult; + +struct SetRfTxPinCommandResult; + +struct HubToLocalMessage; +struct HubToLocalMessageBuilder; + +enum class AccountLinkResultCode : uint8_t { + Success = 0, + CodeRequired = 1, + InvalidCodeLength = 2, + NoInternetConnection = 3, + InvalidCode = 4, + InternalError = 5, + MIN = Success, + MAX = InternalError +}; + +inline const AccountLinkResultCode (&EnumValuesAccountLinkResultCode())[6] { + static const AccountLinkResultCode values[] = { + AccountLinkResultCode::Success, + AccountLinkResultCode::CodeRequired, + AccountLinkResultCode::InvalidCodeLength, + AccountLinkResultCode::NoInternetConnection, + AccountLinkResultCode::InvalidCode, + AccountLinkResultCode::InternalError + }; + return values; +} + +inline const char * const *EnumNamesAccountLinkResultCode() { + static const char * const names[7] = { + "Success", + "CodeRequired", + "InvalidCodeLength", + "NoInternetConnection", + "InvalidCode", + "InternalError", + nullptr + }; + return names; +} + +inline const char *EnumNameAccountLinkResultCode(AccountLinkResultCode e) { + if (::flatbuffers::IsOutRange(e, AccountLinkResultCode::Success, AccountLinkResultCode::InternalError)) return ""; + const size_t index = static_cast(e); + return EnumNamesAccountLinkResultCode()[index]; +} + +enum class SetRfPinResultCode : uint8_t { + Success = 0, + InvalidPin = 1, + InternalError = 2, + MIN = Success, + MAX = InternalError +}; + +inline const SetRfPinResultCode (&EnumValuesSetRfPinResultCode())[3] { + static const SetRfPinResultCode values[] = { + SetRfPinResultCode::Success, + SetRfPinResultCode::InvalidPin, + SetRfPinResultCode::InternalError + }; + return values; +} + +inline const char * const *EnumNamesSetRfPinResultCode() { + static const char * const names[4] = { + "Success", + "InvalidPin", + "InternalError", + nullptr + }; + return names; +} + +inline const char *EnumNameSetRfPinResultCode(SetRfPinResultCode e) { + if (::flatbuffers::IsOutRange(e, SetRfPinResultCode::Success, SetRfPinResultCode::InternalError)) return ""; + const size_t index = static_cast(e); + return EnumNamesSetRfPinResultCode()[index]; +} + +enum class HubToLocalMessagePayload : uint8_t { + NONE = 0, + ReadyMessage = 1, + ErrorMessage = 2, + WifiScanStatusMessage = 3, + WifiNetworkEvent = 4, + WifiGotIpEvent = 5, + WifiLostIpEvent = 6, + AccountLinkCommandResult = 7, + SetRfTxPinCommandResult = 8, + MIN = NONE, + MAX = SetRfTxPinCommandResult +}; + +inline const HubToLocalMessagePayload (&EnumValuesHubToLocalMessagePayload())[9] { + static const HubToLocalMessagePayload values[] = { + HubToLocalMessagePayload::NONE, + HubToLocalMessagePayload::ReadyMessage, + HubToLocalMessagePayload::ErrorMessage, + HubToLocalMessagePayload::WifiScanStatusMessage, + HubToLocalMessagePayload::WifiNetworkEvent, + HubToLocalMessagePayload::WifiGotIpEvent, + HubToLocalMessagePayload::WifiLostIpEvent, + HubToLocalMessagePayload::AccountLinkCommandResult, + HubToLocalMessagePayload::SetRfTxPinCommandResult + }; + return values; +} + +inline const char * const *EnumNamesHubToLocalMessagePayload() { + static const char * const names[10] = { + "NONE", + "ReadyMessage", + "ErrorMessage", + "WifiScanStatusMessage", + "WifiNetworkEvent", + "WifiGotIpEvent", + "WifiLostIpEvent", + "AccountLinkCommandResult", + "SetRfTxPinCommandResult", + nullptr + }; + return names; +} + +inline const char *EnumNameHubToLocalMessagePayload(HubToLocalMessagePayload e) { + if (::flatbuffers::IsOutRange(e, HubToLocalMessagePayload::NONE, HubToLocalMessagePayload::SetRfTxPinCommandResult)) return ""; + const size_t index = static_cast(e); + return EnumNamesHubToLocalMessagePayload()[index]; +} + +template struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::NONE; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::ReadyMessage; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::ErrorMessage; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::WifiScanStatusMessage; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::WifiNetworkEvent; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::WifiGotIpEvent; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::WifiLostIpEvent; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::AccountLinkCommandResult; +}; + +template<> struct HubToLocalMessagePayloadTraits { + static const HubToLocalMessagePayload enum_value = HubToLocalMessagePayload::SetRfTxPinCommandResult; +}; + +bool VerifyHubToLocalMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, HubToLocalMessagePayload type); +bool VerifyHubToLocalMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) WifiScanStatusMessage FLATBUFFERS_FINAL_CLASS { + private: + uint8_t status_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiScanStatusMessage"; + } + WifiScanStatusMessage() + : status_(0) { + } + WifiScanStatusMessage(OpenShock::Serialization::Types::WifiScanStatus _status) + : status_(::flatbuffers::EndianScalar(static_cast(_status))) { + } + OpenShock::Serialization::Types::WifiScanStatus status() const { + return static_cast(::flatbuffers::EndianScalar(status_)); + } +}; +FLATBUFFERS_STRUCT_END(WifiScanStatusMessage, 1); + +struct WifiScanStatusMessage::Traits { + using type = WifiScanStatusMessage; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) AccountLinkCommandResult FLATBUFFERS_FINAL_CLASS { + private: + uint8_t result_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.AccountLinkCommandResult"; + } + AccountLinkCommandResult() + : result_(0) { + } + AccountLinkCommandResult(OpenShock::Serialization::Local::AccountLinkResultCode _result) + : result_(::flatbuffers::EndianScalar(static_cast(_result))) { + } + OpenShock::Serialization::Local::AccountLinkResultCode result() const { + return static_cast(::flatbuffers::EndianScalar(result_)); + } +}; +FLATBUFFERS_STRUCT_END(AccountLinkCommandResult, 1); + +struct AccountLinkCommandResult::Traits { + using type = AccountLinkCommandResult; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) SetRfTxPinCommandResult FLATBUFFERS_FINAL_CLASS { + private: + uint8_t pin_; + uint8_t result_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.SetRfTxPinCommandResult"; + } + SetRfTxPinCommandResult() + : pin_(0), + result_(0) { + } + SetRfTxPinCommandResult(uint8_t _pin, OpenShock::Serialization::Local::SetRfPinResultCode _result) + : pin_(::flatbuffers::EndianScalar(_pin)), + result_(::flatbuffers::EndianScalar(static_cast(_result))) { + } + uint8_t pin() const { + return ::flatbuffers::EndianScalar(pin_); + } + OpenShock::Serialization::Local::SetRfPinResultCode result() const { + return static_cast(::flatbuffers::EndianScalar(result_)); + } +}; +FLATBUFFERS_STRUCT_END(SetRfTxPinCommandResult, 2); + +struct SetRfTxPinCommandResult::Traits { + using type = SetRfTxPinCommandResult; +}; + +struct ReadyMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef ReadyMessageBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.ReadyMessage"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_POGGIES = 4, + VT_CONNECTED_WIFI = 6, + VT_ACCOUNT_LINKED = 8, + VT_CONFIG = 10 + }; + bool poggies() const { + return GetField(VT_POGGIES, 0) != 0; + } + const OpenShock::Serialization::Types::WifiNetwork *connected_wifi() const { + return GetPointer(VT_CONNECTED_WIFI); + } + bool account_linked() const { + return GetField(VT_ACCOUNT_LINKED, 0) != 0; + } + const OpenShock::Serialization::Configuration::HubConfig *config() const { + return GetPointer(VT_CONFIG); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_POGGIES, 1) && + VerifyOffset(verifier, VT_CONNECTED_WIFI) && + verifier.VerifyTable(connected_wifi()) && + VerifyField(verifier, VT_ACCOUNT_LINKED, 1) && + VerifyOffset(verifier, VT_CONFIG) && + verifier.VerifyTable(config()) && + verifier.EndTable(); + } +}; + +struct ReadyMessageBuilder { + typedef ReadyMessage Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_poggies(bool poggies) { + fbb_.AddElement(ReadyMessage::VT_POGGIES, static_cast(poggies), 0); + } + void add_connected_wifi(::flatbuffers::Offset connected_wifi) { + fbb_.AddOffset(ReadyMessage::VT_CONNECTED_WIFI, connected_wifi); + } + void add_account_linked(bool account_linked) { + fbb_.AddElement(ReadyMessage::VT_ACCOUNT_LINKED, static_cast(account_linked), 0); + } + void add_config(::flatbuffers::Offset config) { + fbb_.AddOffset(ReadyMessage::VT_CONFIG, config); + } + explicit ReadyMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateReadyMessage( + ::flatbuffers::FlatBufferBuilder &_fbb, + bool poggies = false, + ::flatbuffers::Offset connected_wifi = 0, + bool account_linked = false, + ::flatbuffers::Offset config = 0) { + ReadyMessageBuilder builder_(_fbb); + builder_.add_config(config); + builder_.add_connected_wifi(connected_wifi); + builder_.add_account_linked(account_linked); + builder_.add_poggies(poggies); + return builder_.Finish(); +} + +struct ReadyMessage::Traits { + using type = ReadyMessage; + static auto constexpr Create = CreateReadyMessage; +}; + +struct ErrorMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef ErrorMessageBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.ErrorMessage"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_MESSAGE = 4 + }; + const ::flatbuffers::String *message() const { + return GetPointer(VT_MESSAGE); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_MESSAGE) && + verifier.VerifyString(message()) && + verifier.EndTable(); + } +}; + +struct ErrorMessageBuilder { + typedef ErrorMessage Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_message(::flatbuffers::Offset<::flatbuffers::String> message) { + fbb_.AddOffset(ErrorMessage::VT_MESSAGE, message); + } + explicit ErrorMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateErrorMessage( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> message = 0) { + ErrorMessageBuilder builder_(_fbb); + builder_.add_message(message); + return builder_.Finish(); +} + +struct ErrorMessage::Traits { + using type = ErrorMessage; + static auto constexpr Create = CreateErrorMessage; +}; + +inline ::flatbuffers::Offset CreateErrorMessageDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *message = nullptr) { + auto message__ = message ? _fbb.CreateString(message) : 0; + return OpenShock::Serialization::Local::CreateErrorMessage( + _fbb, + message__); +} + +struct WifiNetworkEvent FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WifiNetworkEventBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiNetworkEvent"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_EVENT_TYPE = 4, + VT_NETWORKS = 6 + }; + OpenShock::Serialization::Types::WifiNetworkEventType event_type() const { + return static_cast(GetField(VT_EVENT_TYPE, 0)); + } + const ::flatbuffers::Vector<::flatbuffers::Offset> *networks() const { + return GetPointer> *>(VT_NETWORKS); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_EVENT_TYPE, 1) && + VerifyOffset(verifier, VT_NETWORKS) && + verifier.VerifyVector(networks()) && + verifier.VerifyVectorOfTables(networks()) && + verifier.EndTable(); + } +}; + +struct WifiNetworkEventBuilder { + typedef WifiNetworkEvent Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_event_type(OpenShock::Serialization::Types::WifiNetworkEventType event_type) { + fbb_.AddElement(WifiNetworkEvent::VT_EVENT_TYPE, static_cast(event_type), 0); + } + void add_networks(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> networks) { + fbb_.AddOffset(WifiNetworkEvent::VT_NETWORKS, networks); + } + explicit WifiNetworkEventBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWifiNetworkEvent( + ::flatbuffers::FlatBufferBuilder &_fbb, + OpenShock::Serialization::Types::WifiNetworkEventType event_type = OpenShock::Serialization::Types::WifiNetworkEventType::Discovered, + ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> networks = 0) { + WifiNetworkEventBuilder builder_(_fbb); + builder_.add_networks(networks); + builder_.add_event_type(event_type); + return builder_.Finish(); +} + +struct WifiNetworkEvent::Traits { + using type = WifiNetworkEvent; + static auto constexpr Create = CreateWifiNetworkEvent; +}; + +inline ::flatbuffers::Offset CreateWifiNetworkEventDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + OpenShock::Serialization::Types::WifiNetworkEventType event_type = OpenShock::Serialization::Types::WifiNetworkEventType::Discovered, + const std::vector<::flatbuffers::Offset> *networks = nullptr) { + auto networks__ = networks ? _fbb.CreateVector<::flatbuffers::Offset>(*networks) : 0; + return OpenShock::Serialization::Local::CreateWifiNetworkEvent( + _fbb, + event_type, + networks__); +} + +struct WifiGotIpEvent FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WifiGotIpEventBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiGotIpEvent"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IP = 4 + }; + const ::flatbuffers::String *ip() const { + return GetPointer(VT_IP); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_IP) && + verifier.VerifyString(ip()) && + verifier.EndTable(); + } +}; + +struct WifiGotIpEventBuilder { + typedef WifiGotIpEvent Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_ip(::flatbuffers::Offset<::flatbuffers::String> ip) { + fbb_.AddOffset(WifiGotIpEvent::VT_IP, ip); + } + explicit WifiGotIpEventBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWifiGotIpEvent( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> ip = 0) { + WifiGotIpEventBuilder builder_(_fbb); + builder_.add_ip(ip); + return builder_.Finish(); +} + +struct WifiGotIpEvent::Traits { + using type = WifiGotIpEvent; + static auto constexpr Create = CreateWifiGotIpEvent; +}; + +inline ::flatbuffers::Offset CreateWifiGotIpEventDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *ip = nullptr) { + auto ip__ = ip ? _fbb.CreateString(ip) : 0; + return OpenShock::Serialization::Local::CreateWifiGotIpEvent( + _fbb, + ip__); +} + +struct WifiLostIpEvent FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WifiLostIpEventBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiLostIpEvent"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IP = 4 + }; + const ::flatbuffers::String *ip() const { + return GetPointer(VT_IP); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_IP) && + verifier.VerifyString(ip()) && + verifier.EndTable(); + } +}; + +struct WifiLostIpEventBuilder { + typedef WifiLostIpEvent Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_ip(::flatbuffers::Offset<::flatbuffers::String> ip) { + fbb_.AddOffset(WifiLostIpEvent::VT_IP, ip); + } + explicit WifiLostIpEventBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWifiLostIpEvent( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> ip = 0) { + WifiLostIpEventBuilder builder_(_fbb); + builder_.add_ip(ip); + return builder_.Finish(); +} + +struct WifiLostIpEvent::Traits { + using type = WifiLostIpEvent; + static auto constexpr Create = CreateWifiLostIpEvent; +}; + +inline ::flatbuffers::Offset CreateWifiLostIpEventDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *ip = nullptr) { + auto ip__ = ip ? _fbb.CreateString(ip) : 0; + return OpenShock::Serialization::Local::CreateWifiLostIpEvent( + _fbb, + ip__); +} + +struct HubToLocalMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef HubToLocalMessageBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.HubToLocalMessage"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_PAYLOAD_TYPE = 4, + VT_PAYLOAD = 6 + }; + OpenShock::Serialization::Local::HubToLocalMessagePayload payload_type() const { + return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); + } + const void *payload() const { + return GetPointer(VT_PAYLOAD); + } + template const T *payload_as() const; + const OpenShock::Serialization::Local::ReadyMessage *payload_as_ReadyMessage() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::ReadyMessage ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::ErrorMessage *payload_as_ErrorMessage() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::ErrorMessage ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiScanStatusMessage *payload_as_WifiScanStatusMessage() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::WifiScanStatusMessage ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiNetworkEvent *payload_as_WifiNetworkEvent() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::WifiNetworkEvent ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiGotIpEvent *payload_as_WifiGotIpEvent() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::WifiGotIpEvent ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiLostIpEvent *payload_as_WifiLostIpEvent() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::WifiLostIpEvent ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::AccountLinkCommandResult *payload_as_AccountLinkCommandResult() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::AccountLinkCommandResult ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::SetRfTxPinCommandResult *payload_as_SetRfTxPinCommandResult() const { + return payload_type() == OpenShock::Serialization::Local::HubToLocalMessagePayload::SetRfTxPinCommandResult ? static_cast(payload()) : nullptr; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && + VerifyOffset(verifier, VT_PAYLOAD) && + VerifyHubToLocalMessagePayload(verifier, payload(), payload_type()) && + verifier.EndTable(); + } +}; + +template<> inline const OpenShock::Serialization::Local::ReadyMessage *HubToLocalMessage::payload_as() const { + return payload_as_ReadyMessage(); +} + +template<> inline const OpenShock::Serialization::Local::ErrorMessage *HubToLocalMessage::payload_as() const { + return payload_as_ErrorMessage(); +} + +template<> inline const OpenShock::Serialization::Local::WifiScanStatusMessage *HubToLocalMessage::payload_as() const { + return payload_as_WifiScanStatusMessage(); +} + +template<> inline const OpenShock::Serialization::Local::WifiNetworkEvent *HubToLocalMessage::payload_as() const { + return payload_as_WifiNetworkEvent(); +} + +template<> inline const OpenShock::Serialization::Local::WifiGotIpEvent *HubToLocalMessage::payload_as() const { + return payload_as_WifiGotIpEvent(); +} + +template<> inline const OpenShock::Serialization::Local::WifiLostIpEvent *HubToLocalMessage::payload_as() const { + return payload_as_WifiLostIpEvent(); +} + +template<> inline const OpenShock::Serialization::Local::AccountLinkCommandResult *HubToLocalMessage::payload_as() const { + return payload_as_AccountLinkCommandResult(); +} + +template<> inline const OpenShock::Serialization::Local::SetRfTxPinCommandResult *HubToLocalMessage::payload_as() const { + return payload_as_SetRfTxPinCommandResult(); +} + +struct HubToLocalMessageBuilder { + typedef HubToLocalMessage Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_payload_type(OpenShock::Serialization::Local::HubToLocalMessagePayload payload_type) { + fbb_.AddElement(HubToLocalMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); + } + void add_payload(::flatbuffers::Offset payload) { + fbb_.AddOffset(HubToLocalMessage::VT_PAYLOAD, payload); + } + explicit HubToLocalMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateHubToLocalMessage( + ::flatbuffers::FlatBufferBuilder &_fbb, + OpenShock::Serialization::Local::HubToLocalMessagePayload payload_type = OpenShock::Serialization::Local::HubToLocalMessagePayload::NONE, + ::flatbuffers::Offset payload = 0) { + HubToLocalMessageBuilder builder_(_fbb); + builder_.add_payload(payload); + builder_.add_payload_type(payload_type); + return builder_.Finish(); +} + +struct HubToLocalMessage::Traits { + using type = HubToLocalMessage; + static auto constexpr Create = CreateHubToLocalMessage; +}; + +inline bool VerifyHubToLocalMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, HubToLocalMessagePayload type) { + switch (type) { + case HubToLocalMessagePayload::NONE: { + return true; + } + case HubToLocalMessagePayload::ReadyMessage: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToLocalMessagePayload::ErrorMessage: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToLocalMessagePayload::WifiScanStatusMessage: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case HubToLocalMessagePayload::WifiNetworkEvent: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToLocalMessagePayload::WifiGotIpEvent: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToLocalMessagePayload::WifiLostIpEvent: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case HubToLocalMessagePayload::AccountLinkCommandResult: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case HubToLocalMessagePayload::SetRfTxPinCommandResult: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + default: return true; + } +} + +inline bool VerifyHubToLocalMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyHubToLocalMessagePayload( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const OpenShock::Serialization::Local::HubToLocalMessage *GetHubToLocalMessage(const void *buf) { + return ::flatbuffers::GetRoot(buf); +} + +inline const OpenShock::Serialization::Local::HubToLocalMessage *GetSizePrefixedHubToLocalMessage(const void *buf) { + return ::flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyHubToLocalMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedHubToLocalMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishHubToLocalMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedHubToLocalMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace Local +} // namespace Serialization +} // namespace OpenShock + +#endif // FLATBUFFERS_GENERATED_HUBTOLOCALMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ diff --git a/include/serialization/_fbs/LocalToDeviceMessage_generated.h b/include/serialization/_fbs/LocalToHubMessage_generated.h similarity index 70% rename from include/serialization/_fbs/LocalToDeviceMessage_generated.h rename to include/serialization/_fbs/LocalToHubMessage_generated.h index 26ef89b6..1589d8f1 100644 --- a/include/serialization/_fbs/LocalToDeviceMessage_generated.h +++ b/include/serialization/_fbs/LocalToHubMessage_generated.h @@ -1,1258 +1,1258 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_LOCALTODEVICEMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ -#define FLATBUFFERS_GENERATED_LOCALTODEVICEMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ - -#include "flatbuffers/flatbuffers.h" - -// Ensure the included flatbuffers.h is the same version as when this file was -// generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && - FLATBUFFERS_VERSION_MINOR == 3 && - FLATBUFFERS_VERSION_REVISION == 25, - "Non-compatible flatbuffers version included"); - -namespace OpenShock { -namespace Serialization { -namespace Local { - -struct WifiScanCommand; - -struct WifiNetworkSaveCommand; -struct WifiNetworkSaveCommandBuilder; - -struct WifiNetworkForgetCommand; -struct WifiNetworkForgetCommandBuilder; - -struct WifiNetworkConnectCommand; -struct WifiNetworkConnectCommandBuilder; - -struct WifiNetworkDisconnectCommand; - -struct OtaUpdateSetIsEnabledCommand; - -struct OtaUpdateSetDomainCommand; -struct OtaUpdateSetDomainCommandBuilder; - -struct OtaUpdateSetUpdateChannelCommand; -struct OtaUpdateSetUpdateChannelCommandBuilder; - -struct OtaUpdateSetCheckIntervalCommand; - -struct OtaUpdateSetAllowBackendManagementCommand; - -struct OtaUpdateSetRequireManualApprovalCommand; - -struct OtaUpdateHandleUpdateRequestCommand; - -struct OtaUpdateCheckForUpdatesCommand; -struct OtaUpdateCheckForUpdatesCommandBuilder; - -struct OtaUpdateStartUpdateCommand; -struct OtaUpdateStartUpdateCommandBuilder; - -struct AccountLinkCommand; -struct AccountLinkCommandBuilder; - -struct AccountUnlinkCommand; - -struct SetRfTxPinCommand; - -struct LocalToDeviceMessage; -struct LocalToDeviceMessageBuilder; - -enum class LocalToDeviceMessagePayload : uint8_t { - NONE = 0, - WifiScanCommand = 1, - WifiNetworkSaveCommand = 2, - WifiNetworkForgetCommand = 3, - WifiNetworkConnectCommand = 4, - WifiNetworkDisconnectCommand = 5, - OtaUpdateSetIsEnabledCommand = 6, - OtaUpdateSetDomainCommand = 7, - OtaUpdateSetUpdateChannelCommand = 8, - OtaUpdateSetCheckIntervalCommand = 9, - OtaUpdateSetAllowBackendManagementCommand = 10, - OtaUpdateSetRequireManualApprovalCommand = 11, - OtaUpdateHandleUpdateRequestCommand = 12, - OtaUpdateCheckForUpdatesCommand = 13, - OtaUpdateStartUpdateCommand = 14, - AccountLinkCommand = 15, - AccountUnlinkCommand = 16, - SetRfTxPinCommand = 17, - MIN = NONE, - MAX = SetRfTxPinCommand -}; - -inline const LocalToDeviceMessagePayload (&EnumValuesLocalToDeviceMessagePayload())[18] { - static const LocalToDeviceMessagePayload values[] = { - LocalToDeviceMessagePayload::NONE, - LocalToDeviceMessagePayload::WifiScanCommand, - LocalToDeviceMessagePayload::WifiNetworkSaveCommand, - LocalToDeviceMessagePayload::WifiNetworkForgetCommand, - LocalToDeviceMessagePayload::WifiNetworkConnectCommand, - LocalToDeviceMessagePayload::WifiNetworkDisconnectCommand, - LocalToDeviceMessagePayload::OtaUpdateSetIsEnabledCommand, - LocalToDeviceMessagePayload::OtaUpdateSetDomainCommand, - LocalToDeviceMessagePayload::OtaUpdateSetUpdateChannelCommand, - LocalToDeviceMessagePayload::OtaUpdateSetCheckIntervalCommand, - LocalToDeviceMessagePayload::OtaUpdateSetAllowBackendManagementCommand, - LocalToDeviceMessagePayload::OtaUpdateSetRequireManualApprovalCommand, - LocalToDeviceMessagePayload::OtaUpdateHandleUpdateRequestCommand, - LocalToDeviceMessagePayload::OtaUpdateCheckForUpdatesCommand, - LocalToDeviceMessagePayload::OtaUpdateStartUpdateCommand, - LocalToDeviceMessagePayload::AccountLinkCommand, - LocalToDeviceMessagePayload::AccountUnlinkCommand, - LocalToDeviceMessagePayload::SetRfTxPinCommand - }; - return values; -} - -inline const char * const *EnumNamesLocalToDeviceMessagePayload() { - static const char * const names[19] = { - "NONE", - "WifiScanCommand", - "WifiNetworkSaveCommand", - "WifiNetworkForgetCommand", - "WifiNetworkConnectCommand", - "WifiNetworkDisconnectCommand", - "OtaUpdateSetIsEnabledCommand", - "OtaUpdateSetDomainCommand", - "OtaUpdateSetUpdateChannelCommand", - "OtaUpdateSetCheckIntervalCommand", - "OtaUpdateSetAllowBackendManagementCommand", - "OtaUpdateSetRequireManualApprovalCommand", - "OtaUpdateHandleUpdateRequestCommand", - "OtaUpdateCheckForUpdatesCommand", - "OtaUpdateStartUpdateCommand", - "AccountLinkCommand", - "AccountUnlinkCommand", - "SetRfTxPinCommand", - nullptr - }; - return names; -} - -inline const char *EnumNameLocalToDeviceMessagePayload(LocalToDeviceMessagePayload e) { - if (::flatbuffers::IsOutRange(e, LocalToDeviceMessagePayload::NONE, LocalToDeviceMessagePayload::SetRfTxPinCommand)) return ""; - const size_t index = static_cast(e); - return EnumNamesLocalToDeviceMessagePayload()[index]; -} - -template struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::NONE; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::WifiScanCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::WifiNetworkSaveCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::WifiNetworkForgetCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::WifiNetworkConnectCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::WifiNetworkDisconnectCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateSetIsEnabledCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateSetDomainCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateSetUpdateChannelCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateSetCheckIntervalCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateSetAllowBackendManagementCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateSetRequireManualApprovalCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateHandleUpdateRequestCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateCheckForUpdatesCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::OtaUpdateStartUpdateCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::AccountLinkCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::AccountUnlinkCommand; -}; - -template<> struct LocalToDeviceMessagePayloadTraits { - static const LocalToDeviceMessagePayload enum_value = LocalToDeviceMessagePayload::SetRfTxPinCommand; -}; - -bool VerifyLocalToDeviceMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, LocalToDeviceMessagePayload type); -bool VerifyLocalToDeviceMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) WifiScanCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t run_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiScanCommand"; - } - WifiScanCommand() - : run_(0) { - } - WifiScanCommand(bool _run) - : run_(::flatbuffers::EndianScalar(static_cast(_run))) { - } - bool run() const { - return ::flatbuffers::EndianScalar(run_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(WifiScanCommand, 1); - -struct WifiScanCommand::Traits { - using type = WifiScanCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) WifiNetworkDisconnectCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t placeholder_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiNetworkDisconnectCommand"; - } - WifiNetworkDisconnectCommand() - : placeholder_(0) { - } - WifiNetworkDisconnectCommand(bool _placeholder) - : placeholder_(::flatbuffers::EndianScalar(static_cast(_placeholder))) { - } - bool placeholder() const { - return ::flatbuffers::EndianScalar(placeholder_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(WifiNetworkDisconnectCommand, 1); - -struct WifiNetworkDisconnectCommand::Traits { - using type = WifiNetworkDisconnectCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateSetIsEnabledCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t enabled_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateSetIsEnabledCommand"; - } - OtaUpdateSetIsEnabledCommand() - : enabled_(0) { - } - OtaUpdateSetIsEnabledCommand(bool _enabled) - : enabled_(::flatbuffers::EndianScalar(static_cast(_enabled))) { - } - bool enabled() const { - return ::flatbuffers::EndianScalar(enabled_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(OtaUpdateSetIsEnabledCommand, 1); - -struct OtaUpdateSetIsEnabledCommand::Traits { - using type = OtaUpdateSetIsEnabledCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) OtaUpdateSetCheckIntervalCommand FLATBUFFERS_FINAL_CLASS { - private: - uint16_t interval_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateSetCheckIntervalCommand"; - } - OtaUpdateSetCheckIntervalCommand() - : interval_(0) { - } - OtaUpdateSetCheckIntervalCommand(uint16_t _interval) - : interval_(::flatbuffers::EndianScalar(_interval)) { - } - uint16_t interval() const { - return ::flatbuffers::EndianScalar(interval_); - } -}; -FLATBUFFERS_STRUCT_END(OtaUpdateSetCheckIntervalCommand, 2); - -struct OtaUpdateSetCheckIntervalCommand::Traits { - using type = OtaUpdateSetCheckIntervalCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateSetAllowBackendManagementCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t allow_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateSetAllowBackendManagementCommand"; - } - OtaUpdateSetAllowBackendManagementCommand() - : allow_(0) { - } - OtaUpdateSetAllowBackendManagementCommand(bool _allow) - : allow_(::flatbuffers::EndianScalar(static_cast(_allow))) { - } - bool allow() const { - return ::flatbuffers::EndianScalar(allow_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(OtaUpdateSetAllowBackendManagementCommand, 1); - -struct OtaUpdateSetAllowBackendManagementCommand::Traits { - using type = OtaUpdateSetAllowBackendManagementCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateSetRequireManualApprovalCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t require_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateSetRequireManualApprovalCommand"; - } - OtaUpdateSetRequireManualApprovalCommand() - : require_(0) { - } - OtaUpdateSetRequireManualApprovalCommand(bool _require) - : require_(::flatbuffers::EndianScalar(static_cast(_require))) { - } - bool require() const { - return ::flatbuffers::EndianScalar(require_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(OtaUpdateSetRequireManualApprovalCommand, 1); - -struct OtaUpdateSetRequireManualApprovalCommand::Traits { - using type = OtaUpdateSetRequireManualApprovalCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateHandleUpdateRequestCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t accept_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateHandleUpdateRequestCommand"; - } - OtaUpdateHandleUpdateRequestCommand() - : accept_(0) { - } - OtaUpdateHandleUpdateRequestCommand(bool _accept) - : accept_(::flatbuffers::EndianScalar(static_cast(_accept))) { - } - bool accept() const { - return ::flatbuffers::EndianScalar(accept_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(OtaUpdateHandleUpdateRequestCommand, 1); - -struct OtaUpdateHandleUpdateRequestCommand::Traits { - using type = OtaUpdateHandleUpdateRequestCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) AccountUnlinkCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t placeholder_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.AccountUnlinkCommand"; - } - AccountUnlinkCommand() - : placeholder_(0) { - } - AccountUnlinkCommand(bool _placeholder) - : placeholder_(::flatbuffers::EndianScalar(static_cast(_placeholder))) { - } - bool placeholder() const { - return ::flatbuffers::EndianScalar(placeholder_) != 0; - } -}; -FLATBUFFERS_STRUCT_END(AccountUnlinkCommand, 1); - -struct AccountUnlinkCommand::Traits { - using type = AccountUnlinkCommand; -}; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) SetRfTxPinCommand FLATBUFFERS_FINAL_CLASS { - private: - uint8_t pin_; - - public: - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.SetRfTxPinCommand"; - } - SetRfTxPinCommand() - : pin_(0) { - } - SetRfTxPinCommand(uint8_t _pin) - : pin_(::flatbuffers::EndianScalar(_pin)) { - } - uint8_t pin() const { - return ::flatbuffers::EndianScalar(pin_); - } -}; -FLATBUFFERS_STRUCT_END(SetRfTxPinCommand, 1); - -struct SetRfTxPinCommand::Traits { - using type = SetRfTxPinCommand; -}; - -struct WifiNetworkSaveCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WifiNetworkSaveCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiNetworkSaveCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SSID = 4, - VT_PASSWORD = 6, - VT_CONNECT = 8 - }; - const ::flatbuffers::String *ssid() const { - return GetPointer(VT_SSID); - } - const ::flatbuffers::String *password() const { - return GetPointer(VT_PASSWORD); - } - bool connect() const { - return GetField(VT_CONNECT, 0) != 0; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_SSID) && - verifier.VerifyString(ssid()) && - VerifyOffset(verifier, VT_PASSWORD) && - verifier.VerifyString(password()) && - VerifyField(verifier, VT_CONNECT, 1) && - verifier.EndTable(); - } -}; - -struct WifiNetworkSaveCommandBuilder { - typedef WifiNetworkSaveCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { - fbb_.AddOffset(WifiNetworkSaveCommand::VT_SSID, ssid); - } - void add_password(::flatbuffers::Offset<::flatbuffers::String> password) { - fbb_.AddOffset(WifiNetworkSaveCommand::VT_PASSWORD, password); - } - void add_connect(bool connect) { - fbb_.AddElement(WifiNetworkSaveCommand::VT_CONNECT, static_cast(connect), 0); - } - explicit WifiNetworkSaveCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWifiNetworkSaveCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> ssid = 0, - ::flatbuffers::Offset<::flatbuffers::String> password = 0, - bool connect = false) { - WifiNetworkSaveCommandBuilder builder_(_fbb); - builder_.add_password(password); - builder_.add_ssid(ssid); - builder_.add_connect(connect); - return builder_.Finish(); -} - -struct WifiNetworkSaveCommand::Traits { - using type = WifiNetworkSaveCommand; - static auto constexpr Create = CreateWifiNetworkSaveCommand; -}; - -inline ::flatbuffers::Offset CreateWifiNetworkSaveCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *ssid = nullptr, - const char *password = nullptr, - bool connect = false) { - auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; - auto password__ = password ? _fbb.CreateString(password) : 0; - return OpenShock::Serialization::Local::CreateWifiNetworkSaveCommand( - _fbb, - ssid__, - password__, - connect); -} - -struct WifiNetworkForgetCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WifiNetworkForgetCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiNetworkForgetCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SSID = 4 - }; - const ::flatbuffers::String *ssid() const { - return GetPointer(VT_SSID); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_SSID) && - verifier.VerifyString(ssid()) && - verifier.EndTable(); - } -}; - -struct WifiNetworkForgetCommandBuilder { - typedef WifiNetworkForgetCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { - fbb_.AddOffset(WifiNetworkForgetCommand::VT_SSID, ssid); - } - explicit WifiNetworkForgetCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWifiNetworkForgetCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> ssid = 0) { - WifiNetworkForgetCommandBuilder builder_(_fbb); - builder_.add_ssid(ssid); - return builder_.Finish(); -} - -struct WifiNetworkForgetCommand::Traits { - using type = WifiNetworkForgetCommand; - static auto constexpr Create = CreateWifiNetworkForgetCommand; -}; - -inline ::flatbuffers::Offset CreateWifiNetworkForgetCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *ssid = nullptr) { - auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; - return OpenShock::Serialization::Local::CreateWifiNetworkForgetCommand( - _fbb, - ssid__); -} - -struct WifiNetworkConnectCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef WifiNetworkConnectCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.WifiNetworkConnectCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SSID = 4 - }; - const ::flatbuffers::String *ssid() const { - return GetPointer(VT_SSID); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_SSID) && - verifier.VerifyString(ssid()) && - verifier.EndTable(); - } -}; - -struct WifiNetworkConnectCommandBuilder { - typedef WifiNetworkConnectCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { - fbb_.AddOffset(WifiNetworkConnectCommand::VT_SSID, ssid); - } - explicit WifiNetworkConnectCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateWifiNetworkConnectCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> ssid = 0) { - WifiNetworkConnectCommandBuilder builder_(_fbb); - builder_.add_ssid(ssid); - return builder_.Finish(); -} - -struct WifiNetworkConnectCommand::Traits { - using type = WifiNetworkConnectCommand; - static auto constexpr Create = CreateWifiNetworkConnectCommand; -}; - -inline ::flatbuffers::Offset CreateWifiNetworkConnectCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *ssid = nullptr) { - auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; - return OpenShock::Serialization::Local::CreateWifiNetworkConnectCommand( - _fbb, - ssid__); -} - -struct OtaUpdateSetDomainCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaUpdateSetDomainCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateSetDomainCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_DOMAIN = 4 - }; - const ::flatbuffers::String *domain() const { - return GetPointer(VT_DOMAIN); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_DOMAIN) && - verifier.VerifyString(domain()) && - verifier.EndTable(); - } -}; - -struct OtaUpdateSetDomainCommandBuilder { - typedef OtaUpdateSetDomainCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_domain(::flatbuffers::Offset<::flatbuffers::String> domain) { - fbb_.AddOffset(OtaUpdateSetDomainCommand::VT_DOMAIN, domain); - } - explicit OtaUpdateSetDomainCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaUpdateSetDomainCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> domain = 0) { - OtaUpdateSetDomainCommandBuilder builder_(_fbb); - builder_.add_domain(domain); - return builder_.Finish(); -} - -struct OtaUpdateSetDomainCommand::Traits { - using type = OtaUpdateSetDomainCommand; - static auto constexpr Create = CreateOtaUpdateSetDomainCommand; -}; - -inline ::flatbuffers::Offset CreateOtaUpdateSetDomainCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *domain = nullptr) { - auto domain__ = domain ? _fbb.CreateString(domain) : 0; - return OpenShock::Serialization::Local::CreateOtaUpdateSetDomainCommand( - _fbb, - domain__); -} - -struct OtaUpdateSetUpdateChannelCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaUpdateSetUpdateChannelCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateSetUpdateChannelCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_CHANNEL = 4 - }; - const ::flatbuffers::String *channel() const { - return GetPointer(VT_CHANNEL); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_CHANNEL) && - verifier.VerifyString(channel()) && - verifier.EndTable(); - } -}; - -struct OtaUpdateSetUpdateChannelCommandBuilder { - typedef OtaUpdateSetUpdateChannelCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_channel(::flatbuffers::Offset<::flatbuffers::String> channel) { - fbb_.AddOffset(OtaUpdateSetUpdateChannelCommand::VT_CHANNEL, channel); - } - explicit OtaUpdateSetUpdateChannelCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaUpdateSetUpdateChannelCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> channel = 0) { - OtaUpdateSetUpdateChannelCommandBuilder builder_(_fbb); - builder_.add_channel(channel); - return builder_.Finish(); -} - -struct OtaUpdateSetUpdateChannelCommand::Traits { - using type = OtaUpdateSetUpdateChannelCommand; - static auto constexpr Create = CreateOtaUpdateSetUpdateChannelCommand; -}; - -inline ::flatbuffers::Offset CreateOtaUpdateSetUpdateChannelCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *channel = nullptr) { - auto channel__ = channel ? _fbb.CreateString(channel) : 0; - return OpenShock::Serialization::Local::CreateOtaUpdateSetUpdateChannelCommand( - _fbb, - channel__); -} - -struct OtaUpdateCheckForUpdatesCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaUpdateCheckForUpdatesCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateCheckForUpdatesCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_CHANNEL = 4 - }; - const ::flatbuffers::String *channel() const { - return GetPointer(VT_CHANNEL); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_CHANNEL) && - verifier.VerifyString(channel()) && - verifier.EndTable(); - } -}; - -struct OtaUpdateCheckForUpdatesCommandBuilder { - typedef OtaUpdateCheckForUpdatesCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_channel(::flatbuffers::Offset<::flatbuffers::String> channel) { - fbb_.AddOffset(OtaUpdateCheckForUpdatesCommand::VT_CHANNEL, channel); - } - explicit OtaUpdateCheckForUpdatesCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaUpdateCheckForUpdatesCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> channel = 0) { - OtaUpdateCheckForUpdatesCommandBuilder builder_(_fbb); - builder_.add_channel(channel); - return builder_.Finish(); -} - -struct OtaUpdateCheckForUpdatesCommand::Traits { - using type = OtaUpdateCheckForUpdatesCommand; - static auto constexpr Create = CreateOtaUpdateCheckForUpdatesCommand; -}; - -inline ::flatbuffers::Offset CreateOtaUpdateCheckForUpdatesCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *channel = nullptr) { - auto channel__ = channel ? _fbb.CreateString(channel) : 0; - return OpenShock::Serialization::Local::CreateOtaUpdateCheckForUpdatesCommand( - _fbb, - channel__); -} - -struct OtaUpdateStartUpdateCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef OtaUpdateStartUpdateCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.OtaUpdateStartUpdateCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_CHANNEL = 4, - VT_VERSION = 6 - }; - const ::flatbuffers::String *channel() const { - return GetPointer(VT_CHANNEL); - } - const ::flatbuffers::String *version() const { - return GetPointer(VT_VERSION); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_CHANNEL) && - verifier.VerifyString(channel()) && - VerifyOffset(verifier, VT_VERSION) && - verifier.VerifyString(version()) && - verifier.EndTable(); - } -}; - -struct OtaUpdateStartUpdateCommandBuilder { - typedef OtaUpdateStartUpdateCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_channel(::flatbuffers::Offset<::flatbuffers::String> channel) { - fbb_.AddOffset(OtaUpdateStartUpdateCommand::VT_CHANNEL, channel); - } - void add_version(::flatbuffers::Offset<::flatbuffers::String> version) { - fbb_.AddOffset(OtaUpdateStartUpdateCommand::VT_VERSION, version); - } - explicit OtaUpdateStartUpdateCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateOtaUpdateStartUpdateCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> channel = 0, - ::flatbuffers::Offset<::flatbuffers::String> version = 0) { - OtaUpdateStartUpdateCommandBuilder builder_(_fbb); - builder_.add_version(version); - builder_.add_channel(channel); - return builder_.Finish(); -} - -struct OtaUpdateStartUpdateCommand::Traits { - using type = OtaUpdateStartUpdateCommand; - static auto constexpr Create = CreateOtaUpdateStartUpdateCommand; -}; - -inline ::flatbuffers::Offset CreateOtaUpdateStartUpdateCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *channel = nullptr, - const char *version = nullptr) { - auto channel__ = channel ? _fbb.CreateString(channel) : 0; - auto version__ = version ? _fbb.CreateString(version) : 0; - return OpenShock::Serialization::Local::CreateOtaUpdateStartUpdateCommand( - _fbb, - channel__, - version__); -} - -struct AccountLinkCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef AccountLinkCommandBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.AccountLinkCommand"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_CODE = 4 - }; - const ::flatbuffers::String *code() const { - return GetPointer(VT_CODE); - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_CODE) && - verifier.VerifyString(code()) && - verifier.EndTable(); - } -}; - -struct AccountLinkCommandBuilder { - typedef AccountLinkCommand Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_code(::flatbuffers::Offset<::flatbuffers::String> code) { - fbb_.AddOffset(AccountLinkCommand::VT_CODE, code); - } - explicit AccountLinkCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateAccountLinkCommand( - ::flatbuffers::FlatBufferBuilder &_fbb, - ::flatbuffers::Offset<::flatbuffers::String> code = 0) { - AccountLinkCommandBuilder builder_(_fbb); - builder_.add_code(code); - return builder_.Finish(); -} - -struct AccountLinkCommand::Traits { - using type = AccountLinkCommand; - static auto constexpr Create = CreateAccountLinkCommand; -}; - -inline ::flatbuffers::Offset CreateAccountLinkCommandDirect( - ::flatbuffers::FlatBufferBuilder &_fbb, - const char *code = nullptr) { - auto code__ = code ? _fbb.CreateString(code) : 0; - return OpenShock::Serialization::Local::CreateAccountLinkCommand( - _fbb, - code__); -} - -struct LocalToDeviceMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { - typedef LocalToDeviceMessageBuilder Builder; - struct Traits; - static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { - return "OpenShock.Serialization.Local.LocalToDeviceMessage"; - } - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_PAYLOAD_TYPE = 4, - VT_PAYLOAD = 6 - }; - OpenShock::Serialization::Local::LocalToDeviceMessagePayload payload_type() const { - return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); - } - const void *payload() const { - return GetPointer(VT_PAYLOAD); - } - template const T *payload_as() const; - const OpenShock::Serialization::Local::WifiScanCommand *payload_as_WifiScanCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::WifiScanCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiNetworkSaveCommand *payload_as_WifiNetworkSaveCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::WifiNetworkSaveCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiNetworkForgetCommand *payload_as_WifiNetworkForgetCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::WifiNetworkForgetCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiNetworkConnectCommand *payload_as_WifiNetworkConnectCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::WifiNetworkConnectCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::WifiNetworkDisconnectCommand *payload_as_WifiNetworkDisconnectCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::WifiNetworkDisconnectCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateSetIsEnabledCommand *payload_as_OtaUpdateSetIsEnabledCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateSetIsEnabledCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateSetDomainCommand *payload_as_OtaUpdateSetDomainCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateSetDomainCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateSetUpdateChannelCommand *payload_as_OtaUpdateSetUpdateChannelCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateSetUpdateChannelCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateSetCheckIntervalCommand *payload_as_OtaUpdateSetCheckIntervalCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateSetCheckIntervalCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateSetAllowBackendManagementCommand *payload_as_OtaUpdateSetAllowBackendManagementCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateSetAllowBackendManagementCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateSetRequireManualApprovalCommand *payload_as_OtaUpdateSetRequireManualApprovalCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateSetRequireManualApprovalCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateHandleUpdateRequestCommand *payload_as_OtaUpdateHandleUpdateRequestCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateHandleUpdateRequestCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateCheckForUpdatesCommand *payload_as_OtaUpdateCheckForUpdatesCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateCheckForUpdatesCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::OtaUpdateStartUpdateCommand *payload_as_OtaUpdateStartUpdateCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::OtaUpdateStartUpdateCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::AccountLinkCommand *payload_as_AccountLinkCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::AccountLinkCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::AccountUnlinkCommand *payload_as_AccountUnlinkCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::AccountUnlinkCommand ? static_cast(payload()) : nullptr; - } - const OpenShock::Serialization::Local::SetRfTxPinCommand *payload_as_SetRfTxPinCommand() const { - return payload_type() == OpenShock::Serialization::Local::LocalToDeviceMessagePayload::SetRfTxPinCommand ? static_cast(payload()) : nullptr; - } - bool Verify(::flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && - VerifyOffset(verifier, VT_PAYLOAD) && - VerifyLocalToDeviceMessagePayload(verifier, payload(), payload_type()) && - verifier.EndTable(); - } -}; - -template<> inline const OpenShock::Serialization::Local::WifiScanCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_WifiScanCommand(); -} - -template<> inline const OpenShock::Serialization::Local::WifiNetworkSaveCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_WifiNetworkSaveCommand(); -} - -template<> inline const OpenShock::Serialization::Local::WifiNetworkForgetCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_WifiNetworkForgetCommand(); -} - -template<> inline const OpenShock::Serialization::Local::WifiNetworkConnectCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_WifiNetworkConnectCommand(); -} - -template<> inline const OpenShock::Serialization::Local::WifiNetworkDisconnectCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_WifiNetworkDisconnectCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateSetIsEnabledCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateSetIsEnabledCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateSetDomainCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateSetDomainCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateSetUpdateChannelCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateSetUpdateChannelCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateSetCheckIntervalCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateSetCheckIntervalCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateSetAllowBackendManagementCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateSetAllowBackendManagementCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateSetRequireManualApprovalCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateSetRequireManualApprovalCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateHandleUpdateRequestCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateHandleUpdateRequestCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateCheckForUpdatesCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateCheckForUpdatesCommand(); -} - -template<> inline const OpenShock::Serialization::Local::OtaUpdateStartUpdateCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_OtaUpdateStartUpdateCommand(); -} - -template<> inline const OpenShock::Serialization::Local::AccountLinkCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_AccountLinkCommand(); -} - -template<> inline const OpenShock::Serialization::Local::AccountUnlinkCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_AccountUnlinkCommand(); -} - -template<> inline const OpenShock::Serialization::Local::SetRfTxPinCommand *LocalToDeviceMessage::payload_as() const { - return payload_as_SetRfTxPinCommand(); -} - -struct LocalToDeviceMessageBuilder { - typedef LocalToDeviceMessage Table; - ::flatbuffers::FlatBufferBuilder &fbb_; - ::flatbuffers::uoffset_t start_; - void add_payload_type(OpenShock::Serialization::Local::LocalToDeviceMessagePayload payload_type) { - fbb_.AddElement(LocalToDeviceMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); - } - void add_payload(::flatbuffers::Offset payload) { - fbb_.AddOffset(LocalToDeviceMessage::VT_PAYLOAD, payload); - } - explicit LocalToDeviceMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ::flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = ::flatbuffers::Offset(end); - return o; - } -}; - -inline ::flatbuffers::Offset CreateLocalToDeviceMessage( - ::flatbuffers::FlatBufferBuilder &_fbb, - OpenShock::Serialization::Local::LocalToDeviceMessagePayload payload_type = OpenShock::Serialization::Local::LocalToDeviceMessagePayload::NONE, - ::flatbuffers::Offset payload = 0) { - LocalToDeviceMessageBuilder builder_(_fbb); - builder_.add_payload(payload); - builder_.add_payload_type(payload_type); - return builder_.Finish(); -} - -struct LocalToDeviceMessage::Traits { - using type = LocalToDeviceMessage; - static auto constexpr Create = CreateLocalToDeviceMessage; -}; - -inline bool VerifyLocalToDeviceMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, LocalToDeviceMessagePayload type) { - switch (type) { - case LocalToDeviceMessagePayload::NONE: { - return true; - } - case LocalToDeviceMessagePayload::WifiScanCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case LocalToDeviceMessagePayload::WifiNetworkSaveCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::WifiNetworkForgetCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::WifiNetworkConnectCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::WifiNetworkDisconnectCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case LocalToDeviceMessagePayload::OtaUpdateSetIsEnabledCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case LocalToDeviceMessagePayload::OtaUpdateSetDomainCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::OtaUpdateSetUpdateChannelCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::OtaUpdateSetCheckIntervalCommand: { - return verifier.VerifyField(static_cast(obj), 0, 2); - } - case LocalToDeviceMessagePayload::OtaUpdateSetAllowBackendManagementCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case LocalToDeviceMessagePayload::OtaUpdateSetRequireManualApprovalCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case LocalToDeviceMessagePayload::OtaUpdateHandleUpdateRequestCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case LocalToDeviceMessagePayload::OtaUpdateCheckForUpdatesCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::OtaUpdateStartUpdateCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::AccountLinkCommand: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LocalToDeviceMessagePayload::AccountUnlinkCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - case LocalToDeviceMessagePayload::SetRfTxPinCommand: { - return verifier.VerifyField(static_cast(obj), 0, 1); - } - default: return true; - } -} - -inline bool VerifyLocalToDeviceMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyLocalToDeviceMessagePayload( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const OpenShock::Serialization::Local::LocalToDeviceMessage *GetLocalToDeviceMessage(const void *buf) { - return ::flatbuffers::GetRoot(buf); -} - -inline const OpenShock::Serialization::Local::LocalToDeviceMessage *GetSizePrefixedLocalToDeviceMessage(const void *buf) { - return ::flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyLocalToDeviceMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedLocalToDeviceMessageBuffer( - ::flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishLocalToDeviceMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedLocalToDeviceMessageBuffer( - ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace Local -} // namespace Serialization -} // namespace OpenShock - -#endif // FLATBUFFERS_GENERATED_LOCALTODEVICEMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_LOCALTOHUBMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ +#define FLATBUFFERS_GENERATED_LOCALTOHUBMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, + "Non-compatible flatbuffers version included"); + +namespace OpenShock { +namespace Serialization { +namespace Local { + +struct WifiScanCommand; + +struct WifiNetworkSaveCommand; +struct WifiNetworkSaveCommandBuilder; + +struct WifiNetworkForgetCommand; +struct WifiNetworkForgetCommandBuilder; + +struct WifiNetworkConnectCommand; +struct WifiNetworkConnectCommandBuilder; + +struct WifiNetworkDisconnectCommand; + +struct OtaUpdateSetIsEnabledCommand; + +struct OtaUpdateSetDomainCommand; +struct OtaUpdateSetDomainCommandBuilder; + +struct OtaUpdateSetUpdateChannelCommand; +struct OtaUpdateSetUpdateChannelCommandBuilder; + +struct OtaUpdateSetCheckIntervalCommand; + +struct OtaUpdateSetAllowBackendManagementCommand; + +struct OtaUpdateSetRequireManualApprovalCommand; + +struct OtaUpdateHandleUpdateRequestCommand; + +struct OtaUpdateCheckForUpdatesCommand; +struct OtaUpdateCheckForUpdatesCommandBuilder; + +struct OtaUpdateStartUpdateCommand; +struct OtaUpdateStartUpdateCommandBuilder; + +struct AccountLinkCommand; +struct AccountLinkCommandBuilder; + +struct AccountUnlinkCommand; + +struct SetRfTxPinCommand; + +struct LocalToHubMessage; +struct LocalToHubMessageBuilder; + +enum class LocalToHubMessagePayload : uint8_t { + NONE = 0, + WifiScanCommand = 1, + WifiNetworkSaveCommand = 2, + WifiNetworkForgetCommand = 3, + WifiNetworkConnectCommand = 4, + WifiNetworkDisconnectCommand = 5, + OtaUpdateSetIsEnabledCommand = 6, + OtaUpdateSetDomainCommand = 7, + OtaUpdateSetUpdateChannelCommand = 8, + OtaUpdateSetCheckIntervalCommand = 9, + OtaUpdateSetAllowBackendManagementCommand = 10, + OtaUpdateSetRequireManualApprovalCommand = 11, + OtaUpdateHandleUpdateRequestCommand = 12, + OtaUpdateCheckForUpdatesCommand = 13, + OtaUpdateStartUpdateCommand = 14, + AccountLinkCommand = 15, + AccountUnlinkCommand = 16, + SetRfTxPinCommand = 17, + MIN = NONE, + MAX = SetRfTxPinCommand +}; + +inline const LocalToHubMessagePayload (&EnumValuesLocalToHubMessagePayload())[18] { + static const LocalToHubMessagePayload values[] = { + LocalToHubMessagePayload::NONE, + LocalToHubMessagePayload::WifiScanCommand, + LocalToHubMessagePayload::WifiNetworkSaveCommand, + LocalToHubMessagePayload::WifiNetworkForgetCommand, + LocalToHubMessagePayload::WifiNetworkConnectCommand, + LocalToHubMessagePayload::WifiNetworkDisconnectCommand, + LocalToHubMessagePayload::OtaUpdateSetIsEnabledCommand, + LocalToHubMessagePayload::OtaUpdateSetDomainCommand, + LocalToHubMessagePayload::OtaUpdateSetUpdateChannelCommand, + LocalToHubMessagePayload::OtaUpdateSetCheckIntervalCommand, + LocalToHubMessagePayload::OtaUpdateSetAllowBackendManagementCommand, + LocalToHubMessagePayload::OtaUpdateSetRequireManualApprovalCommand, + LocalToHubMessagePayload::OtaUpdateHandleUpdateRequestCommand, + LocalToHubMessagePayload::OtaUpdateCheckForUpdatesCommand, + LocalToHubMessagePayload::OtaUpdateStartUpdateCommand, + LocalToHubMessagePayload::AccountLinkCommand, + LocalToHubMessagePayload::AccountUnlinkCommand, + LocalToHubMessagePayload::SetRfTxPinCommand + }; + return values; +} + +inline const char * const *EnumNamesLocalToHubMessagePayload() { + static const char * const names[19] = { + "NONE", + "WifiScanCommand", + "WifiNetworkSaveCommand", + "WifiNetworkForgetCommand", + "WifiNetworkConnectCommand", + "WifiNetworkDisconnectCommand", + "OtaUpdateSetIsEnabledCommand", + "OtaUpdateSetDomainCommand", + "OtaUpdateSetUpdateChannelCommand", + "OtaUpdateSetCheckIntervalCommand", + "OtaUpdateSetAllowBackendManagementCommand", + "OtaUpdateSetRequireManualApprovalCommand", + "OtaUpdateHandleUpdateRequestCommand", + "OtaUpdateCheckForUpdatesCommand", + "OtaUpdateStartUpdateCommand", + "AccountLinkCommand", + "AccountUnlinkCommand", + "SetRfTxPinCommand", + nullptr + }; + return names; +} + +inline const char *EnumNameLocalToHubMessagePayload(LocalToHubMessagePayload e) { + if (::flatbuffers::IsOutRange(e, LocalToHubMessagePayload::NONE, LocalToHubMessagePayload::SetRfTxPinCommand)) return ""; + const size_t index = static_cast(e); + return EnumNamesLocalToHubMessagePayload()[index]; +} + +template struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::NONE; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::WifiScanCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::WifiNetworkSaveCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::WifiNetworkForgetCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::WifiNetworkConnectCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::WifiNetworkDisconnectCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateSetIsEnabledCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateSetDomainCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateSetUpdateChannelCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateSetCheckIntervalCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateSetAllowBackendManagementCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateSetRequireManualApprovalCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateHandleUpdateRequestCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateCheckForUpdatesCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::OtaUpdateStartUpdateCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::AccountLinkCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::AccountUnlinkCommand; +}; + +template<> struct LocalToHubMessagePayloadTraits { + static const LocalToHubMessagePayload enum_value = LocalToHubMessagePayload::SetRfTxPinCommand; +}; + +bool VerifyLocalToHubMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, LocalToHubMessagePayload type); +bool VerifyLocalToHubMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) WifiScanCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t run_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiScanCommand"; + } + WifiScanCommand() + : run_(0) { + } + WifiScanCommand(bool _run) + : run_(::flatbuffers::EndianScalar(static_cast(_run))) { + } + bool run() const { + return ::flatbuffers::EndianScalar(run_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(WifiScanCommand, 1); + +struct WifiScanCommand::Traits { + using type = WifiScanCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) WifiNetworkDisconnectCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t placeholder_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiNetworkDisconnectCommand"; + } + WifiNetworkDisconnectCommand() + : placeholder_(0) { + } + WifiNetworkDisconnectCommand(bool _placeholder) + : placeholder_(::flatbuffers::EndianScalar(static_cast(_placeholder))) { + } + bool placeholder() const { + return ::flatbuffers::EndianScalar(placeholder_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(WifiNetworkDisconnectCommand, 1); + +struct WifiNetworkDisconnectCommand::Traits { + using type = WifiNetworkDisconnectCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateSetIsEnabledCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t enabled_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateSetIsEnabledCommand"; + } + OtaUpdateSetIsEnabledCommand() + : enabled_(0) { + } + OtaUpdateSetIsEnabledCommand(bool _enabled) + : enabled_(::flatbuffers::EndianScalar(static_cast(_enabled))) { + } + bool enabled() const { + return ::flatbuffers::EndianScalar(enabled_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(OtaUpdateSetIsEnabledCommand, 1); + +struct OtaUpdateSetIsEnabledCommand::Traits { + using type = OtaUpdateSetIsEnabledCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) OtaUpdateSetCheckIntervalCommand FLATBUFFERS_FINAL_CLASS { + private: + uint16_t interval_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateSetCheckIntervalCommand"; + } + OtaUpdateSetCheckIntervalCommand() + : interval_(0) { + } + OtaUpdateSetCheckIntervalCommand(uint16_t _interval) + : interval_(::flatbuffers::EndianScalar(_interval)) { + } + uint16_t interval() const { + return ::flatbuffers::EndianScalar(interval_); + } +}; +FLATBUFFERS_STRUCT_END(OtaUpdateSetCheckIntervalCommand, 2); + +struct OtaUpdateSetCheckIntervalCommand::Traits { + using type = OtaUpdateSetCheckIntervalCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateSetAllowBackendManagementCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t allow_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateSetAllowBackendManagementCommand"; + } + OtaUpdateSetAllowBackendManagementCommand() + : allow_(0) { + } + OtaUpdateSetAllowBackendManagementCommand(bool _allow) + : allow_(::flatbuffers::EndianScalar(static_cast(_allow))) { + } + bool allow() const { + return ::flatbuffers::EndianScalar(allow_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(OtaUpdateSetAllowBackendManagementCommand, 1); + +struct OtaUpdateSetAllowBackendManagementCommand::Traits { + using type = OtaUpdateSetAllowBackendManagementCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateSetRequireManualApprovalCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t require_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateSetRequireManualApprovalCommand"; + } + OtaUpdateSetRequireManualApprovalCommand() + : require_(0) { + } + OtaUpdateSetRequireManualApprovalCommand(bool _require) + : require_(::flatbuffers::EndianScalar(static_cast(_require))) { + } + bool require() const { + return ::flatbuffers::EndianScalar(require_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(OtaUpdateSetRequireManualApprovalCommand, 1); + +struct OtaUpdateSetRequireManualApprovalCommand::Traits { + using type = OtaUpdateSetRequireManualApprovalCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) OtaUpdateHandleUpdateRequestCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t accept_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateHandleUpdateRequestCommand"; + } + OtaUpdateHandleUpdateRequestCommand() + : accept_(0) { + } + OtaUpdateHandleUpdateRequestCommand(bool _accept) + : accept_(::flatbuffers::EndianScalar(static_cast(_accept))) { + } + bool accept() const { + return ::flatbuffers::EndianScalar(accept_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(OtaUpdateHandleUpdateRequestCommand, 1); + +struct OtaUpdateHandleUpdateRequestCommand::Traits { + using type = OtaUpdateHandleUpdateRequestCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) AccountUnlinkCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t placeholder_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.AccountUnlinkCommand"; + } + AccountUnlinkCommand() + : placeholder_(0) { + } + AccountUnlinkCommand(bool _placeholder) + : placeholder_(::flatbuffers::EndianScalar(static_cast(_placeholder))) { + } + bool placeholder() const { + return ::flatbuffers::EndianScalar(placeholder_) != 0; + } +}; +FLATBUFFERS_STRUCT_END(AccountUnlinkCommand, 1); + +struct AccountUnlinkCommand::Traits { + using type = AccountUnlinkCommand; +}; + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) SetRfTxPinCommand FLATBUFFERS_FINAL_CLASS { + private: + uint8_t pin_; + + public: + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.SetRfTxPinCommand"; + } + SetRfTxPinCommand() + : pin_(0) { + } + SetRfTxPinCommand(uint8_t _pin) + : pin_(::flatbuffers::EndianScalar(_pin)) { + } + uint8_t pin() const { + return ::flatbuffers::EndianScalar(pin_); + } +}; +FLATBUFFERS_STRUCT_END(SetRfTxPinCommand, 1); + +struct SetRfTxPinCommand::Traits { + using type = SetRfTxPinCommand; +}; + +struct WifiNetworkSaveCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WifiNetworkSaveCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiNetworkSaveCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SSID = 4, + VT_PASSWORD = 6, + VT_CONNECT = 8 + }; + const ::flatbuffers::String *ssid() const { + return GetPointer(VT_SSID); + } + const ::flatbuffers::String *password() const { + return GetPointer(VT_PASSWORD); + } + bool connect() const { + return GetField(VT_CONNECT, 0) != 0; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_SSID) && + verifier.VerifyString(ssid()) && + VerifyOffset(verifier, VT_PASSWORD) && + verifier.VerifyString(password()) && + VerifyField(verifier, VT_CONNECT, 1) && + verifier.EndTable(); + } +}; + +struct WifiNetworkSaveCommandBuilder { + typedef WifiNetworkSaveCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { + fbb_.AddOffset(WifiNetworkSaveCommand::VT_SSID, ssid); + } + void add_password(::flatbuffers::Offset<::flatbuffers::String> password) { + fbb_.AddOffset(WifiNetworkSaveCommand::VT_PASSWORD, password); + } + void add_connect(bool connect) { + fbb_.AddElement(WifiNetworkSaveCommand::VT_CONNECT, static_cast(connect), 0); + } + explicit WifiNetworkSaveCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWifiNetworkSaveCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> ssid = 0, + ::flatbuffers::Offset<::flatbuffers::String> password = 0, + bool connect = false) { + WifiNetworkSaveCommandBuilder builder_(_fbb); + builder_.add_password(password); + builder_.add_ssid(ssid); + builder_.add_connect(connect); + return builder_.Finish(); +} + +struct WifiNetworkSaveCommand::Traits { + using type = WifiNetworkSaveCommand; + static auto constexpr Create = CreateWifiNetworkSaveCommand; +}; + +inline ::flatbuffers::Offset CreateWifiNetworkSaveCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *ssid = nullptr, + const char *password = nullptr, + bool connect = false) { + auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; + auto password__ = password ? _fbb.CreateString(password) : 0; + return OpenShock::Serialization::Local::CreateWifiNetworkSaveCommand( + _fbb, + ssid__, + password__, + connect); +} + +struct WifiNetworkForgetCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WifiNetworkForgetCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiNetworkForgetCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SSID = 4 + }; + const ::flatbuffers::String *ssid() const { + return GetPointer(VT_SSID); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_SSID) && + verifier.VerifyString(ssid()) && + verifier.EndTable(); + } +}; + +struct WifiNetworkForgetCommandBuilder { + typedef WifiNetworkForgetCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { + fbb_.AddOffset(WifiNetworkForgetCommand::VT_SSID, ssid); + } + explicit WifiNetworkForgetCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWifiNetworkForgetCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> ssid = 0) { + WifiNetworkForgetCommandBuilder builder_(_fbb); + builder_.add_ssid(ssid); + return builder_.Finish(); +} + +struct WifiNetworkForgetCommand::Traits { + using type = WifiNetworkForgetCommand; + static auto constexpr Create = CreateWifiNetworkForgetCommand; +}; + +inline ::flatbuffers::Offset CreateWifiNetworkForgetCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *ssid = nullptr) { + auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; + return OpenShock::Serialization::Local::CreateWifiNetworkForgetCommand( + _fbb, + ssid__); +} + +struct WifiNetworkConnectCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef WifiNetworkConnectCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.WifiNetworkConnectCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SSID = 4 + }; + const ::flatbuffers::String *ssid() const { + return GetPointer(VT_SSID); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_SSID) && + verifier.VerifyString(ssid()) && + verifier.EndTable(); + } +}; + +struct WifiNetworkConnectCommandBuilder { + typedef WifiNetworkConnectCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_ssid(::flatbuffers::Offset<::flatbuffers::String> ssid) { + fbb_.AddOffset(WifiNetworkConnectCommand::VT_SSID, ssid); + } + explicit WifiNetworkConnectCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateWifiNetworkConnectCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> ssid = 0) { + WifiNetworkConnectCommandBuilder builder_(_fbb); + builder_.add_ssid(ssid); + return builder_.Finish(); +} + +struct WifiNetworkConnectCommand::Traits { + using type = WifiNetworkConnectCommand; + static auto constexpr Create = CreateWifiNetworkConnectCommand; +}; + +inline ::flatbuffers::Offset CreateWifiNetworkConnectCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *ssid = nullptr) { + auto ssid__ = ssid ? _fbb.CreateString(ssid) : 0; + return OpenShock::Serialization::Local::CreateWifiNetworkConnectCommand( + _fbb, + ssid__); +} + +struct OtaUpdateSetDomainCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaUpdateSetDomainCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateSetDomainCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_DOMAIN = 4 + }; + const ::flatbuffers::String *domain() const { + return GetPointer(VT_DOMAIN); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_DOMAIN) && + verifier.VerifyString(domain()) && + verifier.EndTable(); + } +}; + +struct OtaUpdateSetDomainCommandBuilder { + typedef OtaUpdateSetDomainCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_domain(::flatbuffers::Offset<::flatbuffers::String> domain) { + fbb_.AddOffset(OtaUpdateSetDomainCommand::VT_DOMAIN, domain); + } + explicit OtaUpdateSetDomainCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaUpdateSetDomainCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> domain = 0) { + OtaUpdateSetDomainCommandBuilder builder_(_fbb); + builder_.add_domain(domain); + return builder_.Finish(); +} + +struct OtaUpdateSetDomainCommand::Traits { + using type = OtaUpdateSetDomainCommand; + static auto constexpr Create = CreateOtaUpdateSetDomainCommand; +}; + +inline ::flatbuffers::Offset CreateOtaUpdateSetDomainCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *domain = nullptr) { + auto domain__ = domain ? _fbb.CreateString(domain) : 0; + return OpenShock::Serialization::Local::CreateOtaUpdateSetDomainCommand( + _fbb, + domain__); +} + +struct OtaUpdateSetUpdateChannelCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaUpdateSetUpdateChannelCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateSetUpdateChannelCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_CHANNEL = 4 + }; + const ::flatbuffers::String *channel() const { + return GetPointer(VT_CHANNEL); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_CHANNEL) && + verifier.VerifyString(channel()) && + verifier.EndTable(); + } +}; + +struct OtaUpdateSetUpdateChannelCommandBuilder { + typedef OtaUpdateSetUpdateChannelCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_channel(::flatbuffers::Offset<::flatbuffers::String> channel) { + fbb_.AddOffset(OtaUpdateSetUpdateChannelCommand::VT_CHANNEL, channel); + } + explicit OtaUpdateSetUpdateChannelCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaUpdateSetUpdateChannelCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> channel = 0) { + OtaUpdateSetUpdateChannelCommandBuilder builder_(_fbb); + builder_.add_channel(channel); + return builder_.Finish(); +} + +struct OtaUpdateSetUpdateChannelCommand::Traits { + using type = OtaUpdateSetUpdateChannelCommand; + static auto constexpr Create = CreateOtaUpdateSetUpdateChannelCommand; +}; + +inline ::flatbuffers::Offset CreateOtaUpdateSetUpdateChannelCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *channel = nullptr) { + auto channel__ = channel ? _fbb.CreateString(channel) : 0; + return OpenShock::Serialization::Local::CreateOtaUpdateSetUpdateChannelCommand( + _fbb, + channel__); +} + +struct OtaUpdateCheckForUpdatesCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaUpdateCheckForUpdatesCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateCheckForUpdatesCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_CHANNEL = 4 + }; + const ::flatbuffers::String *channel() const { + return GetPointer(VT_CHANNEL); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_CHANNEL) && + verifier.VerifyString(channel()) && + verifier.EndTable(); + } +}; + +struct OtaUpdateCheckForUpdatesCommandBuilder { + typedef OtaUpdateCheckForUpdatesCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_channel(::flatbuffers::Offset<::flatbuffers::String> channel) { + fbb_.AddOffset(OtaUpdateCheckForUpdatesCommand::VT_CHANNEL, channel); + } + explicit OtaUpdateCheckForUpdatesCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaUpdateCheckForUpdatesCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> channel = 0) { + OtaUpdateCheckForUpdatesCommandBuilder builder_(_fbb); + builder_.add_channel(channel); + return builder_.Finish(); +} + +struct OtaUpdateCheckForUpdatesCommand::Traits { + using type = OtaUpdateCheckForUpdatesCommand; + static auto constexpr Create = CreateOtaUpdateCheckForUpdatesCommand; +}; + +inline ::flatbuffers::Offset CreateOtaUpdateCheckForUpdatesCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *channel = nullptr) { + auto channel__ = channel ? _fbb.CreateString(channel) : 0; + return OpenShock::Serialization::Local::CreateOtaUpdateCheckForUpdatesCommand( + _fbb, + channel__); +} + +struct OtaUpdateStartUpdateCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef OtaUpdateStartUpdateCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.OtaUpdateStartUpdateCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_CHANNEL = 4, + VT_VERSION = 6 + }; + const ::flatbuffers::String *channel() const { + return GetPointer(VT_CHANNEL); + } + const ::flatbuffers::String *version() const { + return GetPointer(VT_VERSION); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_CHANNEL) && + verifier.VerifyString(channel()) && + VerifyOffset(verifier, VT_VERSION) && + verifier.VerifyString(version()) && + verifier.EndTable(); + } +}; + +struct OtaUpdateStartUpdateCommandBuilder { + typedef OtaUpdateStartUpdateCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_channel(::flatbuffers::Offset<::flatbuffers::String> channel) { + fbb_.AddOffset(OtaUpdateStartUpdateCommand::VT_CHANNEL, channel); + } + void add_version(::flatbuffers::Offset<::flatbuffers::String> version) { + fbb_.AddOffset(OtaUpdateStartUpdateCommand::VT_VERSION, version); + } + explicit OtaUpdateStartUpdateCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateOtaUpdateStartUpdateCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> channel = 0, + ::flatbuffers::Offset<::flatbuffers::String> version = 0) { + OtaUpdateStartUpdateCommandBuilder builder_(_fbb); + builder_.add_version(version); + builder_.add_channel(channel); + return builder_.Finish(); +} + +struct OtaUpdateStartUpdateCommand::Traits { + using type = OtaUpdateStartUpdateCommand; + static auto constexpr Create = CreateOtaUpdateStartUpdateCommand; +}; + +inline ::flatbuffers::Offset CreateOtaUpdateStartUpdateCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *channel = nullptr, + const char *version = nullptr) { + auto channel__ = channel ? _fbb.CreateString(channel) : 0; + auto version__ = version ? _fbb.CreateString(version) : 0; + return OpenShock::Serialization::Local::CreateOtaUpdateStartUpdateCommand( + _fbb, + channel__, + version__); +} + +struct AccountLinkCommand FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef AccountLinkCommandBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.AccountLinkCommand"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_CODE = 4 + }; + const ::flatbuffers::String *code() const { + return GetPointer(VT_CODE); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_CODE) && + verifier.VerifyString(code()) && + verifier.EndTable(); + } +}; + +struct AccountLinkCommandBuilder { + typedef AccountLinkCommand Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_code(::flatbuffers::Offset<::flatbuffers::String> code) { + fbb_.AddOffset(AccountLinkCommand::VT_CODE, code); + } + explicit AccountLinkCommandBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateAccountLinkCommand( + ::flatbuffers::FlatBufferBuilder &_fbb, + ::flatbuffers::Offset<::flatbuffers::String> code = 0) { + AccountLinkCommandBuilder builder_(_fbb); + builder_.add_code(code); + return builder_.Finish(); +} + +struct AccountLinkCommand::Traits { + using type = AccountLinkCommand; + static auto constexpr Create = CreateAccountLinkCommand; +}; + +inline ::flatbuffers::Offset CreateAccountLinkCommandDirect( + ::flatbuffers::FlatBufferBuilder &_fbb, + const char *code = nullptr) { + auto code__ = code ? _fbb.CreateString(code) : 0; + return OpenShock::Serialization::Local::CreateAccountLinkCommand( + _fbb, + code__); +} + +struct LocalToHubMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef LocalToHubMessageBuilder Builder; + struct Traits; + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "OpenShock.Serialization.Local.LocalToHubMessage"; + } + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_PAYLOAD_TYPE = 4, + VT_PAYLOAD = 6 + }; + OpenShock::Serialization::Local::LocalToHubMessagePayload payload_type() const { + return static_cast(GetField(VT_PAYLOAD_TYPE, 0)); + } + const void *payload() const { + return GetPointer(VT_PAYLOAD); + } + template const T *payload_as() const; + const OpenShock::Serialization::Local::WifiScanCommand *payload_as_WifiScanCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::WifiScanCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiNetworkSaveCommand *payload_as_WifiNetworkSaveCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::WifiNetworkSaveCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiNetworkForgetCommand *payload_as_WifiNetworkForgetCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::WifiNetworkForgetCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiNetworkConnectCommand *payload_as_WifiNetworkConnectCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::WifiNetworkConnectCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::WifiNetworkDisconnectCommand *payload_as_WifiNetworkDisconnectCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::WifiNetworkDisconnectCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateSetIsEnabledCommand *payload_as_OtaUpdateSetIsEnabledCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateSetIsEnabledCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateSetDomainCommand *payload_as_OtaUpdateSetDomainCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateSetDomainCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateSetUpdateChannelCommand *payload_as_OtaUpdateSetUpdateChannelCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateSetUpdateChannelCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateSetCheckIntervalCommand *payload_as_OtaUpdateSetCheckIntervalCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateSetCheckIntervalCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateSetAllowBackendManagementCommand *payload_as_OtaUpdateSetAllowBackendManagementCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateSetAllowBackendManagementCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateSetRequireManualApprovalCommand *payload_as_OtaUpdateSetRequireManualApprovalCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateSetRequireManualApprovalCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateHandleUpdateRequestCommand *payload_as_OtaUpdateHandleUpdateRequestCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateHandleUpdateRequestCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateCheckForUpdatesCommand *payload_as_OtaUpdateCheckForUpdatesCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateCheckForUpdatesCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::OtaUpdateStartUpdateCommand *payload_as_OtaUpdateStartUpdateCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::OtaUpdateStartUpdateCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::AccountLinkCommand *payload_as_AccountLinkCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::AccountLinkCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::AccountUnlinkCommand *payload_as_AccountUnlinkCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::AccountUnlinkCommand ? static_cast(payload()) : nullptr; + } + const OpenShock::Serialization::Local::SetRfTxPinCommand *payload_as_SetRfTxPinCommand() const { + return payload_type() == OpenShock::Serialization::Local::LocalToHubMessagePayload::SetRfTxPinCommand ? static_cast(payload()) : nullptr; + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_PAYLOAD_TYPE, 1) && + VerifyOffset(verifier, VT_PAYLOAD) && + VerifyLocalToHubMessagePayload(verifier, payload(), payload_type()) && + verifier.EndTable(); + } +}; + +template<> inline const OpenShock::Serialization::Local::WifiScanCommand *LocalToHubMessage::payload_as() const { + return payload_as_WifiScanCommand(); +} + +template<> inline const OpenShock::Serialization::Local::WifiNetworkSaveCommand *LocalToHubMessage::payload_as() const { + return payload_as_WifiNetworkSaveCommand(); +} + +template<> inline const OpenShock::Serialization::Local::WifiNetworkForgetCommand *LocalToHubMessage::payload_as() const { + return payload_as_WifiNetworkForgetCommand(); +} + +template<> inline const OpenShock::Serialization::Local::WifiNetworkConnectCommand *LocalToHubMessage::payload_as() const { + return payload_as_WifiNetworkConnectCommand(); +} + +template<> inline const OpenShock::Serialization::Local::WifiNetworkDisconnectCommand *LocalToHubMessage::payload_as() const { + return payload_as_WifiNetworkDisconnectCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateSetIsEnabledCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateSetIsEnabledCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateSetDomainCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateSetDomainCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateSetUpdateChannelCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateSetUpdateChannelCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateSetCheckIntervalCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateSetCheckIntervalCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateSetAllowBackendManagementCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateSetAllowBackendManagementCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateSetRequireManualApprovalCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateSetRequireManualApprovalCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateHandleUpdateRequestCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateHandleUpdateRequestCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateCheckForUpdatesCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateCheckForUpdatesCommand(); +} + +template<> inline const OpenShock::Serialization::Local::OtaUpdateStartUpdateCommand *LocalToHubMessage::payload_as() const { + return payload_as_OtaUpdateStartUpdateCommand(); +} + +template<> inline const OpenShock::Serialization::Local::AccountLinkCommand *LocalToHubMessage::payload_as() const { + return payload_as_AccountLinkCommand(); +} + +template<> inline const OpenShock::Serialization::Local::AccountUnlinkCommand *LocalToHubMessage::payload_as() const { + return payload_as_AccountUnlinkCommand(); +} + +template<> inline const OpenShock::Serialization::Local::SetRfTxPinCommand *LocalToHubMessage::payload_as() const { + return payload_as_SetRfTxPinCommand(); +} + +struct LocalToHubMessageBuilder { + typedef LocalToHubMessage Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + void add_payload_type(OpenShock::Serialization::Local::LocalToHubMessagePayload payload_type) { + fbb_.AddElement(LocalToHubMessage::VT_PAYLOAD_TYPE, static_cast(payload_type), 0); + } + void add_payload(::flatbuffers::Offset payload) { + fbb_.AddOffset(LocalToHubMessage::VT_PAYLOAD, payload); + } + explicit LocalToHubMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateLocalToHubMessage( + ::flatbuffers::FlatBufferBuilder &_fbb, + OpenShock::Serialization::Local::LocalToHubMessagePayload payload_type = OpenShock::Serialization::Local::LocalToHubMessagePayload::NONE, + ::flatbuffers::Offset payload = 0) { + LocalToHubMessageBuilder builder_(_fbb); + builder_.add_payload(payload); + builder_.add_payload_type(payload_type); + return builder_.Finish(); +} + +struct LocalToHubMessage::Traits { + using type = LocalToHubMessage; + static auto constexpr Create = CreateLocalToHubMessage; +}; + +inline bool VerifyLocalToHubMessagePayload(::flatbuffers::Verifier &verifier, const void *obj, LocalToHubMessagePayload type) { + switch (type) { + case LocalToHubMessagePayload::NONE: { + return true; + } + case LocalToHubMessagePayload::WifiScanCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case LocalToHubMessagePayload::WifiNetworkSaveCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::WifiNetworkForgetCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::WifiNetworkConnectCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::WifiNetworkDisconnectCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case LocalToHubMessagePayload::OtaUpdateSetIsEnabledCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case LocalToHubMessagePayload::OtaUpdateSetDomainCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::OtaUpdateSetUpdateChannelCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::OtaUpdateSetCheckIntervalCommand: { + return verifier.VerifyField(static_cast(obj), 0, 2); + } + case LocalToHubMessagePayload::OtaUpdateSetAllowBackendManagementCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case LocalToHubMessagePayload::OtaUpdateSetRequireManualApprovalCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case LocalToHubMessagePayload::OtaUpdateHandleUpdateRequestCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case LocalToHubMessagePayload::OtaUpdateCheckForUpdatesCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::OtaUpdateStartUpdateCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::AccountLinkCommand: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LocalToHubMessagePayload::AccountUnlinkCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + case LocalToHubMessagePayload::SetRfTxPinCommand: { + return verifier.VerifyField(static_cast(obj), 0, 1); + } + default: return true; + } +} + +inline bool VerifyLocalToHubMessagePayloadVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyLocalToHubMessagePayload( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const OpenShock::Serialization::Local::LocalToHubMessage *GetLocalToHubMessage(const void *buf) { + return ::flatbuffers::GetRoot(buf); +} + +inline const OpenShock::Serialization::Local::LocalToHubMessage *GetSizePrefixedLocalToHubMessage(const void *buf) { + return ::flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyLocalToHubMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedLocalToHubMessageBuffer( + ::flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishLocalToHubMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedLocalToHubMessageBuffer( + ::flatbuffers::FlatBufferBuilder &fbb, + ::flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace Local +} // namespace Serialization +} // namespace OpenShock + +#endif // FLATBUFFERS_GENERATED_LOCALTOHUBMESSAGE_OPENSHOCK_SERIALIZATION_LOCAL_H_ diff --git a/platformio.ini b/platformio.ini index 87f03dbe..956604ce 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [env] -platform = espressif32 @ ^6.5.0 +platform = espressif32 @ 6.8.1 board = az-delivery-devkit-v4 ; Overridden per board framework = arduino build_flags = @@ -63,6 +63,27 @@ custom_openshock.flash_size = 16MB build_flags = -DOPENSHOCK_LED_WS2812B=38 +; https://docs.platformio.org/en/latest/boards/espressif32/lolin_s3_mini.html +[env:Wemos-Lolin-S3-Mini] +board = lolin_s3_mini ; builtin +custom_openshock.chip = ESP32-S3 +custom_openshock.flash_size = 4MB +build_flags = + -DOPENSHOCK_LED_WS2812B=47 + -DOPENSHOCK_LED_FLIP_RG_CHANNELS=1 + -DARDUINO_USB_CDC_ON_BOOT=1 + +; https://www.waveshare.com/wiki/ESP32-S3-Zero +[env:Waveshare_esp32_s3_zero] +board = esp32-s3-devkitc-1 +custom_openshock.chip = ESP32-S3 +custom_openshock.flash_size = 4MB +build_flags = + -DOPENSHOCK_RF_TX_GPIO=1 + -DOPENSHOCK_LED_WS2812B=21 + -DOPENSHOCK_LED_FLIP_RG_CHANNELS=1 + -DARDUINO_USB_CDC_ON_BOOT=1 + [env:Pishock-2023] board = Wemos-D1-Mini-ESP32 ; override custom_openshock.chip = ESP32 @@ -91,6 +112,16 @@ custom_openshock.flash_size = 8MB build_flags = -DOPENSHOCK_LED_GPIO=21 +; https://docs.platformio.org/en/latest//boards/espressif32/dfrobot_firebeetle2_esp32e.html +[env:DFRobot-Firebeetle2-ESP32E] +board = dfrobot_firebeetle2_esp32e ; builtin +custom_openshock.chip = ESP32 +custom_openshock.flash_size = 4MB +build_flags = + -DOPENSHOCK_RF_TX_GPIO=13 + -DOPENSHOCK_LED_WS2812B=5 + -DOPENSHOCK_LED_GPIO=2 + ; https://github.com/OpenShock/Hardware/tree/main/Core ; 8MB Flash, assume no PSRAM. ; Uses now-blacklisted pins for RF TX and Status LED. diff --git a/requirements.txt b/requirements.txt index 556c1cba..7b1fa11b 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/schemas b/schemas new file mode 160000 index 00000000..fbc59f1c --- /dev/null +++ b/schemas @@ -0,0 +1 @@ +Subproject commit fbc59f1c5514b23a21a261ce3fe31829eed5a8d5 diff --git a/schemas/ConfigFile.fbs b/schemas/ConfigFile.fbs deleted file mode 100644 index 5810b956..00000000 --- a/schemas/ConfigFile.fbs +++ /dev/null @@ -1,121 +0,0 @@ -namespace OpenShock.Serialization.Configuration; - -table RFConfig { - /// The GPIO pin connected to the RF modulator's data pin for transmitting (TX) - tx_pin:uint8; - - /// Whether to transmit keepalive messages to keep the devices from entering sleep mode - keepalive_enabled:bool; -} - -table WiFiCredentials { - /// ID of the WiFi network credentials, used for referencing the credentials with a low memory footprint - id:uint8; - - /// SSID of the WiFi network - ssid:string; - - /// Password of the WiFi network - password:string; -} - -table WiFiConfig { - /// Access point SSID - ap_ssid:string; - - /// Device hostname - hostname:string; - - /// WiFi network credentials - credentials:[WiFiCredentials]; -} - -table CaptivePortalConfig { - /// Whether the captive portal is forced to be enabled - /// The captive portal will otherwise shut down when a gateway connection is established - always_enabled:bool; -} - -table BackendConfig { - /// Domain name of the backend server, e.g. "api.shocklink.net" - domain:string; - - /// Authentication token for the backend server - auth_token:string; - - /// Override the Live-Control-Gateway (LCG) URL - lcg_override:string; -} - -table SerialInputConfig { - /// Whether to echo typed characters back to the serial console - echo_enabled:bool = true; -} - -enum OtaUpdateChannel:uint8 { - Stable = 0, - Beta = 1, - Develop = 2 -} - -enum OtaUpdateStep:uint8 { - None = 0, - Updating = 1, - Updated = 2, - Validating = 3, - Validated = 4, - RollingBack = 5, -} - -// Represents configuration for Over-The-Air (OTA) updates. -table OtaUpdateConfig { - /// Indicates whether OTA updates are enabled. - is_enabled:bool; - - /// The domain name of the OTA Content Delivery Network (CDN). - cdn_domain:string; - - /// The update channel to use. - update_channel:OtaUpdateChannel; - - /// Indicates whether to check for updates on startup. - check_on_startup:bool; - - /// Indicates whether to check for updates periodically. - check_periodically:bool; - - /// The interval in minutes between periodic update checks. - check_interval:uint16; - - /// Indicates if the backend is authorized to manage the device's update version on behalf of the user. - allow_backend_management:bool; - - /// Indicates if manual approval via serial input or captive portal is required before installing updates. - require_manual_approval:bool; - - /// Update process ID, used to track the update process server-side across reboots. - update_id:int32; - - /// Indicates what step of the update process the device is currently in, used to detect failed updates for status reporting. - update_step:OtaUpdateStep; -} - -table Config { - /// RF Transmitter configuration - rf:RFConfig; - - /// WiFi configuration - wifi:WiFiConfig; - - /// Captive portal configuration - captive_portal:CaptivePortalConfig; - - /// Backend configuration - backend:BackendConfig; - - /// Serial input configuration - serial_input:SerialInputConfig; - - /// OTA update configuration - ota_update:OtaUpdateConfig; -} diff --git a/schemas/DeviceToGatewayMessage.fbs b/schemas/DeviceToGatewayMessage.fbs deleted file mode 100644 index e2e7e252..00000000 --- a/schemas/DeviceToGatewayMessage.fbs +++ /dev/null @@ -1,57 +0,0 @@ -include "./Types/SemVer.fbs"; -include "./Types/FirmwareBootType.fbs"; - -attribute "fs_serializer"; - -namespace OpenShock.Serialization.Gateway; - -struct KeepAlive { - uptime:ulong; -} - -table BootStatus { - boot_type:Types.FirmwareBootType; - firmware_version:Types.SemVer; - ota_update_id:int32; -} - -table OtaInstallStarted { - update_id:int32; - version:Types.SemVer; -} - -enum OtaInstallProgressTask:byte { - FetchingMetadata, - PreparingForInstall, - FlashingFilesystem, - VerifyingFilesystem, - FlashingApplication, - MarkingApplicationBootable, - Rebooting -} - -table OtaInstallProgress { - update_id:int32; - task:OtaInstallProgressTask; - progress:float; -} - -table OtaInstallFailed { - update_id:int32; - message:string; - fatal:bool; -} - -union DeviceToGatewayMessagePayload { - KeepAlive, - BootStatus, - OtaInstallStarted, - OtaInstallProgress, - OtaInstallFailed -} - -table DeviceToGatewayMessage (fs_serializer) { - payload:DeviceToGatewayMessagePayload; -} - -root_type DeviceToGatewayMessage; diff --git a/schemas/DeviceToLocalMessage.fbs b/schemas/DeviceToLocalMessage.fbs deleted file mode 100644 index 50cdb999..00000000 --- a/schemas/DeviceToLocalMessage.fbs +++ /dev/null @@ -1,82 +0,0 @@ -include "./Types/WifiScanStatus.fbs"; -include "./Types/WifiNetwork.fbs"; -include "./Types/WifiNetworkEventType.fbs"; -include "./ConfigFile.fbs"; - -attribute "fs_serializer"; - -namespace OpenShock.Serialization.Local; - -table ReadyMessage { - poggies:bool; - connected_wifi:Types.WifiNetwork; - account_linked:bool; - - config:Configuration.Config; -} - -table ErrorMessage { - message:string; -} - -struct WifiScanStatusMessage { - status:Types.WifiScanStatus; -} -table WifiNetworkEvent { - event_type:Types.WifiNetworkEventType; - networks:[Types.WifiNetwork]; -} -table WifiGotIpEvent { - ip:string; -} -table WifiLostIpEvent { - ip:string; -} - -enum AccountLinkResultCode : uint8 { - Success = 0, - CodeRequired = 1, - InvalidCodeLength = 2, - NoInternetConnection = 3, - InvalidCode = 4, - InternalError = 5 -} - -struct AccountLinkCommandResult { - result:AccountLinkResultCode; -} - -enum SetRfPinResultCode : uint8 { - Success = 0, - InvalidPin = 1, - InternalError = 2 -} -struct SetRfTxPinCommandResult { - pin:uint8; - result:SetRfPinResultCode; -} - -union DeviceToLocalMessagePayload { - - // General stuff - ReadyMessage, - ErrorMessage, - - // Wifi stuff - WifiScanStatusMessage, - WifiNetworkEvent, - WifiGotIpEvent, - WifiLostIpEvent, - - // Account linking stuff - AccountLinkCommandResult, - - // RF transmitter stuff - SetRfTxPinCommandResult -} - -table DeviceToLocalMessage (fs_serializer) { - payload:DeviceToLocalMessagePayload; -} - -root_type DeviceToLocalMessage; diff --git a/schemas/GatewayToDeviceMessage.fbs b/schemas/GatewayToDeviceMessage.fbs deleted file mode 100644 index 141d483d..00000000 --- a/schemas/GatewayToDeviceMessage.fbs +++ /dev/null @@ -1,40 +0,0 @@ -include "./Types/ShockerCommandType.fbs"; -include "./Types/ShockerModelType.fbs"; -include "./Types/SemVer.fbs"; - -attribute "fs_serializer"; - -namespace OpenShock.Serialization.Gateway; - -struct ShockerCommand { - model:Types.ShockerModelType; - id:uint16; - type:Types.ShockerCommandType; - intensity:uint8; - duration:uint16; -} - -table ShockerCommandList { - commands:[ShockerCommand] (required); -} - -struct CaptivePortalConfig { - enabled:bool; -} - -// Begin installing an OTA update -table OtaInstall { - version:Types.SemVer; -} - -union GatewayToDeviceMessagePayload { - ShockerCommandList, - CaptivePortalConfig, - OtaInstall -} - -table GatewayToDeviceMessage (fs_serializer) { - payload:GatewayToDeviceMessagePayload; -} - -root_type GatewayToDeviceMessage; diff --git a/schemas/LocalToDeviceMessage.fbs b/schemas/LocalToDeviceMessage.fbs deleted file mode 100644 index 12964936..00000000 --- a/schemas/LocalToDeviceMessage.fbs +++ /dev/null @@ -1,94 +0,0 @@ -attribute "fs_serializer"; - -namespace OpenShock.Serialization.Local; - -struct WifiScanCommand { - run:bool; -} -table WifiNetworkSaveCommand { - ssid:string; - password:string; - connect:bool; -} -table WifiNetworkForgetCommand { - ssid:string; -} -table WifiNetworkConnectCommand { - ssid:string; -} -struct WifiNetworkDisconnectCommand { - placeholder:bool; -} - -struct OtaUpdateSetIsEnabledCommand { - enabled:bool; -} -table OtaUpdateSetDomainCommand { - domain:string; -} -table OtaUpdateSetUpdateChannelCommand { - channel:string; -} -struct OtaUpdateSetCheckIntervalCommand { - interval:uint16; -} -struct OtaUpdateSetAllowBackendManagementCommand { - allow:bool; -} -struct OtaUpdateSetRequireManualApprovalCommand { - require:bool; -} -struct OtaUpdateHandleUpdateRequestCommand { - accept:bool; -} -table OtaUpdateCheckForUpdatesCommand { - channel:string; -} -table OtaUpdateStartUpdateCommand { - channel:string; - version:string; -} - -table AccountLinkCommand { - code:string; -} -struct AccountUnlinkCommand { - placeholder:bool; -} -struct SetRfTxPinCommand { - pin:uint8; -} - -union LocalToDeviceMessagePayload { - - // Wifi stuff - WifiScanCommand, - WifiNetworkSaveCommand, - WifiNetworkForgetCommand, - WifiNetworkConnectCommand, - WifiNetworkDisconnectCommand, - - // OTA stuff - OtaUpdateSetIsEnabledCommand, - OtaUpdateSetDomainCommand, - OtaUpdateSetUpdateChannelCommand, - OtaUpdateSetCheckIntervalCommand, - OtaUpdateSetAllowBackendManagementCommand, - OtaUpdateSetRequireManualApprovalCommand, - OtaUpdateHandleUpdateRequestCommand, - OtaUpdateCheckForUpdatesCommand, - OtaUpdateStartUpdateCommand, - - // Account linking stuff - AccountLinkCommand, - AccountUnlinkCommand, - - // RF Transmitter stuff - SetRfTxPinCommand -} - -table LocalToDeviceMessage (fs_serializer) { - payload:LocalToDeviceMessagePayload; -} - -root_type LocalToDeviceMessage; diff --git a/schemas/README.md b/schemas/README.md deleted file mode 100644 index 0c427d52..00000000 --- a/schemas/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Schemas for communication and data storage - -This directory contains the schemas for communication and data storage. - -They are using the [FlatBuffers](https://google.github.io/flatbuffers/) serialization format. - -## How to update - -1. Update the schema files. -2. Run `gen_schema.py` to generate the new schema files. -3. Push the changes to the repository. diff --git a/schemas/Types/FirmwareBootType.fbs b/schemas/Types/FirmwareBootType.fbs deleted file mode 100644 index 2055b6dc..00000000 --- a/schemas/Types/FirmwareBootType.fbs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OpenShock.Serialization.Types; - -enum FirmwareBootType : uint8 { - Normal = 0, - NewFirmware = 1, - Rollback = 2, -} diff --git a/schemas/Types/SemVer.fbs b/schemas/Types/SemVer.fbs deleted file mode 100644 index 733f952e..00000000 --- a/schemas/Types/SemVer.fbs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OpenShock.Serialization.Types; - -table SemVer { - major: uint16; - minor: uint16; - patch: uint16; - prerelease: string; - build: string; -} diff --git a/schemas/Types/ShockerCommandType.fbs b/schemas/Types/ShockerCommandType.fbs deleted file mode 100644 index 9cbe46a9..00000000 --- a/schemas/Types/ShockerCommandType.fbs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OpenShock.Serialization.Types; - -enum ShockerCommandType : uint8 { - Stop = 0, - Shock = 1, - Vibrate = 2, - Sound = 3 -} diff --git a/schemas/Types/ShockerModelType.fbs b/schemas/Types/ShockerModelType.fbs deleted file mode 100644 index 8eb555d7..00000000 --- a/schemas/Types/ShockerModelType.fbs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OpenShock.Serialization.Types; - -enum ShockerModelType : uint8 { - CaiXianlin = 0, - Petrainer = 1, - Petrainer998DR = 2 -} diff --git a/schemas/Types/WifiAuthMode.fbs b/schemas/Types/WifiAuthMode.fbs deleted file mode 100644 index 1b99ea46..00000000 --- a/schemas/Types/WifiAuthMode.fbs +++ /dev/null @@ -1,14 +0,0 @@ -namespace OpenShock.Serialization.Types; - -enum WifiAuthMode : uint8 { - Open, - WEP, - WPA_PSK, - WPA2_PSK, - WPA_WPA2_PSK, - WPA2_ENTERPRISE, - WPA3_PSK, - WPA2_WPA3_PSK, - WAPI_PSK, - UNKNOWN -} diff --git a/schemas/Types/WifiNetwork.fbs b/schemas/Types/WifiNetwork.fbs deleted file mode 100644 index fa8a16db..00000000 --- a/schemas/Types/WifiNetwork.fbs +++ /dev/null @@ -1,12 +0,0 @@ -include "./WifiAuthMode.fbs"; - -namespace OpenShock.Serialization.Types; - -table WifiNetwork { - ssid:string; - bssid:string; - channel:uint8; - rssi:int8; - auth_mode:WifiAuthMode; - saved:bool; -} diff --git a/schemas/Types/WifiNetworkEventType.fbs b/schemas/Types/WifiNetworkEventType.fbs deleted file mode 100644 index ab1b8a9a..00000000 --- a/schemas/Types/WifiNetworkEventType.fbs +++ /dev/null @@ -1,11 +0,0 @@ -namespace OpenShock.Serialization.Types; - -enum WifiNetworkEventType : uint8 { - Discovered, - Updated, - Lost, - Saved, - Removed, - Connected, - Disconnected -} diff --git a/schemas/Types/WifiScanStatus.fbs b/schemas/Types/WifiScanStatus.fbs deleted file mode 100644 index 06325ceb..00000000 --- a/schemas/Types/WifiScanStatus.fbs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OpenShock.Serialization.Types; - -enum WifiScanStatus : uint8 { - Started, - InProgress, - Completed, - TimedOut, - Aborted, - Error -} diff --git a/scripts/use_openshock_params.py b/scripts/use_openshock_params.py index 18066721..75e10ec3 100644 --- a/scripts/use_openshock_params.py +++ b/scripts/use_openshock_params.py @@ -46,8 +46,10 @@ def use_openshock_params(): print('WARNING: OTA NOT SUPPORTED FOR THIS FLASH SIZE.') print('Using Non-OTA partition layout.') board_config.update('build.partitions', str(partitions)) + board_config.update('upload.flash_size', boardconf.get_flash_size()) else: board_config.update('build.partitions', str(partitions_ota)) + board_config.update('upload.flash_size', boardconf.get_flash_size()) print_header() diff --git a/src/CaptivePortalInstance.cpp b/src/CaptivePortalInstance.cpp index ae7d2780..93cc77bc 100644 --- a/src/CaptivePortalInstance.cpp +++ b/src/CaptivePortalInstance.cpp @@ -10,7 +10,7 @@ #include "util/TaskUtils.h" #include "wifi/WiFiManager.h" -#include "serialization/_fbs/DeviceToLocalMessage_generated.h" +#include "serialization/_fbs/HubToLocalMessage_generated.h" #include diff --git a/src/CommandHandler.cpp b/src/CommandHandler.cpp index 95e25a63..7b72e020 100644 --- a/src/CommandHandler.cpp +++ b/src/CommandHandler.cpp @@ -1,8 +1,8 @@ #include "CommandHandler.h" #include "Chipset.h" -#include "config/Config.h" #include "Common.h" +#include "config/Config.h" #include "Logging.h" #include "radio/RFTransmitter.h" #include "Time.h" @@ -104,7 +104,6 @@ bool _internalSetKeepAliveEnabled(bool enabled) { bool wasEnabled = s_keepAliveQueue != nullptr && s_keepAliveTaskHandle != nullptr; if (enabled == wasEnabled) { - ESP_LOGV(TAG, "keep-alive task is already %s", enabled ? "enabled" : "disabled"); return true; } @@ -171,16 +170,19 @@ bool CommandHandler::Init() { std::uint8_t txPin = rfConfig.txPin; if (!OpenShock::IsValidOutputPin(txPin)) { - if (!OpenShock::IsValidOutputPin(Constants::GPIO_RF_TX)) { - ESP_LOGE(TAG, "Configured RF TX pin (%u) is invalid, and default pin (%u) is invalid. Unable to initialize RF transmitter", txPin, Constants::GPIO_RF_TX); + if (!OpenShock::IsValidOutputPin(OPENSHOCK_RF_TX_GPIO)) { + ESP_LOGE(TAG, "Configured RF TX pin (%u) is invalid, and default pin (%u) is invalid. Unable to initialize RF transmitter", txPin, OPENSHOCK_RF_TX_GPIO); ESP_LOGD(TAG, "Setting RF TX pin to GPIO_INVALID"); - return Config::SetRFConfigTxPin(Constants::GPIO_INVALID); // This is not a error yet, unless we are unable to save the RF TX Pin as invalid + return Config::SetRFConfigTxPin(OPENSHOCK_GPIO_INVALID); // This is not a error yet, unless we are unable to save the RF TX Pin as invalid } - ESP_LOGW(TAG, "Configured RF TX pin (%u) is invalid, using default pin (%u)", txPin, Constants::GPIO_RF_TX); - txPin = Constants::GPIO_RF_TX; - Config::SetRFConfigTxPin(txPin); + ESP_LOGW(TAG, "Configured RF TX pin (%u) is invalid, using default pin (%u)", txPin, OPENSHOCK_RF_TX_GPIO); + txPin = OPENSHOCK_RF_TX_GPIO; + if (!Config::SetRFConfigTxPin(txPin)) { + ESP_LOGE(TAG, "Failed to set RF TX pin in config"); + return false; + } } s_rfTransmitter = std::make_unique(txPin); @@ -270,7 +272,7 @@ std::uint8_t CommandHandler::GetRfTxPin() { std::uint8_t txPin; if (!Config::GetRFConfigTxPin(txPin)) { ESP_LOGE(TAG, "Failed to get RF TX pin from config"); - txPin = Constants::GPIO_INVALID; + txPin = OPENSHOCK_GPIO_INVALID; } return txPin; diff --git a/src/CompatibilityChecks.cpp b/src/CompatibilityChecks.cpp index ffb4c970..3f059afc 100644 --- a/src/CompatibilityChecks.cpp +++ b/src/CompatibilityChecks.cpp @@ -1,7 +1,7 @@ #include "Common.h" #include "Chipset.h" -const bool kIsValidOrUndefinedRfTxPin = OpenShock::IsValidOutputPin(OpenShock::Constants::GPIO_RF_TX) || OpenShock::Constants::GPIO_RF_TX == OpenShock::Constants::GPIO_INVALID; +const bool kIsValidOrUndefinedRfTxPin = OpenShock::IsValidOutputPin(OPENSHOCK_RF_TX_GPIO) || OPENSHOCK_RF_TX_GPIO == OPENSHOCK_GPIO_INVALID; static_assert(kIsValidOrUndefinedRfTxPin , "OPENSHOCK_RF_TX_GPIO is not a valid output GPIO, and is not declared as bypassed by board specific definitions, refusing to compile"); #ifdef OPENSHOCK_ESTOP_PIN diff --git a/src/EStopManager.cpp b/src/EStopManager.cpp index 22e0d7fa..6420aa28 100644 --- a/src/EStopManager.cpp +++ b/src/EStopManager.cpp @@ -6,100 +6,158 @@ #include "Time.h" #include "VisualStateManager.h" -#include +#include +#include +#include const char* const TAG = "EStopManager"; using namespace OpenShock; -static EStopManager::EStopStatus s_estopStatus = EStopManager::EStopStatus::ALL_CLEAR; -static std::uint32_t s_estopHoldToClearTime = 5000; -static std::int64_t s_lastEStopButtonStateChange = 0; -static std::int64_t s_estoppedAt = 0; -static int s_lastEStopButtonState = HIGH; +const std::uint32_t k_estopHoldToClearTime = 5000; +const std::uint32_t k_estopDebounceTime = 100; + +static TaskHandle_t s_estopEventHandlerTask; +static QueueHandle_t s_estopEventQueue; + +static bool s_estopActive = false; +static bool s_estopAwaitingRelease = false; +static std::int64_t s_estopActivatedAt = 0; + +static gpio_num_t s_estopPin; + +struct EstopEventQueueMessage { + bool pressed : 1; + bool deactivatesAtChanged : 1; + std::int64_t deactivatesAt; +}; + +// This high-priority task is usually idling, waiting for +// messages from the EStop interrupt or it's hold timer +void _estopEventHandler(void* pvParameters) { + std::int64_t deactivatesAt = 0; + for (;;) { + // Wait indefinitely for a message from the EStop interrupt routine + TickType_t waitTime = portMAX_DELAY; + + // If the EStop is being deactivated, wait for the hold timer to trigger + if (deactivatesAt != 0) { + std::int64_t now = OpenShock::millis(); + if (now >= deactivatesAt) { + waitTime = 0; + } else { + waitTime = pdMS_TO_TICKS(deactivatesAt - OpenShock::millis()); + } + } + + // Wait for a message from the EStop interrupt routine + EstopEventQueueMessage message; + if (xQueueReceive(s_estopEventQueue, &message, waitTime) == pdTRUE) { + if (message.pressed) { + ESP_LOGI(TAG, "EStop pressed"); + } else { + ESP_LOGI(TAG, "EStop released"); + } + + if (message.deactivatesAtChanged) { + ESP_LOGI(TAG, "EStop deactivation time changed"); + deactivatesAt = message.deactivatesAt; + } -static std::uint8_t s_estopPin; + OpenShock::VisualStateManager::SetEmergencyStopStatus(s_estopActive, s_estopAwaitingRelease); + OpenShock::CommandHandler::SetKeepAlivePaused(EStopManager::IsEStopped()); + } else if (deactivatesAt != 0 && OpenShock::millis() >= deactivatesAt) { // If we didn't get a message, the time probably expired, check if the estop is pending deactivation and if we have reached that time + // Reset the deactivation time + deactivatesAt = 0; -void _estopManagerTask(TimerHandle_t xTimer) { - configASSERT(xTimer); + // If the button is held for the specified time, clear the EStop + s_estopAwaitingRelease = true; + OpenShock::VisualStateManager::SetEmergencyStopStatus(s_estopActive, s_estopAwaitingRelease); - int buttonState = digitalRead(s_estopPin); - if (buttonState != s_lastEStopButtonState) { - s_lastEStopButtonStateChange = OpenShock::millis(); + ESP_LOGI(TAG, "EStop cleared, awaiting release"); + } } - switch (s_estopStatus) { - case EStopManager::EStopStatus::ALL_CLEAR: - if (buttonState == LOW) { - s_estopStatus = EStopManager::EStopStatus::ESTOPPED_AND_HELD; - s_estoppedAt = s_lastEStopButtonStateChange; - ESP_LOGI(TAG, "EStop triggered"); - OpenShock::VisualStateManager::SetEmergencyStop(s_estopStatus); - OpenShock::CommandHandler::SetKeepAlivePaused(true); - } - break; - case EStopManager::EStopStatus::ESTOPPED_AND_HELD: - if (buttonState == HIGH) { - // User has released the button, now we can trust them holding to clear it. - s_estopStatus = EStopManager::EStopStatus::ESTOPPED; - OpenShock::VisualStateManager::SetEmergencyStop(s_estopStatus); - } - break; - case EStopManager::EStopStatus::ESTOPPED: - // If the button is held again for the specified time after being released, clear the EStop - if (buttonState == LOW && s_lastEStopButtonState == LOW && s_lastEStopButtonStateChange + s_estopHoldToClearTime <= OpenShock::millis()) { - s_estopStatus = EStopManager::EStopStatus::ESTOPPED_CLEARED; - ESP_LOGI(TAG, "EStop cleared"); - OpenShock::VisualStateManager::SetEmergencyStop(s_estopStatus); - } - break; - case EStopManager::EStopStatus::ESTOPPED_CLEARED: - // If the button is released, report as ALL_CLEAR - if (buttonState == HIGH) { - s_estopStatus = EStopManager::EStopStatus::ALL_CLEAR; - ESP_LOGI(TAG, "EStop cleared, all clear"); - OpenShock::VisualStateManager::SetEmergencyStop(s_estopStatus); - OpenShock::CommandHandler::SetKeepAlivePaused(false); - } - break; +} - default: - break; +// Interrupt should only be a dumb sender of the GPIO change, additionally triggering if needed +// Clearing and debouncing is handled by the task. +void _estopEdgeInterrupt(void* arg) { + std::int64_t now = OpenShock::millis(); + + // TODO: Allow active HIGH EStops? + bool pressed = gpio_get_level(s_estopPin) == 0; + + bool deactivatesAtChanged = false; + std::int64_t deactivatesAt = 0; + + if (!s_estopActive && pressed) { + s_estopActive = true; + s_estopActivatedAt = now; + } else if (s_estopActive && pressed && (now - s_estopActivatedAt >= k_estopDebounceTime)) { + deactivatesAtChanged = true; + deactivatesAt = now + k_estopHoldToClearTime; + } else if (s_estopActive && !pressed && s_estopAwaitingRelease) { + s_estopActive = false; + s_estopAwaitingRelease = false; + } else if (s_estopActive && !pressed) { + deactivatesAtChanged = true; + deactivatesAt = 0; } - s_lastEStopButtonState = buttonState; + BaseType_t higherPriorityTaskWoken = pdFALSE; + EstopEventQueueMessage message = { + .pressed = pressed, + .deactivatesAtChanged = deactivatesAtChanged, + .deactivatesAt = deactivatesAt, + }; + + xQueueSendToBackFromISR(s_estopEventQueue, &message, &higherPriorityTaskWoken); // TODO: Check if queue is full? + + if (higherPriorityTaskWoken) { + portYIELD_FROM_ISR(); + } } -// TODO?: Allow active HIGH EStops? -void EStopManager::Init(std::uint16_t updateIntervalMs) { +void EStopManager::Init() { #ifdef OPENSHOCK_ESTOP_PIN - s_estopPin = OPENSHOCK_ESTOP_PIN; - pinMode(s_estopPin, INPUT_PULLUP); - ESP_LOGI(TAG, "Initializing on pin %u", s_estopPin); - - // Start the repeating task, 10Hz may seem slow, but it's plenty fast for an EStop - TimerHandle_t timer = xTimerCreate(TAG, pdMS_TO_TICKS(updateIntervalMs), pdTRUE, nullptr, _estopManagerTask); - if (timer == nullptr) { - ESP_LOGE(TAG, "Failed to create timer!!! Triggering EStop."); - s_estopStatus = EStopManager::EStopStatus::ESTOPPED; - } else { - xTimerStart(timer, 0); + s_estopPin = static_cast(OPENSHOCK_ESTOP_PIN); + + ESP_LOGI(TAG, "Initializing on pin %hhi", static_cast(s_estopPin)); + + gpio_config_t io_conf; + io_conf.pin_bit_mask = 1ULL << s_estopPin; + io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + io_conf.pull_up_en = GPIO_PULLUP_ENABLE; + io_conf.mode = GPIO_MODE_INPUT; + io_conf.intr_type = GPIO_INTR_ANYEDGE; + gpio_config(&io_conf); + + // TODO?: Should we maybe use statically allocated queues and timers? See CreateStatic for both. + s_estopEventQueue = xQueueCreate(8, sizeof(EstopEventQueueMessage)); + + esp_err_t err = gpio_install_isr_service(ESP_INTR_FLAG_EDGE); + if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) { // ESP_ERR_INVALID_STATE is fine, it just means the ISR service is already installed + ESP_PANIC(TAG, "Failed to install EStop ISR service"); } -#else - (void)updateIntervalMs; + err = gpio_isr_handler_add(s_estopPin, _estopEdgeInterrupt, nullptr); + if (err != ESP_OK) { + ESP_PANIC(TAG, "Failed to add EStop ISR handler"); + } + if (xTaskCreate(_estopEventHandler, TAG, 4096, nullptr, 5, &s_estopEventHandlerTask) != pdPASS) { + ESP_PANIC(TAG, "Failed to create EStop event handler task"); + } + +#else ESP_LOGI(TAG, "EStopManager disabled, no pin defined"); #endif } bool EStopManager::IsEStopped() { - return (s_estopStatus != EStopManager::EStopStatus::ALL_CLEAR); + return s_estopActive; } -std::int64_t EStopManager::WhenEStopped() { - if (IsEStopped()) { - return s_estoppedAt; - } - - return 0; +std::int64_t EStopManager::LastEStopped() { + return s_estopActivatedAt; } diff --git a/src/RGBPatternManager.cpp b/src/RGBPatternManager.cpp index cdd59a99..124e9c8f 100644 --- a/src/RGBPatternManager.cpp +++ b/src/RGBPatternManager.cpp @@ -97,12 +97,17 @@ void RGBPatternManager::RunPattern(void* arg) { while (true) { for (const auto& state : pattern) { + // WS2812B usually takes commands in GRB order + // https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf - Page 5 + // But some actually expect RGB! + std::uint8_t r = static_cast(static_cast(state.red) * brightness / 255); std::uint8_t g = static_cast(static_cast(state.green) * brightness / 255); std::uint8_t b = static_cast(static_cast(state.blue) * brightness / 255); +#if OPENSHOCK_LED_FLIP_RG_CHANNELS + std::swap(r, g); +#endif - // WS2812B takes commands in GRB order - // https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf - Page 5 const std::uint32_t colors = (static_cast(g) << 16) | (static_cast(r) << 8) | static_cast(b); // Encode the data diff --git a/src/VisualStateManager.cpp b/src/VisualStateManager.cpp index 7ab132e0..91cf5d37 100644 --- a/src/VisualStateManager.cpp +++ b/src/VisualStateManager.cpp @@ -10,12 +10,12 @@ const char* const TAG = "VisualStateManager"; -const std::uint64_t kCriticalErrorFlag = 1 << 0; -const std::uint64_t kEmergencyStoppedFlag = 1 << 1; -const std::uint64_t kEmergencyStopClearedFlag = 1 << 2; -const std::uint64_t kWebSocketConnectedFlag = 1 << 3; -const std::uint64_t kWiFiConnectedFlag = 1 << 4; -const std::uint64_t kWiFiScanningFlag = 1 << 5; +const std::uint64_t kCriticalErrorFlag = 1 << 0; +const std::uint64_t kEmergencyStoppedFlag = 1 << 1; +const std::uint64_t kEmergencyStopAwaitingReleaseFlag = 1 << 2; +const std::uint64_t kWebSocketConnectedFlag = 1 << 3; +const std::uint64_t kWiFiConnectedFlag = 1 << 4; +const std::uint64_t kWiFiScanningFlag = 1 << 5; // Bitmask of when the system is in a "all clear" state. const std::uint64_t kStatusOKMask = kWebSocketConnectedFlag | kWiFiConnectedFlag; @@ -44,11 +44,11 @@ const RGBPatternManager::RGBState kEmergencyStoppedRGBPattern[] = { { 0, 0, 0, 500} }; -const PinPatternManager::State kEmergencyStopClearedPattern[] = { +const PinPatternManager::State kEmergencyStopAwaitingReleasePattern[] = { { true, 150}, {false, 150} }; -const RGBPatternManager::RGBState kEmergencyStopClearedRGBPattern[] = { +const RGBPatternManager::RGBState kEmergencyStopAwaitingReleaseRGBPattern[] = { {0, 255, 0, 150}, {0, 0, 0, 150} }; @@ -157,13 +157,13 @@ void _updateVisualStateGPIO() { return; } - if (s_stateFlags & kEmergencyStoppedFlag) { - s_builtInLedManager->SetPattern(kEmergencyStoppedPattern); + if (s_stateFlags & kEmergencyStopAwaitingReleaseFlag) { + s_builtInLedManager->SetPattern(kEmergencyStopAwaitingReleasePattern); return; } - if (s_stateFlags & kEmergencyStopClearedFlag) { - s_builtInLedManager->SetPattern(kEmergencyStopClearedPattern); + if (s_stateFlags & kEmergencyStoppedFlag) { + s_builtInLedManager->SetPattern(kEmergencyStoppedPattern); return; } @@ -191,13 +191,13 @@ void _updateVisualStateRGB() { return; } - if (s_stateFlags & kEmergencyStoppedFlag) { - s_RGBLedManager->SetPattern(kEmergencyStoppedRGBPattern); + if (s_stateFlags & kEmergencyStopAwaitingReleaseFlag) { + s_RGBLedManager->SetPattern(kEmergencyStopAwaitingReleaseRGBPattern); return; } - if (s_stateFlags & kEmergencyStopClearedFlag) { - s_RGBLedManager->SetPattern(kEmergencyStopClearedRGBPattern); + if (s_stateFlags & kEmergencyStoppedFlag) { + s_RGBLedManager->SetPattern(kEmergencyStoppedRGBPattern); return; } @@ -344,30 +344,19 @@ void VisualStateManager::SetScanningStarted() { } } -void VisualStateManager::SetEmergencyStop(OpenShock::EStopManager::EStopStatus status) { +void VisualStateManager::SetEmergencyStopStatus(bool isActive, bool isAwaitingRelease) { std::uint64_t oldState = s_stateFlags; - switch (status) { - // When there is no EStop currently active. - case OpenShock::EStopManager::EStopStatus::ALL_CLEAR: - s_stateFlags &= ~kEmergencyStoppedFlag; - s_stateFlags &= ~kEmergencyStopClearedFlag; - break; - // EStop has been triggered! - case OpenShock::EStopManager::EStopStatus::ESTOPPED_AND_HELD: - // EStop still active, and user has released the button from the initial trigger. - case OpenShock::EStopManager::EStopStatus::ESTOPPED: - s_stateFlags |= kEmergencyStoppedFlag; - s_stateFlags &= ~kEmergencyStopClearedFlag; - break; - // User has held and cleared the EStop, now we're waiting for them to release the button. - case OpenShock::EStopManager::EStopStatus::ESTOPPED_CLEARED: - s_stateFlags &= ~kEmergencyStoppedFlag; - s_stateFlags |= kEmergencyStopClearedFlag; - break; - default: - ESP_LOGE(TAG, "Unhandled EStop status: %d", status); - break; + if (isActive) { + s_stateFlags |= kEmergencyStoppedFlag; + } else { + s_stateFlags &= ~kEmergencyStoppedFlag; + } + + if (isAwaitingRelease) { + s_stateFlags |= kEmergencyStopAwaitingReleaseFlag; + } else { + s_stateFlags &= ~kEmergencyStopAwaitingReleaseFlag; } if (oldState != s_stateFlags) { diff --git a/src/config/Config.cpp b/src/config/Config.cpp index 8aad0307..7399e4a8 100644 --- a/src/config/Config.cpp +++ b/src/config/Config.cpp @@ -20,6 +20,25 @@ static fs::LittleFSFS _configFS; static Config::RootConfig _configData; static ReadWriteMutex _configMutex; +#define CONFIG_LOCK_READ_ACTION(retval, action) \ + ScopedReadLock lock__(&_configMutex); \ + if (!lock__.isLocked()) { \ + ESP_LOGE(TAG, "Failed to acquire read lock"); \ + action; \ + return retval; \ + } + +#define CONFIG_LOCK_WRITE_ACTION(retval, action) \ + ScopedWriteLock lock__(&_configMutex); \ + if (!lock__.isLocked()) { \ + ESP_LOGE(TAG, "Failed to acquire write lock"); \ + action; \ + return retval; \ + } + +#define CONFIG_LOCK_READ(retval) CONFIG_LOCK_READ_ACTION(retval, {}) +#define CONFIG_LOCK_WRITE(retval) CONFIG_LOCK_WRITE_ACTION(retval, {}) + bool _tryDeserializeConfig(const std::uint8_t* buffer, std::size_t bufferLen, OpenShock::Config::RootConfig& config) { if (buffer == nullptr || bufferLen == 0) { ESP_LOGE(TAG, "Buffer is null or empty"); @@ -27,7 +46,7 @@ bool _tryDeserializeConfig(const std::uint8_t* buffer, std::size_t bufferLen, Op } // Deserialize - auto fbsConfig = flatbuffers::GetRoot(buffer); + auto fbsConfig = flatbuffers::GetRoot(buffer); if (fbsConfig == nullptr) { ESP_LOGE(TAG, "Failed to get deserialization root for config file"); return false; @@ -110,10 +129,7 @@ bool _trySaveConfig() { } void Config::Init() { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - return; - } + CONFIG_LOCK_WRITE(); if (!_configFS.begin(true, "/config", 3, "config")) { ESP_PANIC(TAG, "Unable to mount config LittleFS partition!"); @@ -132,15 +148,14 @@ void Config::Init() { } } -std::string Config::GetAsJSON(bool withSensitiveData) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - return ""; - } +cJSON* _getAsCJSON(bool withSensitiveData) { + CONFIG_LOCK_READ(nullptr); - cJSON* root = _configData.ToJSON(withSensitiveData); + return _configData.ToJSON(withSensitiveData); +} - lock.unlock(); +std::string Config::GetAsJSON(bool withSensitiveData) { + cJSON* root = _getAsCJSON(withSensitiveData); char* json = cJSON_PrintUnformatted(root); @@ -159,12 +174,7 @@ bool Config::SaveFromJSON(StringView json) { return false; } - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - cJSON_Delete(root); - return false; - } + CONFIG_LOCK_WRITE_ACTION(false, cJSON_Delete(root)); bool result = _configData.FromJSON(root); @@ -178,21 +188,14 @@ bool Config::SaveFromJSON(StringView json) { return _trySaveConfig(); } -flatbuffers::Offset Config::GetAsFlatBuffer(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - return 0; - } +flatbuffers::Offset Config::GetAsFlatBuffer(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData) { + CONFIG_LOCK_READ(0); return _configData.ToFlatbuffers(builder, withSensitiveData); } -bool Config::SaveFromFlatBuffer(const Serialization::Configuration::Config* config) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } +bool Config::SaveFromFlatBuffer(const Serialization::Configuration::HubConfig* config) { + CONFIG_LOCK_WRITE(false); if (!_configData.FromFlatbuffers(config)) { ESP_LOGE(TAG, "Failed to read config file"); @@ -203,21 +206,13 @@ bool Config::SaveFromFlatBuffer(const Serialization::Configuration::Config* conf } bool Config::GetRaw(std::vector& buffer) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); return _tryLoadConfig(buffer); } bool Config::SetRaw(const std::uint8_t* buffer, std::size_t size) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); OpenShock::Config::RootConfig config; if (!_tryDeserializeConfig(buffer, size, config)) { @@ -229,11 +224,7 @@ bool Config::SetRaw(const std::uint8_t* buffer, std::size_t size) { } void Config::FactoryReset() { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return; - } + CONFIG_LOCK_WRITE(); _configData.ToDefault(); @@ -249,11 +240,7 @@ void Config::FactoryReset() { } bool Config::GetRFConfig(Config::RFConfig& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.rf; @@ -261,11 +248,7 @@ bool Config::GetRFConfig(Config::RFConfig& out) { } bool Config::GetWiFiConfig(Config::WiFiConfig& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.wifi; @@ -273,11 +256,7 @@ bool Config::GetWiFiConfig(Config::WiFiConfig& out) { } bool Config::GetOtaUpdateConfig(Config::OtaUpdateConfig& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.otaUpdate; @@ -285,11 +264,7 @@ bool Config::GetOtaUpdateConfig(Config::OtaUpdateConfig& out) { } bool Config::GetWiFiCredentials(cJSON* array, bool withSensitiveData) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); for (auto& creds : _configData.wifi.credentialsList) { cJSON* jsonCreds = creds.ToJSON(withSensitiveData); @@ -301,11 +276,7 @@ bool Config::GetWiFiCredentials(cJSON* array, bool withSensitiveData) { } bool Config::GetWiFiCredentials(std::vector& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.wifi.credentialsList; @@ -313,22 +284,14 @@ bool Config::GetWiFiCredentials(std::vector& out) { } bool Config::SetRFConfig(const Config::RFConfig& config) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.rf = config; return _trySaveConfig(); } bool Config::SetWiFiConfig(const Config::WiFiConfig& config) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.wifi = config; return _trySaveConfig(); @@ -341,59 +304,49 @@ bool Config::SetWiFiCredentials(const std::vector& cred return false; } - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.wifi.credentialsList = credentials; return _trySaveConfig(); } bool Config::SetCaptivePortalConfig(const Config::CaptivePortalConfig& config) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.captivePortal = config; return _trySaveConfig(); } bool Config::SetSerialInputConfig(const Config::SerialInputConfig& config) { + CONFIG_LOCK_WRITE(false); + _configData.serialInput = config; return _trySaveConfig(); } bool Config::GetSerialInputConfigEchoEnabled(bool& out) { + CONFIG_LOCK_READ(false); + out = _configData.serialInput.echoEnabled; return true; } bool Config::SetSerialInputConfigEchoEnabled(bool enabled) { + CONFIG_LOCK_WRITE(false); + _configData.serialInput.echoEnabled = enabled; return _trySaveConfig(); } bool Config::SetBackendConfig(const Config::BackendConfig& config) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.backend = config; return _trySaveConfig(); } bool Config::GetRFConfigTxPin(std::uint8_t& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.rf.txPin; @@ -401,22 +354,14 @@ bool Config::GetRFConfigTxPin(std::uint8_t& out) { } bool Config::SetRFConfigTxPin(std::uint8_t txPin) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.rf.txPin = txPin; return _trySaveConfig(); } bool Config::GetRFConfigKeepAliveEnabled(bool& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.rf.keepAliveEnabled; @@ -424,21 +369,14 @@ bool Config::GetRFConfigKeepAliveEnabled(bool& out) { } bool Config::SetRFConfigKeepAliveEnabled(bool enabled) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.rf.keepAliveEnabled = enabled; return _trySaveConfig(); } bool Config::AnyWiFiCredentials(std::function predicate) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - } + CONFIG_LOCK_READ(false); auto& creds = _configData.wifi.credentialsList; @@ -446,11 +384,7 @@ bool Config::AnyWiFiCredentials(std::functionid == id) { @@ -568,11 +486,7 @@ bool Config::RemoveWiFiCredentials(std::uint8_t id) { } bool Config::ClearWiFiCredentials() { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.wifi.credentialsList.clear(); @@ -580,10 +494,7 @@ bool Config::ClearWiFiCredentials() { } bool Config::GetOtaUpdateId(std::int32_t& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - } + CONFIG_LOCK_READ(false); out = _configData.otaUpdate.updateId; @@ -591,10 +502,7 @@ bool Config::GetOtaUpdateId(std::int32_t& out) { } bool Config::SetOtaUpdateId(std::int32_t updateId) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - } + CONFIG_LOCK_WRITE(false); if (_configData.otaUpdate.updateId == updateId) { return true; @@ -605,10 +513,7 @@ bool Config::SetOtaUpdateId(std::int32_t updateId) { } bool Config::GetOtaUpdateStep(OtaUpdateStep& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - } + CONFIG_LOCK_READ(false); out = _configData.otaUpdate.updateStep; @@ -616,10 +521,7 @@ bool Config::GetOtaUpdateStep(OtaUpdateStep& out) { } bool Config::SetOtaUpdateStep(OtaUpdateStep updateStep) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - } + CONFIG_LOCK_WRITE(false); if (_configData.otaUpdate.updateStep == updateStep) { return true; @@ -630,11 +532,7 @@ bool Config::SetOtaUpdateStep(OtaUpdateStep updateStep) { } bool Config::GetBackendDomain(std::string& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.backend.domain; @@ -642,32 +540,20 @@ bool Config::GetBackendDomain(std::string& out) { } bool Config::SetBackendDomain(StringView domain) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.backend.domain = domain.toString(); return _trySaveConfig(); } bool Config::HasBackendAuthToken() { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); return !_configData.backend.authToken.empty(); } bool Config::GetBackendAuthToken(std::string& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.backend.authToken; @@ -675,43 +561,27 @@ bool Config::GetBackendAuthToken(std::string& out) { } bool Config::SetBackendAuthToken(StringView token) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.backend.authToken = token.toString(); return _trySaveConfig(); } bool Config::ClearBackendAuthToken() { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.backend.authToken.clear(); return _trySaveConfig(); } bool Config::HasBackendLCGOverride() { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); return !_configData.backend.lcgOverride.empty(); } bool Config::GetBackendLCGOverride(std::string& out) { - ScopedReadLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire read lock"); - return false; - } + CONFIG_LOCK_READ(false); out = _configData.backend.lcgOverride; @@ -719,22 +589,14 @@ bool Config::GetBackendLCGOverride(std::string& out) { } bool Config::SetBackendLCGOverride(StringView lcgOverride) { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.backend.lcgOverride = lcgOverride.toString(); return _trySaveConfig(); } bool Config::ClearBackendLCGOverride() { - ScopedWriteLock lock(&_configMutex); - if (!lock.isLocked()) { - ESP_LOGE(TAG, "Failed to acquire write lock"); - return false; - } + CONFIG_LOCK_WRITE(false); _configData.backend.lcgOverride.clear(); return _trySaveConfig(); diff --git a/src/config/RFConfig.cpp b/src/config/RFConfig.cpp index be8007be..443e5aa5 100644 --- a/src/config/RFConfig.cpp +++ b/src/config/RFConfig.cpp @@ -8,12 +8,12 @@ const char* const TAG = "Config::RFConfig"; using namespace OpenShock::Config; -RFConfig::RFConfig() : txPin(OpenShock::Constants::GPIO_RF_TX), keepAliveEnabled(true) { } +RFConfig::RFConfig() : txPin(OPENSHOCK_RF_TX_GPIO), keepAliveEnabled(true) { } RFConfig::RFConfig(std::uint8_t txPin, bool keepAliveEnabled) : txPin(txPin), keepAliveEnabled(keepAliveEnabled) { } void RFConfig::ToDefault() { - txPin = OpenShock::Constants::GPIO_RF_TX; + txPin = OPENSHOCK_RF_TX_GPIO; keepAliveEnabled = true; } @@ -44,7 +44,7 @@ bool RFConfig::FromJSON(const cJSON* json) { return false; } - Internal::Utils::FromJsonU8(txPin, json, "txPin", OpenShock::Constants::GPIO_RF_TX); + Internal::Utils::FromJsonU8(txPin, json, "txPin", OPENSHOCK_RF_TX_GPIO); Internal::Utils::FromJsonBool(keepAliveEnabled, json, "keepAliveEnabled", true); return true; diff --git a/src/config/RootConfig.cpp b/src/config/RootConfig.cpp index 20e8ba41..c3d0cb62 100644 --- a/src/config/RootConfig.cpp +++ b/src/config/RootConfig.cpp @@ -12,9 +12,10 @@ void RootConfig::ToDefault() { captivePortal.ToDefault(); backend.ToDefault(); serialInput.ToDefault(); + otaUpdate.ToDefault(); } -bool RootConfig::FromFlatbuffers(const Serialization::Configuration::Config* config) { +bool RootConfig::FromFlatbuffers(const Serialization::Configuration::HubConfig* config) { if (config == nullptr) { ESP_LOGE(TAG, "config is null"); return false; @@ -53,7 +54,7 @@ bool RootConfig::FromFlatbuffers(const Serialization::Configuration::Config* con return true; } -flatbuffers::Offset RootConfig::ToFlatbuffers(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData) const { +flatbuffers::Offset RootConfig::ToFlatbuffers(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData) const { auto rfOffset = rf.ToFlatbuffers(builder, withSensitiveData); auto wifiOffset = wifi.ToFlatbuffers(builder, withSensitiveData); auto captivePortalOffset = captivePortal.ToFlatbuffers(builder, withSensitiveData); @@ -61,7 +62,7 @@ flatbuffers::Offset RootConfig: auto serialInputOffset = serialInput.ToFlatbuffers(builder, withSensitiveData); auto otaUpdateOffset = otaUpdate.ToFlatbuffers(builder, withSensitiveData); - return Serialization::Configuration::CreateConfig(builder, rfOffset, wifiOffset, captivePortalOffset, backendOffset, serialInputOffset, otaUpdateOffset); + return Serialization::Configuration::CreateHubConfig(builder, rfOffset, wifiOffset, captivePortalOffset, backendOffset, serialInputOffset, otaUpdateOffset); } bool RootConfig::FromJSON(const cJSON* json) { diff --git a/src/event_handlers/websocket/Gateway.cpp b/src/event_handlers/websocket/Gateway.cpp index b7274fa6..31b0b576 100644 --- a/src/event_handlers/websocket/Gateway.cpp +++ b/src/event_handlers/websocket/Gateway.cpp @@ -4,7 +4,7 @@ #include "Logging.h" -#include "serialization/_fbs/GatewayToDeviceMessage_generated.h" +#include "serialization/_fbs/GatewayToHubMessage_generated.h" #include @@ -15,7 +15,7 @@ static const char* TAG = "ServerMessageHandlers"; namespace Schemas = OpenShock::Serialization::Gateway; namespace Handlers = OpenShock::MessageHandlers::Server::_Private; -typedef Schemas::GatewayToDeviceMessagePayload PayloadType; +typedef Schemas::GatewayToHubMessagePayload PayloadType; using namespace OpenShock; @@ -36,7 +36,7 @@ static std::array s_serverHandlers = []() void EventHandlers::WebSocket::HandleGatewayBinary(const std::uint8_t* data, std::size_t len) { // Deserialize - auto msg = flatbuffers::GetRoot(data); + auto msg = flatbuffers::GetRoot(data); if (msg == nullptr) { ESP_LOGE(TAG, "Failed to deserialize message"); return; diff --git a/src/event_handlers/websocket/Local.cpp b/src/event_handlers/websocket/Local.cpp index 8ddde09f..5b30fbee 100644 --- a/src/event_handlers/websocket/Local.cpp +++ b/src/event_handlers/websocket/Local.cpp @@ -3,7 +3,7 @@ #include "event_handlers/impl/WSLocal.h" #include "Logging.h" -#include "serialization/_fbs/LocalToDeviceMessage_generated.h" +#include "serialization/_fbs/LocalToHubMessage_generated.h" #include @@ -14,7 +14,7 @@ static const char* TAG = "LocalMessageHandlers"; namespace Schemas = OpenShock::Serialization::Local; namespace Handlers = OpenShock::MessageHandlers::Local::_Private; -typedef Schemas::LocalToDeviceMessagePayload PayloadType; +typedef Schemas::LocalToHubMessagePayload PayloadType; using namespace OpenShock; @@ -40,7 +40,7 @@ static std::array s_localHandlers = []() { void EventHandlers::WebSocket::HandleLocalBinary(std::uint8_t socketId, const std::uint8_t* data, std::size_t len) { // Deserialize - auto msg = flatbuffers::GetRoot(data); + auto msg = flatbuffers::GetRoot(data); if (msg == nullptr) { ESP_LOGE(TAG, "Failed to deserialize message"); return; diff --git a/src/event_handlers/websocket/gateway/CaptivePortalConfig.cpp b/src/event_handlers/websocket/gateway/CaptivePortalConfig.cpp index b29216d3..4ee97ea1 100644 --- a/src/event_handlers/websocket/gateway/CaptivePortalConfig.cpp +++ b/src/event_handlers/websocket/gateway/CaptivePortalConfig.cpp @@ -9,7 +9,7 @@ const char* const TAG = "ServerMessageHandlers"; using namespace OpenShock::MessageHandlers::Server; -void _Private::HandleCaptivePortalConfig(const OpenShock::Serialization::Gateway::GatewayToDeviceMessage* root) { +void _Private::HandleCaptivePortalConfig(const OpenShock::Serialization::Gateway::GatewayToHubMessage* root) { auto msg = root->payload_as_CaptivePortalConfig(); if (msg == nullptr) { ESP_LOGE(TAG, "Payload cannot be parsed as CaptivePortalConfig"); diff --git a/src/event_handlers/websocket/gateway/OtaInstall.cpp b/src/event_handlers/websocket/gateway/OtaInstall.cpp index 18634fee..0f0b9a4a 100644 --- a/src/event_handlers/websocket/gateway/OtaInstall.cpp +++ b/src/event_handlers/websocket/gateway/OtaInstall.cpp @@ -10,7 +10,7 @@ const char* const TAG = "ServerMessageHandlers"; using namespace OpenShock::MessageHandlers::Server; -void _Private::HandleOtaInstall(const OpenShock::Serialization::Gateway::GatewayToDeviceMessage* root) { +void _Private::HandleOtaInstall(const OpenShock::Serialization::Gateway::GatewayToHubMessage* root) { auto msg = root->payload_as_OtaInstall(); if (msg == nullptr) { ESP_LOGE(TAG, "Payload cannot be parsed as OtaInstall"); diff --git a/src/event_handlers/websocket/gateway/ShockerCommandList.cpp b/src/event_handlers/websocket/gateway/ShockerCommandList.cpp index 6145c16d..8f7a3aca 100644 --- a/src/event_handlers/websocket/gateway/ShockerCommandList.cpp +++ b/src/event_handlers/websocket/gateway/ShockerCommandList.cpp @@ -10,7 +10,7 @@ const char* const TAG = "ServerMessageHandlers"; using namespace OpenShock::MessageHandlers::Server; -void _Private::HandleShockerCommandList(const OpenShock::Serialization::Gateway::GatewayToDeviceMessage* root) { +void _Private::HandleShockerCommandList(const OpenShock::Serialization::Gateway::GatewayToHubMessage* root) { auto msg = root->payload_as_ShockerCommandList(); if (msg == nullptr) { ESP_LOGE(TAG, "Payload cannot be parsed as ShockerCommandList"); diff --git a/src/event_handlers/websocket/gateway/_InvalidMessage.cpp b/src/event_handlers/websocket/gateway/_InvalidMessage.cpp index f5eb97d8..426cdf7c 100644 --- a/src/event_handlers/websocket/gateway/_InvalidMessage.cpp +++ b/src/event_handlers/websocket/gateway/_InvalidMessage.cpp @@ -7,7 +7,7 @@ const char* const TAG = "ServerMessageHandlers"; using namespace OpenShock::MessageHandlers::Server; -void _Private::HandleInvalidMessage(const OpenShock::Serialization::Gateway::GatewayToDeviceMessage* root) { +void _Private::HandleInvalidMessage(const OpenShock::Serialization::Gateway::GatewayToHubMessage* root) { if (root == nullptr) { ESP_LOGE(TAG, "Message cannot be parsed"); return; diff --git a/src/event_handlers/websocket/local/AccountLinkCommand.cpp b/src/event_handlers/websocket/local/AccountLinkCommand.cpp index 9bd34ce9..855803b7 100644 --- a/src/event_handlers/websocket/local/AccountLinkCommand.cpp +++ b/src/event_handlers/websocket/local/AccountLinkCommand.cpp @@ -13,7 +13,7 @@ void serializeSetRfTxPinResult(std::uint8_t socketId, OpenShock::Serialization:: auto responseOffset = builder.CreateStruct(OpenShock::Serialization::Local::AccountLinkCommandResult(result)); - auto msgOffset = OpenShock::Serialization::Local::CreateDeviceToLocalMessage(builder, OpenShock::Serialization::Local::DeviceToLocalMessagePayload::AccountLinkCommandResult, responseOffset.Union()); + auto msgOffset = OpenShock::Serialization::Local::CreateHubToLocalMessage(builder, OpenShock::Serialization::Local::HubToLocalMessagePayload::AccountLinkCommandResult, responseOffset.Union()); builder.Finish(msgOffset); @@ -25,7 +25,7 @@ void serializeSetRfTxPinResult(std::uint8_t socketId, OpenShock::Serialization:: using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleAccountLinkCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleAccountLinkCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { auto msg = root->payload_as_AccountLinkCommand(); if (msg == nullptr) { ESP_LOGE(TAG, "Payload cannot be parsed as AccountLinkCommand"); diff --git a/src/event_handlers/websocket/local/AccountUnlinkCommand.cpp b/src/event_handlers/websocket/local/AccountUnlinkCommand.cpp index aacba07a..c07aa0a8 100644 --- a/src/event_handlers/websocket/local/AccountUnlinkCommand.cpp +++ b/src/event_handlers/websocket/local/AccountUnlinkCommand.cpp @@ -9,7 +9,7 @@ const char* const TAG = "LocalMessageHandlers"; using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleAccountUnlinkCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleAccountUnlinkCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { (void)socketId; auto msg = root->payload_as_AccountUnlinkCommand(); diff --git a/src/event_handlers/websocket/local/SetRfTxPinCommand.cpp b/src/event_handlers/websocket/local/SetRfTxPinCommand.cpp index d7456a13..90b81131 100644 --- a/src/event_handlers/websocket/local/SetRfTxPinCommand.cpp +++ b/src/event_handlers/websocket/local/SetRfTxPinCommand.cpp @@ -14,7 +14,7 @@ void serializeSetRfTxPinResult(std::uint8_t socketId, std::uint8_t pin, OpenShoc auto responseOffset = builder.CreateStruct(OpenShock::Serialization::Local::SetRfTxPinCommandResult(pin, result)); - auto msgOffset = OpenShock::Serialization::Local::CreateDeviceToLocalMessage(builder, OpenShock::Serialization::Local::DeviceToLocalMessagePayload::SetRfTxPinCommandResult, responseOffset.Union()); + auto msgOffset = OpenShock::Serialization::Local::CreateHubToLocalMessage(builder, OpenShock::Serialization::Local::HubToLocalMessagePayload::SetRfTxPinCommandResult, responseOffset.Union()); builder.Finish(msgOffset); @@ -26,7 +26,7 @@ void serializeSetRfTxPinResult(std::uint8_t socketId, std::uint8_t pin, OpenShoc using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleSetRfTxPinCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleSetRfTxPinCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { auto msg = root->payload_as_SetRfTxPinCommand(); if (msg == nullptr) { ESP_LOGE(TAG, "Payload cannot be parsed as SetRfTxPinCommand"); diff --git a/src/event_handlers/websocket/local/WiFiNetworkConnectCommand.cpp b/src/event_handlers/websocket/local/WiFiNetworkConnectCommand.cpp index 445098c9..f53ff06d 100644 --- a/src/event_handlers/websocket/local/WiFiNetworkConnectCommand.cpp +++ b/src/event_handlers/websocket/local/WiFiNetworkConnectCommand.cpp @@ -10,7 +10,7 @@ const char* const TAG = "LocalMessageHandlers"; using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleWiFiNetworkConnectCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleWiFiNetworkConnectCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { (void)socketId; auto msg = root->payload_as_WifiNetworkConnectCommand(); diff --git a/src/event_handlers/websocket/local/WiFiNetworkDisconnectCommand.cpp b/src/event_handlers/websocket/local/WiFiNetworkDisconnectCommand.cpp index dfc6e913..d9b1712e 100644 --- a/src/event_handlers/websocket/local/WiFiNetworkDisconnectCommand.cpp +++ b/src/event_handlers/websocket/local/WiFiNetworkDisconnectCommand.cpp @@ -10,7 +10,7 @@ const char* const TAG = "LocalMessageHandlers"; using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleWiFiNetworkDisconnectCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleWiFiNetworkDisconnectCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { (void)socketId; auto msg = root->payload_as_WifiNetworkDisconnectCommand(); diff --git a/src/event_handlers/websocket/local/WiFiNetworkForgetCommand.cpp b/src/event_handlers/websocket/local/WiFiNetworkForgetCommand.cpp index 6514893e..15749cf3 100644 --- a/src/event_handlers/websocket/local/WiFiNetworkForgetCommand.cpp +++ b/src/event_handlers/websocket/local/WiFiNetworkForgetCommand.cpp @@ -10,7 +10,7 @@ const char* const TAG = "LocalMessageHandlers"; using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleWiFiNetworkForgetCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleWiFiNetworkForgetCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { (void)socketId; auto msg = root->payload_as_WifiNetworkForgetCommand(); diff --git a/src/event_handlers/websocket/local/WiFiNetworkSaveCommand.cpp b/src/event_handlers/websocket/local/WiFiNetworkSaveCommand.cpp index 3a254cee..12d8ced0 100644 --- a/src/event_handlers/websocket/local/WiFiNetworkSaveCommand.cpp +++ b/src/event_handlers/websocket/local/WiFiNetworkSaveCommand.cpp @@ -10,7 +10,7 @@ const char* const TAG = "LocalMessageHandlers"; using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleWiFiNetworkSaveCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleWiFiNetworkSaveCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { (void)socketId; auto msg = root->payload_as_WifiNetworkSaveCommand(); diff --git a/src/event_handlers/websocket/local/WiFiScanCommand.cpp b/src/event_handlers/websocket/local/WiFiScanCommand.cpp index 9450198c..b159ed93 100644 --- a/src/event_handlers/websocket/local/WiFiScanCommand.cpp +++ b/src/event_handlers/websocket/local/WiFiScanCommand.cpp @@ -7,7 +7,7 @@ const char* const TAG = "LocalMessageHandlers"; using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleWiFiScanCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleWiFiScanCommand(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { (void)socketId; auto msg = root->payload_as_WifiScanCommand(); diff --git a/src/event_handlers/websocket/local/_InvalidMessage.cpp b/src/event_handlers/websocket/local/_InvalidMessage.cpp index cb7b5817..2d87631f 100644 --- a/src/event_handlers/websocket/local/_InvalidMessage.cpp +++ b/src/event_handlers/websocket/local/_InvalidMessage.cpp @@ -6,7 +6,7 @@ const char* const TAG = "LocalMessageHandlers"; using namespace OpenShock::MessageHandlers::Local; -void _Private::HandleInvalidMessage(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToDeviceMessage* root) { +void _Private::HandleInvalidMessage(std::uint8_t socketId, const OpenShock::Serialization::Local::LocalToHubMessage* root) { (void)socketId; if (root == nullptr) { diff --git a/src/http/HTTPRequestManager.cpp b/src/http/HTTPRequestManager.cpp index faf33801..69b55f92 100644 --- a/src/http/HTTPRequestManager.cpp +++ b/src/http/HTTPRequestManager.cpp @@ -158,7 +158,7 @@ std::shared_ptr _getRateLimiter(StringView url) { } void _setupClient(HTTPClient& client) { - client.setUserAgent(OpenShock::Constants::FW_USERAGENT); + client.setUserAgent(OpenShock::Constants::FW_USERAGENT_sv.toArduinoString()); } struct StreamReaderResult { diff --git a/src/main.cpp b/src/main.cpp index d9e190af..f62331e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,7 +27,7 @@ bool trySetup() { ESP_PANIC(TAG, "Unable to initialize VisualStateManager"); } - OpenShock::EStopManager::Init(100); // 100ms update interval + OpenShock::EStopManager::Init(); if (!OpenShock::SerialInputHandler::Init()) { ESP_LOGE(TAG, "Unable to initialize SerialInputHandler"); diff --git a/src/radio/RFTransmitter.cpp b/src/radio/RFTransmitter.cpp index df9848f9..f43b77a4 100644 --- a/src/radio/RFTransmitter.cpp +++ b/src/radio/RFTransmitter.cpp @@ -179,9 +179,8 @@ void RFTransmitter::TransmitTask(void* arg) { } } - if(OpenShock::EStopManager::IsEStopped()) { - - std::int64_t whenEStoppedTime = EStopManager::WhenEStopped(); + if (OpenShock::EStopManager::IsEStopped()) { + std::int64_t whenEStoppedTime = EStopManager::LastEStopped(); for (auto it = commands.begin(); it != commands.end(); ++it) { cmd = *it; diff --git a/src/radio/rmt/CaiXianlinEncoder.cpp b/src/radio/rmt/CaiXianlinEncoder.cpp index fa1b88cc..87eb02f0 100644 --- a/src/radio/rmt/CaiXianlinEncoder.cpp +++ b/src/radio/rmt/CaiXianlinEncoder.cpp @@ -29,6 +29,7 @@ std::vector Rmt::CaiXianlinEncoder::GetSequence(std::uint16_t transm break; case ShockerCommandType::Sound: typeVal = 0x03; + intensity = 0; // Sound intensity must be 0 for some shockers, otherwise it wont work, or they soft lock until restarted break; default: return {}; // Invalid type diff --git a/src/radio/rmt/Petrainer998DREncoder.cpp b/src/radio/rmt/Petrainer998DREncoder.cpp index 68b1f0c2..b55b16af 100644 --- a/src/radio/rmt/Petrainer998DREncoder.cpp +++ b/src/radio/rmt/Petrainer998DREncoder.cpp @@ -5,6 +5,7 @@ const rmt_data_t kRmtPreamble = {1500, 1, 750, 0}; const rmt_data_t kRmtOne = {750, 1, 250, 0}; const rmt_data_t kRmtZero = {250, 1, 750, 0}; +const rmt_data_t kRmtPostamble = {1500, 0, 1500, 0}; // Some subvariants expect a quiet period between commands using namespace OpenShock; @@ -45,7 +46,7 @@ std::vector Rmt::Petrainer998DREncoder::GetSequence(std::uint16_t sh std::uint64_t data = (static_cast(channel & 0b111) << 35 | static_cast(typeVal & 0b1111) << 31 | static_cast(shockerId & 0x1FFFF) << 14 | static_cast(intensity & 0x7F) << 7 | static_cast(typeInvert & 0b1111) << 3 | static_cast(channelInvert & 0b111)); std::vector pulses; - pulses.reserve(42); + pulses.reserve(43); // Generate the sequence pulses.push_back(kRmtPreamble); @@ -53,6 +54,7 @@ std::vector Rmt::Petrainer998DREncoder::GetSequence(std::uint16_t sh Internal::EncodeBits<38>(pulses, data, kRmtOne, kRmtZero); pulses.push_back(kRmtZero); pulses.push_back(kRmtZero); + pulses.push_back(kRmtPostamble); return pulses; } diff --git a/src/serialization/WSGateway.cpp b/src/serialization/WSGateway.cpp index 0d0b046d..3ebfd48a 100644 --- a/src/serialization/WSGateway.cpp +++ b/src/serialization/WSGateway.cpp @@ -20,7 +20,7 @@ bool Gateway::SerializeKeepAliveMessage(Common::SerializationCallbackFn callback Gateway::KeepAlive keepAlive(static_cast(uptime)); auto keepAliveOffset = builder.CreateStruct(keepAlive); - auto msg = Gateway::CreateDeviceToGatewayMessage(builder, Gateway::DeviceToGatewayMessagePayload::KeepAlive, keepAliveOffset.Union()); + auto msg = Gateway::CreateHubToGatewayMessage(builder, Gateway::HubToGatewayMessagePayload::KeepAlive, keepAliveOffset.Union()); builder.Finish(msg); @@ -36,7 +36,7 @@ bool Gateway::SerializeBootStatusMessage(std::int32_t updateId, OpenShock::Firmw auto fbsBootStatus = Gateway::CreateBootStatus(builder, bootType, fbsVersion, updateId); - auto msg = Gateway::CreateDeviceToGatewayMessage(builder, Gateway::DeviceToGatewayMessagePayload::BootStatus, fbsBootStatus.Union()); + auto msg = Gateway::CreateHubToGatewayMessage(builder, Gateway::HubToGatewayMessagePayload::BootStatus, fbsBootStatus.Union()); builder.Finish(msg); @@ -52,7 +52,7 @@ bool Gateway::SerializeOtaInstallStartedMessage(std::int32_t updateId, const Ope auto otaInstallStartedOffset = Gateway::CreateOtaInstallStarted(builder, updateId, versionOffset); - auto msg = Gateway::CreateDeviceToGatewayMessage(builder, Gateway::DeviceToGatewayMessagePayload::OtaInstallStarted, otaInstallStartedOffset.Union()); + auto msg = Gateway::CreateHubToGatewayMessage(builder, Gateway::HubToGatewayMessagePayload::OtaInstallStarted, otaInstallStartedOffset.Union()); builder.Finish(msg); @@ -66,7 +66,7 @@ bool Gateway::SerializeOtaInstallProgressMessage(std::int32_t updateId, Gateway: auto otaInstallProgressOffset = Gateway::CreateOtaInstallProgress(builder, updateId, task, progress); - auto msg = Gateway::CreateDeviceToGatewayMessage(builder, Gateway::DeviceToGatewayMessagePayload::OtaInstallProgress, otaInstallProgressOffset.Union()); + auto msg = Gateway::CreateHubToGatewayMessage(builder, Gateway::HubToGatewayMessagePayload::OtaInstallProgress, otaInstallProgressOffset.Union()); builder.Finish(msg); @@ -82,7 +82,7 @@ bool Gateway::SerializeOtaInstallFailedMessage(std::int32_t updateId, StringView auto otaInstallFailedOffset = Gateway::CreateOtaInstallFailed(builder, updateId, messageOffset, fatal); - auto msg = Gateway::CreateDeviceToGatewayMessage(builder, Gateway::DeviceToGatewayMessagePayload::OtaInstallFailed, otaInstallFailedOffset.Union()); + auto msg = Gateway::CreateHubToGatewayMessage(builder, Gateway::HubToGatewayMessagePayload::OtaInstallFailed, otaInstallFailedOffset.Union()); builder.Finish(msg); diff --git a/src/serialization/WSLocal.cpp b/src/serialization/WSLocal.cpp index 68baff7c..88c1e5b9 100644 --- a/src/serialization/WSLocal.cpp +++ b/src/serialization/WSLocal.cpp @@ -5,7 +5,7 @@ #include "util/HexUtils.h" #include "wifi/WiFiNetwork.h" -#include "serialization/_fbs/DeviceToLocalMessage_generated.h" +#include "serialization/_fbs/HubToLocalMessage_generated.h" const char* const TAG = "WSLocal"; @@ -50,7 +50,7 @@ bool Local::SerializeErrorMessage(const char* message, Common::SerializationCall auto wrapperOffset = Local::CreateErrorMessage(builder, builder.CreateString(message)); - auto msg = Local::CreateDeviceToLocalMessage(builder, Local::DeviceToLocalMessagePayload::ErrorMessage, wrapperOffset.Union()); + auto msg = Local::CreateHubToLocalMessage(builder, Local::HubToLocalMessagePayload::ErrorMessage, wrapperOffset.Union()); builder.Finish(msg); @@ -80,7 +80,7 @@ bool Local::SerializeReadyMessage(const WiFiNetwork* connectedNetwork, bool acco auto readyMessageOffset = Serialization::Local::CreateReadyMessage(builder, true, fbsNetwork, accountLinked, configOffset); - auto msg = Serialization::Local::CreateDeviceToLocalMessage(builder, Serialization::Local::DeviceToLocalMessagePayload::ReadyMessage, readyMessageOffset.Union()); + auto msg = Serialization::Local::CreateHubToLocalMessage(builder, Serialization::Local::HubToLocalMessagePayload::ReadyMessage, readyMessageOffset.Union()); builder.Finish(msg); @@ -95,7 +95,7 @@ bool Local::SerializeWiFiScanStatusChangedEvent(OpenShock::WiFiScanStatus status Serialization::Local::WifiScanStatusMessage scanStatus(status); auto scanStatusOffset = builder.CreateStruct(scanStatus); - auto msg = Serialization::Local::CreateDeviceToLocalMessage(builder, Serialization::Local::DeviceToLocalMessagePayload::WifiScanStatusMessage, scanStatusOffset.Union()); + auto msg = Serialization::Local::CreateHubToLocalMessage(builder, Serialization::Local::HubToLocalMessagePayload::WifiScanStatusMessage, scanStatusOffset.Union()); builder.Finish(msg); @@ -111,7 +111,7 @@ bool Local::SerializeWiFiNetworkEvent(Types::WifiNetworkEventType eventType, con auto wrapperOffset = Local::CreateWifiNetworkEvent(builder, eventType, builder.CreateVector(&networkOffset, 1)); // Resulting vector will have 1 element - auto msg = Local::CreateDeviceToLocalMessage(builder, Local::DeviceToLocalMessagePayload::WifiNetworkEvent, wrapperOffset.Union()); + auto msg = Local::CreateHubToLocalMessage(builder, Local::HubToLocalMessagePayload::WifiNetworkEvent, wrapperOffset.Union()); builder.Finish(msg); @@ -132,7 +132,7 @@ bool Local::SerializeWiFiNetworksEvent(Types::WifiNetworkEventType eventType, co auto wrapperOffset = Local::CreateWifiNetworkEvent(builder, eventType, builder.CreateVector(fbsNetworks)); - auto msg = Local::CreateDeviceToLocalMessage(builder, Local::DeviceToLocalMessagePayload::WifiNetworkEvent, wrapperOffset.Union()); + auto msg = Local::CreateHubToLocalMessage(builder, Local::HubToLocalMessagePayload::WifiNetworkEvent, wrapperOffset.Union()); builder.Finish(msg); diff --git a/src/wifi/WiFiManager.cpp b/src/wifi/WiFiManager.cpp index 3e38a6a7..bdc4a290 100644 --- a/src/wifi/WiFiManager.cpp +++ b/src/wifi/WiFiManager.cpp @@ -210,7 +210,7 @@ void _evWiFiGotIP(arduino_event_t* event) { std::uint8_t ip[4]; memcpy(ip, &info.ip_info.ip.addr, sizeof(ip)); - ESP_LOGI(TAG, "Got IP address %u.%u.%u.%u from network " BSSID_FMT, ip[0], ip[1], ip[2], ip[3], BSSID_ARG(s_connectedBSSID)); + ESP_LOGI(TAG, "Got IP address " IPV4ADDR_FMT " from network " BSSID_FMT, IPV4ADDR_ARG(ip), BSSID_ARG(s_connectedBSSID)); } void _evWiFiGotIP6(arduino_event_t* event) { auto& info = event->event_info.got_ip6;