mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Rename class GattService to GattServiceServer
This commit is contained in:
@@ -41,7 +41,7 @@ GattServer::CreateCharacteristic(
|
||||
}
|
||||
|
||||
auto count = services_.size();
|
||||
auto service = std::make_unique<bluez::GattService>(
|
||||
auto service = std::make_unique<bluez::GattServiceServer>(
|
||||
system_bus_, count, service_uuid, server_cb_, devices_);
|
||||
try {
|
||||
service->emitInterfacesAddedSignal(
|
||||
|
||||
@@ -87,7 +87,7 @@ class GattServer : public api::ble_v2::GattServer {
|
||||
|
||||
std::shared_ptr<api::ble_v2::ServerGattConnectionCallback> server_cb_;
|
||||
absl::Mutex services_mutex_;
|
||||
absl::flat_hash_map<Uuid, std::unique_ptr<bluez::GattService>> services_
|
||||
absl::flat_hash_map<Uuid, std::unique_ptr<bluez::GattServiceServer>> services_
|
||||
ABSL_GUARDED_BY(services_mutex_);
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
namespace nearby {
|
||||
namespace linux {
|
||||
namespace bluez {
|
||||
bool GattService::AddCharacteristic(
|
||||
bool GattServiceServer::AddCharacteristic(
|
||||
const Uuid &service_uuid, const Uuid &characteristic_uuid,
|
||||
api::ble_v2::GattCharacteristic::Permission permission,
|
||||
api::ble_v2::GattCharacteristic::Property property) {
|
||||
@@ -50,7 +50,7 @@ bool GattService::AddCharacteristic(
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<GattCharacteristicServer> GattService::GetCharacteristic(
|
||||
std::shared_ptr<GattCharacteristicServer> GattServiceServer::GetCharacteristic(
|
||||
const Uuid &uuid) {
|
||||
absl::ReaderMutexLock lock(&characterstics_mutex_);
|
||||
if (characteristics_.count(uuid) == 0) {
|
||||
|
||||
@@ -34,17 +34,17 @@
|
||||
namespace nearby {
|
||||
namespace linux {
|
||||
namespace bluez {
|
||||
class GattService final
|
||||
class GattServiceServer final
|
||||
: public sdbus::AdaptorInterfaces<org::bluez::GattService1_adaptor,
|
||||
sdbus::ManagedObject_adaptor,
|
||||
sdbus::Properties_adaptor> {
|
||||
public:
|
||||
GattService(const GattService &) = delete;
|
||||
GattService(GattService &&) = delete;
|
||||
GattService &operator=(const GattService &) = delete;
|
||||
GattService &operator=(GattService &&) = delete;
|
||||
GattServiceServer(const GattServiceServer &) = delete;
|
||||
GattServiceServer(GattServiceServer &&) = delete;
|
||||
GattServiceServer &operator=(const GattServiceServer &) = delete;
|
||||
GattServiceServer &operator=(GattServiceServer &&) = delete;
|
||||
|
||||
GattService(
|
||||
GattServiceServer(
|
||||
sdbus::IConnection &system_bus, size_t num, const Uuid &service_uuid,
|
||||
std::shared_ptr<api::ble_v2::ServerGattConnectionCallback> server_cb,
|
||||
std::shared_ptr<BluetoothDevices> devices)
|
||||
@@ -59,7 +59,7 @@ class GattService final
|
||||
<< " object at " << getObjectPath();
|
||||
}
|
||||
|
||||
~GattService() {
|
||||
~GattServiceServer() {
|
||||
absl::MutexLock lock(&characterstics_mutex_);
|
||||
for (auto &[_uuid, characteristic] : characteristics_) {
|
||||
NEARBY_LOGS(VERBOSE) << __func__ << ": Removing characteristic "
|
||||
|
||||
Reference in New Issue
Block a user