Files
palemoon27/dom/bluetooth/common/BluetoothInterface.cpp
roytam1 e333860065 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1251090 - Shell functions should check whether an off main thread compilation is for a script or a module r=shu (41b89b1232)
- Bug 1222420 - Make AutoFinishGC into a function r=terrence (a8f535528c)
- Bug 1253094, part 4 - Stop using DebugOnly for class/struct members in js/. r=billm (2c790aa526)
- Bug 1080968 - Don't use constexpr on clang-cl when emulating MSVC 2013 (e9cc2d7c7c)
- Bug 1257496 - Add information about cycle count and GC state to our GC stats r=sfink (6c2250bfba)
- Bug 1256178 - Drop the moz prefix from the MozCSSKeyframeRule and MozCSSKeyframesRule interfaces; r=bzbarsky (894855bce1)
- Bug 1249896 - Part 1: Remove unused AndOrLeft, AndOrRight, RelationalLeft, and RelationalRight. r=jwalden (c4db9dfecf)
- Bug 1249896 - Part 2: Remove unused type member from SIMD Int8x16Defnetc. r=bbouvier (7d3d7a4db1)
- Bug 1249896 - Part 3: Add JS namespace for GenericNaN. r=luke (69acc1f3ec)
- Bug 1249896 - Part 4: Avoid declaring variable between cases in switch. r=luke (28e5f94c24)
- Bug 1249896 - Part 5: Remove unused ReportInvalidTrapResult. r=efaust (caa948acac)
- Bug 1249896 - Part 7: Remove unnecessary static from my_ErrorReporter. r=sfink (7f723e079d)
- Bug 1249896 - Part 8: Remove unreachable code from GetLine. r=jwalden (108c857a1a)
- Bug 1249896 - Part 9: Include shell/jsshell.h in js.cpp. r=sfink (638bfc13c4)
- Bug 1253094, part 3 - Stop using DebugOnly for class/struct members in ipc/. r=billm (ab9e014158)
- Bug 1259737 - Make sure BackgroundImpl.cpp's mBoundThread is not used in release builds. r=froydnj (5c278ab398)
- Bug 1254515 - GonkCameraImage.cpp:16:5: error: class 'mozilla::GonkCameraImage' does not have any field named 'mThread' r=reuben (e5cac8cf5b)
- Bug 1250952: Create a join block in case we're in dead code after the condition; r=luke (1d6b706ae5)
- Bug 1249601 - Implement wasm i64 comparisons. r=sunfish (4927f709db)
- Bug 1250165 - Implement wasm i64 bitwise ops. r=luke (5c25322772)
- Bug 1251225 - Implement wasm i64 binary arithmetic operators. r=sunfish (f478fa8b4b)
- Bug 1251392 - Baldr: Implement PopcntI. r=sunfish (79556e947f)
- Bug 1229985 - remove nsAutoArrayPtr; r=erahm (91c49451ca)
- Bug 1251541: Replace |nsAutoArrayPtr<>| with |UniquePtr<[]>| in Bluetooth managers, r=shuang (2c1dc7ca89)
- Bug 1251541: Pass arguments to AVRCP passthrough command as uint8_t, r=shuang (73a094bd26)
- Bug 1251541: Replace |nsAutoArrayPtr<>| with |UniquePtr<[]>| in Bluetooth interfaces, r=shuang (371041f093)
- Bug 1249424 - Remove use of nsAutoArrayPtr from librlz. r=gerald (7cbcfea1b0)
- Bug 1249389 - part 0 - use getter_Transfers in TestStartupCache.cpp; r=erahm (ecb8818959)
- Bug 1249389 - part 1 - change NewObjectInputStreamFromBuffer to take a UniquePtr argument; r=erahm (0bdafa20ae)
- Bug 1249389 - part 2 - change NewBufferFromStorageStream's outparam into a UniquePtr; r=erahm (b27a70ce2d)
- Bug 1249389 - part 3 - assert the size of nsZipItemPtr's storage type; r=erahm (7c55da9ea7)
- Bug 1249389 - part 4 - make StartupCache::GetBuffer take a UniquePtr outparam; r=erahm (84b722479b)
- Bug 1249389 - part 5 - use UniquePtr instead of nsAutoArrayPtr in mozilla::scache::CacheEntry; r=erahm (0fd492ea95)
- Bug 1249389 - part 6 - provide UniquePtr overload for nsIStartupCache::GetBuffer; r=erahm (c27231d945)
- Bug 1249389 - followup - fix compilation bustage in gfxFT2FontList.cpp; r=me (a86a1b0399)
- Bug 1249389 - part 7 - clean up calls to GetBuffer in TestStartupCache; r=erahm (98939334b6)
- Bug 1249369 - use UniquePtr instead of nsAutoArrayPtr in MediaPipeline.cpp; r=jesup (7402a75a8a)
- Bug 1238842 - Add error codes to Gecko by following W3C spec. r=brsun (0dd283f6ba)
- Bug 1253217 - Change filename from BluetoothUuid to BluetoothUuidHelper. r=jocelyn (1946bcac26)
- Bug 1241382 - Revise default value of BluetoothAdapter.address and BluetoothDevice.address to empty string, f=wiwang, r=shuang (d9fdb97743)
- Bug 1223722: Transfer arrays of Bluetooth UUIDs in |BluetoothValue|, r=brsun (344af40591)
- Bug 1222956: Use |BluetoothUuid| in |BluetoothDiscoveryHandle|, r=tzimmermann (40512de386)
- Bug 1250694: Use functions to return static const BluetoothAddress and BluetoothUuid; r=tzimmermann (0c4b20066f)
- Bug 1236561 - part 1 - convert easy cases of nsAutoArrayPtr<T> to UniquePtr<T[]> in dom/bluetooth/; r=btian (31ef8b7b50)
- Bug 1236561 - part 2 - remove ObexHeaderSet::GetAuthChallenge; r=btian (f70daddd53)
- Bug 1236561 - part 3 - make BluetoothConfigurationParameter.mValue a UniquePtr; r=btian (a5a0ac988a)
- Bug 1239979: Add |BluetoothSocket::Accept| method, r=btian (ca92a0ab7c)
- Bug 1239979: Store pointer to Bluetooth socket interface in |BluetoothSocket|, r=btian (7c15e75133)
- Bug 1239979: Cleanup |BluetoothSocket|'s internals when connections close, r=btian (b6ac677d2e)
- Bug 1252841: Convert Bluetooth module to |UniquePtr<>|, r=btian (76d9759afd)
- Bug 1232687: Start bluetoothd with HAL service interface, r=shuang (379a68064f)
- Bug 1223729 - HID Connection Implementation, r=jocelyn, sr=mrbkap (0eeddf875e)
- Bug 1232670: Prepare Bluetooth PDU for sending after checking connection status, r=shuang (699ff14d9b)
- Bug 1252841: Convert Bluetooth daemon interfaces to |UniquePtr<>|, r=brsun (797260c6dc)
2024-02-07 15:25:46 +08:00

1220 lines
24 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "BluetoothInterface.h"
#if ANDROID_VERSION >= 17
#include <cutils/properties.h>
#endif
#ifdef MOZ_B2G_BT_DAEMON
#include "BluetoothDaemonInterface.h"
#endif
BEGIN_BLUETOOTH_NAMESPACE
//
// Setup Interface
//
// Result handling
//
void
BluetoothSetupResultHandler::OnError(BluetoothStatus aStatus)
{
BT_WARNING("Received error code %d", (int)aStatus);
}
void
BluetoothSetupResultHandler::RegisterModule()
{ }
void
BluetoothSetupResultHandler::UnregisterModule()
{ }
void
BluetoothSetupResultHandler::Configuration()
{ }
// Interface
//
BluetoothSetupInterface::~BluetoothSetupInterface()
{ }
//
// Bluetooth Core Interface
//
// Notification handling
//
BluetoothCoreNotificationHandler::BluetoothCoreNotificationHandler()
{ }
BluetoothCoreNotificationHandler::~BluetoothCoreNotificationHandler()
{ }
void
BluetoothCoreNotificationHandler::AdapterStateChangedNotification(bool aState)
{ }
void
BluetoothCoreNotificationHandler::AdapterPropertiesNotification(
BluetoothStatus aStatus,int aNumProperties,
const BluetoothProperty* aProperties)
{ }
void
BluetoothCoreNotificationHandler::RemoteDevicePropertiesNotification(
BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
int aNumProperties, const BluetoothProperty* aProperties)
{ }
void
BluetoothCoreNotificationHandler::DeviceFoundNotification(
int aNumProperties, const BluetoothProperty* aProperties)
{ }
void
BluetoothCoreNotificationHandler::DiscoveryStateChangedNotification(
bool aState)
{ }
void
BluetoothCoreNotificationHandler::PinRequestNotification(
const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
uint32_t aCod)
{ }
void
BluetoothCoreNotificationHandler::SspRequestNotification(
const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
uint32_t aCod, BluetoothSspVariant aPairingVariant, uint32_t aPassKey)
{ }
void
BluetoothCoreNotificationHandler::BondStateChangedNotification(
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
BluetoothBondState aState)
{ }
void
BluetoothCoreNotificationHandler::AclStateChangedNotification(
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
BluetoothAclState aState)
{ }
void
BluetoothCoreNotificationHandler::DutModeRecvNotification(
uint16_t aOpcode,
const uint8_t* aBuf,
uint8_t aLen)
{ }
void
BluetoothCoreNotificationHandler::LeTestModeNotification(
BluetoothStatus aStatus,
uint16_t aNumPackets)
{ }
void
BluetoothCoreNotificationHandler::EnergyInfoNotification(
const BluetoothActivityEnergyInfo& aInfo)
{ }
// Result handling
//
void
BluetoothCoreResultHandler::OnError(BluetoothStatus aStatus)
{
BT_LOGR("Received error code %d", aStatus);
}
void
BluetoothCoreResultHandler::Enable()
{ }
void
BluetoothCoreResultHandler::Disable()
{ }
void
BluetoothCoreResultHandler::GetAdapterProperties()
{ }
void
BluetoothCoreResultHandler::GetAdapterProperty()
{ }
void
BluetoothCoreResultHandler::SetAdapterProperty()
{ }
void
BluetoothCoreResultHandler::GetRemoteDeviceProperties()
{ }
void
BluetoothCoreResultHandler::GetRemoteDeviceProperty()
{ }
void
BluetoothCoreResultHandler::SetRemoteDeviceProperty()
{ }
void
BluetoothCoreResultHandler::GetRemoteServiceRecord()
{ }
void
BluetoothCoreResultHandler::GetRemoteServices()
{ }
void
BluetoothCoreResultHandler::StartDiscovery()
{ }
void
BluetoothCoreResultHandler::CancelDiscovery()
{ }
void
BluetoothCoreResultHandler::CreateBond()
{ }
void
BluetoothCoreResultHandler::RemoveBond()
{ }
void
BluetoothCoreResultHandler::CancelBond()
{ }
void
BluetoothCoreResultHandler::GetConnectionState()
{ }
void
BluetoothCoreResultHandler::PinReply()
{ }
void
BluetoothCoreResultHandler::SspReply()
{ }
void
BluetoothCoreResultHandler::DutModeConfigure()
{ }
void
BluetoothCoreResultHandler::DutModeSend()
{ }
void
BluetoothCoreResultHandler::LeTestMode()
{ }
void
BluetoothCoreResultHandler::ReadEnergyInfo()
{ }
// Interface
//
BluetoothCoreInterface::BluetoothCoreInterface()
{ }
BluetoothCoreInterface::~BluetoothCoreInterface()
{ }
//
// Socket Interface
//
// Result handling
//
void
BluetoothSocketResultHandler::OnError(BluetoothStatus aStatus)
{
BT_WARNING("Received error code %d", (int)aStatus);
}
void
BluetoothSocketResultHandler::Listen(int aSockFd)
{ }
void
BluetoothSocketResultHandler::Connect(int aSockFd,
const BluetoothAddress& aBdAddress,
int aConnectionState)
{ }
void
BluetoothSocketResultHandler::Accept(int aSockFd,
const BluetoothAddress& aBdAddress,
int aConnectionState)
{ }
// Interface
//
BluetoothSocketInterface::~BluetoothSocketInterface()
{ }
//
//Hid Interface
//
//Notification handling
//
BluetoothHidNotificationHandler::BluetoothHidNotificationHandler()
{ }
BluetoothHidNotificationHandler::~BluetoothHidNotificationHandler()
{ }
void
BluetoothHidNotificationHandler::ConnectionStateNotification(
const BluetoothAddress& aBdAddr, BluetoothHidConnectionState aState)
{ }
void
BluetoothHidNotificationHandler::HidInfoNotification(
const BluetoothAddress& aBdAddr,
const BluetoothHidInfoParam& aHidInfoParam)
{ }
void
BluetoothHidNotificationHandler::ProtocolModeNotification(
const BluetoothAddress& aBdAddr, BluetoothHidStatus aStatus,
BluetoothHidProtocolMode aProtocolMode)
{ }
void
BluetoothHidNotificationHandler::IdleTimeNotification(
const BluetoothAddress& aBdAddr,
BluetoothHidStatus aStatus, uint16_t aIdleTime)
{ }
void
BluetoothHidNotificationHandler::GetReportNotification(
const BluetoothAddress& aBdAddr, BluetoothHidStatus aStatus,
const BluetoothHidReport& aReport)
{ }
void
BluetoothHidNotificationHandler::VirtualUnplugNotification(
const BluetoothAddress& aBdAddr, BluetoothHidStatus aStatus)
{ }
void
BluetoothHidNotificationHandler::HandshakeNotification(
const BluetoothAddress& aBdAddr, BluetoothHidStatus aStatus)
{ }
// Result handling
//
void BluetoothHidResultHandler::OnError(BluetoothStatus aStatus)
{
BT_WARNING("Received error code %d", (int)aStatus);
}
void
BluetoothHidResultHandler::Connect()
{ }
void
BluetoothHidResultHandler::Disconnect()
{ }
void
BluetoothHidResultHandler::VirtualUnplug()
{ }
void
BluetoothHidResultHandler::SetInfo()
{ }
void
BluetoothHidResultHandler::GetProtocol()
{ }
void
BluetoothHidResultHandler::SetProtocol()
{ }
void
BluetoothHidResultHandler::GetReport()
{ }
void
BluetoothHidResultHandler::SetReport()
{ }
void
BluetoothHidResultHandler::SendData()
{ }
// Interface
//
BluetoothHidInterface::BluetoothHidInterface()
{ }
BluetoothHidInterface::~BluetoothHidInterface()
{ }
//
// Handsfree Interface
//
// Notification handling
//
BluetoothHandsfreeNotificationHandler::BluetoothHandsfreeNotificationHandler()
{ }
BluetoothHandsfreeNotificationHandler::~BluetoothHandsfreeNotificationHandler()
{ }
void
BluetoothHandsfreeNotificationHandler::ConnectionStateNotification(
BluetoothHandsfreeConnectionState aState, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::AudioStateNotification(
BluetoothHandsfreeAudioState aState, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::VoiceRecognitionNotification(
BluetoothHandsfreeVoiceRecognitionState aState, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::AnswerCallNotification(
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::HangupCallNotification(
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::VolumeNotification(
BluetoothHandsfreeVolumeType aType, int aVolume, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::DialCallNotification(
const nsAString& aNumber, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::DtmfNotification(
char aDtmf, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::NRECNotification(
BluetoothHandsfreeNRECState aNrec, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::WbsNotification(
BluetoothHandsfreeWbsConfig aWbs, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::CallHoldNotification(
BluetoothHandsfreeCallHoldType aChld, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::CnumNotification(
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::CindNotification(
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::CopsNotification(
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::ClccNotification(
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::UnknownAtNotification(
const nsACString& aAtString, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothHandsfreeNotificationHandler::KeyPressedNotification(
const BluetoothAddress& aBdAddr)
{ }
// Result handling
//
void
BluetoothHandsfreeResultHandler::OnError(BluetoothStatus aStatus)
{
BT_WARNING("Received error code %d", (int)aStatus);
}
void
BluetoothHandsfreeResultHandler::Connect()
{ }
void
BluetoothHandsfreeResultHandler::Disconnect()
{ }
void
BluetoothHandsfreeResultHandler::ConnectAudio()
{ }
void
BluetoothHandsfreeResultHandler::DisconnectAudio()
{ }
void
BluetoothHandsfreeResultHandler::StartVoiceRecognition()
{ }
void
BluetoothHandsfreeResultHandler::StopVoiceRecognition()
{ }
void
BluetoothHandsfreeResultHandler::VolumeControl()
{ }
void
BluetoothHandsfreeResultHandler::DeviceStatusNotification()
{ }
void
BluetoothHandsfreeResultHandler::CopsResponse()
{ }
void
BluetoothHandsfreeResultHandler::CindResponse()
{ }
void
BluetoothHandsfreeResultHandler::FormattedAtResponse()
{ }
void
BluetoothHandsfreeResultHandler::AtResponse()
{ }
void
BluetoothHandsfreeResultHandler::ClccResponse()
{ }
void
BluetoothHandsfreeResultHandler::PhoneStateChange()
{ }
void
BluetoothHandsfreeResultHandler::ConfigureWbs()
{ }
// Interface
//
BluetoothHandsfreeInterface::BluetoothHandsfreeInterface()
{ }
BluetoothHandsfreeInterface::~BluetoothHandsfreeInterface()
{ }
//
// Bluetooth Advanced Audio Interface
//
// Notification handling
//
BluetoothA2dpNotificationHandler::BluetoothA2dpNotificationHandler()
{ }
BluetoothA2dpNotificationHandler::~BluetoothA2dpNotificationHandler()
{ }
void
BluetoothA2dpNotificationHandler::ConnectionStateNotification(
BluetoothA2dpConnectionState aState, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothA2dpNotificationHandler::AudioStateNotification(
BluetoothA2dpAudioState aState, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothA2dpNotificationHandler::AudioConfigNotification(
const BluetoothAddress& aBdAddr, uint32_t aSampleRate, uint8_t aChannelCount)
{ }
// Result handling
//
void
BluetoothA2dpResultHandler::OnError(BluetoothStatus aStatus)
{
BT_WARNING("Received error code %d", (int)aStatus);
}
void
BluetoothA2dpResultHandler::Connect()
{ }
void
BluetoothA2dpResultHandler::Disconnect()
{ }
// Interface
//
BluetoothA2dpInterface::BluetoothA2dpInterface()
{ }
BluetoothA2dpInterface::~BluetoothA2dpInterface()
{ }
//
// Bluetooth AVRCP Interface
//
// Notification handling
//
BluetoothAvrcpNotificationHandler::BluetoothAvrcpNotificationHandler()
{ }
BluetoothAvrcpNotificationHandler::~BluetoothAvrcpNotificationHandler()
{ }
void
BluetoothAvrcpNotificationHandler::GetPlayStatusNotification()
{ }
void
BluetoothAvrcpNotificationHandler::ListPlayerAppAttrNotification()
{ }
void
BluetoothAvrcpNotificationHandler::ListPlayerAppValuesNotification(
BluetoothAvrcpPlayerAttribute aAttrId)
{ }
void
BluetoothAvrcpNotificationHandler::GetPlayerAppValueNotification(
uint8_t aNumAttrs, const BluetoothAvrcpPlayerAttribute* aAttrs)
{ }
void
BluetoothAvrcpNotificationHandler::GetPlayerAppAttrsTextNotification(
uint8_t aNumAttrs, const BluetoothAvrcpPlayerAttribute* aAttrs)
{ }
void
BluetoothAvrcpNotificationHandler::GetPlayerAppValuesTextNotification(
uint8_t aAttrId, uint8_t aNumVals, const uint8_t* aValues)
{ }
void
BluetoothAvrcpNotificationHandler::SetPlayerAppValueNotification(
const BluetoothAvrcpPlayerSettings& aSettings)
{ }
void
BluetoothAvrcpNotificationHandler::GetElementAttrNotification(
uint8_t aNumAttrs, const BluetoothAvrcpMediaAttribute* aAttrs)
{ }
void
BluetoothAvrcpNotificationHandler::RegisterNotificationNotification(
BluetoothAvrcpEvent aEvent, uint32_t aParam)
{ }
void
BluetoothAvrcpNotificationHandler::RemoteFeatureNotification(
const BluetoothAddress& aBdAddr, unsigned long aFeatures)
{ }
void
BluetoothAvrcpNotificationHandler::VolumeChangeNotification(
uint8_t aVolume, uint8_t aCType)
{ }
void
BluetoothAvrcpNotificationHandler::PassthroughCmdNotification(
uint8_t aId, uint8_t aKeyState)
{ }
// Result handling
//
void
BluetoothAvrcpResultHandler::OnError(BluetoothStatus aStatus)
{
BT_WARNING("Received error code %d", (int)aStatus);
}
void
BluetoothAvrcpResultHandler::GetPlayStatusRsp()
{ }
void
BluetoothAvrcpResultHandler::ListPlayerAppAttrRsp()
{ }
void
BluetoothAvrcpResultHandler::ListPlayerAppValueRsp()
{ }
void
BluetoothAvrcpResultHandler::GetPlayerAppValueRsp()
{ }
void
BluetoothAvrcpResultHandler::GetPlayerAppAttrTextRsp()
{ }
void
BluetoothAvrcpResultHandler::GetPlayerAppValueTextRsp()
{ }
void
BluetoothAvrcpResultHandler::GetElementAttrRsp()
{ }
void
BluetoothAvrcpResultHandler::SetPlayerAppValueRsp()
{ }
void
BluetoothAvrcpResultHandler::RegisterNotificationRsp()
{ }
void
BluetoothAvrcpResultHandler::SetVolume()
{ }
// Interface
//
BluetoothAvrcpInterface::BluetoothAvrcpInterface()
{ }
BluetoothAvrcpInterface::~BluetoothAvrcpInterface()
{ }
//
// Bluetooth GATT Interface
//
// Notification handling
//
BluetoothGattNotificationHandler::BluetoothGattNotificationHandler()
{ }
BluetoothGattNotificationHandler::~BluetoothGattNotificationHandler()
{ }
void
BluetoothGattNotificationHandler::RegisterClientNotification(
BluetoothGattStatus aStatus, int aClientIf, const BluetoothUuid& aAppUuid)
{ }
void
BluetoothGattNotificationHandler::ScanResultNotification(
const BluetoothAddress& aBdAddr, int aRssi, const BluetoothGattAdvData& aAdvData)
{ }
void
BluetoothGattNotificationHandler::ConnectNotification(
int aConnId, BluetoothGattStatus aStatus, int aClientIf,
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothGattNotificationHandler::DisconnectNotification(
int aConnId, BluetoothGattStatus aStatus, int aClientIf,
const BluetoothAddress& aBdAddr)
{ }
void
BluetoothGattNotificationHandler::SearchCompleteNotification(
int aConnId, BluetoothGattStatus aStatus)
{ }
void
BluetoothGattNotificationHandler::SearchResultNotification(
int aConnId, const BluetoothGattServiceId& aServiceId)
{ }
void
BluetoothGattNotificationHandler::GetCharacteristicNotification(
int aConnId, BluetoothGattStatus aStatus,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharId,
const BluetoothGattCharProp& aCharProperty)
{ }
void
BluetoothGattNotificationHandler::GetDescriptorNotification(
int aConnId, BluetoothGattStatus aStatus,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattId& aCharId,
const BluetoothGattId& aDescriptorId)
{ }
void
BluetoothGattNotificationHandler::GetIncludedServiceNotification(
int aConnId, BluetoothGattStatus aStatus,
const BluetoothGattServiceId& aServiceId,
const BluetoothGattServiceId& aIncludedServId)
{ }
void
BluetoothGattNotificationHandler::RegisterNotificationNotification(
int aConnId, int aIsRegister, BluetoothGattStatus aStatus,
const BluetoothGattServiceId& aServiceId, const BluetoothGattId& aCharId)
{ }
void
BluetoothGattNotificationHandler::NotifyNotification(
int aConnId, const BluetoothGattNotifyParam& aNotifyParam)
{ }
void
BluetoothGattNotificationHandler::ReadCharacteristicNotification(
int aConnId, BluetoothGattStatus aStatus,
const BluetoothGattReadParam& aReadParam)
{ }
void
BluetoothGattNotificationHandler::WriteCharacteristicNotification(
int aConnId, BluetoothGattStatus aStatus,
const BluetoothGattWriteParam& aWriteParam)
{ }
void
BluetoothGattNotificationHandler::ReadDescriptorNotification(
int aConnId, BluetoothGattStatus aStatus,
const BluetoothGattReadParam& aReadParam)
{ }
void
BluetoothGattNotificationHandler::WriteDescriptorNotification(
int aConnId, BluetoothGattStatus aStatus,
const BluetoothGattWriteParam& aWriteParam)
{ }
void
BluetoothGattNotificationHandler::ExecuteWriteNotification(
int aConnId, BluetoothGattStatus aStatus)
{ }
void
BluetoothGattNotificationHandler::ReadRemoteRssiNotification(
int aClientIf, const BluetoothAddress& aBdAddr, int aRssi,
BluetoothGattStatus aStatus)
{ }
void
BluetoothGattNotificationHandler::ListenNotification(
BluetoothGattStatus aStatus, int aServerIf)
{ }
void
BluetoothGattNotificationHandler::RegisterServerNotification(
BluetoothGattStatus aStatus, int aServerIf, const BluetoothUuid& aAppUuid)
{ }
void
BluetoothGattNotificationHandler::ConnectionNotification(
int aConnId, int aServerIf, bool aConnected, const BluetoothAddress& aBdAddr)
{ }
void
BluetoothGattNotificationHandler::ServiceAddedNotification(
BluetoothGattStatus aStatus, int aServerIf,
const BluetoothGattServiceId& aServiceId,
const BluetoothAttributeHandle& aServiceHandle)
{ }
void
BluetoothGattNotificationHandler::IncludedServiceAddedNotification(
BluetoothGattStatus aStatus, int aServerIf,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aIncludedServiceHandle)
{ }
void
BluetoothGattNotificationHandler::CharacteristicAddedNotification(
BluetoothGattStatus aStatus, int aServerIf, const BluetoothUuid& aCharId,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aCharacteristicHandle)
{ }
void
BluetoothGattNotificationHandler::DescriptorAddedNotification(
BluetoothGattStatus aStatus, int aServerIf, const BluetoothUuid& aCharId,
const BluetoothAttributeHandle& aServiceHandle,
const BluetoothAttributeHandle& aDescriptorHandle)
{ }
void
BluetoothGattNotificationHandler::ServiceStartedNotification(
BluetoothGattStatus aStatus, int aServerIf,
const BluetoothAttributeHandle& aServiceHandle)
{ }
void
BluetoothGattNotificationHandler::ServiceStoppedNotification(
BluetoothGattStatus aStatus, int aServerIf,
const BluetoothAttributeHandle& aServiceHandle)
{ }
void
BluetoothGattNotificationHandler::ServiceDeletedNotification(
BluetoothGattStatus aStatus, int aServerIf,
const BluetoothAttributeHandle& aServiceHandle)
{ }
void
BluetoothGattNotificationHandler::RequestReadNotification(
int aConnId, int aTransId, const BluetoothAddress& aBdAddr,
const BluetoothAttributeHandle& aAttributeHandle, int aOffset, bool aIsLong)
{ }
void
BluetoothGattNotificationHandler::RequestWriteNotification(
int aConnId, int aTransId, const BluetoothAddress& aBdAddr,
const BluetoothAttributeHandle& aAttributeHandle, int aOffset, int aLength,
const uint8_t* aValue, bool aNeedResponse, bool aIsPrepareWrite)
{ }
void
BluetoothGattNotificationHandler::RequestExecuteWriteNotification(
int aConnId, int aTransId, const BluetoothAddress& aBdAddr, bool aExecute)
{ }
void
BluetoothGattNotificationHandler::ResponseConfirmationNotification(
BluetoothGattStatus aStatus, int aHandle)
{ }
void
BluetoothGattNotificationHandler::IndicationSentNotification(
int aConnId, BluetoothGattStatus aStatus)
{ }
void
BluetoothGattNotificationHandler::CongestionNotification(int aConnId,
bool aCongested)
{ }
void
BluetoothGattNotificationHandler::MtuChangedNotification(int aConnId,
int aMtu)
{ }
// Result handling
//
void
BluetoothGattResultHandler::OnError(BluetoothStatus aStatus)
{
BT_WARNING("Received error code %d", (int)aStatus);
}
void
BluetoothGattResultHandler::RegisterClient()
{ }
void
BluetoothGattResultHandler::UnregisterClient()
{ }
void
BluetoothGattResultHandler::Scan()
{ }
void
BluetoothGattResultHandler::Connect()
{ }
void
BluetoothGattResultHandler::Disconnect()
{ }
void
BluetoothGattResultHandler::Listen()
{ }
void
BluetoothGattResultHandler::Refresh()
{ }
void
BluetoothGattResultHandler::SearchService()
{ }
void
BluetoothGattResultHandler::GetIncludedService()
{ }
void
BluetoothGattResultHandler::GetCharacteristic()
{ }
void
BluetoothGattResultHandler::GetDescriptor()
{ }
void
BluetoothGattResultHandler::ReadCharacteristic()
{ }
void
BluetoothGattResultHandler::WriteCharacteristic()
{ }
void
BluetoothGattResultHandler::ReadDescriptor()
{ }
void
BluetoothGattResultHandler::WriteDescriptor()
{ }
void
BluetoothGattResultHandler::ExecuteWrite()
{ }
void
BluetoothGattResultHandler::RegisterNotification()
{ }
void
BluetoothGattResultHandler::DeregisterNotification()
{ }
void
BluetoothGattResultHandler::ReadRemoteRssi()
{ }
void
BluetoothGattResultHandler::GetDeviceType(BluetoothTypeOfDevice aType)
{ }
void
BluetoothGattResultHandler::SetAdvData()
{ }
void
BluetoothGattResultHandler::TestCommand()
{ }
void
BluetoothGattResultHandler::RegisterServer()
{ }
void
BluetoothGattResultHandler::UnregisterServer()
{ }
void
BluetoothGattResultHandler::ConnectPeripheral()
{ }
void
BluetoothGattResultHandler::DisconnectPeripheral()
{ }
void
BluetoothGattResultHandler::AddService()
{ }
void
BluetoothGattResultHandler::AddIncludedService()
{ }
void
BluetoothGattResultHandler::AddCharacteristic()
{ }
void
BluetoothGattResultHandler::AddDescriptor()
{ }
void
BluetoothGattResultHandler::StartService()
{ }
void
BluetoothGattResultHandler::StopService()
{ }
void
BluetoothGattResultHandler::DeleteService()
{ }
void
BluetoothGattResultHandler::SendIndication()
{ }
void
BluetoothGattResultHandler::SendResponse()
{ }
// Interface
//
BluetoothGattInterface::BluetoothGattInterface()
{ }
BluetoothGattInterface::~BluetoothGattInterface()
{ }
//
// Bluetooth Interface
//
// Notification handling
//
BluetoothNotificationHandler::BluetoothNotificationHandler()
{ }
BluetoothNotificationHandler::~BluetoothNotificationHandler()
{ }
void
BluetoothNotificationHandler::BackendErrorNotification(bool aCrashed)
{ }
// Result handling
//
void
BluetoothResultHandler::OnError(BluetoothStatus aStatus)
{
BT_LOGR("Received error code %d", aStatus);
}
void
BluetoothResultHandler::Init()
{ }
void
BluetoothResultHandler::Cleanup()
{ }
// Interface
//
BluetoothInterface*
BluetoothInterface::GetInstance()
{
#if ANDROID_VERSION >= 17
/* We pick a default backend from the available ones. The options are
* ordered by preference. If a backend is supported but not available
* on the current system, we pick the next one. The selected default
* can be overriden manually by storing the respective string in the
* system property 'ro.moz.bluetooth.backend'.
*/
static const char* const sDefaultBackend[] = {
#ifdef MOZ_B2G_BT_DAEMON
"bluetoothd",
#endif
nullptr // no default backend; must be final element in array
};
const char* defaultBackend;
for (size_t i = 0; i < MOZ_ARRAY_LENGTH(sDefaultBackend); ++i) {
/* select current backend */
defaultBackend = sDefaultBackend[i];
if (defaultBackend) {
if (!strcmp(defaultBackend, "bluetoothd") &&
access("/init.bluetooth.rc", F_OK) == -1) {
continue; /* bluetoothd not available */
}
}
break;
}
char value[PROPERTY_VALUE_MAX];
int len;
len = property_get("ro.moz.bluetooth.backend", value, defaultBackend);
if (len < 0) {
BT_WARNING("No Bluetooth backend available.");
return nullptr;
}
const nsDependentCString backend(value, len);
/* Here's where we decide which implementation to use. Currently
* there is only Bluedroid and the Bluetooth daemon, but others are
* possible. Having multiple interfaces built-in and selecting the
* correct one at runtime is also an option.
*/
#ifdef MOZ_B2G_BT_DAEMON
if (backend.LowerCaseEqualsLiteral("bluetoothd")) {
return BluetoothDaemonInterface::GetInstance();
} else
#endif
{
BT_WARNING("Bluetooth backend '%s' is unknown or not available.",
backend.get());
}
return nullptr;
#else
/* Anything that's not Android 4.2 or later uses BlueZ instead. The
* code should actually never reach this point.
*/
BT_WARNING("No Bluetooth backend available for your system.");
return nullptr;
#endif
}
BluetoothInterface::BluetoothInterface()
{ }
BluetoothInterface::~BluetoothInterface()
{ }
END_BLUETOOTH_NAMESPACE