Bug 1029386: Asynchronous Bluedroid DUT and LE interfaces, r=shuang

This commit is contained in:
Thomas Zimmermann 2014-07-03 09:53:39 +02:00
Родитель ae8327a31e
Коммит 09f4418e5b
2 изменённых файлов: 39 добавлений и 12 удалений

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

@ -783,24 +783,49 @@ BluetoothInterface::SspReply(const bt_bdaddr_t* aBdAddr,
/* DUT Mode */
int
BluetoothInterface::DutModeConfigure(uint8_t aEnable)
void
BluetoothInterface::DutModeConfigure(uint8_t aEnable,
BluetoothResultHandler* aRes)
{
return mInterface->dut_mode_configure(aEnable);
int status = mInterface->dut_mode_configure(aEnable);
if (aRes) {
DispatchBluetoothResult(aRes,
&BluetoothResultHandler::DutModeConfigure,
status);
}
}
int
BluetoothInterface::DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen)
void
BluetoothInterface::DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
BluetoothResultHandler* aRes)
{
return mInterface->dut_mode_send(aOpcode, aBuf, aLen);
int status = mInterface->dut_mode_send(aOpcode, aBuf, aLen);
if (aRes) {
DispatchBluetoothResult(aRes,
&BluetoothResultHandler::DutModeSend,
status);
}
}
/* LE Mode */
int
BluetoothInterface::LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen)
void
BluetoothInterface::LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
BluetoothResultHandler* aRes)
{
return mInterface->le_test_mode(aOpcode, aBuf, aLen);
#if ANDROID_VERSION >= 18
int status = mInterface->le_test_mode(aOpcode, aBuf, aLen);
#else
int status = BT_STATUS_UNSUPPORTED;
#endif
if (aRes) {
DispatchBluetoothResult(aRes,
&BluetoothResultHandler::LeTestMode,
status);
}
}
/* Profile Interfaces */

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

@ -287,12 +287,14 @@ public:
/* DUT Mode */
int DutModeConfigure(uint8_t aEnable);
int DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen);
void DutModeConfigure(uint8_t aEnable, BluetoothResultHandler* aRes);
void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
BluetoothResultHandler* aRes);
/* LE Mode */
int LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen);
void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
BluetoothResultHandler* aRes);
/* Profile Interfaces */