Skip to content

Commit

Permalink
Fix up bluez void cast errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Feb 23, 2024
1 parent 5baea9e commit 400a39b
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/platform/Linux/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1676,9 +1676,13 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi
return false;
}

// NOLINTNEXTLINE(bugprone-casting-through-void)
WpaFiW1Wpa_supplicant1BSSProxy * bssProxy = WPA_FI_W1_WPA_SUPPLICANT1_BSS_PROXY(bss.get());

// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<GVariant> ssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "SSID"));

// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<GVariant> bssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "BSSID"));

// Network scan is performed in the background, so the BSS
Expand Down Expand Up @@ -1789,7 +1793,10 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi
return res;
};
auto GetNetworkSecurityType = [IsNetworkWPAPSK, IsNetworkWPA2PSK](WpaFiW1Wpa_supplicant1BSSProxy * proxy) -> uint8_t {
// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<GVariant> wpa(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "WPA"));

// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<GVariant> rsn(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "RSN"));

uint8_t res = IsNetworkWPAPSK(wpa.get()) | IsNetworkWPA2PSK(rsn.get());
Expand Down
4 changes: 4 additions & 0 deletions src/platform/Linux/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ CHIP_ERROR ThreadStackManagerImpl::_GetThreadProvision(Thread::OperationalDatase

{
GAutoPtr<GError> err;

// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<GVariant> response(g_dbus_proxy_call_sync(G_DBUS_PROXY(mProxy.get()), "org.freedesktop.DBus.Properties.Get",
g_variant_new("(ss)", "io.openthread.BorderRouter", "ActiveDatasetTlvs"),
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &err.GetReceiver()));
Expand Down Expand Up @@ -326,6 +328,8 @@ bool ThreadStackManagerImpl::_IsThreadEnabled()
VerifyOrReturnError(mProxy, false);

GAutoPtr<GError> err;

// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<GVariant> response(g_dbus_proxy_call_sync(G_DBUS_PROXY(mProxy.get()), "org.freedesktop.DBus.Properties.Get",
g_variant_new("(ss)", "io.openthread.BorderRouter", "DeviceRole"),
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &err.GetReceiver()));
Expand Down
2 changes: 2 additions & 0 deletions src/platform/Linux/bluez/AdapterIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ bool AdapterIterator::Advance()

while (mCurrentListItem != nullptr)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezAdapter1 * adapter = bluez_object_get_adapter1(BLUEZ_OBJECT(mCurrentListItem->data));
if (adapter == nullptr)
{
Expand All @@ -98,6 +99,7 @@ uint32_t AdapterIterator::GetIndex() const
{
// PATH is of the for BLUEZ_PATH / hci<nr>, i.e. like '/org/bluez/hci0'
// Index represents the number after hci
// NOLINTNEXTLINE(bugprone-casting-through-void)
const char * path = g_dbus_proxy_get_object_path(G_DBUS_PROXY(mCurrentAdapter.get()));
unsigned index = 0;

Expand Down
8 changes: 8 additions & 0 deletions src/platform/Linux/bluez/BluezAdvertisement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ BluezLEAdvertisement1 * BluezAdvertisement::CreateLEAdvertisement()
}),
this);

// NOLINTNEXTLINE(bugprone-casting-through-void)
g_dbus_object_manager_server_export(mRoot.get(), G_DBUS_OBJECT_SKELETON(object));
g_object_unref(object);

Expand Down Expand Up @@ -118,6 +119,7 @@ CHIP_ERROR BluezAdvertisement::Init(const BluezEndpoint & aEndpoint, const char
mRoot.reset(reinterpret_cast<GDBusObjectManagerServer *>(g_object_ref(aEndpoint.GetGattApplicationObjectManager())));
mAdapter.reset(reinterpret_cast<BluezAdapter1 *>(g_object_ref(aEndpoint.GetAdapter())));

// NOLINTNEXTLINE(bugprone-casting-through-void)
g_object_get(G_OBJECT(mRoot.get()), "object-path", &rootPath.GetReceiver(), nullptr);
g_snprintf(mAdvPath, sizeof(mAdvPath), "%s/advertising", rootPath.get());
g_strlcpy(mAdvUUID, aAdvUUID, sizeof(mAdvUUID));
Expand Down Expand Up @@ -224,6 +226,7 @@ void BluezAdvertisement::Shutdown()

void BluezAdvertisement::StartDone(GObject * aObject, GAsyncResult * aResult)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezLEAdvertisingManager1 * advMgr = BLUEZ_LEADVERTISING_MANAGER1(aObject);
GAutoPtr<GError> error;
gboolean success = FALSE;
Expand All @@ -249,9 +252,11 @@ CHIP_ERROR BluezAdvertisement::StartImpl()
VerifyOrExit(!mIsAdvertising, ChipLogError(DeviceLayer, "FAIL: Advertising has already been enabled in %s", __func__));
VerifyOrExit(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__));

// NOLINTNEXTLINE(bugprone-casting-through-void)
adapterObject = g_dbus_interface_get_object(G_DBUS_INTERFACE(mAdapter.get()));
VerifyOrExit(adapterObject != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL adapterObject in %s", __func__));

// NOLINTNEXTLINE(bugprone-casting-through-void)
advMgr.reset(bluez_object_get_leadvertising_manager1(BLUEZ_OBJECT(adapterObject)));
VerifyOrExit(advMgr.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL advMgr in %s", __func__));

Expand Down Expand Up @@ -282,6 +287,7 @@ CHIP_ERROR BluezAdvertisement::Start()

void BluezAdvertisement::StopDone(GObject * aObject, GAsyncResult * aResult)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezLEAdvertisingManager1 * advMgr = BLUEZ_LEADVERTISING_MANAGER1(aObject);
GAutoPtr<GError> error;
gboolean success = FALSE;
Expand All @@ -305,9 +311,11 @@ CHIP_ERROR BluezAdvertisement::StopImpl()
VerifyOrExit(mIsAdvertising, ChipLogError(DeviceLayer, "FAIL: Advertising has already been disabled in %s", __func__));
VerifyOrExit(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__));

// NOLINTNEXTLINE(bugprone-casting-through-void)
adapterObject = g_dbus_interface_get_object(G_DBUS_INTERFACE(mAdapter.get()));
VerifyOrExit(adapterObject != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL adapterObject in %s", __func__));

// NOLINTNEXTLINE(bugprone-casting-through-void)
advMgr.reset(bluez_object_get_leadvertising_manager1(BLUEZ_OBJECT(adapterObject)));
VerifyOrExit(advMgr.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL advMgr in %s", __func__));

Expand Down
16 changes: 14 additions & 2 deletions src/platform/Linux/bluez/BluezConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ namespace {
gboolean BluezIsServiceOnDevice(BluezGattService1 * aService, BluezDevice1 * aDevice)
{
const auto * servicePath = bluez_gatt_service1_get_device(aService);
const auto * devicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(aDevice));
// NOLINTNEXTLINE(bugprone-casting-through-void)
const auto * devicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(aDevice));
return strcmp(servicePath, devicePath) == 0 ? TRUE : FALSE;
}

gboolean BluezIsCharOnService(BluezGattCharacteristic1 * aChar, BluezGattService1 * aService)
{
const auto * charPath = bluez_gatt_characteristic1_get_service(aChar);
const auto * charPath = bluez_gatt_characteristic1_get_service(aChar);
// NOLINTNEXTLINE(bugprone-casting-through-void)
const auto * servicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(aService));

ChipLogDetail(DeviceLayer, "Char %s on service %s", charPath, servicePath);
return strcmp(charPath, servicePath) == 0 ? TRUE : FALSE;
}
Expand Down Expand Up @@ -111,6 +114,7 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint)

for (l = objects; l != nullptr; l = l->next)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezGattService1 * service = bluez_object_get_gatt_service1(BLUEZ_OBJECT(l->data));
if (service != nullptr)
{
Expand All @@ -128,6 +132,7 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint)

for (l = objects; l != nullptr; l = l->next)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezGattCharacteristic1 * char1 = bluez_object_get_gatt_characteristic1(BLUEZ_OBJECT(l->data));
if (char1 != nullptr)
{
Expand Down Expand Up @@ -227,6 +232,7 @@ void BluezConnection::SetupWriteHandler(int aSocketFd)
g_io_channel_set_close_on_unref(channel, TRUE);
g_io_channel_set_buffered(channel, FALSE);

// NOLINTNEXTLINE(*.EnumCastOutOfRange)
auto watchSource = g_io_create_watch(channel, static_cast<GIOCondition>(G_IO_HUP | G_IO_IN | G_IO_ERR | G_IO_NVAL));
g_source_set_callback(watchSource, G_SOURCE_FUNC(WriteHandlerCallback), this, nullptr);

Expand All @@ -248,6 +254,7 @@ void BluezConnection::SetupNotifyHandler(int aSocketFd, bool aAdditionalAdvertis
g_io_channel_set_close_on_unref(channel, TRUE);
g_io_channel_set_buffered(channel, FALSE);

// NOLINTNEXTLINE(*.EnumCastOutOfRange)
auto watchSource = g_io_create_watch(channel, static_cast<GIOCondition>(G_IO_HUP | G_IO_ERR | G_IO_NVAL));
g_source_set_callback(watchSource, G_SOURCE_FUNC(NotifyHandlerCallback), this, nullptr);

Expand Down Expand Up @@ -305,6 +312,7 @@ CHIP_ERROR BluezConnection::SendIndication(chip::System::PacketBufferHandle apBu

void BluezConnection::SendWriteRequestDone(GObject * aObject, GAsyncResult * aResult, gpointer apConnection)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezGattCharacteristic1 * c1 = BLUEZ_GATT_CHARACTERISTIC1(aObject);
GAutoPtr<GError> error;
gboolean success = bluez_gatt_characteristic1_call_write_value_finish(c1, aResult, &error.GetReceiver());
Expand Down Expand Up @@ -354,6 +362,7 @@ void BluezConnection::OnCharacteristicChanged(GDBusProxy * aInterface, GVariant

void BluezConnection::SubscribeCharacteristicDone(GObject * aObject, GAsyncResult * aResult, gpointer apConnection)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezGattCharacteristic1 * c2 = BLUEZ_GATT_CHARACTERISTIC1(aObject);
GAutoPtr<GError> error;
gboolean success = bluez_gatt_characteristic1_call_write_value_finish(c2, aResult, &error.GetReceiver());
Expand All @@ -367,6 +376,8 @@ CHIP_ERROR BluezConnection::SubscribeCharacteristicImpl(BluezConnection * connec
{
BluezGattCharacteristic1 * c2 = nullptr;
VerifyOrExit(connection->mpC2 != nullptr, ChipLogError(DeviceLayer, "C2 is NULL in %s", __func__));

// NOLINTNEXTLINE(bugprone-casting-through-void)
c2 = BLUEZ_GATT_CHARACTERISTIC1(connection->mpC2);

// Get notifications on the TX characteristic change (e.g. indication is received)
Expand All @@ -386,6 +397,7 @@ CHIP_ERROR BluezConnection::SubscribeCharacteristic()

void BluezConnection::UnsubscribeCharacteristicDone(GObject * aObject, GAsyncResult * aResult, gpointer apConnection)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezGattCharacteristic1 * c2 = BLUEZ_GATT_CHARACTERISTIC1(aObject);
GAutoPtr<GError> error;
gboolean success = bluez_gatt_characteristic1_call_write_value_finish(c2, aResult, &error.GetReceiver());
Expand Down
26 changes: 22 additions & 4 deletions src/platform/Linux/bluez/BluezEndpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ static gboolean BluezCharacteristicConfirmError(BluezGattCharacteristic1 * aChar

static gboolean BluezIsDeviceOnAdapter(BluezDevice1 * aDevice, BluezAdapter1 * aAdapter)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
return strcmp(bluez_device1_get_adapter(aDevice), g_dbus_proxy_get_object_path(G_DBUS_PROXY(aAdapter))) == 0 ? TRUE : FALSE;
}

BluezGattCharacteristic1 * BluezEndpoint::CreateGattCharacteristic(BluezGattService1 * aService, const char * aCharName,
const char * aUUID, const char * const * aFlags)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
const char * servicePath = g_dbus_object_get_object_path(g_dbus_interface_get_object(G_DBUS_INTERFACE(aService)));
GAutoPtr<char> charPath(g_strdup_printf("%s/%s", servicePath, aCharName));
BluezObjectSkeleton * object;
Expand All @@ -253,6 +255,8 @@ BluezGattCharacteristic1 * BluezEndpoint::CreateGattCharacteristic(BluezGattServ
bluez_gatt_characteristic1_set_value(characteristic, value);

bluez_object_skeleton_set_gatt_characteristic1(object, characteristic);

// NOLINTNEXTLINE(bugprone-casting-through-void)
g_dbus_object_manager_server_export(mpRoot, G_DBUS_OBJECT_SKELETON(object));
g_object_unref(object);

Expand All @@ -262,6 +266,8 @@ BluezGattCharacteristic1 * BluezEndpoint::CreateGattCharacteristic(BluezGattServ
void BluezEndpoint::RegisterGattApplicationDone(GObject * aObject, GAsyncResult * aResult)
{
GAutoPtr<GError> error;

// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezGattManager1 * gattMgr = BLUEZ_GATT_MANAGER1(aObject);

gboolean success = bluez_gatt_manager1_call_register_application_finish(gattMgr, aResult, &error.GetReceiver());
Expand All @@ -284,9 +290,11 @@ CHIP_ERROR BluezEndpoint::RegisterGattApplicationImpl()

VerifyOrExit(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__));

// NOLINTNEXTLINE(bugprone-casting-through-void)
adapterObject = g_dbus_interface_get_object(G_DBUS_INTERFACE(mAdapter.get()));
VerifyOrExit(adapterObject != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL adapterObject in %s", __func__));

// NOLINTNEXTLINE(bugprone-casting-through-void)
gattMgr.reset(bluez_object_get_gatt_manager1(BLUEZ_OBJECT(adapterObject)));
VerifyOrExit(gattMgr.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL gattMgr in %s", __func__));

Expand All @@ -307,6 +315,7 @@ CHIP_ERROR BluezEndpoint::RegisterGattApplicationImpl()
/// Update the table of open BLE connections whenever a new device is spotted or its attributes have changed.
void BluezEndpoint::UpdateConnectionTable(BluezDevice1 * apDevice)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
const char * objectPath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(apDevice));
BluezConnection * connection = GetBluezConnection(objectPath);

Expand Down Expand Up @@ -347,6 +356,7 @@ void BluezEndpoint::BluezSignalInterfacePropertiesChanged(GDBusObjectManagerClie
VerifyOrReturn(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__));
VerifyOrReturn(strcmp(g_dbus_proxy_get_interface_name(aInterface), DEVICE_INTERFACE) == 0, );

// NOLINTNEXTLINE(bugprone-casting-through-void)
BluezDevice1 * device = BLUEZ_DEVICE1(aInterface);
VerifyOrReturn(BluezIsDeviceOnAdapter(device, mAdapter.get()));

Expand All @@ -361,16 +371,19 @@ void BluezEndpoint::HandleNewDevice(BluezDevice1 * device)
// When a device is connected for first time, this function will be triggered.
// The future connections for the same device will trigger ``Connect'' property change.
// TODO: Factor common code in the two function.
BluezConnection * conn;
VerifyOrExit(bluez_device1_get_connected(device), ChipLogError(DeviceLayer, "FAIL: device is not connected"));
BluezConnection * conn = nullptr;

// NOLINTBEGIN(bugprone-casting-through-void)
VerifyOrExit(bluez_device1_get_connected(device), ChipLogError(DeviceLayer, "FAIL: device is not connected"));
conn = GetBluezConnection(g_dbus_proxy_get_object_path(G_DBUS_PROXY(device)));
VerifyOrExit(conn == nullptr,
ChipLogError(DeviceLayer, "FAIL: connection already tracked: conn: %p new device: %s", conn,
g_dbus_proxy_get_object_path(G_DBUS_PROXY(device))));

conn = chip::Platform::New<BluezConnection>(*this, device);
mpPeerDevicePath = g_strdup(g_dbus_proxy_get_object_path(G_DBUS_PROXY(device)));
conn = chip::Platform::New<BluezConnection>(*this, device);
mpPeerDevicePath = g_strdup(g_dbus_proxy_get_object_path(G_DBUS_PROXY(device)));
// NOLINTEND(bugprone-casting-through-void)

mConnMap[mpPeerDevicePath] = conn;

ChipLogDetail(DeviceLayer, "BLE device connected: conn %p, device %s, path %s", conn, conn->GetPeerAddress(), mpPeerDevicePath);
Expand All @@ -383,6 +396,7 @@ void BluezEndpoint::BluezSignalOnObjectAdded(GDBusObjectManager * aManager, GDBu
{
// TODO: right now we do not handle addition/removal of adapters
// Primary focus here is to handle addition of a device
// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<BluezDevice1> device(bluez_object_get_device1(BLUEZ_OBJECT(aObject)));
VerifyOrReturn(device.get() != nullptr);

Expand Down Expand Up @@ -415,6 +429,8 @@ BluezGattService1 * BluezEndpoint::CreateGattService(const char * aUUID)

// includes -- unclear whether required. Might be filled in later
bluez_object_skeleton_set_gatt_service1(object, service);

// NOLINTNEXTLINE(bugprone-casting-through-void)
g_dbus_object_manager_server_export(mpRoot, G_DBUS_OBJECT_SKELETON(object));
g_object_unref(object);

Expand All @@ -429,11 +445,13 @@ void BluezEndpoint::SetupAdapter()
GList * objects = g_dbus_object_manager_get_objects(mpObjMgr);
for (auto l = objects; l != nullptr && mAdapter.get() == nullptr; l = l->next)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<BluezAdapter1> adapter(bluez_object_get_adapter1(BLUEZ_OBJECT(l->data)));
if (adapter.get() != nullptr)
{
if (mpAdapterAddr == nullptr) // no adapter address provided, bind to the hci indicated by nodeid
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
if (strcmp(g_dbus_proxy_get_object_path(G_DBUS_PROXY(adapter.get())), expectedPath) == 0)
{
mAdapter.reset(static_cast<BluezAdapter1 *>(g_object_ref(adapter.get())));
Expand Down
13 changes: 11 additions & 2 deletions src/platform/Linux/bluez/BluezObjectIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ class BluezObjectIterator
BluezObjectIterator() = default;
explicit BluezObjectIterator(GList * position) : mPosition(position) {}

reference operator*() const { return *BLUEZ_OBJECT(mPosition->data); }
pointer operator->() const { return BLUEZ_OBJECT(mPosition->data); }
reference operator*() const
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
return *BLUEZ_OBJECT(mPosition->data);
}

pointer operator->() const
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
return BLUEZ_OBJECT(mPosition->data);
}
bool operator==(const BluezObjectIterator & other) const { return mPosition == other.mPosition; }
bool operator!=(const BluezObjectIterator & other) const { return mPosition != other.mPosition; }

Expand Down
5 changes: 5 additions & 0 deletions src/platform/Linux/bluez/ChipDeviceScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ CHIP_ERROR ChipDeviceScanner::MainLoopStopScan(ChipDeviceScanner * self)

void ChipDeviceScanner::SignalObjectAdded(GDBusObjectManager * manager, GDBusObject * object, ChipDeviceScanner * self)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<BluezDevice1> device(bluez_object_get_device1(BLUEZ_OBJECT(object)));
VerifyOrReturn(device.get() != nullptr);

Expand All @@ -225,6 +226,7 @@ void ChipDeviceScanner::SignalInterfaceChanged(GDBusObjectManagerClient * manage
GDBusProxy * aInterface, GVariant * aChangedProperties,
const gchar * const * aInvalidatedProps, ChipDeviceScanner * self)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
GAutoPtr<BluezDevice1> device(bluez_object_get_device1(BLUEZ_OBJECT(object)));
VerifyOrReturn(device.get() != nullptr);

Expand All @@ -233,6 +235,7 @@ void ChipDeviceScanner::SignalInterfaceChanged(GDBusObjectManagerClient * manage

void ChipDeviceScanner::ReportDevice(BluezDevice1 & device)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
if (strcmp(bluez_device1_get_adapter(&device), g_dbus_proxy_get_object_path(G_DBUS_PROXY(mAdapter.get()))) != 0)
{
return;
Expand All @@ -251,6 +254,7 @@ void ChipDeviceScanner::ReportDevice(BluezDevice1 & device)

void ChipDeviceScanner::RemoveDevice(BluezDevice1 & device)
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
if (strcmp(bluez_device1_get_adapter(&device), g_dbus_proxy_get_object_path(G_DBUS_PROXY(mAdapter.get()))) != 0)
{
return;
Expand All @@ -263,6 +267,7 @@ void ChipDeviceScanner::RemoveDevice(BluezDevice1 & device)
return;
}

// NOLINTNEXTLINE(bugprone-casting-through-void)
const auto devicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(&device));
GAutoPtr<GError> error;

Expand Down

0 comments on commit 400a39b

Please sign in to comment.