Bug 1220121: Convert IPDL of Bluetooth GATT API to |BluetoothUuid|, r=joliu

This commit is contained in:
Thomas Zimmermann 2015-11-13 15:26:50 +01:00
Родитель 0d85c6c530
Коммит c89087189f
15 изменённых файлов: 387 добавлений и 324 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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