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

Commit 8396516f authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Gerrit Code Review
Browse files

Merge changes I98e7c931,Ib1604a8f,I02e31bea

* changes:
  floss: Fix missing GD_CONTROLLER_MODULE
  floss: Change enum repr and D-Bus type from i32 to u32
  floss: Fix compiler warnings
parents 502596b4 490a2de5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ extern const module_t bte_logmsg_module;
extern const module_t btif_config_module;
extern const module_t btsnoop_module;
extern const module_t bt_utils_module;
extern const module_t controller_module;
extern const module_t gd_controller_module;
extern const module_t gd_idle_module;
extern const module_t gd_shim_module;
extern const module_t hci_module;
@@ -183,6 +183,7 @@ const struct module_lookup module_table[] = {
    {BTIF_CONFIG_MODULE, &btif_config_module},
    {BTSNOOP_MODULE, &btsnoop_module},
    {BT_UTILS_MODULE, &bt_utils_module},
    {GD_CONTROLLER_MODULE, &gd_controller_module},
    {GD_IDLE_MODULE, &gd_idle_module},
    {GD_SHIM_MODULE, &gd_shim_module},
    {INTEROP_MODULE, &interop_module},
@@ -200,7 +201,7 @@ inline const module_t* get_local_module(const char* name) {
    }
  }

  abort();
  LOG_ALWAYS_FATAL("Cannot find module %s, aborting", name);
  return nullptr;
}
#else
+5 −5
Original line number Diff line number Diff line
@@ -162,16 +162,16 @@ impl DisconnectWatcher {
macro_rules! impl_dbus_arg_enum {
    ($enum_type:ty) => {
        impl DBusArg for $enum_type {
            type DBusType = i32;
            type DBusType = u32;
            fn from_dbus(
                data: i32,
                data: u32,
                _conn: Option<Arc<SyncConnection>>,
                _remote: Option<dbus::strings::BusName<'static>>,
                _disconnect_watcher: Option<
                    Arc<std::sync::Mutex<dbus_projection::DisconnectWatcher>>,
                >,
            ) -> Result<$enum_type, Box<dyn std::error::Error>> {
                match <$enum_type>::from_i32(data) {
                match <$enum_type>::from_u32(data) {
                    Some(x) => Ok(x),
                    None => Err(Box::new(DBusArgError::new(String::from(format!(
                        "error converting {} to {}",
@@ -181,8 +181,8 @@ macro_rules! impl_dbus_arg_enum {
                }
            }

            fn to_dbus(data: $enum_type) -> Result<i32, Box<dyn std::error::Error>> {
                return Ok(data.to_i32().unwrap());
            fn to_dbus(data: $enum_type) -> Result<u32, Box<dyn std::error::Error>> {
                return Ok(data.to_u32().unwrap());
            }
        }
    };
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ use tokio::sync::mpsc;
pub const PID_DIR: &str = "/var/run/bluetooth";

#[derive(Debug, PartialEq, Copy, Clone)]
#[repr(i32)]
#[repr(u32)]
pub enum State {
    Off = 0,        // Bluetooth is not running
    TurningOn = 1,  // We are not notified that the Bluetooth is running
+1 −1
Original line number Diff line number Diff line
@@ -594,7 +594,7 @@ impl BtifBluetoothCallbacks for Bluetooth {

    fn remote_device_properties_changed(
        &mut self,
        status: BtStatus,
        _status: BtStatus,
        addr: RawAddress,
        _num_properties: i32,
        properties: Vec<BluetoothProperty>,
+1 −1
Original line number Diff line number Diff line
@@ -443,7 +443,7 @@ pub enum LePhy {
}

#[derive(Debug, FromPrimitive, ToPrimitive)]
#[repr(i32)]
#[repr(u32)]
/// Scan type configuration.
pub enum ScanType {
    Active = 0,
Loading