Backed out changeset 74199d201199 (bug 1220121)

This commit is contained in:
Carsten "Tomcat" Book 2015-11-12 11:48:51 +01:00
parent 919880f855
commit 4bf2867843
15 changed files with 324 additions and 387 deletions

View File

@ -326,7 +326,7 @@ BluetoothServiceBluedroid::StopInternal(BluetoothReplyRunnable* aRunnable)
void
BluetoothServiceBluedroid::StartLeScanInternal(
const nsTArray<BluetoothUuid>& aServiceUuids,
const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -335,12 +335,18 @@ BluetoothServiceBluedroid::StartLeScanInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->StartLeScan(aServiceUuids, aRunnable);
nsTArray<BluetoothUuid> serviceUuids(aServiceUuids.Length());
for (auto i = 0ul; i < aServiceUuids.Length(); ++i) {
StringToUuid(aServiceUuids[i], serviceUuids[i]);
}
gatt->StartLeScan(serviceUuids, aRunnable);
}
void
BluetoothServiceBluedroid::StopLeScanInternal(
const BluetoothUuid& aScanUuid,
const nsAString& aScanUuid,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -349,12 +355,15 @@ BluetoothServiceBluedroid::StopLeScanInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->StopLeScan(aScanUuid, aRunnable);
BluetoothUuid scanUuid;
StringToUuid(aScanUuid, scanUuid);
gatt->StopLeScan(scanUuid, aRunnable);
}
void
BluetoothServiceBluedroid::ConnectGattClientInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aDeviceAddress,
const nsAString& aAppUuid, const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -364,12 +373,15 @@ BluetoothServiceBluedroid::ConnectGattClientInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->Connect(aAppUuid, aDeviceAddress, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->Connect(appUuid, aDeviceAddress, aRunnable);
}
void
BluetoothServiceBluedroid::DisconnectGattClientInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aDeviceAddress,
const nsAString& aAppUuid, const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -379,12 +391,15 @@ BluetoothServiceBluedroid::DisconnectGattClientInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->Disconnect(aAppUuid, aDeviceAddress, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->Disconnect(appUuid, aDeviceAddress, aRunnable);
}
void
BluetoothServiceBluedroid::DiscoverGattServicesInternal(
const BluetoothUuid& aAppUuid, BluetoothReplyRunnable* aRunnable)
const nsAString& aAppUuid, BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -393,12 +408,15 @@ BluetoothServiceBluedroid::DiscoverGattServicesInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->Discover(aAppUuid, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->Discover(appUuid, aRunnable);
}
void
BluetoothServiceBluedroid::GattClientStartNotificationsInternal(
const BluetoothUuid& aAppUuid, const BluetoothGattServiceId& aServId,
const nsAString& aAppUuid, const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId, BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -408,12 +426,15 @@ BluetoothServiceBluedroid::GattClientStartNotificationsInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->RegisterNotifications(aAppUuid, aServId, aCharId, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->RegisterNotifications(appUuid, aServId, aCharId, aRunnable);
}
void
BluetoothServiceBluedroid::GattClientStopNotificationsInternal(
const BluetoothUuid& aAppUuid, const BluetoothGattServiceId& aServId,
const nsAString& aAppUuid, const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId, BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -423,7 +444,10 @@ BluetoothServiceBluedroid::GattClientStopNotificationsInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->DeregisterNotifications(aAppUuid, aServId, aCharId, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->DeregisterNotifications(appUuid, aServId, aCharId, aRunnable);
}
void
@ -457,7 +481,7 @@ BluetoothServiceBluedroid::GattClientReadRemoteRssiInternal(
void
BluetoothServiceBluedroid::GattClientReadCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
BluetoothReplyRunnable* aRunnable)
@ -469,13 +493,16 @@ BluetoothServiceBluedroid::GattClientReadCharacteristicValueInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ReadCharacteristicValue(aAppUuid, aServiceId, aCharacteristicId,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ReadCharacteristicValue(appUuid, aServiceId, aCharacteristicId,
aRunnable);
}
void
BluetoothServiceBluedroid::GattClientWriteCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattWriteType& aWriteType,
@ -489,13 +516,16 @@ BluetoothServiceBluedroid::GattClientWriteCharacteristicValueInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->WriteCharacteristicValue(aAppUuid, aServiceId, aCharacteristicId,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->WriteCharacteristicValue(appUuid, aServiceId, aCharacteristicId,
aWriteType, aValue, aRunnable);
}
void
BluetoothServiceBluedroid::GattClientReadDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -508,13 +538,16 @@ BluetoothServiceBluedroid::GattClientReadDescriptorValueInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ReadDescriptorValue(aAppUuid, aServiceId, aCharacteristicId,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ReadDescriptorValue(appUuid, aServiceId, aCharacteristicId,
aDescriptorId, aRunnable);
}
void
BluetoothServiceBluedroid::GattClientWriteDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -528,14 +561,17 @@ BluetoothServiceBluedroid::GattClientWriteDescriptorValueInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->WriteDescriptorValue(aAppUuid, aServiceId, aCharacteristicId,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->WriteDescriptorValue(appUuid, aServiceId, aCharacteristicId,
aDescriptorId, aValue, aRunnable);
}
// GATT Server
void
BluetoothServiceBluedroid::GattServerConnectPeripheralInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aAddress,
const nsAString& aAppUuid, const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -545,12 +581,15 @@ BluetoothServiceBluedroid::GattServerConnectPeripheralInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ConnectPeripheral(aAppUuid, aAddress, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ConnectPeripheral(appUuid, aAddress, aRunnable);
}
void
BluetoothServiceBluedroid::GattServerDisconnectPeripheralInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aAddress,
const nsAString& aAppUuid, const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable)
{
MOZ_ASSERT(NS_IsMainThread());
@ -560,7 +599,10 @@ BluetoothServiceBluedroid::GattServerDisconnectPeripheralInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->DisconnectPeripheral(aAppUuid, aAddress, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->DisconnectPeripheral(appUuid, aAddress, aRunnable);
}
void
@ -579,7 +621,7 @@ BluetoothServiceBluedroid::UnregisterGattServerInternal(
void
BluetoothServiceBluedroid::GattServerAddServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
uint16_t aHandleCount,
BluetoothReplyRunnable* aRunnable)
@ -591,12 +633,15 @@ BluetoothServiceBluedroid::GattServerAddServiceInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerAddService(aAppUuid, aServiceId, aHandleCount, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerAddService(appUuid, aServiceId, aHandleCount, aRunnable);
}
void
BluetoothServiceBluedroid::GattServerAddIncludedServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle,
BluetoothReplyRunnable* aRunnable)
@ -608,7 +653,10 @@ BluetoothServiceBluedroid::GattServerAddIncludedServiceInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerAddIncludedService(aAppUuid,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerAddIncludedService(appUuid,
aServiceHandle,
aIncludedServiceHandle,
aRunnable);
@ -616,7 +664,7 @@ BluetoothServiceBluedroid::GattServerAddIncludedServiceInternal(
void
BluetoothServiceBluedroid::GattServerAddCharacteristicInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothUuid& aCharacteristicUuid,
BluetoothGattAttrPerm aPermissions,
@ -630,7 +678,10 @@ BluetoothServiceBluedroid::GattServerAddCharacteristicInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerAddCharacteristic(aAppUuid,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerAddCharacteristic(appUuid,
aServiceHandle,
aCharacteristicUuid,
aPermissions,
@ -640,7 +691,7 @@ BluetoothServiceBluedroid::GattServerAddCharacteristicInternal(
void
BluetoothServiceBluedroid::GattServerAddDescriptorInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle,
const BluetoothUuid& aDescriptorUuid,
@ -654,7 +705,10 @@ BluetoothServiceBluedroid::GattServerAddDescriptorInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerAddDescriptor(aAppUuid,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerAddDescriptor(appUuid,
aServiceHandle,
aCharacteristicHandle,
aDescriptorUuid,
@ -664,7 +718,7 @@ BluetoothServiceBluedroid::GattServerAddDescriptorInternal(
void
BluetoothServiceBluedroid::GattServerRemoveServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
@ -675,12 +729,15 @@ BluetoothServiceBluedroid::GattServerRemoveServiceInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerRemoveService(aAppUuid, aServiceHandle, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerRemoveService(appUuid, aServiceHandle, aRunnable);
}
void
BluetoothServiceBluedroid::GattServerStartServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
@ -691,12 +748,15 @@ BluetoothServiceBluedroid::GattServerStartServiceInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerStartService(aAppUuid, aServiceHandle, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerStartService(appUuid, aServiceHandle, aRunnable);
}
void
BluetoothServiceBluedroid::GattServerStopServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
@ -707,12 +767,15 @@ BluetoothServiceBluedroid::GattServerStopServiceInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerStopService(aAppUuid, aServiceHandle, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerStopService(appUuid, aServiceHandle, aRunnable);
}
void
BluetoothServiceBluedroid::GattServerSendResponseInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
uint16_t aStatus,
int32_t aRequestId,
@ -726,13 +789,16 @@ BluetoothServiceBluedroid::GattServerSendResponseInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerSendResponse(
aAppUuid, aAddress, aStatus, aRequestId, aRsp, aRunnable);
appUuid, aAddress, aStatus, aRequestId, aRsp, aRunnable);
}
void
BluetoothServiceBluedroid::GattServerSendIndicationInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
const BluetoothAttributeHandle& aCharacteristicHandle,
bool aConfirm,
@ -746,7 +812,10 @@ BluetoothServiceBluedroid::GattServerSendIndicationInternal(
BluetoothGattManager* gatt = BluetoothGattManager::Get();
ENSURE_GATT_MGR_IS_READY_VOID(gatt, aRunnable);
gatt->ServerSendIndication(aAppUuid,
BluetoothUuid appUuid;
StringToUuid(aAppUuid, appUuid);
gatt->ServerSendIndication(appUuid,
aAddress,
aCharacteristicHandle,
aConfirm,

View File

@ -275,36 +275,36 @@ public:
// GATT Client
//
virtual void StartLeScanInternal(const nsTArray<BluetoothUuid>& aServiceUuids,
virtual void StartLeScanInternal(const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable);
virtual void StopLeScanInternal(const BluetoothUuid& aScanUuid,
virtual void StopLeScanInternal(const nsAString& aScanUuid,
BluetoothReplyRunnable* aRunnable);
virtual void
ConnectGattClientInternal(const BluetoothUuid& aAppUuid,
ConnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
DisconnectGattClientInternal(const BluetoothUuid& aAppUuid,
DisconnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
DiscoverGattServicesInternal(const BluetoothUuid& aAppUuid,
DiscoverGattServicesInternal(const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientStartNotificationsInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientStopNotificationsInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) override;
@ -320,14 +320,14 @@ public:
virtual void
GattClientReadCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientWriteCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattWriteType& aWriteType,
@ -336,7 +336,7 @@ public:
virtual void
GattClientReadDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -344,7 +344,7 @@ public:
virtual void
GattClientWriteDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -353,13 +353,13 @@ public:
virtual void
GattServerConnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerDisconnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) override;
@ -369,21 +369,21 @@ public:
virtual void
GattServerAddServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
uint16_t aHandleCount,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerAddIncludedServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerAddCharacteristicInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothUuid& aCharacteristicUuid,
BluetoothGattAttrPerm aPermissions,
@ -392,7 +392,7 @@ public:
virtual void
GattServerAddDescriptorInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle,
const BluetoothUuid& aDescriptorUuid,
@ -401,25 +401,25 @@ public:
virtual void
GattServerRemoveServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerStartServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerStopServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerSendResponseInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
uint16_t aStatus,
int32_t aRequestId,
@ -428,7 +428,7 @@ public:
virtual void
GattServerSendIndicationInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
const BluetoothAttributeHandle& aCharacteristicHandle,
bool aConfirm,

View File

@ -4295,48 +4295,48 @@ BluetoothDBusService::UpdateNotification(ControlEventId aEventId,
void
BluetoothDBusService::StartLeScanInternal(
const nsTArray<BluetoothUuid>& aServiceUuids,
const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::StopLeScanInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ConnectGattClientInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aDeviceAddress,
const nsAString& aAppUuid, const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::DisconnectGattClientInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aDeviceAddress,
const nsAString& aAppUuid, const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::DiscoverGattServicesInternal(
const BluetoothUuid& aAppUuid, BluetoothReplyRunnable* aRunnable)
const nsAString& aAppUuid, BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::GattClientStartNotificationsInternal(
const BluetoothUuid& aAppUuid, const BluetoothGattServiceId& aServId,
const nsAString& aAppUuid, const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId, BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::GattClientStopNotificationsInternal(
const BluetoothUuid& aAppUuid, const BluetoothGattServiceId& aServId,
const nsAString& aAppUuid, const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId, BluetoothReplyRunnable* aRunnable)
{
}
@ -4356,7 +4356,7 @@ BluetoothDBusService::GattClientReadRemoteRssiInternal(
void
BluetoothDBusService::GattClientReadCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
BluetoothReplyRunnable* aRunnable)
@ -4365,7 +4365,7 @@ BluetoothDBusService::GattClientReadCharacteristicValueInternal(
void
BluetoothDBusService::GattClientWriteCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattWriteType& aWriteType,
@ -4376,7 +4376,7 @@ BluetoothDBusService::GattClientWriteCharacteristicValueInternal(
void
BluetoothDBusService::GattClientReadDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -4386,7 +4386,7 @@ BluetoothDBusService::GattClientReadDescriptorValueInternal(
void
BluetoothDBusService::GattClientWriteDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -4521,14 +4521,14 @@ BluetoothDBusService::ReplyToMapMessageUpdate(long aMasId, bool aStatus,
void
BluetoothDBusService::GattServerConnectPeripheralInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aAddress,
const nsAString& aAppUuid, const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::GattServerDisconnectPeripheralInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aAddress,
const nsAString& aAppUuid, const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable)
{
}
@ -4541,7 +4541,7 @@ BluetoothDBusService::UnregisterGattServerInternal(
void
BluetoothDBusService::GattServerAddServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
uint16_t aHandleCount,
BluetoothReplyRunnable* aRunnable)
@ -4550,7 +4550,7 @@ BluetoothDBusService::GattServerAddServiceInternal(
void
BluetoothDBusService::GattServerAddIncludedServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle,
BluetoothReplyRunnable* aRunnable)
@ -4559,7 +4559,7 @@ BluetoothDBusService::GattServerAddIncludedServiceInternal(
void
BluetoothDBusService::GattServerAddCharacteristicInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothUuid& aCharacteristicUuid,
BluetoothGattAttrPerm aPermissions,
@ -4570,7 +4570,7 @@ BluetoothDBusService::GattServerAddCharacteristicInternal(
void
BluetoothDBusService::GattServerAddDescriptorInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle,
const BluetoothUuid& aDescriptorUuid,
@ -4581,7 +4581,7 @@ BluetoothDBusService::GattServerAddDescriptorInternal(
void
BluetoothDBusService::GattServerRemoveServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
@ -4589,7 +4589,7 @@ BluetoothDBusService::GattServerRemoveServiceInternal(
void
BluetoothDBusService::GattServerStartServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
@ -4597,7 +4597,7 @@ BluetoothDBusService::GattServerStartServiceInternal(
void
BluetoothDBusService::GattServerStopServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
@ -4605,7 +4605,7 @@ BluetoothDBusService::GattServerStopServiceInternal(
void
BluetoothDBusService::GattServerSendIndicationInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
const BluetoothAttributeHandle& aCharacteristicHandle,
bool aConfirm,
@ -4616,7 +4616,7 @@ BluetoothDBusService::GattServerSendIndicationInternal(
void
BluetoothDBusService::GattServerSendResponseInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
uint16_t aStatus,
int32_t aRequestId,

View File

@ -285,37 +285,37 @@ public:
const nsAString& aMessage) override;
virtual void
StartLeScanInternal(const nsTArray<BluetoothUuid>& aServiceUuids,
StartLeScanInternal(const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable) override;
virtual void
StopLeScanInternal(const BluetoothUuid& aAppUuid,
StopLeScanInternal(const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ConnectGattClientInternal(const BluetoothUuid& aAppUuid,
ConnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
DisconnectGattClientInternal(const BluetoothUuid& aAppUuid,
DisconnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
DiscoverGattServicesInternal(const BluetoothUuid& aAppUuid,
DiscoverGattServicesInternal(const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientStartNotificationsInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientStopNotificationsInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) override;
@ -331,14 +331,14 @@ public:
virtual void
GattClientReadCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientWriteCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattWriteType& aWriteType,
@ -347,7 +347,7 @@ public:
virtual void
GattClientReadDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -355,7 +355,7 @@ public:
virtual void
GattClientWriteDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -364,13 +364,13 @@ public:
virtual void
GattServerConnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerDisconnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) override;
@ -380,21 +380,21 @@ public:
virtual void
GattServerAddServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
uint16_t aHandleCount,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerAddIncludedServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerAddCharacteristicInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothUuid& aCharacteristicUuid,
BluetoothGattAttrPerm aPermissions,
@ -403,7 +403,7 @@ public:
virtual void
GattServerAddDescriptorInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle,
const BluetoothUuid& aDescriptorUuid,
@ -412,25 +412,25 @@ public:
virtual void
GattServerRemoveServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerStartServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerStopServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerSendResponseInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
uint16_t aStatus,
int32_t aRequestId,
@ -439,7 +439,7 @@ public:
virtual void
GattServerSendIndicationInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
const BluetoothAttributeHandle& aCharacteristicHandle,
bool aConfirm,

View File

@ -189,14 +189,14 @@ public:
* Stops an ongoing Bluetooth LE device scan.
*/
virtual void
StopLeScanInternal(const BluetoothUuid& aScanUuid,
StopLeScanInternal(const nsAString& aScanUuid,
BluetoothReplyRunnable* aRunnable) = 0;
/**
* Starts a Bluetooth LE device scan.
*/
virtual void
StartLeScanInternal(const nsTArray<BluetoothUuid>& aServiceUuids,
StartLeScanInternal(const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable) = 0;
/**
@ -441,7 +441,7 @@ public:
* Connect to a remote GATT server. (platform specific implementation)
*/
virtual void
ConnectGattClientInternal(const BluetoothUuid& aAppUuid,
ConnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) = 0;
@ -450,7 +450,7 @@ public:
* (platform specific implementation)
*/
virtual void
DisconnectGattClientInternal(const BluetoothUuid& aAppUuid,
DisconnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) = 0;
@ -459,7 +459,7 @@ public:
* server. (platform specific implementation)
*/
virtual void
DiscoverGattServicesInternal(const BluetoothUuid& aAppUuid,
DiscoverGattServicesInternal(const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable) = 0;
/**
@ -467,7 +467,7 @@ public:
* (platform specific implementation)
*/
virtual void
GattClientStartNotificationsInternal(const BluetoothUuid& aAppUuid,
GattClientStartNotificationsInternal(const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) = 0;
@ -477,7 +477,7 @@ public:
* (platform specific implementation)
*/
virtual void
GattClientStopNotificationsInternal(const BluetoothUuid& aAppUuid,
GattClientStopNotificationsInternal(const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) = 0;
@ -503,7 +503,7 @@ public:
*/
virtual void
GattClientReadCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
BluetoothReplyRunnable* aRunnable) = 0;
@ -514,7 +514,7 @@ public:
*/
virtual void
GattClientWriteCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattWriteType& aWriteType,
@ -527,7 +527,7 @@ public:
*/
virtual void
GattClientReadDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -539,7 +539,7 @@ public:
*/
virtual void
GattClientWriteDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -548,13 +548,13 @@ public:
virtual void
GattServerConnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
GattServerDisconnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) = 0;
@ -567,21 +567,21 @@ public:
virtual void
GattServerAddServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
uint16_t aHandleCount,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
GattServerAddIncludedServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
GattServerAddCharacteristicInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothUuid& aCharacteristicUuid,
BluetoothGattAttrPerm aPermissions,
@ -590,7 +590,7 @@ public:
virtual void
GattServerAddDescriptorInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle,
const BluetoothUuid& aDescriptorUuid,
@ -599,25 +599,25 @@ public:
virtual void
GattServerRemoveServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
GattServerStartServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
GattServerStopServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
GattServerSendResponseInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
uint16_t aStatus,
int32_t aRequestId,
@ -626,7 +626,7 @@ public:
virtual void
GattServerSendIndicationInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
const BluetoothAttributeHandle& aCharacteristicHandle,
bool aConfirm,

View File

@ -245,18 +245,15 @@ UuidToString(const BluetoothUuid& aUuid, nsAString& aString)
aString.AssignLiteral(uuidStr);
}
nsresult
void
StringToUuid(const nsAString& aString, BluetoothUuid& aUuid)
{
uint32_t uuid0, uuid4;
uint16_t uuid1, uuid2, uuid3, uuid5;
auto res = sscanf(NS_ConvertUTF16toUTF8(aString).get(),
"%08x-%04hx-%04hx-%04hx-%08x%04hx",
&uuid0, &uuid1, &uuid2, &uuid3, &uuid4, &uuid5);
if (res == EOF || res < 6) {
return NS_ERROR_ILLEGAL_VALUE;
}
sscanf(NS_ConvertUTF16toUTF8(aString).get(),
"%08x-%04hx-%04hx-%04hx-%08x%04hx",
&uuid0, &uuid1, &uuid2, &uuid3, &uuid4, &uuid5);
uuid0 = htonl(uuid0);
uuid1 = htons(uuid1);
@ -271,8 +268,6 @@ StringToUuid(const nsAString& aString, BluetoothUuid& aUuid)
memcpy(&aUuid.mUuid[8], &uuid3, sizeof(uint16_t));
memcpy(&aUuid.mUuid[10], &uuid4, sizeof(uint32_t));
memcpy(&aUuid.mUuid[14], &uuid5, sizeof(uint16_t));
return NS_OK;
}
nsresult

View File

@ -100,7 +100,7 @@ UuidToString(const BluetoothUuid& aUuid, nsAString& aString);
* Note: This utility function is used by gecko internal only to convert uuid
* string created by gecko back to BluetoothUuid representation.
*/
nsresult
void
StringToUuid(const nsAString& aString, BluetoothUuid& aUuid);
/**

View File

@ -366,16 +366,12 @@ BluetoothAdapter::Cleanup()
BluetoothService* bs = BluetoothService::Get();
NS_ENSURE_TRUE_VOID(bs);
nsString uuidStr;
nsString uuid;
for (uint32_t i = 0; i < mLeScanHandleArray.Length(); ++i) {
mLeScanHandleArray[i]->GetLeScanUuid(uuidStr);
mLeScanHandleArray[i]->GetLeScanUuid(uuid);
RefPtr<BluetoothVoidReplyRunnable> results =
new BluetoothVoidReplyRunnable(nullptr);
BluetoothUuid uuid;
if (NS_SUCCEEDED(StringToUuid(uuidStr, uuid))) {
bs->StopLeScanInternal(uuid, results);
}
bs->StopLeScanInternal(uuid, results);
}
mLeScanHandleArray.Clear();
}
@ -686,16 +682,6 @@ BluetoothAdapter::StartLeScan(const nsTArray<nsString>& aServiceUuids,
RefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
nsTArray<BluetoothUuid> serviceUuids;
serviceUuids.SetLength(aServiceUuids.Length());
for (size_t i = 0; i < serviceUuids.Length(); ++i) {
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(aServiceUuids[i],
serviceUuids[i])),
promise,
NS_ERROR_DOM_OPERATION_ERR);
}
BT_ENSURE_TRUE_REJECT(mState == BluetoothAdapterState::Enabled,
promise,
NS_ERROR_DOM_INVALID_STATE_ERR);
@ -705,7 +691,7 @@ BluetoothAdapter::StartLeScan(const nsTArray<nsString>& aServiceUuids,
RefPtr<BluetoothReplyRunnable> result =
new StartLeScanTask(this, promise, aServiceUuids);
bs->StartLeScanInternal(serviceUuids, result);
bs->StartLeScanInternal(aServiceUuids, result);
return promise.forget();
}
@ -735,16 +721,10 @@ BluetoothAdapter::StopLeScan(BluetoothDiscoveryHandle& aDiscoveryHandle,
promise,
NS_ERROR_DOM_BLUETOOTH_DONE);
nsString scanUuidStr;
aDiscoveryHandle.GetLeScanUuid(scanUuidStr);
BluetoothUuid scanUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(scanUuidStr, scanUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
nsString scanUuid;
aDiscoveryHandle.GetLeScanUuid(scanUuid);
RefPtr<BluetoothReplyRunnable> result =
new StopLeScanTask(this, promise, scanUuidStr);
new StopLeScanTask(this, promise, scanUuid);
bs->StopLeScanInternal(scanUuid, result);
return promise.forget();

View File

@ -112,11 +112,6 @@ BluetoothGatt::Connect(ErrorResult& aRv)
BluetoothService* bs = BluetoothService::Get();
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
BluetoothAddress deviceAddr;
BT_ENSURE_TRUE_REJECT(
NS_SUCCEEDED(StringToAddress(mDeviceAddr, deviceAddr)),
@ -133,7 +128,7 @@ BluetoothGatt::Connect(ErrorResult& aRv)
UpdateConnectionState(BluetoothConnectionState::Connecting);
bs->ConnectGattClientInternal(
appUuid, deviceAddr, new BluetoothVoidReplyRunnable(nullptr, promise));
mAppUuid, deviceAddr, new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}
@ -158,11 +153,6 @@ BluetoothGatt::Disconnect(ErrorResult& aRv)
BluetoothService* bs = BluetoothService::Get();
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
BluetoothAddress deviceAddr;
BT_ENSURE_TRUE_REJECT(
NS_SUCCEEDED(StringToAddress(mDeviceAddr, deviceAddr)),
@ -171,7 +161,7 @@ BluetoothGatt::Disconnect(ErrorResult& aRv)
UpdateConnectionState(BluetoothConnectionState::Disconnecting);
bs->DisconnectGattClientInternal(
appUuid, deviceAddr, new BluetoothVoidReplyRunnable(nullptr, promise));
mAppUuid, deviceAddr, new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}
@ -242,11 +232,6 @@ BluetoothGatt::DiscoverServices(ErrorResult& aRv)
RefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
BT_ENSURE_TRUE_REJECT(
mConnectionState == BluetoothConnectionState::Connected &&
!mDiscoveringServices,
@ -261,7 +246,7 @@ BluetoothGatt::DiscoverServices(ErrorResult& aRv)
BluetoothGattBinding::ClearCachedServicesValue(this);
bs->DiscoverGattServicesInternal(
appUuid, new BluetoothVoidReplyRunnable(nullptr, promise));
mAppUuid, new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}

View File

@ -154,14 +154,8 @@ BluetoothGattCharacteristic::StartNotifications(ErrorResult& aRv)
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
BT_ENSURE_TRUE_REJECT(mService, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mService->GetAppUuid(),
appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
bs->GattClientStartNotificationsInternal(
appUuid, mService->GetServiceId(), mCharId,
mService->GetAppUuid(), mService->GetServiceId(), mCharId,
new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
@ -187,14 +181,8 @@ BluetoothGattCharacteristic::StopNotifications(ErrorResult& aRv)
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
BT_ENSURE_TRUE_REJECT(mService, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mService->GetAppUuid(),
appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
bs->GattClientStopNotificationsInternal(
appUuid, mService->GetServiceId(), mCharId,
mService->GetAppUuid(), mService->GetServiceId(), mCharId,
new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
@ -374,14 +362,8 @@ BluetoothGattCharacteristic::ReadValue(ErrorResult& aRv)
BluetoothService* bs = BluetoothService::Get();
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mService->GetAppUuid(),
appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
bs->GattClientReadCharacteristicValueInternal(
appUuid, mService->GetServiceId(), mCharId,
mService->GetAppUuid(), mService->GetServiceId(), mCharId,
new ReadValueTask(this, promise));
return promise.forget();
@ -423,14 +405,9 @@ BluetoothGattCharacteristic::WriteValue(const ArrayBuffer& aValue,
BluetoothService* bs = BluetoothService::Get();
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mService->GetAppUuid(),
appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
bs->GattClientWriteCharacteristicValueInternal(
appUuid, mService->GetServiceId(), mCharId, mWriteType, value,
mService->GetAppUuid(), mService->GetServiceId(),
mCharId, mWriteType, value,
new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();

View File

@ -232,12 +232,6 @@ BluetoothGattDescriptor::ReadValue(ErrorResult& aRv)
RefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(
mCharacteristic->Service()->GetAppUuid(), appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
if (mAttRole == ATT_SERVER_ROLE) {
promise->MaybeResolve(mValue);
return promise.forget();
@ -247,7 +241,7 @@ BluetoothGattDescriptor::ReadValue(ErrorResult& aRv)
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
bs->GattClientReadDescriptorValueInternal(
appUuid,
mCharacteristic->Service()->GetAppUuid(),
mCharacteristic->Service()->GetServiceId(),
mCharacteristic->GetCharacteristicId(),
mDescriptorId,
@ -269,12 +263,6 @@ BluetoothGattDescriptor::WriteValue(
RefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(
mCharacteristic->Service()->GetAppUuid(), appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
aValue.ComputeLengthAndData();
if (mAttRole == ATT_SERVER_ROLE) {
@ -292,7 +280,7 @@ BluetoothGattDescriptor::WriteValue(
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
bs->GattClientWriteDescriptorValueInternal(
appUuid,
mCharacteristic->Service()->GetAppUuid(),
mCharacteristic->Service()->GetServiceId(),
mCharacteristic->GetCharacteristicId(),
mDescriptorId,

View File

@ -319,11 +319,6 @@ BluetoothGattServer::Connect(const nsAString& aAddress, ErrorResult& aRv)
RefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
BluetoothAddress address;
BT_ENSURE_TRUE_REJECT(
NS_SUCCEEDED(StringToAddress(aAddress, address)),
@ -335,7 +330,7 @@ BluetoothGattServer::Connect(const nsAString& aAddress, ErrorResult& aRv)
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
bs->GattServerConnectPeripheralInternal(
appUuid, address, new BluetoothVoidReplyRunnable(nullptr, promise));
mAppUuid, address, new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}
@ -352,11 +347,6 @@ BluetoothGattServer::Disconnect(const nsAString& aAddress, ErrorResult& aRv)
RefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
BluetoothAddress address;
BT_ENSURE_TRUE_REJECT(
NS_SUCCEEDED(StringToAddress(aAddress, address)),
@ -368,7 +358,7 @@ BluetoothGattServer::Disconnect(const nsAString& aAddress, ErrorResult& aRv)
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
bs->GattServerDisconnectPeripheralInternal(
appUuid, address, new BluetoothVoidReplyRunnable(nullptr, promise));
mAppUuid, address, new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}
@ -394,13 +384,8 @@ public:
return false;
}
BluetoothUuid appUuid;
if (NS_FAILED(StringToUuid(mServer->mAppUuid, appUuid))) {
return false;
}
bs->GattServerAddIncludedServiceInternal(
appUuid,
mServer->mAppUuid,
mService->GetServiceHandle(),
mIncludedService->GetServiceHandle(),
GetReply());
@ -435,15 +420,10 @@ public:
return false;
}
BluetoothUuid appUuid;
if (NS_FAILED(StringToUuid(mServer->mAppUuid, appUuid))) {
return false;
}
BluetoothUuid uuid;
mCharacteristic->GetUuid(uuid);
bs->GattServerAddCharacteristicInternal(
appUuid,
mServer->mAppUuid,
mService->GetServiceHandle(),
uuid,
mCharacteristic->GetPermissions(),
@ -482,15 +462,10 @@ public:
return false;
}
BluetoothUuid appUuid;
if (NS_FAILED(StringToUuid(mServer->mAppUuid, appUuid))) {
return false;
}
BluetoothUuid uuid;
mDescriptor->GetUuid(uuid);
bs->GattServerAddDescriptorInternal(
appUuid,
mServer->mAppUuid,
mService->GetServiceHandle(),
mCharacteristic->GetCharacteristicHandle(),
uuid,
@ -526,13 +501,8 @@ public:
return false;
}
BluetoothUuid appUuid;
if (NS_FAILED(StringToUuid(mServer->mAppUuid, appUuid))) {
return false;
}
bs->GattServerStartServiceInternal(
appUuid,
mServer->mAppUuid,
mService->GetServiceHandle(),
GetReply());
@ -658,14 +628,8 @@ private:
BluetoothService* bs = BluetoothService::Get();
BT_ENSURE_TRUE_REJECT_VOID(bs, mPromise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT_VOID(NS_SUCCEEDED(StringToUuid(mServer->mAppUuid,
appUuid)),
mPromise,
NS_ERROR_DOM_OPERATION_ERR);
bs->GattServerRemoveServiceInternal(
appUuid,
mServer->mAppUuid,
mService->GetServiceHandle(),
new CancelAddServiceTask(mServer, mService, mPromise));
}
@ -752,12 +716,7 @@ BluetoothGattServer::AddService(BluetoothGattService& aService,
mPendingService = &aService;
BluetoothUuid appUuid;
if (NS_FAILED(StringToUuid(mAppUuid, appUuid))) {
return false;
}
bs->GattServerAddServiceInternal(appUuid,
bs->GattServerAddServiceInternal(mAppUuid,
mPendingService->GetServiceId(),
mPendingService->GetHandleCount(),
new AddServiceTask(this,
@ -825,13 +784,8 @@ BluetoothGattServer::RemoveService(BluetoothGattService& aService,
BluetoothService* bs = BluetoothService::Get();
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
bs->GattServerRemoveServiceInternal(
appUuid, aService.GetServiceHandle(), new RemoveServiceTask(this,
mAppUuid, aService.GetServiceHandle(), new RemoveServiceTask(this,
&aService,
promise));
@ -856,11 +810,6 @@ BluetoothGattServer::NotifyCharacteristicChanged(
BT_ENSURE_TRUE_REJECT(mValid, promise, NS_ERROR_NOT_AVAILABLE);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
BluetoothAddress address;
BT_ENSURE_TRUE_REJECT(
NS_SUCCEEDED(StringToAddress(aAddress, address)),
@ -877,7 +826,7 @@ BluetoothGattServer::NotifyCharacteristicChanged(
NS_ERROR_NOT_AVAILABLE);
bs->GattServerSendIndicationInternal(
appUuid, address, aCharacteristic.GetCharacteristicHandle(), aConfirm,
mAppUuid, address, aCharacteristic.GetCharacteristicHandle(), aConfirm,
aCharacteristic.GetValue(),
new BluetoothVoidReplyRunnable(nullptr, promise));
@ -899,11 +848,6 @@ BluetoothGattServer::SendResponse(const nsAString& aAddress,
RefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothUuid appUuid;
BT_ENSURE_TRUE_REJECT(NS_SUCCEEDED(StringToUuid(mAppUuid, appUuid)),
promise,
NS_ERROR_DOM_OPERATION_ERR);
BluetoothAddress address;
BT_ENSURE_TRUE_REJECT(
NS_SUCCEEDED(StringToAddress(aAddress, address)),
@ -941,7 +885,7 @@ BluetoothGattServer::SendResponse(const nsAString& aAddress,
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
bs->GattServerSendResponseInternal(
appUuid,
mAppUuid,
address,
aStatus,
aRequestId,

View File

@ -163,15 +163,15 @@ BluetoothServiceChildProcess::StartDiscoveryInternal(
void
BluetoothServiceChildProcess::StopLeScanInternal(
const BluetoothUuid& aScanUuid,
const nsAString& aScanUuid,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable, StopLeScanRequest(aScanUuid));
SendRequest(aRunnable, StopLeScanRequest(nsString(aScanUuid)));
}
void
BluetoothServiceChildProcess::StartLeScanInternal(
const nsTArray<BluetoothUuid>& aServiceUuids,
const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable, StartLeScanRequest(aServiceUuids));
@ -550,44 +550,46 @@ BluetoothServiceChildProcess::SendPlayStatus(int64_t aDuration,
void
BluetoothServiceChildProcess::ConnectGattClientInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aDeviceAddress,
const nsAString& aAppUuid, const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable, ConnectGattClientRequest(aAppUuid, aDeviceAddress));
SendRequest(aRunnable, ConnectGattClientRequest(nsString(aAppUuid),
aDeviceAddress));
}
void
BluetoothServiceChildProcess::DisconnectGattClientInternal(
const BluetoothUuid& aAppUuid, const BluetoothAddress& aDeviceAddress,
const nsAString& aAppUuid, const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
DisconnectGattClientRequest(aAppUuid, aDeviceAddress));
DisconnectGattClientRequest(nsString(aAppUuid), aDeviceAddress));
}
void
BluetoothServiceChildProcess::DiscoverGattServicesInternal(
const BluetoothUuid& aAppUuid, BluetoothReplyRunnable* aRunnable)
const nsAString& aAppUuid, BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable, DiscoverGattServicesRequest(aAppUuid));
SendRequest(aRunnable,
DiscoverGattServicesRequest(nsString(aAppUuid)));
}
void
BluetoothServiceChildProcess::GattClientStartNotificationsInternal(
const BluetoothUuid& aAppUuid, const BluetoothGattServiceId& aServId,
const nsAString& aAppUuid, const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId, BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattClientStartNotificationsRequest(aAppUuid, aServId, aCharId));
GattClientStartNotificationsRequest(nsString(aAppUuid), aServId, aCharId));
}
void
BluetoothServiceChildProcess::GattClientStopNotificationsInternal(
const BluetoothUuid& aAppUuid, const BluetoothGattServiceId& aServId,
const nsAString& aAppUuid, const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId, BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattClientStopNotificationsRequest(aAppUuid, aServId, aCharId));
GattClientStopNotificationsRequest(nsString(aAppUuid), aServId, aCharId));
}
void
@ -608,20 +610,20 @@ BluetoothServiceChildProcess::GattClientReadRemoteRssiInternal(
void
BluetoothServiceChildProcess::GattClientReadCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattClientReadCharacteristicValueRequest(aAppUuid,
GattClientReadCharacteristicValueRequest(nsString(aAppUuid),
aServiceId,
aCharacteristicId));
}
void
BluetoothServiceChildProcess::GattClientWriteCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattWriteType& aWriteType,
@ -629,7 +631,7 @@ BluetoothServiceChildProcess::GattClientWriteCharacteristicValueInternal(
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattClientWriteCharacteristicValueRequest(aAppUuid,
GattClientWriteCharacteristicValueRequest(nsString(aAppUuid),
aServiceId,
aCharacteristicId,
aWriteType,
@ -638,14 +640,14 @@ BluetoothServiceChildProcess::GattClientWriteCharacteristicValueInternal(
void
BluetoothServiceChildProcess::GattClientReadDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattClientReadDescriptorValueRequest(aAppUuid,
GattClientReadDescriptorValueRequest(nsString(aAppUuid),
aServiceId,
aCharacteristicId,
aDescriptorId));
@ -653,7 +655,7 @@ BluetoothServiceChildProcess::GattClientReadDescriptorValueInternal(
void
BluetoothServiceChildProcess::GattClientWriteDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -661,7 +663,7 @@ BluetoothServiceChildProcess::GattClientWriteDescriptorValueInternal(
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattClientWriteDescriptorValueRequest(aAppUuid,
GattClientWriteDescriptorValueRequest(nsString(aAppUuid),
aServiceId,
aCharacteristicId,
aDescriptorId,
@ -670,22 +672,22 @@ BluetoothServiceChildProcess::GattClientWriteDescriptorValueInternal(
void
BluetoothServiceChildProcess::GattServerConnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerConnectPeripheralRequest(aAppUuid, aAddress));
GattServerConnectPeripheralRequest(nsString(aAppUuid), aAddress));
}
void
BluetoothServiceChildProcess::GattServerDisconnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerDisconnectPeripheralRequest(aAppUuid, aAddress));
GattServerDisconnectPeripheralRequest(nsString(aAppUuid), aAddress));
}
void
@ -697,31 +699,31 @@ BluetoothServiceChildProcess::UnregisterGattServerInternal(
void
BluetoothServiceChildProcess::GattServerAddServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
uint16_t aHandleCount,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerAddServiceRequest(aAppUuid, aServiceId, aHandleCount));
GattServerAddServiceRequest(nsString(aAppUuid), aServiceId, aHandleCount));
}
void
BluetoothServiceChildProcess::GattServerAddIncludedServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerAddIncludedServiceRequest(aAppUuid,
GattServerAddIncludedServiceRequest(nsString(aAppUuid),
aServiceHandle,
aIncludedServiceHandle));
}
void
BluetoothServiceChildProcess::GattServerAddCharacteristicInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothUuid& aCharacteristicUuid,
BluetoothGattAttrPerm aPermissions,
@ -729,7 +731,7 @@ BluetoothServiceChildProcess::GattServerAddCharacteristicInternal(
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerAddCharacteristicRequest(aAppUuid,
GattServerAddCharacteristicRequest(nsString(aAppUuid),
aServiceHandle,
aCharacteristicUuid,
aPermissions,
@ -738,7 +740,7 @@ BluetoothServiceChildProcess::GattServerAddCharacteristicInternal(
void
BluetoothServiceChildProcess::GattServerAddDescriptorInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle,
const BluetoothUuid& aDescriptorUuid,
@ -746,7 +748,7 @@ BluetoothServiceChildProcess::GattServerAddDescriptorInternal(
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerAddDescriptorRequest(aAppUuid,
GattServerAddDescriptorRequest(nsString(aAppUuid),
aServiceHandle,
aCharacteristicHandle,
aDescriptorUuid,
@ -755,37 +757,37 @@ BluetoothServiceChildProcess::GattServerAddDescriptorInternal(
void
BluetoothServiceChildProcess::GattServerRemoveServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerRemoveServiceRequest(aAppUuid, aServiceHandle));
GattServerRemoveServiceRequest(nsString(aAppUuid), aServiceHandle));
}
void
BluetoothServiceChildProcess::GattServerStartServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerStartServiceRequest(aAppUuid, aServiceHandle));
GattServerStartServiceRequest(nsString(aAppUuid), aServiceHandle));
}
void
BluetoothServiceChildProcess::GattServerStopServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerStopServiceRequest(aAppUuid, aServiceHandle));
GattServerStopServiceRequest(nsString(aAppUuid), aServiceHandle));
}
void
BluetoothServiceChildProcess::GattServerSendResponseInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
uint16_t aStatus,
int32_t aRequestId,
@ -793,16 +795,13 @@ BluetoothServiceChildProcess::GattServerSendResponseInternal(
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerSendResponseRequest(aAppUuid,
aAddress,
aStatus,
aRequestId,
aRsp));
GattServerSendResponseRequest(
nsString(aAppUuid), aAddress, aStatus, aRequestId, aRsp));
}
void
BluetoothServiceChildProcess::GattServerSendIndicationInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
const BluetoothAttributeHandle& aCharacteristicHandle,
bool aConfirm,
@ -810,7 +809,7 @@ BluetoothServiceChildProcess::GattServerSendIndicationInternal(
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
GattServerSendIndicationRequest(aAppUuid,
GattServerSendIndicationRequest(nsString(aAppUuid),
aAddress,
aCharacteristicHandle,
aConfirm,

View File

@ -60,11 +60,11 @@ public:
StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
virtual void
StopLeScanInternal(const BluetoothUuid& aScanUuid,
StopLeScanInternal(const nsAString& aScanUuid,
BluetoothReplyRunnable* aRunnable) override;
virtual void
StartLeScanInternal(const nsTArray<BluetoothUuid>& aServiceUuids,
StartLeScanInternal(const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable) override;
virtual nsresult
@ -284,29 +284,29 @@ public:
const nsAString& aMessage) override;
virtual void
ConnectGattClientInternal(const BluetoothUuid& aAppUuid,
ConnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
DisconnectGattClientInternal(const BluetoothUuid& aAppUuid,
DisconnectGattClientInternal(const nsAString& aAppUuid,
const BluetoothAddress& aDeviceAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
DiscoverGattServicesInternal(const BluetoothUuid& aAppUuid,
DiscoverGattServicesInternal(const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientStartNotificationsInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientStopNotificationsInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServId,
const BluetoothGattId& aCharId,
BluetoothReplyRunnable* aRunnable) override;
@ -322,14 +322,14 @@ public:
virtual void
GattClientReadCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattClientWriteCharacteristicValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattWriteType& aWriteType,
@ -338,7 +338,7 @@ public:
virtual void
GattClientReadDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -346,7 +346,7 @@ public:
virtual void
GattClientWriteDescriptorValueInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharacteristicId,
const BluetoothGattId& aDescriptorId,
@ -355,13 +355,13 @@ public:
virtual void
GattServerConnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerDisconnectPeripheralInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
BluetoothReplyRunnable* aRunnable) override;
@ -371,21 +371,21 @@ public:
virtual void
GattServerAddServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothGattServiceId& aServiceId,
uint16_t aHandleCount,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerAddIncludedServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerAddCharacteristicInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothUuid& aCharacteristicUuid,
BluetoothGattAttrPerm aPermissions,
@ -394,7 +394,7 @@ public:
virtual void
GattServerAddDescriptorInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle,
const BluetoothUuid& aDescriptorUuid,
@ -403,25 +403,25 @@ public:
virtual void
GattServerRemoveServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerStartServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerStopServiceInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAttributeHandle& aServiceHandle,
BluetoothReplyRunnable* aRunnable) override;
virtual void
GattServerSendResponseInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
uint16_t aStatus,
int32_t aRequestId,
@ -430,7 +430,7 @@ public:
virtual void
GattServerSendIndicationInternal(
const BluetoothUuid& aAppUuid,
const nsAString& aAppUuid,
const BluetoothAddress& aAddress,
const BluetoothAttributeHandle& aCharacteristicHandle,
bool aConfirm,

View File

@ -62,12 +62,12 @@ struct StopDiscoveryRequest
struct StartLeScanRequest
{
BluetoothUuid[] serviceUuids;
nsString[] serviceUuids;
};
struct StopLeScanRequest
{
BluetoothUuid scanUuid;
nsString scanUuid;
};
struct PairRequest
@ -275,31 +275,31 @@ struct SendPlayStatusRequest
struct ConnectGattClientRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAddress deviceAddress;
};
struct DisconnectGattClientRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAddress deviceAddress;
};
struct DiscoverGattServicesRequest
{
BluetoothUuid appUuid;
nsString appUuid;
};
struct GattClientStartNotificationsRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothGattServiceId servId;
BluetoothGattId charId;
};
struct GattClientStopNotificationsRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothGattServiceId servId;
BluetoothGattId charId;
};
@ -317,14 +317,14 @@ struct GattClientReadRemoteRssiRequest
struct GattClientReadCharacteristicValueRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothGattServiceId serviceId;
BluetoothGattId charId;
};
struct GattClientWriteCharacteristicValueRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothGattServiceId serviceId;
BluetoothGattId charId;
BluetoothGattWriteType writeType;
@ -333,7 +333,7 @@ struct GattClientWriteCharacteristicValueRequest
struct GattClientReadDescriptorValueRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothGattServiceId serviceId;
BluetoothGattId charId;
BluetoothGattId descId;
@ -341,7 +341,7 @@ struct GattClientReadDescriptorValueRequest
struct GattClientWriteDescriptorValueRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothGattServiceId serviceId;
BluetoothGattId charId;
BluetoothGattId descId;
@ -350,13 +350,13 @@ struct GattClientWriteDescriptorValueRequest
struct GattServerConnectPeripheralRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAddress address;
};
struct GattServerDisconnectPeripheralRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAddress address;
};
@ -367,21 +367,21 @@ struct UnregisterGattServerRequest
struct GattServerAddServiceRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothGattServiceId serviceId;
uint16_t handleCount;
};
struct GattServerAddIncludedServiceRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAttributeHandle serviceHandle;
BluetoothAttributeHandle includedServiceHandle;
};
struct GattServerAddCharacteristicRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAttributeHandle serviceHandle;
BluetoothUuid characteristicUuid;
BluetoothGattAttrPerm permissions;
@ -390,7 +390,7 @@ struct GattServerAddCharacteristicRequest
struct GattServerAddDescriptorRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAttributeHandle serviceHandle;
BluetoothAttributeHandle characteristicHandle;
BluetoothUuid descriptorUuid;
@ -399,25 +399,25 @@ struct GattServerAddDescriptorRequest
struct GattServerRemoveServiceRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAttributeHandle serviceHandle;
};
struct GattServerStartServiceRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAttributeHandle serviceHandle;
};
struct GattServerStopServiceRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAttributeHandle serviceHandle;
};
struct GattServerSendResponseRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAddress address;
uint16_t status;
int32_t requestId;
@ -426,7 +426,7 @@ struct GattServerSendResponseRequest
struct GattServerSendIndicationRequest
{
BluetoothUuid appUuid;
nsString appUuid;
BluetoothAddress address;
BluetoothAttributeHandle characteristicHandle;
bool confirm;