Bug 1146923: Rename |BluetoothSspPairingVariant| to |BluetoothSspVariant|, r=btian

This commit is contained in:
Thomas Zimmermann 2015-03-26 10:29:58 +01:00
parent 59d306e5a2
commit f3fd643c51
4 changed files with 26 additions and 27 deletions

View File

@ -201,6 +201,13 @@ enum BluetoothScanMode {
SCAN_MODE_CONNECTABLE_DISCOVERABLE
};
enum BluetoothSspVariant {
SSP_VARIANT_PASSKEY_CONFIRMATION,
SSP_VARIANT_PASSKEY_ENTRY,
SSP_VARIANT_CONSENT,
SSP_VARIANT_PASSKEY_NOTIFICATION
};
struct BluetoothUuid {
uint8_t mUuid[16];
};

View File

@ -455,18 +455,18 @@ Convert(BluetoothSocketType aIn, uint8_t& aOut)
}
nsresult
Convert(uint8_t aIn, BluetoothSspPairingVariant& aOut)
Convert(uint8_t aIn, BluetoothSspVariant& aOut)
{
static const BluetoothSspPairingVariant sSspPairingVariant[] = {
static const BluetoothSspVariant sSspVariant[] = {
CONVERT(0x00, SSP_VARIANT_PASSKEY_CONFIRMATION),
CONVERT(0x01, SSP_VARIANT_PASSKEY_ENTRY),
CONVERT(0x02, SSP_VARIANT_CONSENT),
CONVERT(0x03, SSP_VARIANT_PASSKEY_NOTIFICATION)
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSspPairingVariant))) {
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSspVariant))) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sSspPairingVariant[aIn];
aOut = sSspVariant[aIn];
return NS_OK;
}
@ -599,7 +599,7 @@ Convert(const nsAString& aIn, BluetoothServiceName& aOut)
}
nsresult
Convert(const nsAString& aIn, BluetoothSspPairingVariant& aOut)
Convert(const nsAString& aIn, BluetoothSspVariant& aOut)
{
if (aIn.EqualsLiteral("PasskeyConfirmation")) {
aOut = SSP_VARIANT_PASSKEY_CONFIRMATION;
@ -942,7 +942,7 @@ Convert(BluetoothScanMode aIn, int32_t& aOut)
}
nsresult
Convert(BluetoothSspPairingVariant aIn, uint8_t& aOut)
Convert(BluetoothSspVariant aIn, uint8_t& aOut)
{
static const uint8_t sValue[] = {
CONVERT(SSP_VARIANT_PASSKEY_CONFIRMATION, 0x00),
@ -959,7 +959,7 @@ Convert(BluetoothSspPairingVariant aIn, uint8_t& aOut)
}
nsresult
Convert(BluetoothSspPairingVariant aIn, nsAString& aOut)
Convert(BluetoothSspVariant aIn, nsAString& aOut)
{
static const char* const sString[] = {
CONVERT(SSP_VARIANT_PASSKEY_CONFIRMATION, "PasskeyConfirmation"),
@ -1331,10 +1331,9 @@ PackPDU(BluetoothPropertyType aIn, BluetoothDaemonPDU& aPDU)
}
nsresult
PackPDU(BluetoothSspPairingVariant aIn, BluetoothDaemonPDU& aPDU)
PackPDU(BluetoothSspVariant aIn, BluetoothDaemonPDU& aPDU)
{
return PackPDU(PackConversion<BluetoothSspPairingVariant, uint8_t>(aIn),
aPDU);
return PackPDU(PackConversion<BluetoothSspVariant, uint8_t>(aIn), aPDU);
}
nsresult
@ -1641,10 +1640,10 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothServiceRecord& aOut)
}
nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspPairingVariant& aOut)
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspVariant& aOut)
{
return UnpackPDU(
aPDU, UnpackConversion<uint8_t, BluetoothSspPairingVariant>(aOut));
aPDU, UnpackConversion<uint8_t, BluetoothSspVariant>(aOut));
}
nsresult

View File

@ -26,13 +26,6 @@ enum BluetoothAclState {
ACL_STATE_DISCONNECTED
};
enum BluetoothSspPairingVariant {
SSP_VARIANT_PASSKEY_CONFIRMATION,
SSP_VARIANT_PASSKEY_ENTRY,
SSP_VARIANT_CONSENT,
SSP_VARIANT_PASSKEY_NOTIFICATION
};
struct BluetoothAddress {
uint8_t mAddr[6];
};
@ -242,7 +235,7 @@ nsresult
Convert(uint8_t aIn, BluetoothScanMode& aOut);
nsresult
Convert(uint8_t aIn, BluetoothSspPairingVariant& aOut);
Convert(uint8_t aIn, BluetoothSspVariant& aOut);
nsresult
Convert(uint8_t aIn, BluetoothStatus& aOut);
@ -269,7 +262,7 @@ nsresult
Convert(const nsAString& aIn, BluetoothServiceName& aOut);
nsresult
Convert(const nsAString& aIn, BluetoothSspPairingVariant& aOut);
Convert(const nsAString& aIn, BluetoothSspVariant& aOut);
nsresult
Convert(BluetoothAclState aIn, bool& aOut);
@ -335,10 +328,10 @@ nsresult
Convert(BluetoothSocketType aIn, uint8_t& aOut);
nsresult
Convert(BluetoothSspPairingVariant aIn, uint8_t& aOut);
Convert(BluetoothSspVariant aIn, uint8_t& aOut);
nsresult
Convert(BluetoothSspPairingVariant aIn, nsAString& aOut);
Convert(BluetoothSspVariant aIn, nsAString& aOut);
nsresult
Convert(ControlPlayStatus aIn, uint8_t& aOut);
@ -460,7 +453,7 @@ nsresult
PackPDU(BluetoothSocketType aIn, BluetoothDaemonPDU& aPDU);
nsresult
PackPDU(BluetoothSspPairingVariant aIn, BluetoothDaemonPDU& aPDU);
PackPDU(BluetoothSspVariant aIn, BluetoothDaemonPDU& aPDU);
nsresult
PackPDU(BluetoothScanMode aIn, BluetoothDaemonPDU& aPDU);
@ -843,7 +836,7 @@ nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothServiceRecord& aOut);
nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspPairingVariant& aOut);
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspVariant& aOut);
nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothStatus& aOut);

View File

@ -518,7 +518,7 @@ public:
nsresult rv = PackPDU(
PackConversion<nsAString, BluetoothAddress>(aBdAddr),
PackConversion<nsAString, BluetoothSspPairingVariant>(aVariant),
PackConversion<nsAString, BluetoothSspVariant>(aVariant),
aAccept, aPasskey, *pdu);
if (NS_FAILED(rv)) {
return rv;
@ -1176,7 +1176,7 @@ private:
/* Read pairing variant */
rv = UnpackPDU(
pdu, UnpackConversion<BluetoothSspPairingVariant, nsAString>(aArg4));
pdu, UnpackConversion<BluetoothSspVariant, nsAString>(aArg4));
if (NS_FAILED(rv)) {
return rv;
}