IsoPacket -> Iso, ScoPacket -> Sco
Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I10a058723fe42c731808d6005a9ed32c928e10c0
diff --git a/system/gd/hal/fuzz/fuzz_hci_hal.cc b/system/gd/hal/fuzz/fuzz_hci_hal.cc
index 5936ab4..42653ce 100644
--- a/system/gd/hal/fuzz/fuzz_hci_hal.cc
+++ b/system/gd/hal/fuzz/fuzz_hci_hal.cc
@@ -94,7 +94,7 @@
}
void FuzzHciHal::injectScoData(std::vector<uint8_t> data) {
- hci::ScoPacketView scoPacket = hci::ScoPacketView::FromBytes(data);
+ hci::ScoView scoPacket = hci::ScoView::FromBytes(data);
if (!scoPacket.IsValid()) {
return;
}
diff --git a/system/gd/hci/hci_packets.pdl b/system/gd/hci/hci_packets.pdl
index 0cf82f6..edec775 100644
--- a/system/gd/hci/hci_packets.pdl
+++ b/system/gd/hci/hci_packets.pdl
@@ -65,7 +65,7 @@
PARTIALLY_LOST = 3,
}
-packet ScoPacket {
+packet Sco {
handle : 12,
packet_status_flag : PacketStatusFlag,
_reserved_ : 2, // BroadcastFlag
@@ -4744,7 +4744,7 @@
PRESENT = 1,
}
-packet IsoPacket {
+packet Iso {
connection_handle : 12,
pb_flag : IsoPacketBoundaryFlag,
ts_flag : TimeStampFlag,
@@ -4760,7 +4760,7 @@
LOST_DATA = 2,
}
-packet IsoPacketWithTimestamp : IsoPacket (ts_flag = PRESENT) {
+packet IsoWithTimestamp : Iso (ts_flag = PRESENT) {
time_stamp : 32,
packet_sequence_number : 16,
_size_(_payload_) : 12, // iso_sdu_length
@@ -4769,7 +4769,7 @@
_payload_,
}
-packet IsoPacketWithoutTimestamp : IsoPacket (ts_flag = NOT_PRESENT) {
+packet IsoWithoutTimestamp : Iso (ts_flag = NOT_PRESENT) {
packet_sequence_number : 16,
_size_(_payload_) : 12, // iso_sdu_length
_reserved_ : 2,
diff --git a/system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc b/system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc
index 03fbd32..b056bf9 100644
--- a/system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc
+++ b/system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc
@@ -334,7 +334,7 @@
void DualModeController::HandleSco(std::shared_ptr<std::vector<uint8_t>> packet) {
bluetooth::hci::PacketView<bluetooth::hci::kLittleEndian> raw_packet(packet);
- auto sco_packet = bluetooth::hci::ScoPacketView::Create(raw_packet);
+ auto sco_packet = bluetooth::hci::ScoView::Create(raw_packet);
if (loopback_mode_ == LoopbackMode::ENABLE_LOCAL) {
uint16_t handle = sco_packet.GetHandle();
send_sco_(packet);
@@ -352,7 +352,7 @@
void DualModeController::HandleIso(
std::shared_ptr<std::vector<uint8_t>> packet) {
bluetooth::hci::PacketView<bluetooth::hci::kLittleEndian> raw_packet(packet);
- auto iso = bluetooth::hci::IsoPacketView::Create(raw_packet);
+ auto iso = bluetooth::hci::IsoView::Create(raw_packet);
link_layer_controller_.HandleIso(iso);
}
diff --git a/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc b/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc
index 908d895..535308d 100644
--- a/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc
+++ b/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc
@@ -834,10 +834,10 @@
return;
}
LOG_INFO("ISO packet scheduling is not implemented");
- // send_iso_(bluetooth::hci::IsoPacketWithTimestampBuilder::Create())
+ // send_iso_(bluetooth::hci::IsoWithTimestampBuilder::Create())
}
-void LinkLayerController::HandleIso(bluetooth::hci::IsoPacketView iso) {
+void LinkLayerController::HandleIso(bluetooth::hci::IsoView iso) {
auto cis_handle = iso.GetConnectionHandle();
if (!connections_.HasCisHandle(cis_handle)) {
LOG_INFO("Dropping ISO packet to unknown handle 0x%hx", cis_handle);
@@ -878,7 +878,7 @@
payload->AddOctets1(it);
}
if (start_flag == model::packets::StartContinuation::START) {
- auto timestamped = bluetooth::hci::IsoPacketWithTimestampView::Create(iso);
+ auto timestamped = bluetooth::hci::IsoWithTimestampView::Create(iso);
ASSERT(timestamped.IsValid());
uint32_t timestamp = timestamped.GetTimeStamp();
SendLeLinkLayerPacket(model::packets::IsoStartBuilder::Create(
diff --git a/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h b/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h
index 2cee153..a9addf6 100644
--- a/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h
+++ b/system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h
@@ -43,7 +43,7 @@
const Address& remote);
ErrorCode SendCommandToRemoteByHandle(
OpCode opcode, bluetooth::packet::PacketView<true> args, uint16_t handle);
- ErrorCode SendScoToRemote(bluetooth::hci::ScoPacketView sco_packet);
+ ErrorCode SendScoToRemote(bluetooth::hci::ScoView sco_packet);
ErrorCode SendAclToRemote(bluetooth::hci::AclView acl_packet);
void StartSimplePairing(const Address& address);
@@ -326,7 +326,7 @@
void ReadLocalOobData();
void ReadLocalOobExtendedData();
- void HandleIso(bluetooth::hci::IsoPacketView iso);
+ void HandleIso(bluetooth::hci::IsoView iso);
protected:
void SendLeLinkLayerPacket(