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

Commit 0a6b02f2 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang Committed by Automerger Merge Worker
Browse files

Merge "floss: GATT/Battery/DIS DBus: Change address type to RawAddress" into...

Merge "floss: GATT/Battery/DIS DBus: Change address type to RawAddress" into main am: a8bf44a7 am: 1ee732cb

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3102686



Change-Id: I20c98da9e144d16bedbb5a128f69b12be6d71755
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 53d70f3d 1ee732cb
Loading
Loading
Loading
Loading
+83 −56
Original line number Diff line number Diff line
@@ -576,12 +576,12 @@ impl IAdvertisingSetCallback for AdvertisingSetCallback {
        }
    }

    fn on_own_address_read(&mut self, advertiser_id: i32, address_type: i32, address: String) {
    fn on_own_address_read(&mut self, advertiser_id: i32, address_type: i32, address: RawAddress) {
        print_info!(
            "on_own_address_read: advertiser_id = {}, address_type = {}, address = {}",
            advertiser_id,
            address_type,
            address
            address.to_string()
        );
    }

@@ -718,31 +718,37 @@ impl IBluetoothGattCallback for BtGattCallback {
        status: GattStatus,
        client_id: i32,
        connected: bool,
        addr: String,
        addr: RawAddress,
    ) {
        print_info!(
            "GATT Client connection state = {}, client_id = {}, connected = {}, addr = {}",
            status,
            client_id,
            connected,
            addr
            addr.to_string()
        );
    }

    fn on_phy_update(&mut self, addr: String, tx_phy: LePhy, rx_phy: LePhy, status: GattStatus) {
    fn on_phy_update(
        &mut self,
        addr: RawAddress,
        tx_phy: LePhy,
        rx_phy: LePhy,
        status: GattStatus,
    ) {
        print_info!(
            "Phy updated: addr = {}, tx_phy = {:?}, rx_phy = {:?}, status = {:?}",
            addr,
            addr.to_string(),
            tx_phy,
            rx_phy,
            status
        );
    }

    fn on_phy_read(&mut self, addr: String, tx_phy: LePhy, rx_phy: LePhy, status: GattStatus) {
    fn on_phy_read(&mut self, addr: RawAddress, tx_phy: LePhy, rx_phy: LePhy, status: GattStatus) {
        print_info!(
            "Phy read: addr = {}, tx_phy = {:?}, rx_phy = {:?}, status = {:?}",
            addr,
            addr.to_string(),
            tx_phy,
            rx_phy,
            status
@@ -751,13 +757,13 @@ impl IBluetoothGattCallback for BtGattCallback {

    fn on_search_complete(
        &mut self,
        addr: String,
        addr: RawAddress,
        services: Vec<BluetoothGattService>,
        status: GattStatus,
    ) {
        print_info!(
            "GATT DB Search complete: addr = {}, services = {:?}, status = {}",
            addr,
            addr.to_string(),
            services,
            status
        );
@@ -765,73 +771,88 @@ impl IBluetoothGattCallback for BtGattCallback {

    fn on_characteristic_read(
        &mut self,
        addr: String,
        addr: RawAddress,
        status: GattStatus,
        handle: i32,
        value: Vec<u8>,
    ) {
        print_info!(
            "GATT Characteristic read: addr = {}, status = {}, handle = {}, value = {:?}",
            addr,
            addr.to_string(),
            status,
            handle,
            value
        );
    }

    fn on_characteristic_write(&mut self, addr: String, status: GattStatus, handle: i32) {
    fn on_characteristic_write(&mut self, addr: RawAddress, status: GattStatus, handle: i32) {
        print_info!(
            "GATT Characteristic write: addr = {}, status = {}, handle = {}",
            addr,
            addr.to_string(),
            status,
            handle
        );
    }

    fn on_execute_write(&mut self, addr: String, status: GattStatus) {
        print_info!("GATT execute write addr = {}, status = {}", addr, status);
    fn on_execute_write(&mut self, addr: RawAddress, status: GattStatus) {
        print_info!("GATT execute write addr = {}, status = {}", addr.to_string(), status);
    }

    fn on_descriptor_read(
        &mut self,
        addr: String,
        addr: RawAddress,
        status: GattStatus,
        handle: i32,
        value: Vec<u8>,
    ) {
        print_info!(
            "GATT Descriptor read: addr = {}, status = {}, handle = {}, value = {:?}",
            addr,
            addr.to_string(),
            status,
            handle,
            value
        );
    }

    fn on_descriptor_write(&mut self, addr: String, status: GattStatus, handle: i32) {
    fn on_descriptor_write(&mut self, addr: RawAddress, status: GattStatus, handle: i32) {
        print_info!(
            "GATT Descriptor write: addr = {}, status = {}, handle = {}",
            addr,
            addr.to_string(),
            status,
            handle
        );
    }

    fn on_notify(&mut self, addr: String, handle: i32, value: Vec<u8>) {
        print_info!("GATT Notification: addr = {}, handle = {}, value = {:?}", addr, handle, value);
    fn on_notify(&mut self, addr: RawAddress, handle: i32, value: Vec<u8>) {
        print_info!(
            "GATT Notification: addr = {}, handle = {}, value = {:?}",
            addr.to_string(),
            handle,
            value
        );
    }

    fn on_read_remote_rssi(&mut self, addr: String, rssi: i32, status: GattStatus) {
        print_info!("Remote RSSI read: addr = {}, rssi = {}, status = {}", addr, rssi, status);
    fn on_read_remote_rssi(&mut self, addr: RawAddress, rssi: i32, status: GattStatus) {
        print_info!(
            "Remote RSSI read: addr = {}, rssi = {}, status = {}",
            addr.to_string(),
            rssi,
            status
        );
    }

    fn on_configure_mtu(&mut self, addr: String, mtu: i32, status: GattStatus) {
        print_info!("MTU configured: addr = {}, mtu = {}, status = {}", addr, mtu, status);
    fn on_configure_mtu(&mut self, addr: RawAddress, mtu: i32, status: GattStatus) {
        print_info!(
            "MTU configured: addr = {}, mtu = {}, status = {}",
            addr.to_string(),
            mtu,
            status
        );
    }

    fn on_connection_updated(
        &mut self,
        addr: String,
        addr: RawAddress,
        interval: i32,
        latency: i32,
        timeout: i32,
@@ -839,7 +860,7 @@ impl IBluetoothGattCallback for BtGattCallback {
    ) {
        print_info!(
            "Connection updated: addr = {}, interval = {}, latency = {}, timeout = {}, status = {}",
            addr,
            addr.to_string(),
            interval,
            latency,
            timeout,
@@ -847,8 +868,8 @@ impl IBluetoothGattCallback for BtGattCallback {
        );
    }

    fn on_service_changed(&mut self, addr: String) {
        print_info!("Service changed for {}", addr,);
    fn on_service_changed(&mut self, addr: RawAddress) {
        print_info!("Service changed for {}", addr.to_string());
    }
}

@@ -893,12 +914,12 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
        print_info!("GATT Server registered status = {}, server_id = {}", status, server_id);
    }

    fn on_server_connection_state(&mut self, server_id: i32, connected: bool, addr: String) {
    fn on_server_connection_state(&mut self, server_id: i32, connected: bool, addr: RawAddress) {
        print_info!(
            "GATT server connection with server_id = {}, connected = {}, addr = {}",
            server_id,
            connected,
            addr
            addr.to_string()
        );
    }

@@ -912,7 +933,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {

    fn on_characteristic_read_request(
        &mut self,
        addr: String,
        addr: RawAddress,
        trans_id: i32,
        offset: i32,
        is_long: bool,
@@ -920,7 +941,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
    ) {
        print_info!(
            "GATT characteristic read request for addr = {}, trans_id = {}, offset = {}, is_long = {}, handle = {}",
            addr.clone(),
            addr.to_string(),
            trans_id,
            offset,
            is_long,
@@ -939,7 +960,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {

    fn on_descriptor_read_request(
        &mut self,
        addr: String,
        addr: RawAddress,
        trans_id: i32,
        offset: i32,
        is_long: bool,
@@ -947,7 +968,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
    ) {
        print_info!(
            "GATT descriptor read request for addr = {}, trans_id = {}, offset = {}, is_long = {}, handle = {}",
            addr,
            addr.to_string(),
            trans_id,
            offset,
            is_long,
@@ -966,7 +987,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {

    fn on_characteristic_write_request(
        &mut self,
        addr: String,
        addr: RawAddress,
        trans_id: i32,
        offset: i32,
        len: i32,
@@ -978,7 +999,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
        print_info!(
            "GATT characteristic write request for \
                addr = {}, trans_id = {}, offset = {}, len = {}, is_prep = {}, need_rsp = {}, handle = {}, value = {:?}",
            addr,
            addr.to_string(),
            trans_id,
            offset,
            len,
@@ -1000,7 +1021,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {

    fn on_descriptor_write_request(
        &mut self,
        addr: String,
        addr: RawAddress,
        trans_id: i32,
        offset: i32,
        len: i32,
@@ -1012,7 +1033,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
        print_info!(
            "GATT descriptor write request for \
                addr = {}, trans_id = {}, offset = {}, len = {}, is_prep = {}, need_rsp = {}, handle = {}, value = {:?}",
            addr,
            addr.to_string(),
            trans_id,
            offset,
            len,
@@ -1032,10 +1053,10 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
            Some(GattRequest { address: addr, id: trans_id, offset: offset, value: value });
    }

    fn on_execute_write(&mut self, addr: String, trans_id: i32, exec_write: bool) {
    fn on_execute_write(&mut self, addr: RawAddress, trans_id: i32, exec_write: bool) {
        print_info!(
            "GATT executed write for addr = {}, trans_id = {}, exec_write = {}",
            addr,
            addr.to_string(),
            trans_id,
            exec_write
        );
@@ -1050,32 +1071,38 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
            Some(GattRequest { address: addr, id: trans_id, offset: 0, value: vec![] });
    }

    fn on_notification_sent(&mut self, addr: String, status: GattStatus) {
    fn on_notification_sent(&mut self, addr: RawAddress, status: GattStatus) {
        print_info!(
            "GATT notification/indication sent for addr = {} with status = {}",
            addr,
            addr.to_string(),
            status
        );
    }

    fn on_mtu_changed(&mut self, addr: String, mtu: i32) {
        print_info!("GATT server MTU changed for addr = {}, mtu = {}", addr, mtu);
    fn on_mtu_changed(&mut self, addr: RawAddress, mtu: i32) {
        print_info!("GATT server MTU changed for addr = {}, mtu = {}", addr.to_string(), mtu);
    }

    fn on_phy_update(&mut self, addr: String, tx_phy: LePhy, rx_phy: LePhy, status: GattStatus) {
    fn on_phy_update(
        &mut self,
        addr: RawAddress,
        tx_phy: LePhy,
        rx_phy: LePhy,
        status: GattStatus,
    ) {
        print_info!(
            "GATT server phy updated for addr = {}: tx_phy = {:?}, rx_phy = {:?}, status = {}",
            addr,
            addr.to_string(),
            tx_phy,
            rx_phy,
            status
        );
    }

    fn on_phy_read(&mut self, addr: String, tx_phy: LePhy, rx_phy: LePhy, status: GattStatus) {
    fn on_phy_read(&mut self, addr: RawAddress, tx_phy: LePhy, rx_phy: LePhy, status: GattStatus) {
        print_info!(
            "GATT server phy read for addr = {}: tx_phy = {:?}, rx_phy = {:?}, status = {}",
            addr,
            addr.to_string(),
            tx_phy,
            rx_phy,
            status
@@ -1084,7 +1111,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {

    fn on_connection_updated(
        &mut self,
        addr: String,
        addr: RawAddress,
        interval: i32,
        latency: i32,
        timeout: i32,
@@ -1092,7 +1119,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
    ) {
        print_info!(
            "GATT server connection updated for addr = {}, interval = {}, latency = {}, timeout = {}, status = {}",
            addr,
            addr.to_string(),
            interval,
            latency,
            timeout,
@@ -1102,7 +1129,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {

    fn on_subrate_change(
        &mut self,
        addr: String,
        addr: RawAddress,
        subrate_factor: i32,
        latency: i32,
        cont_num: i32,
@@ -1111,7 +1138,7 @@ impl IBluetoothGattServerCallback for BtGattServerCallback {
    ) {
        print_info!(
            "GATT server subrate changed for addr = {}, subrate_factor = {}, latency = {}, cont_num = {}, timeout = {}, status = {}",
            addr,
            addr.to_string(),
            subrate_factor,
            latency,
            cont_num,
@@ -1597,8 +1624,8 @@ impl BatteryManagerCallback {
}

impl IBatteryManagerCallback for BatteryManagerCallback {
    fn on_battery_info_updated(&mut self, remote_address: String, battery_set: BatterySet) {
        let address = remote_address.to_uppercase();
    fn on_battery_info_updated(&mut self, remote_address: RawAddress, battery_set: BatterySet) {
        let address = remote_address.to_string();
        if self.context.lock().unwrap().battery_address_filter.contains(&address) {
            if battery_set.batteries.len() == 0 {
                print_info!(
+27 −27
Original line number Diff line number Diff line
@@ -691,7 +691,8 @@ impl CommandHandler {
        }

        let command = get_arg(args, 0)?;
        let address = get_arg(args, 1)?.to_uppercase();
        let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
        let address = addr.to_string();

        match &command[..] {
            "status" => {
@@ -700,21 +701,18 @@ impl CommandHandler {
                    .battery_manager_dbus
                    .as_ref()
                    .unwrap()
                    .get_battery_information(address.clone())
                    .get_battery_information(addr)
                {
                    None => println!(
                        "Battery status for device {} could not be fetched",
                        address.clone()
                    ),
                    None => println!("Battery status for device {} could not be fetched", address),
                    Some(set) => {
                        if set.batteries.len() == 0 {
                            println!("Battery set for device {} is empty", set.address.clone());
                            println!("Battery set for device {} is empty", set.address.to_string());
                            return Ok(());
                        }

                        println!(
                            "Battery data for '{}' from source '{}' and uuid '{}':",
                            set.address.clone(),
                            set.address.to_string(),
                            set.source_uuid.clone(),
                            set.source_info.clone()
                        );
@@ -726,10 +724,10 @@ impl CommandHandler {
            }
            "track" => {
                if self.lock_context().battery_address_filter.contains(&address) {
                    println!("Already tracking {}", address.clone());
                    println!("Already tracking {}", address);
                    return Ok(());
                }
                self.lock_context().battery_address_filter.insert(address.clone());
                self.lock_context().battery_address_filter.insert(address);

                println!("Currently tracking:");
                for addr in self.lock_context().battery_address_filter.iter() {
@@ -738,10 +736,10 @@ impl CommandHandler {
            }
            "untrack" => {
                if !self.lock_context().battery_address_filter.remove(&address) {
                    println!("Not tracking {}", address.clone());
                    println!("Not tracking {}", address);
                    return Ok(());
                }
                println!("Stopped tracking {}", address.clone());
                println!("Stopped tracking {}", address);

                if self.lock_context().battery_address_filter.len() == 0 {
                    println!("No longer tracking any addresses for battery status updates");
@@ -1097,13 +1095,13 @@ impl CommandHandler {
                    .client_id
                    .ok_or("GATT client is not yet registered.")?;

                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                let is_direct = self.lock_context().gatt_client_context.is_connect_direct;
                let transport = self.lock_context().gatt_client_context.connect_transport;
                let oppurtunistic = self.lock_context().gatt_client_context.connect_opportunistic;
                let phy = self.lock_context().gatt_client_context.connect_phy;

                println!("Initiating GATT client connect. client_id: {}, addr: {}, is_direct: {}, transport: {:?}, oppurtunistic: {}, phy: {:?}", client_id, addr, is_direct, transport, oppurtunistic, phy);
                println!("Initiating GATT client connect. client_id: {}, addr: {}, is_direct: {}, transport: {:?}, oppurtunistic: {}, phy: {:?}", client_id, addr.to_string(), is_direct, transport, oppurtunistic, phy);
                self.lock_context().gatt_dbus.as_ref().unwrap().client_connect(
                    client_id,
                    addr,
@@ -1120,7 +1118,7 @@ impl CommandHandler {
                    .client_id
                    .ok_or("GATT client is not yet registered.")?;

                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                self.lock_context().gatt_dbus.as_ref().unwrap().client_disconnect(client_id, addr);
            }
            "client-read-phy" => {
@@ -1129,7 +1127,7 @@ impl CommandHandler {
                    .gatt_client_context
                    .client_id
                    .ok_or("GATT client is not yet registered.")?;
                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                self.lock_context().gatt_dbus.as_mut().unwrap().client_read_phy(client_id, addr);
            }
            "client-discover-services" => {
@@ -1139,7 +1137,7 @@ impl CommandHandler {
                    .client_id
                    .ok_or("GATT client is not yet registered.")?;

                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                self.lock_context().gatt_dbus.as_ref().unwrap().discover_services(client_id, addr);
            }
            "client-discover-service-by-uuid-pts" => {
@@ -1148,7 +1146,7 @@ impl CommandHandler {
                    .gatt_client_context
                    .client_id
                    .ok_or("GATT client is not yet registered.")?;
                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                let uuid = String::from(get_arg(args, 2)?);
                self.lock_context()
                    .gatt_dbus
@@ -1163,7 +1161,7 @@ impl CommandHandler {
                    .client_id
                    .ok_or("GATT client is not yet registered.")?;

                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                let mtu =
                    String::from(get_arg(args, 2)?).parse::<i32>().or(Err("Failed parsing mtu"))?;

@@ -1222,7 +1220,7 @@ impl CommandHandler {
                println!("AuthReq: {:?}", self.lock_context().gatt_client_context.get_auth_req());
            }
            "write-characteristic" => {
                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                let handle = String::from(get_arg(args, 2)?)
                    .parse::<i32>()
                    .or(Err("Failed to parse handle"))?;
@@ -1253,7 +1251,7 @@ impl CommandHandler {
                    .write_characteristic(client_id, addr, handle, write_type, auth_req, value);
            }
            "read-characteristic" => {
                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                let handle = String::from(get_arg(args, 2)?)
                    .parse::<i32>()
                    .or(Err("Failed to parse handle"))?;
@@ -1272,7 +1270,7 @@ impl CommandHandler {
                    .read_characteristic(client_id, addr, handle, auth_req);
            }
            "read-characteristic-by-uuid" => {
                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                let uuid = String::from(get_arg(args, 2)?);
                let start_handle = String::from(get_arg(args, 3)?)
                    .parse::<i32>()
@@ -1299,7 +1297,7 @@ impl CommandHandler {
                );
            }
            "register-notification" => {
                let addr = String::from(get_arg(args, 1)?);
                let addr = RawAddress::from_string(get_arg(args, 1)?).ok_or("Invalid Address")?;
                let handle = String::from(get_arg(args, 2)?)
                    .parse::<i32>()
                    .or(Err("Failed to parse handle"))?;
@@ -1351,13 +1349,14 @@ impl CommandHandler {
                let server_id = String::from(get_arg(args, 1)?)
                    .parse::<i32>()
                    .or(Err("Failed to parse server_id"))?;
                let client_addr = String::from(get_arg(args, 2)?);
                let client_addr =
                    RawAddress::from_string(get_arg(args, 2)?).ok_or("Invalid Address")?;
                let is_direct = self.lock_context().gatt_server_context.is_connect_direct;
                let transport = self.lock_context().gatt_server_context.connect_transport;

                if !self.lock_context().gatt_dbus.as_mut().unwrap().server_connect(
                    server_id,
                    client_addr.clone(),
                    client_addr,
                    is_direct,
                    transport,
                ) {
@@ -1368,14 +1367,15 @@ impl CommandHandler {
                let server_id = String::from(get_arg(args, 1)?)
                    .parse::<i32>()
                    .or(Err("Failed to parse server_id"))?;
                let client_addr = String::from(get_arg(args, 2)?);
                let client_addr =
                    RawAddress::from_string(get_arg(args, 2)?).ok_or("Invalid Address")?;

                if !self
                    .lock_context()
                    .gatt_dbus
                    .as_mut()
                    .unwrap()
                    .server_disconnect(server_id, client_addr.clone())
                    .server_disconnect(server_id, client_addr)
                {
                    return Err("Disconnection was unsuccessful".into());
                }
+76 −56

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ mod editor;

#[derive(Clone)]
pub(crate) struct GattRequest {
    address: String,
    address: RawAddress,
    id: i32,
    offset: i32,
    value: Vec<u8>,
+4 −3
Original line number Diff line number Diff line
use bt_topshim::btif::RawAddress;
use btstack::battery_manager::{Battery, BatterySet, IBatteryManager, IBatteryManagerCallback};
use btstack::RPCProxy;
use dbus::arg::RefArg;
@@ -9,7 +10,7 @@ use crate::dbus_arg::{DBusArg, DBusArgError, RefArgToRust};

#[dbus_propmap(BatterySet)]
pub struct BatterySetDBus {
    address: String,
    address: RawAddress,
    source_uuid: String,
    source_info: String,
    batteries: Vec<Battery>,
@@ -26,7 +27,7 @@ struct IBatteryManagerCallbackDBus {}
#[dbus_proxy_obj(BatteryManagerCallback, "org.chromium.bluetooth.BatteryManagerCallback")]
impl IBatteryManagerCallback for IBatteryManagerCallbackDBus {
    #[dbus_method("OnBatteryInfoUpdated")]
    fn on_battery_info_updated(&mut self, remote_address: String, battery_set: BatterySet) {
    fn on_battery_info_updated(&mut self, remote_address: RawAddress, battery_set: BatterySet) {
        dbus_generated!()
    }
}
@@ -49,7 +50,7 @@ impl IBatteryManager for IBatteryManagerDBus {
    }

    #[dbus_method("GetBatteryInformation")]
    fn get_battery_information(&self, remote_address: String) -> Option<BatterySet> {
    fn get_battery_information(&self, remote_address: RawAddress) -> Option<BatterySet> {
        dbus_generated!()
    }
}
Loading