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

Commit a28dd57f authored by Chris Manton's avatar Chris Manton
Browse files

gd shim layer changes

Bug: 144171652
Test: bluetooth_test_gd

Change-Id: If56602e1a90d692435b4366b98c959cc4a13e09f
parent 610f7012
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -34,7 +34,10 @@ using ReadDataReadyCallback = std::function<void(uint16_t cid, std::vector<const

struct IL2cap {
  virtual void RegisterService(uint16_t psm, ConnectionOpenCallback on_open, std::promise<void> completed) = 0;
  virtual void UnregisterService(uint16_t psm) = 0;

  virtual void CreateConnection(uint16_t psm, const std::string address, std::promise<uint16_t> completed) = 0;
  virtual void CloseConnection(uint16_t cid) = 0;

  virtual void SetReadDataReadyCallback(uint16_t cid, ReadDataReadyCallback on_data_ready) = 0;
  virtual void SetConnectionClosedCallback(uint16_t cid, ConnectionClosedCallback on_closed) = 0;
+192 −113

File changed.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
@@ -30,7 +30,10 @@ namespace shim {
class L2cap : public bluetooth::Module, public bluetooth::shim::IL2cap {
 public:
  void RegisterService(uint16_t psm, ConnectionOpenCallback on_open, std::promise<void> completed) override;
  void UnregisterService(uint16_t psm) override;

  void CreateConnection(uint16_t psm, const std::string address, std::promise<uint16_t> completed) override;
  void CloseConnection(uint16_t cid) override;

  void SetReadDataReadyCallback(uint16_t cid, ReadDataReadyCallback on_data_ready) override;
  void SetConnectionClosedCallback(uint16_t cid, ConnectionClosedCallback on_closed) override;
+4 −0
Original line number Diff line number Diff line
@@ -34,11 +34,15 @@ void TestGdShimL2cap::RegisterService(
  completed.set_value();
}

void TestGdShimL2cap::UnregisterService(uint16_t psm) {}

void TestGdShimL2cap::CreateConnection(uint16_t psm, const std::string address,
                                       std::promise<uint16_t> completed) {
  completed.set_value(cid_);
}

void TestGdShimL2cap::CloseConnection(uint16_t cid) {}

void TestGdShimL2cap::SetReadDataReadyCallback(
    uint16_t cid, bluetooth::shim::ReadDataReadyCallback on_data_ready) {}

+2 −0
Original line number Diff line number Diff line
@@ -30,8 +30,10 @@ class TestGdShimL2cap : public bluetooth::shim::IL2cap {
  void RegisterService(uint16_t psm,
                       bluetooth::shim::ConnectionOpenCallback on_open,
                       std::promise<void> completed) override;
  void UnregisterService(uint16_t psm);
  void CreateConnection(uint16_t psm, const std::string address,
                        std::promise<uint16_t> completed) override;
  void CloseConnection(uint16_t cid);
  void SetReadDataReadyCallback(
      uint16_t cid,
      bluetooth::shim::ReadDataReadyCallback on_data_ready) override;