Skip to content

Commit

Permalink
Upgrade flatbuffers
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Feb 14, 2025
1 parent 65082cd commit d2f1af6
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ active():boolean {
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
}

/**
* Set When EmergencyStop is a latching switch
*/
latching():boolean {
const offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
}

static startEStopConfig(builder:flatbuffers.Builder) {
builder.startObject(3);
builder.startObject(4);
}

static addEnabled(builder:flatbuffers.Builder, enabled:boolean) {
Expand All @@ -59,16 +67,21 @@ static addActive(builder:flatbuffers.Builder, active:boolean) {
builder.addFieldInt8(2, +active, +false);
}

static addLatching(builder:flatbuffers.Builder, latching:boolean) {
builder.addFieldInt8(3, +latching, +false);
}

static endEStopConfig(builder:flatbuffers.Builder):flatbuffers.Offset {
const offset = builder.endObject();
return offset;
}

static createEStopConfig(builder:flatbuffers.Builder, enabled:boolean, gpioPin:number, active:boolean):flatbuffers.Offset {
static createEStopConfig(builder:flatbuffers.Builder, enabled:boolean, gpioPin:number, active:boolean, latching:boolean):flatbuffers.Offset {
EStopConfig.startEStopConfig(builder);
EStopConfig.addEnabled(builder, enabled);
EStopConfig.addGpioPin(builder, gpioPin);
EStopConfig.addActive(builder, active);
EStopConfig.addLatching(builder, latching);
return EStopConfig.endEStopConfig(builder);
}
}
4 changes: 2 additions & 2 deletions include/serialization/_fbs/FirmwareBootType_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/GatewayToHubMessage_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

#include "SemVer_generated.h"
Expand Down
19 changes: 15 additions & 4 deletions include/serialization/_fbs/HubConfig_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down Expand Up @@ -190,7 +190,8 @@ struct EStopConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ENABLED = 4,
VT_GPIO_PIN = 6,
VT_ACTIVE = 8
VT_ACTIVE = 8,
VT_LATCHING = 10
};
bool enabled() const {
return GetField<uint8_t>(VT_ENABLED, 0) != 0;
Expand All @@ -203,11 +204,16 @@ struct EStopConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
bool active() const {
return GetField<uint8_t>(VT_ACTIVE, 0) != 0;
}
/// Set When EmergencyStop is a latching switch
bool latching() const {
return GetField<uint8_t>(VT_LATCHING, 0) != 0;
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint8_t>(verifier, VT_ENABLED, 1) &&
VerifyField<int8_t>(verifier, VT_GPIO_PIN, 1) &&
VerifyField<uint8_t>(verifier, VT_ACTIVE, 1) &&
VerifyField<uint8_t>(verifier, VT_LATCHING, 1) &&
verifier.EndTable();
}
};
Expand All @@ -225,6 +231,9 @@ struct EStopConfigBuilder {
void add_active(bool active) {
fbb_.AddElement<uint8_t>(EStopConfig::VT_ACTIVE, static_cast<uint8_t>(active), 0);
}
void add_latching(bool latching) {
fbb_.AddElement<uint8_t>(EStopConfig::VT_LATCHING, static_cast<uint8_t>(latching), 0);
}
explicit EStopConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
Expand All @@ -240,8 +249,10 @@ inline ::flatbuffers::Offset<EStopConfig> CreateEStopConfig(
::flatbuffers::FlatBufferBuilder &_fbb,
bool enabled = false,
int8_t gpio_pin = 0,
bool active = false) {
bool active = false,
bool latching = false) {
EStopConfigBuilder builder_(_fbb);
builder_.add_latching(latching);
builder_.add_active(active);
builder_.add_gpio_pin(gpio_pin);
builder_.add_enabled(enabled);
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/HubToGatewayMessage_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

#include "FirmwareBootType_generated.h"
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/HubToLocalMessage_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

#include "HubConfig_generated.h"
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/LocalToHubMessage_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/OtaUpdateProgressTask_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/SemVer_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/ShockerCommandType_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/ShockerModelType_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/WifiAuthMode_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/WifiNetworkEventType_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/WifiNetwork_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

#include "WifiAuthMode_generated.h"
Expand Down
4 changes: 2 additions & 2 deletions include/serialization/_fbs/WifiScanStatus_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// 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 == 25 &&
FLATBUFFERS_VERSION_MINOR == 1 &&
FLATBUFFERS_VERSION_REVISION == 24,
FLATBUFFERS_VERSION_MINOR == 2 &&
FLATBUFFERS_VERSION_REVISION == 10,
"Non-compatible flatbuffers version included");

namespace OpenShock {
Expand Down
Binary file modified scripts/flatc
Binary file not shown.
Binary file modified scripts/flatc.exe
Binary file not shown.

1 comment on commit d2f1af6

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v18.1.3) reports: 14 file(s) not formatted
  • include/serialization/_fbs/FirmwareBootType_generated.h
  • include/serialization/_fbs/GatewayToHubMessage_generated.h
  • include/serialization/_fbs/HubConfig_generated.h
  • include/serialization/_fbs/HubToGatewayMessage_generated.h
  • include/serialization/_fbs/HubToLocalMessage_generated.h
  • include/serialization/_fbs/LocalToHubMessage_generated.h
  • include/serialization/_fbs/OtaUpdateProgressTask_generated.h
  • include/serialization/_fbs/SemVer_generated.h
  • include/serialization/_fbs/ShockerCommandType_generated.h
  • include/serialization/_fbs/ShockerModelType_generated.h
  • include/serialization/_fbs/WifiAuthMode_generated.h
  • include/serialization/_fbs/WifiNetworkEventType_generated.h
  • include/serialization/_fbs/WifiNetwork_generated.h
  • include/serialization/_fbs/WifiScanStatus_generated.h

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.