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

Commit e9dc9bab authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge "service: handle remote_device_properties_cb callback"

parents e6db09d2 f6c1e98f
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -79,6 +79,20 @@ void AdapterPropertiesCallback(bt_status_t status,
      AdapterPropertiesCallback(status, num_properties, properties));
}

void RemoteDevicePropertiesCallback(bt_status_t status,
                               bt_bdaddr_t *remote_bd_addr,
                               int num_properties,
                               bt_property_t* properties) {
  lock_guard<mutex> lock(g_instance_lock);
  VERIFY_INTERFACE_OR_RETURN();
  VLOG(1) << " Remote device properties changed - status: " << BtStatusText(status)
          << " - BD_ADDR: " << BtAddrString(remote_bd_addr)
          << ", num_properties: " << num_properties;
  FOR_EACH_BLUETOOTH_OBSERVER(
      RemoteDevicePropertiesCallback(status, remote_bd_addr, num_properties,
                                     properties));
}

void DiscoveryStateChangedCallback(bt_discovery_state_t state) {
  lock_guard<mutex> lock(g_instance_lock);
  VERIFY_INTERFACE_OR_RETURN();
@@ -141,7 +155,7 @@ bt_callbacks_t bt_callbacks = {
  sizeof(bt_callbacks_t),
  AdapterStateChangedCallback,
  AdapterPropertiesCallback,
  nullptr, /* remote_device_properties_cb */
  RemoteDevicePropertiesCallback,
  nullptr, /* device_found_cb */
  DiscoveryStateChangedCallback,
  nullptr, /* pin_request_cb  */
@@ -281,6 +295,14 @@ void BluetoothInterface::Observer::AdapterPropertiesCallback(
  // Do nothing.
}

void BluetoothInterface::Observer::RemoteDevicePropertiesCallback(
    bt_status_t /* status */,
    bt_bdaddr_t* /* remote_bd_addr */,
    int /* num_properties */,
    bt_property_t* /* properties */) {
  // Do nothing.
}

void BluetoothInterface::Observer::DiscoveryStateChangedCallback(
    bt_discovery_state_t /* state */) {
  // Do nothing.
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ class BluetoothInterface {
    virtual void AdapterPropertiesCallback(bt_status_t status,
                                           int num_properties,
                                           bt_property_t* properties);
    virtual void RemoteDevicePropertiesCallback(bt_status_t status,
                                                bt_bdaddr_t *remote_bd_addr,
                                                int num_properties,
                                                bt_property_t* properties);
    virtual void DiscoveryStateChangedCallback(bt_discovery_state_t state);
    virtual void AclStateChangedCallback(bt_status_t status,
                                         const bt_bdaddr_t& remote_bdaddr,