Skip to content

Commit

Permalink
[Linux] Reuse short UUID defined in BLE layer (#36557)
Browse files Browse the repository at this point in the history
* [Linux] Reuse short UUID defined in BLE layer

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
arkq and restyled-commits authored Nov 21, 2024
1 parent 13920e5 commit 093aff8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/platform/Linux/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ uint16_t BLEManagerImpl::_NumConnections()

CHIP_ERROR BLEManagerImpl::ConfigureBle(uint32_t aAdapterId, bool aIsCentral)
{
mAdapterId = aAdapterId;
mIsCentral = aIsCentral;
mpBLEAdvUUID = "0xFFF6";
mAdapterId = aAdapterId;
mIsCentral = aIsCentral;
return CHIP_NO_ERROR;
}

Expand Down Expand Up @@ -578,7 +577,7 @@ void BLEManagerImpl::DriveBLEState()
// Configure advertising data if it hasn't been done yet.
if (!mFlags.Has(Flags::kAdvertisingConfigured))
{
SuccessOrExit(err = mBLEAdvertisement.Init(mAdapter.get(), mpBLEAdvUUID, mDeviceName));
SuccessOrExit(err = mBLEAdvertisement.Init(mAdapter.get(), Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR, mDeviceName));
mFlags.Set(Flags::kAdvertisingConfigured);
}

Expand Down
1 change: 0 additions & 1 deletion src/platform/Linux/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ class BLEManagerImpl final : public BLEManager,
BluezEndpoint mEndpoint{ mBluezObjectManager };

BluezAdvertisement mBLEAdvertisement{ mEndpoint };
const char * mpBLEAdvUUID = nullptr;

ChipDeviceScanner mDeviceScanner{ mBluezObjectManager };
BLEScanConfig mBLEScanConfig;
Expand Down
9 changes: 4 additions & 5 deletions src/platform/NuttX/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <type_traits>
#include <utility>

#include <ble/CHIPBleServiceData.h>
#include <ble/Ble.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/SafeInt.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down Expand Up @@ -197,9 +197,8 @@ uint16_t BLEManagerImpl::_NumConnections()

CHIP_ERROR BLEManagerImpl::ConfigureBle(uint32_t aAdapterId, bool aIsCentral)
{
mAdapterId = aAdapterId;
mIsCentral = aIsCentral;
mpBLEAdvUUID = "0xFFF6";
mAdapterId = aAdapterId;
mIsCentral = aIsCentral;
return CHIP_NO_ERROR;
}

Expand Down Expand Up @@ -587,7 +586,7 @@ void BLEManagerImpl::DriveBLEState()
// Configure advertising data if it hasn't been done yet.
if (!mFlags.Has(Flags::kAdvertisingConfigured))
{
SuccessOrExit(err = mBLEAdvertisement.Init(mEndpoint, mpBLEAdvUUID, mDeviceName));
SuccessOrExit(err = mBLEAdvertisement.Init(mEndpoint, Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR, mDeviceName));
mFlags.Set(Flags::kAdvertisingConfigured);
}

Expand Down
1 change: 0 additions & 1 deletion src/platform/NuttX/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ class BLEManagerImpl final : public BLEManager,
BluezEndpoint mEndpoint;

BluezAdvertisement mBLEAdvertisement;
const char * mpBLEAdvUUID = nullptr;

ChipDeviceScanner mDeviceScanner;
BLEScanConfig mBLEScanConfig;
Expand Down

0 comments on commit 093aff8

Please sign in to comment.