mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1206686: Use |BluetoothUuid| throughout Bluetooth backend interfaces, r=btian
This patch converts all public interfaces of the Bluetooth backend code to take UUIDs as |BluetoothUuid|. The code currently uses a mixture of |BluetoothUuid| and arrays/pointers.
This commit is contained in:
parent
c00e41b074
commit
052db18ce5
@ -226,7 +226,7 @@ BluetoothDaemonCoreModule::SetRemoteDevicePropertyCmd(
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::GetRemoteServiceRecordCmd(
|
||||
const nsAString& aRemoteAddr, const uint8_t aUuid[16],
|
||||
const nsAString& aRemoteAddr, const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
@ -237,7 +237,7 @@ BluetoothDaemonCoreModule::GetRemoteServiceRecordCmd(
|
||||
|
||||
nsresult rv = PackPDU(
|
||||
PackConversion<nsAString, BluetoothAddress>(aRemoteAddr),
|
||||
PackArray<uint8_t>(aUuid, 16), *pdu);
|
||||
aUuid, *pdu);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
BluetoothResultHandler* aRes);
|
||||
|
||||
nsresult GetRemoteServiceRecordCmd(const nsAString& aRemoteAddr,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes);
|
||||
|
||||
nsresult GetRemoteServicesCmd(const nsAString& aRemoteAddr,
|
||||
|
@ -704,7 +704,7 @@ BluetoothDaemonInterface::SetRemoteDeviceProperty(
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetRemoteServiceRecord(const nsAString& aRemoteAddr,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
/* Remote Services */
|
||||
|
||||
void GetRemoteServiceRecord(const nsAString& aRemoteAddr,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void GetRemoteServices(const nsAString& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
@ -25,7 +25,7 @@ const int BluetoothDaemonSocketModule::MAX_NUM_CLIENTS = 1;
|
||||
nsresult
|
||||
BluetoothDaemonSocketModule::ListenCmd(BluetoothSocketType aType,
|
||||
const nsAString& aServiceName,
|
||||
const uint8_t aServiceUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt,
|
||||
bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes)
|
||||
@ -39,7 +39,7 @@ BluetoothDaemonSocketModule::ListenCmd(BluetoothSocketType aType,
|
||||
nsresult rv = PackPDU(
|
||||
aType,
|
||||
PackConversion<nsAString, BluetoothServiceName>(aServiceName),
|
||||
PackArray<uint8_t>(aServiceUuid, 16),
|
||||
aServiceUuid,
|
||||
PackConversion<int, int32_t>(aChannel),
|
||||
SocketFlags(aEncrypt, aAuth), *pdu);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -56,7 +56,7 @@ BluetoothDaemonSocketModule::ListenCmd(BluetoothSocketType aType,
|
||||
nsresult
|
||||
BluetoothDaemonSocketModule::ConnectCmd(const nsAString& aBdAddr,
|
||||
BluetoothSocketType aType,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt,
|
||||
bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes)
|
||||
@ -70,7 +70,7 @@ BluetoothDaemonSocketModule::ConnectCmd(const nsAString& aBdAddr,
|
||||
nsresult rv = PackPDU(
|
||||
PackConversion<nsAString, BluetoothAddress>(aBdAddr),
|
||||
aType,
|
||||
PackArray<uint8_t>(aUuid, 16),
|
||||
aServiceUuid,
|
||||
PackConversion<int, int32_t>(aChannel),
|
||||
SocketFlags(aEncrypt, aAuth), *pdu);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -305,7 +305,7 @@ BluetoothDaemonSocketInterface::~BluetoothDaemonSocketInterface()
|
||||
void
|
||||
BluetoothDaemonSocketInterface::Listen(BluetoothSocketType aType,
|
||||
const nsAString& aServiceName,
|
||||
const uint8_t aServiceUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt,
|
||||
bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes)
|
||||
@ -322,14 +322,14 @@ BluetoothDaemonSocketInterface::Listen(BluetoothSocketType aType,
|
||||
void
|
||||
BluetoothDaemonSocketInterface::Connect(const nsAString& aBdAddr,
|
||||
BluetoothSocketType aType,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt,
|
||||
bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(mModule);
|
||||
|
||||
nsresult rv = mModule->ConnectCmd(aBdAddr, aType, aUuid, aChannel,
|
||||
nsresult rv = mModule->ConnectCmd(aBdAddr, aType, aServiceUuid, aChannel,
|
||||
aEncrypt, aAuth, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
|
@ -40,13 +40,13 @@ public:
|
||||
|
||||
nsresult ListenCmd(BluetoothSocketType aType,
|
||||
const nsAString& aServiceName,
|
||||
const uint8_t aServiceUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt, bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes);
|
||||
|
||||
nsresult ConnectCmd(const nsAString& aBdAddr,
|
||||
BluetoothSocketType aType,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt, bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes);
|
||||
|
||||
@ -108,13 +108,13 @@ public:
|
||||
|
||||
void Listen(BluetoothSocketType aType,
|
||||
const nsAString& aServiceName,
|
||||
const uint8_t aServiceUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt, bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes) override;
|
||||
|
||||
void Connect(const nsAString& aBdAddr,
|
||||
BluetoothSocketType aType,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt, bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes) override;
|
||||
|
||||
|
@ -898,7 +898,7 @@ public:
|
||||
void CancelDiscovery() override
|
||||
{
|
||||
// Disabled discovery mode, now perform SDP operation.
|
||||
sBtInterface->GetRemoteServiceRecord(mDeviceAddress, mUuid.mUuid, this);
|
||||
sBtInterface->GetRemoteServiceRecord(mDeviceAddress, mUuid, this);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -941,7 +941,7 @@ BluetoothServiceBluedroid::GetServiceChannel(
|
||||
sBtInterface->CancelDiscovery(res);
|
||||
} else {
|
||||
sBtInterface->GetRemoteServiceRecord(
|
||||
aDeviceAddress, uuid.mUuid, res);
|
||||
aDeviceAddress, uuid, res);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -665,7 +665,7 @@ BluetoothSocket::Connect(const nsAString& aDeviceAddress,
|
||||
|
||||
sBluetoothSocketInterface->Connect(
|
||||
aDeviceAddress, aType,
|
||||
aServiceUuid.mUuid, aChannel,
|
||||
aServiceUuid, aChannel,
|
||||
aEncrypt, aAuth, res);
|
||||
|
||||
return NS_OK;
|
||||
@ -729,7 +729,7 @@ BluetoothSocket::Listen(const nsAString& aServiceName,
|
||||
|
||||
sBluetoothSocketInterface->Listen(
|
||||
aType,
|
||||
aServiceName, aServiceUuid.mUuid, aChannel,
|
||||
aServiceName, aServiceUuid, aChannel,
|
||||
aEncrypt, aAuth, res);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -57,13 +57,13 @@ public:
|
||||
|
||||
virtual void Listen(BluetoothSocketType aType,
|
||||
const nsAString& aServiceName,
|
||||
const uint8_t aServiceUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt, bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes) = 0;
|
||||
|
||||
virtual void Connect(const nsAString& aBdAddr,
|
||||
BluetoothSocketType aType,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel, bool aEncrypt, bool aAuth,
|
||||
BluetoothSocketResultHandler* aRes) = 0;
|
||||
|
||||
@ -1052,7 +1052,7 @@ public:
|
||||
/* Remote Services */
|
||||
|
||||
virtual void GetRemoteServiceRecord(const nsAString& aRemoteAddr,
|
||||
const uint8_t aUuid[16],
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void GetRemoteServices(const nsAString& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user