diff --git a/protocol/cpp/include/solarxr_protocol/generated/all_generated.h b/protocol/cpp/include/solarxr_protocol/generated/all_generated.h index 954bc042..88cda762 100644 --- a/protocol/cpp/include/solarxr_protocol/generated/all_generated.h +++ b/protocol/cpp/include/solarxr_protocol/generated/all_generated.h @@ -2492,7 +2492,8 @@ struct HardwareInfo FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_FIRMWARE_VERSION = 14, VT_HARDWARE_ADDRESS = 16, VT_IP_ADDRESS = 18, - VT_BOARD_TYPE_ID = 22, + VT_BOARD_TYPE = 20, + VT_OFFICIAL_BOARD_TYPE = 22, VT_HARDWARE_IDENTIFIER = 24 }; solarxr_protocol::datatypes::hardware_info::McuType mcu_id() const { @@ -2524,8 +2525,13 @@ struct HardwareInfo FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const solarxr_protocol::datatypes::Ipv4Address *ip_address() const { return GetStruct(VT_IP_ADDRESS); } - solarxr_protocol::datatypes::hardware_info::BoardType board_type_id() const { - return static_cast(GetField(VT_BOARD_TYPE_ID, 0)); + /// A board type string that can be used to name a board. if possible you should use official board type + const flatbuffers::String *board_type() const { + return GetPointer(VT_BOARD_TYPE); + } + /// An enum listing all the board types supported by the firmware + solarxr_protocol::datatypes::hardware_info::BoardType official_board_type() const { + return static_cast(GetField(VT_OFFICIAL_BOARD_TYPE, 0)); } /// A unique identifier for the device. Depending on the type of device it can be the MAC address, /// the IP address, or some other unique identifier like what USB device it is. @@ -2547,7 +2553,9 @@ struct HardwareInfo FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { verifier.VerifyString(firmware_version()) && VerifyField(verifier, VT_HARDWARE_ADDRESS, 8) && VerifyField(verifier, VT_IP_ADDRESS, 4) && - VerifyField(verifier, VT_BOARD_TYPE_ID, 2) && + VerifyOffset(verifier, VT_BOARD_TYPE) && + verifier.VerifyString(board_type()) && + VerifyField(verifier, VT_OFFICIAL_BOARD_TYPE, 2) && VerifyOffset(verifier, VT_HARDWARE_IDENTIFIER) && verifier.VerifyString(hardware_identifier()) && verifier.EndTable(); @@ -2582,8 +2590,11 @@ struct HardwareInfoBuilder { void add_ip_address(const solarxr_protocol::datatypes::Ipv4Address *ip_address) { fbb_.AddStruct(HardwareInfo::VT_IP_ADDRESS, ip_address); } - void add_board_type_id(solarxr_protocol::datatypes::hardware_info::BoardType board_type_id) { - fbb_.AddElement(HardwareInfo::VT_BOARD_TYPE_ID, static_cast(board_type_id), 0); + void add_board_type(flatbuffers::Offset board_type) { + fbb_.AddOffset(HardwareInfo::VT_BOARD_TYPE, board_type); + } + void add_official_board_type(solarxr_protocol::datatypes::hardware_info::BoardType official_board_type) { + fbb_.AddElement(HardwareInfo::VT_OFFICIAL_BOARD_TYPE, static_cast(official_board_type), 0); } void add_hardware_identifier(flatbuffers::Offset hardware_identifier) { fbb_.AddOffset(HardwareInfo::VT_HARDWARE_IDENTIFIER, hardware_identifier); @@ -2609,10 +2620,12 @@ inline flatbuffers::Offset CreateHardwareInfo( flatbuffers::Offset firmware_version = 0, const solarxr_protocol::datatypes::hardware_info::HardwareAddress *hardware_address = nullptr, const solarxr_protocol::datatypes::Ipv4Address *ip_address = nullptr, - solarxr_protocol::datatypes::hardware_info::BoardType board_type_id = solarxr_protocol::datatypes::hardware_info::BoardType::UNKNOWN, + flatbuffers::Offset board_type = 0, + solarxr_protocol::datatypes::hardware_info::BoardType official_board_type = solarxr_protocol::datatypes::hardware_info::BoardType::UNKNOWN, flatbuffers::Offset hardware_identifier = 0) { HardwareInfoBuilder builder_(_fbb); builder_.add_hardware_identifier(hardware_identifier); + builder_.add_board_type(board_type); builder_.add_ip_address(ip_address); builder_.add_hardware_address(hardware_address); builder_.add_firmware_version(firmware_version); @@ -2620,7 +2633,7 @@ inline flatbuffers::Offset CreateHardwareInfo( builder_.add_manufacturer(manufacturer); builder_.add_model(model); builder_.add_display_name(display_name); - builder_.add_board_type_id(board_type_id); + builder_.add_official_board_type(official_board_type); builder_.add_mcu_id(mcu_id); return builder_.Finish(); } @@ -2635,13 +2648,15 @@ inline flatbuffers::Offset CreateHardwareInfoDirect( const char *firmware_version = nullptr, const solarxr_protocol::datatypes::hardware_info::HardwareAddress *hardware_address = nullptr, const solarxr_protocol::datatypes::Ipv4Address *ip_address = nullptr, - solarxr_protocol::datatypes::hardware_info::BoardType board_type_id = solarxr_protocol::datatypes::hardware_info::BoardType::UNKNOWN, + const char *board_type = nullptr, + solarxr_protocol::datatypes::hardware_info::BoardType official_board_type = solarxr_protocol::datatypes::hardware_info::BoardType::UNKNOWN, const char *hardware_identifier = nullptr) { auto display_name__ = display_name ? _fbb.CreateString(display_name) : 0; auto model__ = model ? _fbb.CreateString(model) : 0; auto manufacturer__ = manufacturer ? _fbb.CreateString(manufacturer) : 0; auto hardware_revision__ = hardware_revision ? _fbb.CreateString(hardware_revision) : 0; auto firmware_version__ = firmware_version ? _fbb.CreateString(firmware_version) : 0; + auto board_type__ = board_type ? _fbb.CreateString(board_type) : 0; auto hardware_identifier__ = hardware_identifier ? _fbb.CreateString(hardware_identifier) : 0; return solarxr_protocol::datatypes::hardware_info::CreateHardwareInfo( _fbb, @@ -2653,7 +2668,8 @@ inline flatbuffers::Offset CreateHardwareInfoDirect( firmware_version__, hardware_address, ip_address, - board_type_id, + board_type__, + official_board_type, hardware_identifier__); } diff --git a/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.java b/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.java index 07885b71..b4523c61 100644 --- a/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.java +++ b/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.java @@ -53,7 +53,16 @@ public final class HardwareInfo extends Table { public solarxr_protocol.datatypes.hardware_info.HardwareAddress hardwareAddress(solarxr_protocol.datatypes.hardware_info.HardwareAddress obj) { int o = __offset(16); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; } public solarxr_protocol.datatypes.Ipv4Address ipAddress() { return ipAddress(new solarxr_protocol.datatypes.Ipv4Address()); } public solarxr_protocol.datatypes.Ipv4Address ipAddress(solarxr_protocol.datatypes.Ipv4Address obj) { int o = __offset(18); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; } - public int boardTypeId() { int o = __offset(22); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; } + /** + * A board type string that can be used to name a board. if possible you should use official board type + */ + public String boardType() { int o = __offset(20); return o != 0 ? __string(o + bb_pos) : null; } + public ByteBuffer boardTypeAsByteBuffer() { return __vector_as_bytebuffer(20, 1); } + public ByteBuffer boardTypeInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 20, 1); } + /** + * An enum listing all the board types supported by the firmware + */ + public int officialBoardType() { int o = __offset(22); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; } /** * A unique identifier for the device. Depending on the type of device it can be the MAC address, * the IP address, or some other unique identifier like what USB device it is. @@ -71,7 +80,8 @@ public final class HardwareInfo extends Table { public static void addFirmwareVersion(FlatBufferBuilder builder, int firmwareVersionOffset) { builder.addOffset(5, firmwareVersionOffset, 0); } public static void addHardwareAddress(FlatBufferBuilder builder, int hardwareAddressOffset) { builder.addStruct(6, hardwareAddressOffset, 0); } public static void addIpAddress(FlatBufferBuilder builder, int ipAddressOffset) { builder.addStruct(7, ipAddressOffset, 0); } - public static void addBoardTypeId(FlatBufferBuilder builder, int boardTypeId) { builder.addShort(9, (short) boardTypeId, (short) 0); } + public static void addBoardType(FlatBufferBuilder builder, int boardTypeOffset) { builder.addOffset(8, boardTypeOffset, 0); } + public static void addOfficialBoardType(FlatBufferBuilder builder, int officialBoardType) { builder.addShort(9, (short) officialBoardType, (short) 0); } public static void addHardwareIdentifier(FlatBufferBuilder builder, int hardwareIdentifierOffset) { builder.addOffset(10, hardwareIdentifierOffset, 0); } public static int endHardwareInfo(FlatBufferBuilder builder) { int o = builder.endTable(); @@ -106,8 +116,10 @@ public void unpackTo(HardwareInfoT _o) { else _o.setHardwareAddress(null); if (ipAddress() != null) ipAddress().unpackTo(_o.getIpAddress()); else _o.setIpAddress(null); - int _oBoardTypeId = boardTypeId(); - _o.setBoardTypeId(_oBoardTypeId); + String _oBoardType = boardType(); + _o.setBoardType(_oBoardType); + int _oOfficialBoardType = officialBoardType(); + _o.setOfficialBoardType(_oOfficialBoardType); String _oHardwareIdentifier = hardwareIdentifier(); _o.setHardwareIdentifier(_oHardwareIdentifier); } @@ -118,6 +130,7 @@ public static int pack(FlatBufferBuilder builder, HardwareInfoT _o) { int _manufacturer = _o.getManufacturer() == null ? 0 : builder.createString(_o.getManufacturer()); int _hardwareRevision = _o.getHardwareRevision() == null ? 0 : builder.createString(_o.getHardwareRevision()); int _firmwareVersion = _o.getFirmwareVersion() == null ? 0 : builder.createString(_o.getFirmwareVersion()); + int _boardType = _o.getBoardType() == null ? 0 : builder.createString(_o.getBoardType()); int _hardwareIdentifier = _o.getHardwareIdentifier() == null ? 0 : builder.createString(_o.getHardwareIdentifier()); startHardwareInfo(builder); addMcuId(builder, _o.getMcuId()); @@ -128,7 +141,8 @@ public static int pack(FlatBufferBuilder builder, HardwareInfoT _o) { addFirmwareVersion(builder, _firmwareVersion); addHardwareAddress(builder, solarxr_protocol.datatypes.hardware_info.HardwareAddress.pack(builder, _o.getHardwareAddress())); addIpAddress(builder, solarxr_protocol.datatypes.Ipv4Address.pack(builder, _o.getIpAddress())); - addBoardTypeId(builder, _o.getBoardTypeId()); + addBoardType(builder, _boardType); + addOfficialBoardType(builder, _o.getOfficialBoardType()); addHardwareIdentifier(builder, _hardwareIdentifier); return endHardwareInfo(builder); } diff --git a/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfoT.java b/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfoT.java index 4a0b9b74..150fbecf 100644 --- a/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfoT.java +++ b/protocol/java/src/solarxr_protocol/datatypes/hardware_info/HardwareInfoT.java @@ -16,7 +16,8 @@ public class HardwareInfoT { private String firmwareVersion; private solarxr_protocol.datatypes.hardware_info.HardwareAddressT hardwareAddress; private solarxr_protocol.datatypes.Ipv4AddressT ipAddress; - private int boardTypeId; + private String boardType; + private int officialBoardType; private String hardwareIdentifier; public int getMcuId() { return mcuId; } @@ -51,9 +52,13 @@ public class HardwareInfoT { public void setIpAddress(solarxr_protocol.datatypes.Ipv4AddressT ipAddress) { this.ipAddress = ipAddress; } - public int getBoardTypeId() { return boardTypeId; } + public String getBoardType() { return boardType; } - public void setBoardTypeId(int boardTypeId) { this.boardTypeId = boardTypeId; } + public void setBoardType(String boardType) { this.boardType = boardType; } + + public int getOfficialBoardType() { return officialBoardType; } + + public void setOfficialBoardType(int officialBoardType) { this.officialBoardType = officialBoardType; } public String getHardwareIdentifier() { return hardwareIdentifier; } @@ -69,7 +74,8 @@ public HardwareInfoT() { this.firmwareVersion = null; this.hardwareAddress = new solarxr_protocol.datatypes.hardware_info.HardwareAddressT(); this.ipAddress = new solarxr_protocol.datatypes.Ipv4AddressT(); - this.boardTypeId = 0; + this.boardType = null; + this.officialBoardType = 0; this.hardwareIdentifier = null; } } diff --git a/protocol/kotlin/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.kt b/protocol/kotlin/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.kt index ab1f99ea..0b5fa90d 100644 --- a/protocol/kotlin/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.kt +++ b/protocol/kotlin/src/solarxr_protocol/datatypes/hardware_info/HardwareInfo.kt @@ -92,7 +92,20 @@ class HardwareInfo : Table() { null } } - val boardTypeId : UShort + /** + * A board type string that can be used to name a board. if possible you should use official board type + */ + val boardType : String? + get() { + val o = __offset(20) + return if (o != 0) __string(o + bb_pos) else null + } + val boardTypeAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(20, 1) + fun boardTypeInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 20, 1) + /** + * An enum listing all the board types supported by the firmware + */ + val officialBoardType : UShort get() { val o = __offset(22) return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u @@ -137,7 +150,9 @@ class HardwareInfo : Table() { @JvmStatic fun addIpAddress(builder: FlatBufferBuilder, ipAddress: Int) = builder.addStruct(7, ipAddress, 0) @JvmStatic - fun addBoardTypeId(builder: FlatBufferBuilder, boardTypeId: UShort) = builder.addShort(9, boardTypeId.toShort(), 0) + fun addBoardType(builder: FlatBufferBuilder, boardType: Int) = builder.addOffset(8, boardType, 0) + @JvmStatic + fun addOfficialBoardType(builder: FlatBufferBuilder, officialBoardType: UShort) = builder.addShort(9, officialBoardType.toShort(), 0) @JvmStatic fun addHardwareIdentifier(builder: FlatBufferBuilder, hardwareIdentifier: Int) = builder.addOffset(10, hardwareIdentifier, 0) @JvmStatic diff --git a/protocol/rust/src/generated/solarxr_protocol/datatypes/hardware_info/hardware_info_generated.rs b/protocol/rust/src/generated/solarxr_protocol/datatypes/hardware_info/hardware_info_generated.rs index 9f6ff0d8..b6f5eb32 100644 --- a/protocol/rust/src/generated/solarxr_protocol/datatypes/hardware_info/hardware_info_generated.rs +++ b/protocol/rust/src/generated/solarxr_protocol/datatypes/hardware_info/hardware_info_generated.rs @@ -34,7 +34,8 @@ impl<'a> HardwareInfo<'a> { pub const VT_FIRMWARE_VERSION: flatbuffers::VOffsetT = 14; pub const VT_HARDWARE_ADDRESS: flatbuffers::VOffsetT = 16; pub const VT_IP_ADDRESS: flatbuffers::VOffsetT = 18; - pub const VT_BOARD_TYPE_ID: flatbuffers::VOffsetT = 22; + pub const VT_BOARD_TYPE: flatbuffers::VOffsetT = 20; + pub const VT_OFFICIAL_BOARD_TYPE: flatbuffers::VOffsetT = 22; pub const VT_HARDWARE_IDENTIFIER: flatbuffers::VOffsetT = 24; #[inline] @@ -48,6 +49,7 @@ impl<'a> HardwareInfo<'a> { ) -> flatbuffers::WIPOffset> { let mut builder = HardwareInfoBuilder::new(_fbb); if let Some(x) = args.hardware_identifier { builder.add_hardware_identifier(x); } + if let Some(x) = args.board_type { builder.add_board_type(x); } if let Some(x) = args.ip_address { builder.add_ip_address(x); } if let Some(x) = args.hardware_address { builder.add_hardware_address(x); } if let Some(x) = args.firmware_version { builder.add_firmware_version(x); } @@ -55,7 +57,7 @@ impl<'a> HardwareInfo<'a> { if let Some(x) = args.manufacturer { builder.add_manufacturer(x); } if let Some(x) = args.model { builder.add_model(x); } if let Some(x) = args.display_name { builder.add_display_name(x); } - builder.add_board_type_id(args.board_type_id); + builder.add_official_board_type(args.official_board_type); builder.add_mcu_id(args.mcu_id); builder.finish() } @@ -122,12 +124,21 @@ impl<'a> HardwareInfo<'a> { // which contains a valid value in this slot unsafe { self._tab.get::(HardwareInfo::VT_IP_ADDRESS, None)} } + /// A board type string that can be used to name a board. if possible you should use official board type #[inline] - pub fn board_type_id(&self) -> BoardType { + pub fn board_type(&self) -> Option<&'a str> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot - unsafe { self._tab.get::(HardwareInfo::VT_BOARD_TYPE_ID, Some(BoardType::UNKNOWN)).unwrap()} + unsafe { self._tab.get::>(HardwareInfo::VT_BOARD_TYPE, None)} + } + /// An enum listing all the board types supported by the firmware + #[inline] + pub fn official_board_type(&self) -> BoardType { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(HardwareInfo::VT_OFFICIAL_BOARD_TYPE, Some(BoardType::UNKNOWN)).unwrap()} } /// A unique identifier for the device. Depending on the type of device it can be the MAC address, /// the IP address, or some other unique identifier like what USB device it is. @@ -155,7 +166,8 @@ impl flatbuffers::Verifiable for HardwareInfo<'_> { .visit_field::>("firmware_version", Self::VT_FIRMWARE_VERSION, false)? .visit_field::("hardware_address", Self::VT_HARDWARE_ADDRESS, false)? .visit_field::("ip_address", Self::VT_IP_ADDRESS, false)? - .visit_field::("board_type_id", Self::VT_BOARD_TYPE_ID, false)? + .visit_field::>("board_type", Self::VT_BOARD_TYPE, false)? + .visit_field::("official_board_type", Self::VT_OFFICIAL_BOARD_TYPE, false)? .visit_field::>("hardware_identifier", Self::VT_HARDWARE_IDENTIFIER, false)? .finish(); Ok(()) @@ -170,7 +182,8 @@ pub struct HardwareInfoArgs<'a> { pub firmware_version: Option>, pub hardware_address: Option<&'a HardwareAddress>, pub ip_address: Option<&'a super::Ipv4Address>, - pub board_type_id: BoardType, + pub board_type: Option>, + pub official_board_type: BoardType, pub hardware_identifier: Option>, } impl<'a> Default for HardwareInfoArgs<'a> { @@ -185,7 +198,8 @@ impl<'a> Default for HardwareInfoArgs<'a> { firmware_version: None, hardware_address: None, ip_address: None, - board_type_id: BoardType::UNKNOWN, + board_type: None, + official_board_type: BoardType::UNKNOWN, hardware_identifier: None, } } @@ -229,8 +243,12 @@ impl<'a: 'b, 'b> HardwareInfoBuilder<'a, 'b> { self.fbb_.push_slot_always::<&super::Ipv4Address>(HardwareInfo::VT_IP_ADDRESS, ip_address); } #[inline] - pub fn add_board_type_id(&mut self, board_type_id: BoardType) { - self.fbb_.push_slot::(HardwareInfo::VT_BOARD_TYPE_ID, board_type_id, BoardType::UNKNOWN); + pub fn add_board_type(&mut self, board_type: flatbuffers::WIPOffset<&'b str>) { + self.fbb_.push_slot_always::>(HardwareInfo::VT_BOARD_TYPE, board_type); + } + #[inline] + pub fn add_official_board_type(&mut self, official_board_type: BoardType) { + self.fbb_.push_slot::(HardwareInfo::VT_OFFICIAL_BOARD_TYPE, official_board_type, BoardType::UNKNOWN); } #[inline] pub fn add_hardware_identifier(&mut self, hardware_identifier: flatbuffers::WIPOffset<&'b str>) { @@ -262,7 +280,8 @@ impl core::fmt::Debug for HardwareInfo<'_> { ds.field("firmware_version", &self.firmware_version()); ds.field("hardware_address", &self.hardware_address()); ds.field("ip_address", &self.ip_address()); - ds.field("board_type_id", &self.board_type_id()); + ds.field("board_type", &self.board_type()); + ds.field("official_board_type", &self.official_board_type()); ds.field("hardware_identifier", &self.hardware_identifier()); ds.finish() } diff --git a/protocol/typescript/src/solarxr-protocol/datatypes/hardware-info/hardware-info.ts b/protocol/typescript/src/solarxr-protocol/datatypes/hardware-info/hardware-info.ts index 3ca5fb03..879bf0a0 100644 --- a/protocol/typescript/src/solarxr-protocol/datatypes/hardware-info/hardware-info.ts +++ b/protocol/typescript/src/solarxr-protocol/datatypes/hardware-info/hardware-info.ts @@ -94,7 +94,20 @@ ipAddress(obj?:Ipv4Address):Ipv4Address|null { return offset ? (obj || new Ipv4Address()).__init(this.bb_pos + offset, this.bb!) : null; } -boardTypeId():BoardType { +/** + * A board type string that can be used to name a board. if possible you should use official board type + */ +boardType():string|null +boardType(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null +boardType(optionalEncoding?:any):string|Uint8Array|null { + const offset = this.bb!.__offset(this.bb_pos, 20); + return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; +} + +/** + * An enum listing all the board types supported by the firmware + */ +officialBoardType():BoardType { const offset = this.bb!.__offset(this.bb_pos, 22); return offset ? this.bb!.readUint16(this.bb_pos + offset) : BoardType.UNKNOWN; } @@ -146,8 +159,12 @@ static addIpAddress(builder:flatbuffers.Builder, ipAddressOffset:flatbuffers.Off builder.addFieldStruct(7, ipAddressOffset, 0); } -static addBoardTypeId(builder:flatbuffers.Builder, boardTypeId:BoardType) { - builder.addFieldInt16(9, boardTypeId, BoardType.UNKNOWN); +static addBoardType(builder:flatbuffers.Builder, boardTypeOffset:flatbuffers.Offset) { + builder.addFieldOffset(8, boardTypeOffset, 0); +} + +static addOfficialBoardType(builder:flatbuffers.Builder, officialBoardType:BoardType) { + builder.addFieldInt16(9, officialBoardType, BoardType.UNKNOWN); } static addHardwareIdentifier(builder:flatbuffers.Builder, hardwareIdentifierOffset:flatbuffers.Offset) { @@ -170,7 +187,8 @@ unpack(): HardwareInfoT { this.firmwareVersion(), (this.hardwareAddress() !== null ? this.hardwareAddress()!.unpack() : null), (this.ipAddress() !== null ? this.ipAddress()!.unpack() : null), - this.boardTypeId(), + this.boardType(), + this.officialBoardType(), this.hardwareIdentifier() ); } @@ -185,7 +203,8 @@ unpackTo(_o: HardwareInfoT): void { _o.firmwareVersion = this.firmwareVersion(); _o.hardwareAddress = (this.hardwareAddress() !== null ? this.hardwareAddress()!.unpack() : null); _o.ipAddress = (this.ipAddress() !== null ? this.ipAddress()!.unpack() : null); - _o.boardTypeId = this.boardTypeId(); + _o.boardType = this.boardType(); + _o.officialBoardType = this.officialBoardType(); _o.hardwareIdentifier = this.hardwareIdentifier(); } } @@ -200,7 +219,8 @@ constructor( public firmwareVersion: string|Uint8Array|null = null, public hardwareAddress: HardwareAddressT|null = null, public ipAddress: Ipv4AddressT|null = null, - public boardTypeId: BoardType = BoardType.UNKNOWN, + public boardType: string|Uint8Array|null = null, + public officialBoardType: BoardType = BoardType.UNKNOWN, public hardwareIdentifier: string|Uint8Array|null = null ){} @@ -211,6 +231,7 @@ pack(builder:flatbuffers.Builder): flatbuffers.Offset { const manufacturer = (this.manufacturer !== null ? builder.createString(this.manufacturer!) : 0); const hardwareRevision = (this.hardwareRevision !== null ? builder.createString(this.hardwareRevision!) : 0); const firmwareVersion = (this.firmwareVersion !== null ? builder.createString(this.firmwareVersion!) : 0); + const boardType = (this.boardType !== null ? builder.createString(this.boardType!) : 0); const hardwareIdentifier = (this.hardwareIdentifier !== null ? builder.createString(this.hardwareIdentifier!) : 0); HardwareInfo.startHardwareInfo(builder); @@ -222,7 +243,8 @@ pack(builder:flatbuffers.Builder): flatbuffers.Offset { HardwareInfo.addFirmwareVersion(builder, firmwareVersion); HardwareInfo.addHardwareAddress(builder, (this.hardwareAddress !== null ? this.hardwareAddress!.pack(builder) : 0)); HardwareInfo.addIpAddress(builder, (this.ipAddress !== null ? this.ipAddress!.pack(builder) : 0)); - HardwareInfo.addBoardTypeId(builder, this.boardTypeId); + HardwareInfo.addBoardType(builder, boardType); + HardwareInfo.addOfficialBoardType(builder, this.officialBoardType); HardwareInfo.addHardwareIdentifier(builder, hardwareIdentifier); return HardwareInfo.endHardwareInfo(builder); diff --git a/schema/datatypes/hardware_info.fbs b/schema/datatypes/hardware_info.fbs index 4e5dcbc7..2e1b438c 100644 --- a/schema/datatypes/hardware_info.fbs +++ b/schema/datatypes/hardware_info.fbs @@ -70,8 +70,11 @@ table HardwareInfo { ip_address: solarxr_protocol.datatypes.Ipv4Address; - board_type: string (deprecated); - board_type_id: BoardType; + /// A board type string that can be used to name a board. if possible you should use official board type + board_type: string; + + /// An enum listing all the board types supported by the firmware + official_board_type: BoardType; /// A unique identifier for the device. Depending on the type of device it can be the MAC address, /// the IP address, or some other unique identifier like what USB device it is.