Bug 1197877: Remove |INIT_AT| macro from Bluetooth, r=btian

|INIT_AT| works around missing compiler features for gcc before
version 4.7. All B2G targets have been lifted to gcc 4.8, so the
workaround is not required any longer.
This commit is contained in:
Thomas Zimmermann 2015-08-25 10:00:56 +02:00
parent ef9e5a492b
commit 582d74a87c
7 changed files with 263 additions and 286 deletions

View File

@ -17,22 +17,6 @@ extern bool gBluetoothDebugFlag;
#define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V) #define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
#if MOZ_IS_GCC
# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
/* use designated array initializers if supported */
# define INIT_ARRAY_AT(in_, out_) \
[in_] = out_
# else
/* otherwise init array element by position */
# define INIT_ARRAY_AT(in_, out_) \
out_
# endif
#else
/* otherwise init array element by position */
#define INIT_ARRAY_AT(in_, out_) \
out_
#endif
#undef BT_LOG #undef BT_LOG
#if defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_GONK)
#include <android/log.h> #include <android/log.h>

View File

@ -47,8 +47,8 @@ BluetoothDaemonA2dpModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
{ {
static void (BluetoothDaemonA2dpModule::* const HandleOp[])( static void (BluetoothDaemonA2dpModule::* const HandleOp[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
INIT_ARRAY_AT(0, &BluetoothDaemonA2dpModule::HandleRsp), [0] = &BluetoothDaemonA2dpModule::HandleRsp,
INIT_ARRAY_AT(1, &BluetoothDaemonA2dpModule::HandleNtf), [1] = &BluetoothDaemonA2dpModule::HandleNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
@ -145,12 +145,9 @@ BluetoothDaemonA2dpModule::HandleRsp(
const DaemonSocketPDUHeader&, const DaemonSocketPDUHeader&,
DaemonSocketPDU&, DaemonSocketPDU&,
BluetoothA2dpResultHandler*) = { BluetoothA2dpResultHandler*) = {
INIT_ARRAY_AT(OPCODE_ERROR, [OPCODE_ERROR] = &BluetoothDaemonA2dpModule::ErrorRsp,
&BluetoothDaemonA2dpModule::ErrorRsp), [OPCODE_CONNECT] = &BluetoothDaemonA2dpModule::ConnectRsp,
INIT_ARRAY_AT(OPCODE_CONNECT, [OPCODE_DISCONNECT] = &BluetoothDaemonA2dpModule::DisconnectRsp
&BluetoothDaemonA2dpModule::ConnectRsp),
INIT_ARRAY_AT(OPCODE_DISCONNECT,
&BluetoothDaemonA2dpModule::DisconnectRsp),
}; };
MOZ_ASSERT(!NS_IsMainThread()); // I/O thread MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
@ -322,10 +319,10 @@ BluetoothDaemonA2dpModule::HandleNtf(
{ {
static void (BluetoothDaemonA2dpModule::* const HandleNtf[])( static void (BluetoothDaemonA2dpModule::* const HandleNtf[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
INIT_ARRAY_AT(0, &BluetoothDaemonA2dpModule::ConnectionStateNtf), [0] = &BluetoothDaemonA2dpModule::ConnectionStateNtf,
INIT_ARRAY_AT(1, &BluetoothDaemonA2dpModule::AudioStateNtf), [1] = &BluetoothDaemonA2dpModule::AudioStateNtf,
#if ANDROID_VERSION >= 21 #if ANDROID_VERSION >= 21
INIT_ARRAY_AT(2, &BluetoothDaemonA2dpModule::AudioConfigNtf), [2] = &BluetoothDaemonA2dpModule::AudioConfigNtf
#endif #endif
}; };

View File

@ -47,8 +47,8 @@ BluetoothDaemonAvrcpModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
{ {
static void (BluetoothDaemonAvrcpModule::* const HandleOp[])( static void (BluetoothDaemonAvrcpModule::* const HandleOp[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::HandleRsp), [0] = &BluetoothDaemonAvrcpModule::HandleRsp,
INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::HandleNtf), [1] = &BluetoothDaemonAvrcpModule::HandleNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
@ -427,28 +427,28 @@ BluetoothDaemonAvrcpModule::HandleRsp(
const DaemonSocketPDUHeader&, const DaemonSocketPDUHeader&,
DaemonSocketPDU&, DaemonSocketPDU&,
BluetoothAvrcpResultHandler*) = { BluetoothAvrcpResultHandler*) = {
INIT_ARRAY_AT(OPCODE_ERROR, [OPCODE_ERROR] =
&BluetoothDaemonAvrcpModule::ErrorRsp), &BluetoothDaemonAvrcpModule::ErrorRsp,
INIT_ARRAY_AT(OPCODE_GET_PLAY_STATUS_RSP, [OPCODE_GET_PLAY_STATUS_RSP] =
&BluetoothDaemonAvrcpModule::GetPlayStatusRspRsp), &BluetoothDaemonAvrcpModule::GetPlayStatusRspRsp,
INIT_ARRAY_AT(OPCODE_LIST_PLAYER_APP_ATTR_RSP, [OPCODE_LIST_PLAYER_APP_ATTR_RSP] =
&BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspRsp), &BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspRsp,
INIT_ARRAY_AT(OPCODE_LIST_PLAYER_APP_VALUE_RSP, [OPCODE_LIST_PLAYER_APP_VALUE_RSP] =
&BluetoothDaemonAvrcpModule::ListPlayerAppValueRspRsp), &BluetoothDaemonAvrcpModule::ListPlayerAppValueRspRsp,
INIT_ARRAY_AT(OPCODE_GET_PLAYER_APP_VALUE_RSP, [OPCODE_GET_PLAYER_APP_VALUE_RSP] =
&BluetoothDaemonAvrcpModule::GetPlayerAppValueRspRsp), &BluetoothDaemonAvrcpModule::GetPlayerAppValueRspRsp,
INIT_ARRAY_AT(OPCODE_GET_PLAYER_APP_ATTR_TEXT_RSP, [OPCODE_GET_PLAYER_APP_ATTR_TEXT_RSP] =
&BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspRsp), &BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspRsp,
INIT_ARRAY_AT(OPCODE_GET_PLAYER_APP_VALUE_TEXT_RSP, [OPCODE_GET_PLAYER_APP_VALUE_TEXT_RSP] =
&BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspRsp), &BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspRsp,
INIT_ARRAY_AT(OPCODE_GET_ELEMENT_ATTR_RSP, [OPCODE_GET_ELEMENT_ATTR_RSP]=
&BluetoothDaemonAvrcpModule::GetElementAttrRspRsp), &BluetoothDaemonAvrcpModule::GetElementAttrRspRsp,
INIT_ARRAY_AT(OPCODE_SET_PLAYER_APP_VALUE_RSP, [OPCODE_SET_PLAYER_APP_VALUE_RSP] =
&BluetoothDaemonAvrcpModule::SetPlayerAppValueRspRsp), &BluetoothDaemonAvrcpModule::SetPlayerAppValueRspRsp,
INIT_ARRAY_AT(OPCODE_REGISTER_NOTIFICATION_RSP, [OPCODE_REGISTER_NOTIFICATION_RSP] =
&BluetoothDaemonAvrcpModule::RegisterNotificationRspRsp), &BluetoothDaemonAvrcpModule::RegisterNotificationRspRsp,
INIT_ARRAY_AT(OPCODE_SET_VOLUME, [OPCODE_SET_VOLUME] =
&BluetoothDaemonAvrcpModule::SetVolumeRsp) &BluetoothDaemonAvrcpModule::SetVolumeRsp
}; };
MOZ_ASSERT(!NS_IsMainThread()); // I/O thread MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
@ -797,28 +797,28 @@ BluetoothDaemonAvrcpModule::HandleNtf(
static void (BluetoothDaemonAvrcpModule::* const HandleNtf[])( static void (BluetoothDaemonAvrcpModule::* const HandleNtf[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
#if ANDROID_VERSION >= 19 #if ANDROID_VERSION >= 19
INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::RemoteFeatureNtf), [0] = &BluetoothDaemonAvrcpModule::RemoteFeatureNtf,
INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::GetPlayStatusNtf), [1] = &BluetoothDaemonAvrcpModule::GetPlayStatusNtf,
INIT_ARRAY_AT(2, &BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf), [2] = &BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf,
INIT_ARRAY_AT(3, &BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf), [3] = &BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf,
INIT_ARRAY_AT(4, &BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf), [4] = &BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf,
INIT_ARRAY_AT(5, &BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf), [5] = &BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf,
INIT_ARRAY_AT(6, &BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf), [6] = &BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf,
INIT_ARRAY_AT(7, &BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf), [7] = &BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf,
INIT_ARRAY_AT(8, &BluetoothDaemonAvrcpModule::GetElementAttrNtf), [8] = &BluetoothDaemonAvrcpModule::GetElementAttrNtf,
INIT_ARRAY_AT(9, &BluetoothDaemonAvrcpModule::RegisterNotificationNtf), [9] = &BluetoothDaemonAvrcpModule::RegisterNotificationNtf,
INIT_ARRAY_AT(10, &BluetoothDaemonAvrcpModule::VolumeChangeNtf), [10] = &BluetoothDaemonAvrcpModule::VolumeChangeNtf,
INIT_ARRAY_AT(11, &BluetoothDaemonAvrcpModule::PassthroughCmdNtf) [11] = &BluetoothDaemonAvrcpModule::PassthroughCmdNtf
#else #else
INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::GetPlayStatusNtf), [0] = &BluetoothDaemonAvrcpModule::GetPlayStatusNtf,
INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf), [1] = &BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf,
INIT_ARRAY_AT(2, &BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf), [2] = &BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf,
INIT_ARRAY_AT(3, &BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf), [3] = &BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf,
INIT_ARRAY_AT(4, &BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf), [4] = &BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf,
INIT_ARRAY_AT(5, &BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf), [5] = &BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf,
INIT_ARRAY_AT(6, &BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf), [6] = &BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf,
INIT_ARRAY_AT(7, &BluetoothDaemonAvrcpModule::GetElementAttrNtf), [7] = &BluetoothDaemonAvrcpModule::GetElementAttrNtf,
INIT_ARRAY_AT(8, &BluetoothDaemonAvrcpModule::RegisterNotificationNtf) [8] = &BluetoothDaemonAvrcpModule::RegisterNotificationNtf
#endif #endif
}; };

View File

@ -47,8 +47,8 @@ BluetoothDaemonGattModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
{ {
static void (BluetoothDaemonGattModule::* const HandleOp[])( static void (BluetoothDaemonGattModule::* const HandleOp[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
INIT_ARRAY_AT(0, &BluetoothDaemonGattModule::HandleRsp), [0] = &BluetoothDaemonGattModule::HandleRsp,
INIT_ARRAY_AT(1, &BluetoothDaemonGattModule::HandleNtf), [1] = &BluetoothDaemonGattModule::HandleNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
@ -1411,78 +1411,78 @@ BluetoothDaemonGattModule::HandleRsp(
const DaemonSocketPDUHeader&, const DaemonSocketPDUHeader&,
DaemonSocketPDU&, DaemonSocketPDU&,
BluetoothGattResultHandler*) = { BluetoothGattResultHandler*) = {
INIT_ARRAY_AT(OPCODE_ERROR, [OPCODE_ERROR] =
&BluetoothDaemonGattModule::ErrorRsp), &BluetoothDaemonGattModule::ErrorRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_REGISTER, [OPCODE_CLIENT_REGISTER] =
&BluetoothDaemonGattModule::ClientRegisterRsp), &BluetoothDaemonGattModule::ClientRegisterRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_UNREGISTER, [OPCODE_CLIENT_UNREGISTER] =
&BluetoothDaemonGattModule::ClientUnregisterRsp), &BluetoothDaemonGattModule::ClientUnregisterRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_SCAN, [OPCODE_CLIENT_SCAN] =
&BluetoothDaemonGattModule::ClientScanRsp), &BluetoothDaemonGattModule::ClientScanRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_CONNECT, [OPCODE_CLIENT_CONNECT] =
&BluetoothDaemonGattModule::ClientConnectRsp), &BluetoothDaemonGattModule::ClientConnectRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_DISCONNECT, [OPCODE_CLIENT_DISCONNECT] =
&BluetoothDaemonGattModule::ClientDisconnectRsp), &BluetoothDaemonGattModule::ClientDisconnectRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_LISTEN, [OPCODE_CLIENT_LISTEN] =
&BluetoothDaemonGattModule::ClientListenRsp), &BluetoothDaemonGattModule::ClientListenRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_REFRESH, [OPCODE_CLIENT_REFRESH] =
&BluetoothDaemonGattModule::ClientRefreshRsp), &BluetoothDaemonGattModule::ClientRefreshRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_SEARCH_SERVICE, [OPCODE_CLIENT_SEARCH_SERVICE] =
&BluetoothDaemonGattModule::ClientSearchServiceRsp), &BluetoothDaemonGattModule::ClientSearchServiceRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_GET_INCLUDED_SERVICE, [OPCODE_CLIENT_GET_INCLUDED_SERVICE] =
&BluetoothDaemonGattModule::ClientGetIncludedServiceRsp), &BluetoothDaemonGattModule::ClientGetIncludedServiceRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_GET_CHARACTERISTIC, [OPCODE_CLIENT_GET_CHARACTERISTIC] =
&BluetoothDaemonGattModule::ClientGetCharacteristicRsp), &BluetoothDaemonGattModule::ClientGetCharacteristicRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_GET_DESCRIPTOR, [OPCODE_CLIENT_GET_DESCRIPTOR] =
&BluetoothDaemonGattModule::ClientGetDescriptorRsp), &BluetoothDaemonGattModule::ClientGetDescriptorRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_READ_CHARACTERISTIC, [OPCODE_CLIENT_READ_CHARACTERISTIC] =
&BluetoothDaemonGattModule::ClientReadCharacteristicRsp), &BluetoothDaemonGattModule::ClientReadCharacteristicRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_WRITE_CHARACTERISTIC, [OPCODE_CLIENT_WRITE_CHARACTERISTIC] =
&BluetoothDaemonGattModule::ClientWriteCharacteristicRsp), &BluetoothDaemonGattModule::ClientWriteCharacteristicRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_READ_DESCRIPTOR, [OPCODE_CLIENT_READ_DESCRIPTOR] =
&BluetoothDaemonGattModule::ClientReadDescriptorRsp), &BluetoothDaemonGattModule::ClientReadDescriptorRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_WRITE_DESCRIPTOR, [OPCODE_CLIENT_WRITE_DESCRIPTOR] =
&BluetoothDaemonGattModule::ClientWriteDescriptorRsp), &BluetoothDaemonGattModule::ClientWriteDescriptorRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_EXECUTE_WRITE, [OPCODE_CLIENT_EXECUTE_WRITE] =
&BluetoothDaemonGattModule::ClientExecuteWriteRsp), &BluetoothDaemonGattModule::ClientExecuteWriteRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_REGISTER_NOTIFICATION, [OPCODE_CLIENT_REGISTER_NOTIFICATION] =
&BluetoothDaemonGattModule::ClientRegisterNotificationRsp), &BluetoothDaemonGattModule::ClientRegisterNotificationRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_DEREGISTER_NOTIFICATION, [OPCODE_CLIENT_DEREGISTER_NOTIFICATION] =
&BluetoothDaemonGattModule::ClientDeregisterNotificationRsp), &BluetoothDaemonGattModule::ClientDeregisterNotificationRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_READ_REMOTE_RSSI, [OPCODE_CLIENT_READ_REMOTE_RSSI] =
&BluetoothDaemonGattModule::ClientReadRemoteRssiRsp), &BluetoothDaemonGattModule::ClientReadRemoteRssiRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_GET_DEVICE_TYPE, [OPCODE_CLIENT_GET_DEVICE_TYPE] =
&BluetoothDaemonGattModule::ClientGetDeviceTypeRsp), &BluetoothDaemonGattModule::ClientGetDeviceTypeRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_SET_ADV_DATA, [OPCODE_CLIENT_SET_ADV_DATA] =
&BluetoothDaemonGattModule::ClientSetAdvDataRsp), &BluetoothDaemonGattModule::ClientSetAdvDataRsp,
INIT_ARRAY_AT(OPCODE_CLIENT_TEST_COMMAND, [OPCODE_CLIENT_TEST_COMMAND] =
&BluetoothDaemonGattModule::ClientTestCommandRsp), &BluetoothDaemonGattModule::ClientTestCommandRsp,
INIT_ARRAY_AT(OPCODE_SERVER_REGISTER, [OPCODE_SERVER_REGISTER] =
&BluetoothDaemonGattModule::ServerRegisterRsp), &BluetoothDaemonGattModule::ServerRegisterRsp,
INIT_ARRAY_AT(OPCODE_SERVER_UNREGISTER, [OPCODE_SERVER_UNREGISTER] =
&BluetoothDaemonGattModule::ServerUnregisterRsp), &BluetoothDaemonGattModule::ServerUnregisterRsp,
INIT_ARRAY_AT(OPCODE_SERVER_CONNECT_PERIPHERAL, [OPCODE_SERVER_CONNECT_PERIPHERAL] =
&BluetoothDaemonGattModule::ServerConnectPeripheralRsp), &BluetoothDaemonGattModule::ServerConnectPeripheralRsp,
INIT_ARRAY_AT(OPCODE_SERVER_DISCONNECT_PERIPHERAL, [OPCODE_SERVER_DISCONNECT_PERIPHERAL] =
&BluetoothDaemonGattModule::ServerDisconnectPeripheralRsp), &BluetoothDaemonGattModule::ServerDisconnectPeripheralRsp,
INIT_ARRAY_AT(OPCODE_SERVER_ADD_SERVICE, [OPCODE_SERVER_ADD_SERVICE] =
&BluetoothDaemonGattModule::ServerAddServiceRsp), &BluetoothDaemonGattModule::ServerAddServiceRsp,
INIT_ARRAY_AT(OPCODE_SERVER_ADD_INCLUDED_SERVICE, [OPCODE_SERVER_ADD_INCLUDED_SERVICE] =
&BluetoothDaemonGattModule::ServerAddIncludedServiceRsp), &BluetoothDaemonGattModule::ServerAddIncludedServiceRsp,
INIT_ARRAY_AT(OPCODE_SERVER_ADD_CHARACTERISTIC, [OPCODE_SERVER_ADD_CHARACTERISTIC] =
&BluetoothDaemonGattModule::ServerAddCharacteristicRsp), &BluetoothDaemonGattModule::ServerAddCharacteristicRsp,
INIT_ARRAY_AT(OPCODE_SERVER_ADD_DESCRIPTOR, [OPCODE_SERVER_ADD_DESCRIPTOR] =
&BluetoothDaemonGattModule::ServerAddDescriptorRsp), &BluetoothDaemonGattModule::ServerAddDescriptorRsp,
INIT_ARRAY_AT(OPCODE_SERVER_START_SERVICE, [OPCODE_SERVER_START_SERVICE] =
&BluetoothDaemonGattModule::ServerStartServiceRsp), &BluetoothDaemonGattModule::ServerStartServiceRsp,
INIT_ARRAY_AT(OPCODE_SERVER_STOP_SERVICE, [OPCODE_SERVER_STOP_SERVICE] =
&BluetoothDaemonGattModule::ServerStopServiceRsp), &BluetoothDaemonGattModule::ServerStopServiceRsp,
INIT_ARRAY_AT(OPCODE_SERVER_DELETE_SERVICE, [OPCODE_SERVER_DELETE_SERVICE] =
&BluetoothDaemonGattModule::ServerDeleteServiceRsp), &BluetoothDaemonGattModule::ServerDeleteServiceRsp,
INIT_ARRAY_AT(OPCODE_SERVER_SEND_INDICATION, [OPCODE_SERVER_SEND_INDICATION] =
&BluetoothDaemonGattModule::ServerSendIndicationRsp), &BluetoothDaemonGattModule::ServerSendIndicationRsp,
INIT_ARRAY_AT(OPCODE_SERVER_SEND_RESPONSE, [OPCODE_SERVER_SEND_RESPONSE] =
&BluetoothDaemonGattModule::ServerSendResponseRsp) &BluetoothDaemonGattModule::ServerSendResponseRsp
}; };
MOZ_ASSERT(!NS_IsMainThread()); // I/O thread MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
@ -2156,37 +2156,37 @@ BluetoothDaemonGattModule::HandleNtf(
{ {
static void (BluetoothDaemonGattModule::* const HandleNtf[])( static void (BluetoothDaemonGattModule::* const HandleNtf[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
INIT_ARRAY_AT(0, &BluetoothDaemonGattModule::ClientRegisterNtf), [0] = &BluetoothDaemonGattModule::ClientRegisterNtf,
INIT_ARRAY_AT(1, &BluetoothDaemonGattModule::ClientScanResultNtf), [1] = &BluetoothDaemonGattModule::ClientScanResultNtf,
INIT_ARRAY_AT(2, &BluetoothDaemonGattModule::ClientConnectNtf), [2] = &BluetoothDaemonGattModule::ClientConnectNtf,
INIT_ARRAY_AT(3, &BluetoothDaemonGattModule::ClientDisconnectNtf), [3] = &BluetoothDaemonGattModule::ClientDisconnectNtf,
INIT_ARRAY_AT(4, &BluetoothDaemonGattModule::ClientSearchCompleteNtf), [4] = &BluetoothDaemonGattModule::ClientSearchCompleteNtf,
INIT_ARRAY_AT(5, &BluetoothDaemonGattModule::ClientSearchResultNtf), [5] = &BluetoothDaemonGattModule::ClientSearchResultNtf,
INIT_ARRAY_AT(6, &BluetoothDaemonGattModule::ClientGetCharacteristicNtf), [6] = &BluetoothDaemonGattModule::ClientGetCharacteristicNtf,
INIT_ARRAY_AT(7, &BluetoothDaemonGattModule::ClientGetDescriptorNtf), [7] = &BluetoothDaemonGattModule::ClientGetDescriptorNtf,
INIT_ARRAY_AT(8, &BluetoothDaemonGattModule::ClientGetIncludedServiceNtf), [8] = &BluetoothDaemonGattModule::ClientGetIncludedServiceNtf,
INIT_ARRAY_AT(9, &BluetoothDaemonGattModule::ClientRegisterNotificationNtf), [9] = &BluetoothDaemonGattModule::ClientRegisterNotificationNtf,
INIT_ARRAY_AT(10, &BluetoothDaemonGattModule::ClientNotifyNtf), [10] = &BluetoothDaemonGattModule::ClientNotifyNtf,
INIT_ARRAY_AT(11, &BluetoothDaemonGattModule::ClientReadCharacteristicNtf), [11] = &BluetoothDaemonGattModule::ClientReadCharacteristicNtf,
INIT_ARRAY_AT(12, &BluetoothDaemonGattModule::ClientWriteCharacteristicNtf), [12] = &BluetoothDaemonGattModule::ClientWriteCharacteristicNtf,
INIT_ARRAY_AT(13, &BluetoothDaemonGattModule::ClientReadDescriptorNtf), [13] = &BluetoothDaemonGattModule::ClientReadDescriptorNtf,
INIT_ARRAY_AT(14, &BluetoothDaemonGattModule::ClientWriteDescriptorNtf), [14] = &BluetoothDaemonGattModule::ClientWriteDescriptorNtf,
INIT_ARRAY_AT(15, &BluetoothDaemonGattModule::ClientExecuteWriteNtf), [15] = &BluetoothDaemonGattModule::ClientExecuteWriteNtf,
INIT_ARRAY_AT(16, &BluetoothDaemonGattModule::ClientReadRemoteRssiNtf), [16] = &BluetoothDaemonGattModule::ClientReadRemoteRssiNtf,
INIT_ARRAY_AT(17, &BluetoothDaemonGattModule::ClientListenNtf), [17] = &BluetoothDaemonGattModule::ClientListenNtf,
INIT_ARRAY_AT(18, &BluetoothDaemonGattModule::ServerRegisterNtf), [18] = &BluetoothDaemonGattModule::ServerRegisterNtf,
INIT_ARRAY_AT(19, &BluetoothDaemonGattModule::ServerConnectionNtf), [19] = &BluetoothDaemonGattModule::ServerConnectionNtf,
INIT_ARRAY_AT(20, &BluetoothDaemonGattModule::ServerServiceAddedNtf), [20] = &BluetoothDaemonGattModule::ServerServiceAddedNtf,
INIT_ARRAY_AT(21, &BluetoothDaemonGattModule::ServerIncludedServiceAddedNtf), [21] = &BluetoothDaemonGattModule::ServerIncludedServiceAddedNtf,
INIT_ARRAY_AT(22, &BluetoothDaemonGattModule::ServerCharacteristicAddedNtf), [22] = &BluetoothDaemonGattModule::ServerCharacteristicAddedNtf,
INIT_ARRAY_AT(23, &BluetoothDaemonGattModule::ServerDescriptorAddedNtf), [23] = &BluetoothDaemonGattModule::ServerDescriptorAddedNtf,
INIT_ARRAY_AT(24, &BluetoothDaemonGattModule::ServerServiceStartedNtf), [24] = &BluetoothDaemonGattModule::ServerServiceStartedNtf,
INIT_ARRAY_AT(25, &BluetoothDaemonGattModule::ServerServiceStoppedNtf), [25] = &BluetoothDaemonGattModule::ServerServiceStoppedNtf,
INIT_ARRAY_AT(26, &BluetoothDaemonGattModule::ServerServiceDeletedNtf), [26] = &BluetoothDaemonGattModule::ServerServiceDeletedNtf,
INIT_ARRAY_AT(27, &BluetoothDaemonGattModule::ServerRequestReadNtf), [27] = &BluetoothDaemonGattModule::ServerRequestReadNtf,
INIT_ARRAY_AT(28, &BluetoothDaemonGattModule::ServerRequestWriteNtf), [28] = &BluetoothDaemonGattModule::ServerRequestWriteNtf,
INIT_ARRAY_AT(29, &BluetoothDaemonGattModule::ServerRequestExecuteWriteNtf), [29] = &BluetoothDaemonGattModule::ServerRequestExecuteWriteNtf,
INIT_ARRAY_AT(30, &BluetoothDaemonGattModule::ServerResponseConfirmationNtf) [30] = &BluetoothDaemonGattModule::ServerResponseConfirmationNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());

View File

@ -50,8 +50,8 @@ BluetoothDaemonHandsfreeModule::HandleSvc(
{ {
static void (BluetoothDaemonHandsfreeModule::* const HandleOp[])( static void (BluetoothDaemonHandsfreeModule::* const HandleOp[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
INIT_ARRAY_AT(0, &BluetoothDaemonHandsfreeModule::HandleRsp), [0] = &BluetoothDaemonHandsfreeModule::HandleRsp,
INIT_ARRAY_AT(1, &BluetoothDaemonHandsfreeModule::HandleNtf), [1] = &BluetoothDaemonHandsfreeModule::HandleNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
@ -685,38 +685,38 @@ BluetoothDaemonHandsfreeModule::HandleRsp(
const DaemonSocketPDUHeader&, const DaemonSocketPDUHeader&,
DaemonSocketPDU&, DaemonSocketPDU&,
BluetoothHandsfreeResultHandler*) = { BluetoothHandsfreeResultHandler*) = {
INIT_ARRAY_AT(OPCODE_ERROR, [OPCODE_ERROR] =
&BluetoothDaemonHandsfreeModule::ErrorRsp), &BluetoothDaemonHandsfreeModule::ErrorRsp,
INIT_ARRAY_AT(OPCODE_CONNECT, [OPCODE_CONNECT] =
&BluetoothDaemonHandsfreeModule::ConnectRsp), &BluetoothDaemonHandsfreeModule::ConnectRsp,
INIT_ARRAY_AT(OPCODE_DISCONNECT, [OPCODE_DISCONNECT] =
&BluetoothDaemonHandsfreeModule::DisconnectRsp), &BluetoothDaemonHandsfreeModule::DisconnectRsp,
INIT_ARRAY_AT(OPCODE_CONNECT_AUDIO, [OPCODE_CONNECT_AUDIO] =
&BluetoothDaemonHandsfreeModule::ConnectAudioRsp), &BluetoothDaemonHandsfreeModule::ConnectAudioRsp,
INIT_ARRAY_AT(OPCODE_DISCONNECT_AUDIO, [OPCODE_DISCONNECT_AUDIO] =
&BluetoothDaemonHandsfreeModule::DisconnectAudioRsp), &BluetoothDaemonHandsfreeModule::DisconnectAudioRsp,
INIT_ARRAY_AT(OPCODE_START_VOICE_RECOGNITION, [OPCODE_START_VOICE_RECOGNITION] =
&BluetoothDaemonHandsfreeModule::StartVoiceRecognitionRsp), &BluetoothDaemonHandsfreeModule::StartVoiceRecognitionRsp,
INIT_ARRAY_AT(OPCODE_STOP_VOICE_RECOGNITION, [OPCODE_STOP_VOICE_RECOGNITION] =
&BluetoothDaemonHandsfreeModule::StopVoiceRecognitionRsp), &BluetoothDaemonHandsfreeModule::StopVoiceRecognitionRsp,
INIT_ARRAY_AT(OPCODE_VOLUME_CONTROL, [OPCODE_VOLUME_CONTROL] =
&BluetoothDaemonHandsfreeModule::VolumeControlRsp), &BluetoothDaemonHandsfreeModule::VolumeControlRsp,
INIT_ARRAY_AT(OPCODE_DEVICE_STATUS_NOTIFICATION, [OPCODE_DEVICE_STATUS_NOTIFICATION] =
&BluetoothDaemonHandsfreeModule::DeviceStatusNotificationRsp), &BluetoothDaemonHandsfreeModule::DeviceStatusNotificationRsp,
INIT_ARRAY_AT(OPCODE_COPS_RESPONSE, [OPCODE_COPS_RESPONSE] =
&BluetoothDaemonHandsfreeModule::CopsResponseRsp), &BluetoothDaemonHandsfreeModule::CopsResponseRsp,
INIT_ARRAY_AT(OPCODE_CIND_RESPONSE, [OPCODE_CIND_RESPONSE] =
&BluetoothDaemonHandsfreeModule::CindResponseRsp), &BluetoothDaemonHandsfreeModule::CindResponseRsp,
INIT_ARRAY_AT(OPCODE_FORMATTED_AT_RESPONSE, [OPCODE_FORMATTED_AT_RESPONSE] =
&BluetoothDaemonHandsfreeModule::FormattedAtResponseRsp), &BluetoothDaemonHandsfreeModule::FormattedAtResponseRsp,
INIT_ARRAY_AT(OPCODE_AT_RESPONSE, [OPCODE_AT_RESPONSE] =
&BluetoothDaemonHandsfreeModule::AtResponseRsp), &BluetoothDaemonHandsfreeModule::AtResponseRsp,
INIT_ARRAY_AT(OPCODE_CLCC_RESPONSE, [OPCODE_CLCC_RESPONSE] =
&BluetoothDaemonHandsfreeModule::ClccResponseRsp), &BluetoothDaemonHandsfreeModule::ClccResponseRsp,
INIT_ARRAY_AT(OPCODE_PHONE_STATE_CHANGE, [OPCODE_PHONE_STATE_CHANGE] =
&BluetoothDaemonHandsfreeModule::PhoneStateChangeRsp), &BluetoothDaemonHandsfreeModule::PhoneStateChangeRsp,
INIT_ARRAY_AT(OPCODE_CONFIGURE_WBS, [OPCODE_CONFIGURE_WBS] =
&BluetoothDaemonHandsfreeModule::ConfigureWbsRsp) &BluetoothDaemonHandsfreeModule::ConfigureWbsRsp
}; };
MOZ_ASSERT(!NS_IsMainThread()); // I/O thread MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
@ -1426,22 +1426,22 @@ BluetoothDaemonHandsfreeModule::HandleNtf(
{ {
static void (BluetoothDaemonHandsfreeModule::* const HandleNtf[])( static void (BluetoothDaemonHandsfreeModule::* const HandleNtf[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
INIT_ARRAY_AT(0, &BluetoothDaemonHandsfreeModule::ConnectionStateNtf), [0] = &BluetoothDaemonHandsfreeModule::ConnectionStateNtf,
INIT_ARRAY_AT(1, &BluetoothDaemonHandsfreeModule::AudioStateNtf), [1] = &BluetoothDaemonHandsfreeModule::AudioStateNtf,
INIT_ARRAY_AT(2, &BluetoothDaemonHandsfreeModule::VoiceRecognitionNtf), [2] = &BluetoothDaemonHandsfreeModule::VoiceRecognitionNtf,
INIT_ARRAY_AT(3, &BluetoothDaemonHandsfreeModule::AnswerCallNtf), [3] = &BluetoothDaemonHandsfreeModule::AnswerCallNtf,
INIT_ARRAY_AT(4, &BluetoothDaemonHandsfreeModule::HangupCallNtf), [4] = &BluetoothDaemonHandsfreeModule::HangupCallNtf,
INIT_ARRAY_AT(5, &BluetoothDaemonHandsfreeModule::VolumeNtf), [5] = &BluetoothDaemonHandsfreeModule::VolumeNtf,
INIT_ARRAY_AT(6, &BluetoothDaemonHandsfreeModule::DialCallNtf), [6] = &BluetoothDaemonHandsfreeModule::DialCallNtf,
INIT_ARRAY_AT(7, &BluetoothDaemonHandsfreeModule::DtmfNtf), [7] = &BluetoothDaemonHandsfreeModule::DtmfNtf,
INIT_ARRAY_AT(8, &BluetoothDaemonHandsfreeModule::NRECNtf), [8] = &BluetoothDaemonHandsfreeModule::NRECNtf,
INIT_ARRAY_AT(9, &BluetoothDaemonHandsfreeModule::CallHoldNtf), [9] = &BluetoothDaemonHandsfreeModule::CallHoldNtf,
INIT_ARRAY_AT(10, &BluetoothDaemonHandsfreeModule::CnumNtf), [10] = &BluetoothDaemonHandsfreeModule::CnumNtf,
INIT_ARRAY_AT(11, &BluetoothDaemonHandsfreeModule::CindNtf), [11] = &BluetoothDaemonHandsfreeModule::CindNtf,
INIT_ARRAY_AT(12, &BluetoothDaemonHandsfreeModule::CopsNtf), [12] = &BluetoothDaemonHandsfreeModule::CopsNtf,
INIT_ARRAY_AT(13, &BluetoothDaemonHandsfreeModule::ClccNtf), [13] = &BluetoothDaemonHandsfreeModule::ClccNtf,
INIT_ARRAY_AT(14, &BluetoothDaemonHandsfreeModule::UnknownAtNtf), [14] = &BluetoothDaemonHandsfreeModule::UnknownAtNtf,
INIT_ARRAY_AT(15, &BluetoothDaemonHandsfreeModule::KeyPressedNtf) [15] = &BluetoothDaemonHandsfreeModule::KeyPressedNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());

View File

@ -113,10 +113,10 @@ protected:
const DaemonSocketPDUHeader&, const DaemonSocketPDUHeader&,
DaemonSocketPDU&, DaemonSocketPDU&,
BluetoothSetupResultHandler*) = { BluetoothSetupResultHandler*) = {
INIT_ARRAY_AT(0x00, &BluetoothDaemonSetupModule::ErrorRsp), [0x00] = &BluetoothDaemonSetupModule::ErrorRsp,
INIT_ARRAY_AT(0x01, &BluetoothDaemonSetupModule::RegisterModuleRsp), [0x01] = &BluetoothDaemonSetupModule::RegisterModuleRsp,
INIT_ARRAY_AT(0x02, &BluetoothDaemonSetupModule::UnregisterModuleRsp), [0x02] = &BluetoothDaemonSetupModule::UnregisterModuleRsp,
INIT_ARRAY_AT(0x03, &BluetoothDaemonSetupModule::ConfigurationRsp) [0x03] = &BluetoothDaemonSetupModule::ConfigurationRsp
}; };
if (NS_WARN_IF(aHeader.mOpcode >= MOZ_ARRAY_LENGTH(HandleRsp)) || if (NS_WARN_IF(aHeader.mOpcode >= MOZ_ARRAY_LENGTH(HandleRsp)) ||
@ -604,8 +604,8 @@ protected:
{ {
static void (BluetoothDaemonCoreModule::* const HandleOp[])( static void (BluetoothDaemonCoreModule::* const HandleOp[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
INIT_ARRAY_AT(0, &BluetoothDaemonCoreModule::HandleRsp), [0] = &BluetoothDaemonCoreModule::HandleRsp,
INIT_ARRAY_AT(1, &BluetoothDaemonCoreModule::HandleNtf), [1] = &BluetoothDaemonCoreModule::HandleNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
@ -831,31 +831,27 @@ private:
const DaemonSocketPDUHeader&, const DaemonSocketPDUHeader&,
DaemonSocketPDU&, DaemonSocketPDU&,
BluetoothResultHandler*) = { BluetoothResultHandler*) = {
INIT_ARRAY_AT(0x00, &BluetoothDaemonCoreModule::ErrorRsp), [0x00] = &BluetoothDaemonCoreModule::ErrorRsp,
INIT_ARRAY_AT(0x01, &BluetoothDaemonCoreModule::EnableRsp), [0x01] = &BluetoothDaemonCoreModule::EnableRsp,
INIT_ARRAY_AT(0x02, &BluetoothDaemonCoreModule::DisableRsp), [0x02] = &BluetoothDaemonCoreModule::DisableRsp,
INIT_ARRAY_AT(0x03, &BluetoothDaemonCoreModule::GetAdapterPropertiesRsp), [0x03] = &BluetoothDaemonCoreModule::GetAdapterPropertiesRsp,
INIT_ARRAY_AT(0x04, &BluetoothDaemonCoreModule::GetAdapterPropertyRsp), [0x04] = &BluetoothDaemonCoreModule::GetAdapterPropertyRsp,
INIT_ARRAY_AT(0x05, &BluetoothDaemonCoreModule::SetAdapterPropertyRsp), [0x05] = &BluetoothDaemonCoreModule::SetAdapterPropertyRsp,
INIT_ARRAY_AT(0x06, [0x06] = &BluetoothDaemonCoreModule::GetRemoteDevicePropertiesRsp,
&BluetoothDaemonCoreModule::GetRemoteDevicePropertiesRsp), [0x07] = &BluetoothDaemonCoreModule::GetRemoteDevicePropertyRsp,
INIT_ARRAY_AT(0x07, [0x08] = &BluetoothDaemonCoreModule::SetRemoteDevicePropertyRsp,
&BluetoothDaemonCoreModule::GetRemoteDevicePropertyRsp), [0x09] = &BluetoothDaemonCoreModule::GetRemoteServiceRecordRsp,
INIT_ARRAY_AT(0x08, [0x0a] = &BluetoothDaemonCoreModule::GetRemoteServicesRsp,
&BluetoothDaemonCoreModule::SetRemoteDevicePropertyRsp), [0x0b] = &BluetoothDaemonCoreModule::StartDiscoveryRsp,
INIT_ARRAY_AT(0x09, [0x0c] = &BluetoothDaemonCoreModule::CancelDiscoveryRsp,
&BluetoothDaemonCoreModule::GetRemoteServiceRecordRsp), [0x0d] = &BluetoothDaemonCoreModule::CreateBondRsp,
INIT_ARRAY_AT(0x0a, &BluetoothDaemonCoreModule::GetRemoteServicesRsp), [0x0e] = &BluetoothDaemonCoreModule::RemoveBondRsp,
INIT_ARRAY_AT(0x0b, &BluetoothDaemonCoreModule::StartDiscoveryRsp), [0x0f] = &BluetoothDaemonCoreModule::CancelBondRsp,
INIT_ARRAY_AT(0x0c, &BluetoothDaemonCoreModule::CancelDiscoveryRsp), [0x10] = &BluetoothDaemonCoreModule::PinReplyRsp,
INIT_ARRAY_AT(0x0d, &BluetoothDaemonCoreModule::CreateBondRsp), [0x11] = &BluetoothDaemonCoreModule::SspReplyRsp,
INIT_ARRAY_AT(0x0e, &BluetoothDaemonCoreModule::RemoveBondRsp), [0x12] = &BluetoothDaemonCoreModule::DutModeConfigureRsp,
INIT_ARRAY_AT(0x0f, &BluetoothDaemonCoreModule::CancelBondRsp), [0x13] = &BluetoothDaemonCoreModule::DutModeSendRsp,
INIT_ARRAY_AT(0x10, &BluetoothDaemonCoreModule::PinReplyRsp), [0x14] = &BluetoothDaemonCoreModule::LeTestModeRsp,
INIT_ARRAY_AT(0x11, &BluetoothDaemonCoreModule::SspReplyRsp),
INIT_ARRAY_AT(0x12, &BluetoothDaemonCoreModule::DutModeConfigureRsp),
INIT_ARRAY_AT(0x13, &BluetoothDaemonCoreModule::DutModeSendRsp),
INIT_ARRAY_AT(0x14, &BluetoothDaemonCoreModule::LeTestModeRsp),
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
@ -1353,17 +1349,17 @@ private:
{ {
static void (BluetoothDaemonCoreModule::* const HandleNtf[])( static void (BluetoothDaemonCoreModule::* const HandleNtf[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
INIT_ARRAY_AT(0, &BluetoothDaemonCoreModule::AdapterStateChangedNtf), [0] = &BluetoothDaemonCoreModule::AdapterStateChangedNtf,
INIT_ARRAY_AT(1, &BluetoothDaemonCoreModule::AdapterPropertiesNtf), [1] = &BluetoothDaemonCoreModule::AdapterPropertiesNtf,
INIT_ARRAY_AT(2, &BluetoothDaemonCoreModule::RemoteDevicePropertiesNtf), [2] = &BluetoothDaemonCoreModule::RemoteDevicePropertiesNtf,
INIT_ARRAY_AT(3, &BluetoothDaemonCoreModule::DeviceFoundNtf), [3] = &BluetoothDaemonCoreModule::DeviceFoundNtf,
INIT_ARRAY_AT(4, &BluetoothDaemonCoreModule::DiscoveryStateChangedNtf), [4] = &BluetoothDaemonCoreModule::DiscoveryStateChangedNtf,
INIT_ARRAY_AT(5, &BluetoothDaemonCoreModule::PinRequestNtf), [5] = &BluetoothDaemonCoreModule::PinRequestNtf,
INIT_ARRAY_AT(6, &BluetoothDaemonCoreModule::SspRequestNtf), [6] = &BluetoothDaemonCoreModule::SspRequestNtf,
INIT_ARRAY_AT(7, &BluetoothDaemonCoreModule::BondStateChangedNtf), [7] = &BluetoothDaemonCoreModule::BondStateChangedNtf,
INIT_ARRAY_AT(8, &BluetoothDaemonCoreModule::AclStateChangedNtf), [8] = &BluetoothDaemonCoreModule::AclStateChangedNtf,
INIT_ARRAY_AT(9, &BluetoothDaemonCoreModule::DutModeRecvNtf), [9] = &BluetoothDaemonCoreModule::DutModeRecvNtf,
INIT_ARRAY_AT(10, &BluetoothDaemonCoreModule::LeTestModeNtf) [10] = &BluetoothDaemonCoreModule::LeTestModeNtf
}; };
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
@ -1594,20 +1590,20 @@ BluetoothDaemonProtocol::Handle(DaemonSocketPDU& aPDU)
{ {
static void (BluetoothDaemonProtocol::* const HandleSvc[])( static void (BluetoothDaemonProtocol::* const HandleSvc[])(
const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = { const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
INIT_ARRAY_AT(0x00, &BluetoothDaemonProtocol::HandleSetupSvc), [0x00] = &BluetoothDaemonProtocol::HandleSetupSvc,
INIT_ARRAY_AT(0x01, &BluetoothDaemonProtocol::HandleCoreSvc), [0x01] = &BluetoothDaemonProtocol::HandleCoreSvc,
INIT_ARRAY_AT(0x02, &BluetoothDaemonProtocol::HandleSocketSvc), [0x02] = &BluetoothDaemonProtocol::HandleSocketSvc,
INIT_ARRAY_AT(0x03, nullptr), // HID host [0x03] = nullptr, // HID host
INIT_ARRAY_AT(0x04, nullptr), // PAN [0x04] = nullptr, // PAN
INIT_ARRAY_AT(BluetoothDaemonHandsfreeModule::SERVICE_ID, [BluetoothDaemonHandsfreeModule::SERVICE_ID] =
&BluetoothDaemonProtocol::HandleHandsfreeSvc), &BluetoothDaemonProtocol::HandleHandsfreeSvc,
INIT_ARRAY_AT(BluetoothDaemonA2dpModule::SERVICE_ID, [BluetoothDaemonA2dpModule::SERVICE_ID] =
&BluetoothDaemonProtocol::HandleA2dpSvc), &BluetoothDaemonProtocol::HandleA2dpSvc,
INIT_ARRAY_AT(0x07, nullptr), // Health [0x07] = nullptr, // Health
INIT_ARRAY_AT(BluetoothDaemonAvrcpModule::SERVICE_ID, [BluetoothDaemonAvrcpModule::SERVICE_ID] =
&BluetoothDaemonProtocol::HandleAvrcpSvc), &BluetoothDaemonProtocol::HandleAvrcpSvc,
INIT_ARRAY_AT(BluetoothDaemonGattModule::SERVICE_ID, [BluetoothDaemonGattModule::SERVICE_ID] =
&BluetoothDaemonProtocol::HandleGattSvc) &BluetoothDaemonProtocol::HandleGattSvc
}; };
DaemonSocketPDUHeader header; DaemonSocketPDUHeader header;

View File

@ -166,9 +166,9 @@ BluetoothDaemonSocketModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
const DaemonSocketPDUHeader&, const DaemonSocketPDUHeader&,
DaemonSocketPDU&, DaemonSocketPDU&,
BluetoothSocketResultHandler*) = { BluetoothSocketResultHandler*) = {
INIT_ARRAY_AT(0x00, &BluetoothDaemonSocketModule::ErrorRsp), [0x00] = &BluetoothDaemonSocketModule::ErrorRsp,
INIT_ARRAY_AT(0x01, &BluetoothDaemonSocketModule::ListenRsp), [0x01] = &BluetoothDaemonSocketModule::ListenRsp,
INIT_ARRAY_AT(0x02, &BluetoothDaemonSocketModule::ConnectRsp), [0x02] = &BluetoothDaemonSocketModule::ConnectRsp
}; };
if (NS_WARN_IF(MOZ_ARRAY_LENGTH(HandleRsp) <= aHeader.mOpcode) || if (NS_WARN_IF(MOZ_ARRAY_LENGTH(HandleRsp) <= aHeader.mOpcode) ||