Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e2a70b7 authored by Qasim Javed's avatar Qasim Javed
Browse files

rusty-gd: Generate struct declarations and enums

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest

Change-Id: I0f04b289a4e6fd2e4c582869f77e6fd4d6e71d8a
parent 11f82043
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1119,7 +1119,7 @@ TEST_F(AclManagerWithConnectionTest, send_read_transmit_power_level) {
  auto packet = test_hci_layer_->GetCommandPacket(OpCode::READ_TRANSMIT_POWER_LEVEL);
  auto command_view = ReadTransmitPowerLevelView::Create(packet);
  ASSERT_TRUE(command_view.IsValid());
  ASSERT_EQ(command_view.GetType(), TransmitPowerLevelType::CURRENT);
  ASSERT_EQ(command_view.GetTransmitPowerLevelType(), TransmitPowerLevelType::CURRENT);

  EXPECT_CALL(mock_connection_management_callbacks_, OnReadTransmitPowerLevelComplete(0x07));
  uint8_t num_packets = 1;
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ class AclManagerFacadeService : public AclManagerFacade::Service, public Connect
      case OpCode::READ_TRANSMIT_POWER_LEVEL: {
        auto view = ReadTransmitPowerLevelView::Create(command_view);
        GET_CONNECTION(view);
        connection->second.connection_->ReadTransmitPowerLevel(view.GetType());
        connection->second.connection_->ReadTransmitPowerLevel(view.GetTransmitPowerLevelType());
        return ::grpc::Status::OK;
      }
      case OpCode::READ_LINK_SUPERVISION_TIMEOUT: {
+3 −3
Original line number Diff line number Diff line
@@ -1753,7 +1753,7 @@ enum TransmitPowerLevelType : 8 {
packet ReadTransmitPowerLevel : ConnectionManagementCommand (op_code = READ_TRANSMIT_POWER_LEVEL) {
  connection_handle : 12,
  _reserved_ : 4,
  type : TransmitPowerLevelType,
  transmit_power_level_type : TransmitPowerLevelType,

}

@@ -2491,7 +2491,7 @@ enum OwnAddressType : 8 {
packet LeSetAdvertisingParameters : LeAdvertisingCommand (op_code = LE_SET_ADVERTISING_PARAMETERS) {
  interval_min : 16,
  interval_max : 16,
  type : AdvertisingType,
  advt_type : AdvertisingType,
  own_address_type : OwnAddressType,
  peer_address_type : PeerAddressType,
  peer_address : Address,
@@ -3755,7 +3755,7 @@ packet LeMultiAdvtComplete : CommandComplete (command_op_code = LE_MULTI_ADVT) {
packet LeMultiAdvtParam : LeMultiAdvt (sub_cmd = SET_PARAM) {
  interval_min : 16,
  interval_max : 16,
  type : AdvertisingType,
  advt_type : AdvertisingType,
  own_address_type : OwnAddressType,
  peer_address_type : PeerAddressType,
  peer_address : Address,
+4 −0
Original line number Diff line number Diff line
@@ -195,3 +195,7 @@ void ArrayField::GenStringRepresentation(std::ostream& s, std::string accessor)
  s << ";}";
  s << "ss << \"]\"";
}

std::string ArrayField::GetRustDataType() const {
  return "[" + element_field_->GetRustDataType() + "; " + std::to_string(array_size_) + "]";
}
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ class ArrayField : public PacketField {

  virtual void GenStringRepresentation(std::ostream& s, std::string accessor) const override;

  virtual std::string GetRustDataType() const override;

  const std::string name_;

  const PacketField* element_field_{nullptr};
Loading