OSDN Git Service

gd: Add le read_remote_version_info
authorChris Manton <cmanton@google.com>
Sat, 7 Nov 2020 17:19:04 +0000 (09:19 -0800)
committerChris Manton <cmanton@google.com>
Sat, 7 Nov 2020 19:28:26 +0000 (11:28 -0800)
This command may be executed on both le and classic links

Bug: 171568335
Test: Paired phones on le link
Tag: #refactor

Change-Id: I573ec222ff96761704a080148b06fada37afc835

gd/hci/acl_manager/acl_connection.h
gd/hci/acl_manager/classic_acl_connection.h
gd/hci/acl_manager/le_acl_connection.cc
gd/hci/acl_manager/le_acl_connection.h

index 7981bf8..9c2d3f3 100644 (file)
@@ -34,6 +34,8 @@ class AclConnection {
     return handle_;
   }
 
+  virtual bool ReadRemoteVersionInformation() = 0;
+
   using Queue = common::BidiQueue<PacketView<kLittleEndian>, BasePacketBuilder>;
   using QueueUpEnd = common::BidiQueueEnd<BasePacketBuilder, PacketView<kLittleEndian>>;
   using QueueDownEnd = common::BidiQueueEnd<PacketView<kLittleEndian>, BasePacketBuilder>;
index c5394b0..8357e9d 100644 (file)
@@ -67,7 +67,7 @@ class ClassicAclConnection : public AclConnection {
   virtual bool ReadAfhChannelMap();
   virtual bool ReadRssi();
   virtual bool ReadClock(WhichClock which_clock);
-  virtual bool ReadRemoteVersionInformation();
+  virtual bool ReadRemoteVersionInformation() override;
   virtual bool ReadRemoteSupportedFeatures();
   virtual bool ReadRemoteExtendedFeatures(uint8_t page_number);
 
index 63e8635..737c600 100644 (file)
@@ -132,6 +132,10 @@ bool LeAclConnection::LeConnectionUpdate(uint16_t conn_interval_min, uint16_t co
   return true;
 }
 
+bool LeAclConnection::ReadRemoteVersionInformation() {
+  return false;
+}
+
 bool LeAclConnection::check_connection_parameters(
     uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout) {
   if (conn_interval_min < 0x0006 || conn_interval_min > 0x0C80 || conn_interval_max < 0x0006 ||
index 78ba04c..c764060 100644 (file)
@@ -55,6 +55,9 @@ class LeAclConnection : public AclConnection {
 
   virtual bool LeConnectionUpdate(uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency,
                                   uint16_t supervision_timeout, uint16_t min_ce_length, uint16_t max_ce_length);
+
+  virtual bool ReadRemoteVersionInformation() override;
+
   // TODO implement LeRemoteConnectionParameterRequestReply, LeRemoteConnectionParameterRequestNegativeReply
 
   // Called once before passing the connection to the client